lang/web: fix comments not joining/filling correctly
Before, joining these two lines // hello // world Results in // hello // world And filling the following // Pretend this line is longer than 80 characters Becomes // Pretend this lineis longer than 80 characters
This commit is contained in:
parent
b96b6ed64e
commit
5c06edd90a
2 changed files with 14 additions and 1 deletions
|
@ -92,3 +92,14 @@ Meant for `comment-line-break-function' in `css-mode' and `scss-mode'."
|
|||
(save-excursion
|
||||
(just-one-space)
|
||||
(insert "\n" (make-string pre-indent indent-char)))))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +css-adaptive-fill-fn ()
|
||||
"An `adaptive-fill-function' that conjoins SCSS line comments correctly."
|
||||
(when (looking-at "[ \t]*/[/*][ \t]*")
|
||||
(let ((str (match-string 0)))
|
||||
(when (string-match "/[/*]" str)
|
||||
(replace-match (if (string= (match-string 0 str) "/*")
|
||||
" *"
|
||||
"//")
|
||||
t t str)))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue