]> git.eshelyaron.com Git - emacs.git/commitdiff
Recognize some more SCSS selectors
authorSimen Heggestøyl <simenheg@runbox.com>
Sun, 15 May 2022 14:22:14 +0000 (16:22 +0200)
committerSimen Heggestøyl <simenheg@runbox.com>
Sun, 15 May 2022 14:42:56 +0000 (16:42 +0200)
* 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
test/lisp/textmodes/css-mode-resources/scss-selectors.txt

index 99b4482dc53303b3d5b3464fcdd8cb8d952e8ec8..a2a7774aba7cad9483c5221d6bda8e00f0db9da4 100644 (file)
@@ -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
index 86e58110b726cbd5aa1aa6cad27fb1a8e2ad948a..3e05191a91044e469ff7bd4a881f9cd3bba8316e 100644 (file)
@@ -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