summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/progmodes/js.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index bae9e52bf0f..e6ffe4d75a6 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -475,6 +475,11 @@ This applies to function movement, marking, and so on."
:type 'boolean
:group 'js)
+(defcustom js-indent-align-list-continuation t
+ "Align continuation of non-empty ([{ lines in `js-mode'."
+ :type 'boolean
+ :group 'js)
+
(defcustom js-comment-lineup-func #'c-lineup-C-comments
"Lineup function for `cc-mode-style', for C comments in `js-mode'."
:type 'function
@@ -2092,7 +2097,8 @@ indentation is aligned to that column."
(switch-keyword-p (looking-at "default\\_>\\|case\\_>[^:]"))
(continued-expr-p (js--continued-expression-p)))
(goto-char (nth 1 parse-status)) ; go to the opening char
- (if (looking-at "[({[]\\s-*\\(/[/*]\\|$\\)")
+ (if (or (not js-indent-align-list-continuation)
+ (looking-at "[({[]\\s-*\\(/[/*]\\|$\\)"))
(progn ; nothing following the opening paren/bracket
(skip-syntax-backward " ")
(when (eq (char-before) ?\)) (backward-list))