bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#20282: css-mode: multiple selectors *sometimes* breaks indentation


From: Stefan Monnier
Subject: bug#20282: css-mode: multiple selectors *sometimes* breaks indentation
Date: Thu, 09 Apr 2015 10:52:25 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> The following rather simple example of a chunk of CSS:
>     a, b:hover {
>            color: black;
>        }
> gets indented incorrectly.

Indeed, thanks.  I installed the patch below which seems to fix
this problem.


        Stefan


diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index 7280080..851618c 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/css-mode.el
@@ -327,6 +327,10 @@
     (`(:elem . basic) css-indent-offset)
     (`(:elem . arg) 0)
     (`(:list-intro . ,(or `";" `"")) t) ;"" stands for BOB (bug#15467).
+    (`(:before . "{")
+     (when (smie-rule-hanging-p)
+       (smie-backward-sexp ";")
+       (smie-indent-virtual)))
     (`(:before . ,(or "{" "("))
      (if (smie-rule-hanging-p) (smie-rule-parent 0)))))
 





reply via email to

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