[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master ee05168: Fix highlighting of CSS selectors with dou
From: |
Simen Heggestøyl |
Subject: |
[Emacs-diffs] master ee05168: Fix highlighting of CSS selectors with double hyphens |
Date: |
Sun, 11 Jun 2017 13:32:44 -0400 (EDT) |
branch: master
commit ee051688c18b3bd7bb7c7a01100f09f7dd402ba6
Author: Simen Heggestøyl <address@hidden>
Commit: Simen Heggestøyl <address@hidden>
Fix highlighting of CSS selectors with double hyphens
* lisp/textmodes/css-mode.el (css--font-lock-keywords): Fix
highlighting of selectors that contain double hyphens. They would be
mistaken for a variable.
---
lisp/textmodes/css-mode.el | 4 ++--
test/manual/indent/css-mode.css | 5 +++++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index 45d750a..0beaaaa 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/css-mode.el
@@ -852,8 +852,6 @@ cannot be completed sensibly: `custom-ident',
;; 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.
;; Allow plain ":root" as a selector.
("^[ \t]*\\(:root\\)\\(?:[\n \t]*\\)*{" (1 'css-selector keep))
@@ -898,6 +896,8 @@ cannot be completed sensibly: `custom-ident',
'font-lock-multiline t)
;; No face.
nil)))
+ ;; Variables.
+ (,(concat "--" 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 "\\)\\|"
diff --git a/test/manual/indent/css-mode.css b/test/manual/indent/css-mode.css
index 79b0821..bf612b5 100644
--- a/test/manual/indent/css-mode.css
+++ b/test/manual/indent/css-mode.css
@@ -77,3 +77,8 @@ div::before {
url("Sans-Regular.eot") format("eot"),
url("Sans-Regular.woff") format("woff");
}
+
+.foo-bar--baz {
+ --foo-variable: 5px;
+ margin: var(--foo-variable);
+}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master ee05168: Fix highlighting of CSS selectors with double hyphens,
Simen Heggestøyl <=