From 900ede244c886c56579dcbfabd04cf4f144275a1 Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Fri, 20 Oct 2017 15:04:37 +0100 Subject: [PATCH] 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. --- lisp/textmodes/css-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 "\\)\\|" -- 2.39.2