Skip to content

Commit b98b0c4

Browse files
committed
Add php-errorcontrol-op face
1 parent a1642c7 commit b98b0c4

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

php-face.el

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@
100100
"PHP Mode face used to highlight sigils($) of $this variable."
101101
:group 'php-faces)
102102

103+
(defface php-errorcontrol-op '((t (:inherit font-lock-type-face)))
104+
"PHP Mode face used to highlight errorcontrol operators (@).."
105+
:group 'php-face)
106+
103107
(defface php-php-tag '((t (:inherit font-lock-preprocessor-face)))
104108
"PHP Mode face used to highlight PHP tags."
105109
:group 'php-faces)

php-mode.el

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,10 @@ might be to handle switch and goto labels differently."
569569
php (cl-remove-if (lambda (elm) (and (listp elm) (equal (car elm) "\\s|")))
570570
(c-lang-const c-basic-matchers-before php)))
571571

572+
(c-lang-defconst c-basic-matchers-after
573+
php (cl-remove-if (lambda (elm) (and (listp elm) (memq 'c-annotation-face elm)))
574+
(c-lang-const c-basic-matchers-after php)))
575+
572576
(defun php-lineup-cascaded-calls (langelem)
573577
"Line up chained methods using `c-lineup-cascaded-calls',
574578
but only if the setting is enabled"
@@ -1376,6 +1380,7 @@ a completion list."
13761380
;; only add patterns here if you want to prevent cc-mode from applying
13771381
;; a different face.
13781382
`(
1383+
("\\<\\(@\\)" 1 'php-errorcontrol-op)
13791384
;; Highlight variables, e.g. 'var' in '$var' and '$obj->var', but
13801385
;; not in $obj->var()
13811386
("\\(->\\)\\(\\sw+\\)\\s-*(" (1 'php-object-op) (2 'php-method-call))

0 commit comments

Comments
 (0)