[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 2df0e04: Highlight CSS variables with variable na
From: |
Simen Heggestøyl |
Subject: |
[Emacs-diffs] emacs-25 2df0e04: Highlight CSS variables with variable name face |
Date: |
Sat, 30 Jan 2016 19:47:31 +0000 |
branch: emacs-25
commit 2df0e04296b73d212875ce46c8734ec255496a78
Author: Simen Heggestøyl <address@hidden>
Commit: Simen Heggestøyl <address@hidden>
Highlight CSS variables with variable name face
* lisp/textmodes/css-mode.el (css-nmstart-re): Don't match variables.
(css--font-lock-keywords): Highlight variables in
`font-lock-variable-name-face'.
---
lisp/textmodes/css-mode.el | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index d402fb1..96a82ba 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/css-mode.el
@@ -215,7 +215,7 @@
(defconst css-escapes-re
"\\\\\\(?:[^\000-\037\177]\\|[0-9a-fA-F]+[ \n\t\r\f]?\\)")
(defconst css-nmchar-re (concat "\\(?:[-[:alnum:]]\\|" css-escapes-re "\\)"))
-(defconst css-nmstart-re (concat "\\(?:--\\)?\\(?:[[:alpha:]]\\|"
css-escapes-re "\\)"))
+(defconst css-nmstart-re (concat "\\(?:[[:alpha:]]\\|" css-escapes-re "\\)"))
(defconst css-ident-re ;; (concat css-nmstart-re css-nmchar-re "*")
;; Apparently, "at rules" names can start with a dash, e.g. @-moz-keyframes.
(concat css-nmchar-re "+"))
@@ -246,6 +246,8 @@
;; Since "An at-rule consists of everything up to and including the next
;; semicolon (;) or the next block, whichever comes first."
(,(concat "@" css-ident-re) (0 font-lock-builtin-face))
+ ;; Variables.
+ (,(concat "--" css-ident-re) (0 font-lock-variable-name-face))
;; Selectors.
;; FIXME: attribute selectors don't work well because they may contain
;; strings which have already been highlighted as f-l-string-face and
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-25 2df0e04: Highlight CSS variables with variable name face,
Simen Heggestøyl <=