aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/js.el1
-rw-r--r--test/lisp/progmodes/js-tests.el14
2 files changed, 15 insertions, 0 deletions
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 74dd4add9e2..e42e01481b6 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3849,6 +3849,7 @@ If one hasn't been set, or if it's stale, prompt for a new one."
3849 comment-start-skip "\\(//+\\|/\\*+\\)\\s *") 3849 comment-start-skip "\\(//+\\|/\\*+\\)\\s *")
3850 (setq-local comment-line-break-function #'c-indent-new-comment-line) 3850 (setq-local comment-line-break-function #'c-indent-new-comment-line)
3851 (setq-local c-block-comment-start-regexp "/\\*") 3851 (setq-local c-block-comment-start-regexp "/\\*")
3852 (setq-local comment-multi-line t)
3852 3853
3853 (setq-local electric-indent-chars 3854 (setq-local electric-indent-chars
3854 (append "{}():;," electric-indent-chars)) ;FIXME: js2-mode adds "[]*". 3855 (append "{}():;," electric-indent-chars)) ;FIXME: js2-mode adds "[]*".
diff --git a/test/lisp/progmodes/js-tests.el b/test/lisp/progmodes/js-tests.el
index 84749efa45b..7cb737c30e2 100644
--- a/test/lisp/progmodes/js-tests.el
+++ b/test/lisp/progmodes/js-tests.el
@@ -85,6 +85,20 @@ if (!/[ (:,='\"]/.test(value)) {
85 (should (= (current-column) x)) 85 (should (= (current-column) x))
86 (forward-line)))) 86 (forward-line))))
87 87
88(ert-deftest js-mode-auto-fill ()
89 (with-temp-buffer
90 (js-mode)
91 (setq fill-column 70)
92 (insert "/* ")
93 (dotimes (_ 16)
94 (insert "test "))
95 (do-auto-fill)
96 ;; The bug is that, after auto-fill, the second line starts with
97 ;; "/*", whereas it should start with " * ".
98 (goto-char (point-min))
99 (forward-line)
100 (should (looking-at " \\* test"))))
101
88(provide 'js-tests) 102(provide 'js-tests)
89 103
90;;; js-tests.el ends here 104;;; js-tests.el ends here