From c6af816affb36d512f806725518e6e5f2353b197 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Simen=20Heggest=C3=B8yl?= Date: Fri, 28 Aug 2015 19:36:10 +0200 Subject: [PATCH] Fix indentation rule in css-mode * lisp/textmodes/css-mode.el (css-smie-rules): Fix indentation of brackets in presence of pseudo-selectors. (Bug#21328) --- lisp/textmodes/css-mode.el | 2 +- test/indent/css-mode.css | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index d73780caf36..639456dc77e 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -344,7 +344,7 @@ (`(:elem . arg) 0) (`(:list-intro . ,(or `";" `"")) t) ;"" stands for BOB (bug#15467). (`(:before . "{") - (when (smie-rule-hanging-p) + (when (or (smie-rule-hanging-p) (smie-rule-bolp)) (smie-backward-sexp ";") (smie-indent-virtual))) (`(:before . ,(or "{" "(")) diff --git a/test/indent/css-mode.css b/test/indent/css-mode.css index 67a6b1e30b5..2f04e967648 100644 --- a/test/indent/css-mode.css +++ b/test/indent/css-mode.css @@ -36,3 +36,8 @@ a.b:c,d.e:f,g[h]:i,j[k]:l,.m.n:o,.p.q:r,.s[t]:u,.v[w]:x { /* bug:20282 */ div.x3 { } + +article:hover +{ + color: black; +} -- 2.39.2