From: Wilfred Hughes Date: Fri, 20 Oct 2017 14:04:37 +0000 (+0100) Subject: css-mode: Don't confuse variable names with class names X-Git-Tag: emacs-27.0.90~6237 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=900ede244c886c56579dcbfabd04cf4f144275a1;p=emacs.git css-mode: Don't confuse variable names with class names This fixes highlighting for class names that contain --, for example: .foo--bar { display: none; } * lisp/textmodes/css-mode.el (css--font-lock-keywords): Make regular expression stricter. --- diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 9022ab7c3fb..0a4cb998b57 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -896,7 +896,7 @@ cannot be completed sensibly: `custom-ident', ;; No face. nil))) ;; Variables. - (,(concat "--" css-ident-re) (0 font-lock-variable-name-face)) + (,(concat (rx symbol-start) "--" css-ident-re) (0 font-lock-variable-name-face)) ;; Properties. Again, we don't limit ourselves to css-property-ids. (,(concat "\\(?:[{;]\\|^\\)[ \t]*\\(" "\\(?:\\(" css-proprietary-nmstart-re "\\)\\|"