emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 4aa8115855: Recognize some more SCSS selectors


From: Simen Heggestøyl
Subject: master 4aa8115855: Recognize some more SCSS selectors
Date: Sun, 15 May 2022 10:44:23 -0400 (EDT)

branch: master
commit 4aa811585597884398b5be13d92f4af0a06de3e1
Author: Simen Heggestøyl <simenheg@runbox.com>
Commit: Simen Heggestøyl <simenheg@runbox.com>

    Recognize some more SCSS selectors
    
    * lisp/textmodes/css-mode.el (css--selector-regexp): Recognize some
    more SCSS selectors.
    
    * test/lisp/textmodes/css-mode-resources/scss-selectors.txt: Add tests
    for them.
---
 lisp/textmodes/css-mode.el                                | 4 ++--
 test/lisp/textmodes/css-mode-resources/scss-selectors.txt | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index 99b4482dc5..a2a7774aba 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/css-mode.el
@@ -936,8 +936,8 @@ cannot be completed sensibly: `custom-ident',
      ;; Same as for non-sassy except we do want to allow { and }
      ;; chars in selectors in the case of #{$foo}
      ;; variable interpolation!
-     (concat "\\(?:[-_%*#.>[:alnum:]]*" scss--hash-re
-             "\\|[-_%*#.>[:alnum:]]+\\)"))
+     (concat "\\(?:[-_%*#.>&+~[:alnum:]]*" scss--hash-re
+             "\\|[-_%*#.>&+~[:alnum:]]+\\)"))
    ;; Even though pseudo-elements should be prefixed by ::, a
    ;; single colon is accepted for backward compatibility.
    "\\(?:\\(:" (regexp-opt (append css-pseudo-class-ids
diff --git a/test/lisp/textmodes/css-mode-resources/scss-selectors.txt 
b/test/lisp/textmodes/css-mode-resources/scss-selectors.txt
index 86e58110b7..3e05191a91 100644
--- a/test/lisp/textmodes/css-mode-resources/scss-selectors.txt
+++ b/test/lisp/textmodes/css-mode-resources/scss-selectors.txt
@@ -4,3 +4,7 @@ p.#{$name}::after var
 f.#{$bar}::after p::after
 p.#{$name} f.#{$bar} k.var #{$bar}  #{$bar}
 p.#{$name}
+&:hover
+> li
++ li
+~ li



reply via email to

[Prev in Thread] Current Thread [Next in Thread]