diff options
| author | Simen Heggestøyl | 2017-10-13 21:48:12 +0200 |
|---|---|---|
| committer | Simen Heggestøyl | 2017-10-13 21:57:52 +0200 |
| commit | ff330530123a9e3f6fbb2d0fe52564e4e3d78369 (patch) | |
| tree | 917973bdabcaf3cde6f89871585510beb2c2f0b1 | |
| parent | 8968be822ea864f383be75888e83bd92274fc520 (diff) | |
| download | emacs-ff330530123a9e3f6fbb2d0fe52564e4e3d78369.tar.gz emacs-ff330530123a9e3f6fbb2d0fe52564e4e3d78369.zip | |
Fix indentation bug in multi-line CSS selectors
* lisp/textmodes/css-mode.el (css--colon-inside-selector-p): Fix
indentation of multi-line CSS selectors that include both a
pseudo-class and parenthesis.
* test/manual/indent/css-mode.css: Add test for the above change.
| -rw-r--r-- | lisp/textmodes/css-mode.el | 2 | ||||
| -rw-r--r-- | test/manual/indent/css-mode.css | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 9022ab7c3fb..39885c10860 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el | |||
| @@ -1149,7 +1149,7 @@ This function is intended to be good enough to help SMIE during | |||
| 1149 | tokenization, but should not be regarded as a reliable function | 1149 | tokenization, but should not be regarded as a reliable function |
| 1150 | for determining whether point is within a selector." | 1150 | for determining whether point is within a selector." |
| 1151 | (save-excursion | 1151 | (save-excursion |
| 1152 | (re-search-forward "[{};)]" nil t) | 1152 | (re-search-forward "[{};]" nil t) |
| 1153 | (eq (char-before) ?\{))) | 1153 | (eq (char-before) ?\{))) |
| 1154 | 1154 | ||
| 1155 | (defun css--colon-inside-funcall () | 1155 | (defun css--colon-inside-funcall () |
diff --git a/test/manual/indent/css-mode.css b/test/manual/indent/css-mode.css index bf612b53a14..640418b022d 100644 --- a/test/manual/indent/css-mode.css +++ b/test/manual/indent/css-mode.css | |||
| @@ -66,6 +66,16 @@ div::before { | |||
| 66 | ); | 66 | ); |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | /* Multi-line selector including both a pseudo-class and | ||
| 70 | parenthesis. */ | ||
| 71 | .form-group:not(.required) label, | ||
| 72 | .birth-date .row > * { | ||
| 73 | &::after { | ||
| 74 | display: inline; | ||
| 75 | font-weight: normal; | ||
| 76 | } | ||
| 77 | } | ||
| 78 | |||
| 69 | @font-face { | 79 | @font-face { |
| 70 | src: url("Sans-Regular.eot") format("eot"), | 80 | src: url("Sans-Regular.eot") format("eot"), |
| 71 | url("Sans-Regular.woff") format("woff"), | 81 | url("Sans-Regular.woff") format("woff"), |