:type 'integer
:group 'js)
-(defcustom js-indent-first-initialiser nil
- "Specially indent the first variable declaration's initialiser
-in variable statements.
-
-Normally, the first declaration's initialiser is unindented, and
-subsequent declarations have their identifiers lined up against
-the first:
+(defcustom js-indent-first-init nil
+ "Non-nil means specially indent the first variable declaration's initializer.
+Normally, the first declaration's initializer is unindented, and
+subsequent declarations have their identifiers aligned with it:
var o = {
foo: 3
},
bar = 2;
-When t, always indent the first declaration's initialiser by an
-additional level:
+If this option has the value t, indent the first declaration's
+initializer by an additional level:
var o = {
foo: 3
},
bar = 2;
-When `dynamic', if there is only one declaration, don't indent
-the first one's initialiser; otherwise, indent it.
+If this option has the value `dynamic', if there is only one declaration,
+don't indent the first one's initializer; otherwise, indent it.
var o = {
foo: 3
foo: 3
},
bar = 2;"
- :type 'boolean
+ :version "25.1"
+ :type '(choice (const nil) (const t) (const dynamic))
:safe 'symbolp
:group 'js)
(defun js--maybe-goto-declaration-keyword-end (parse-status)
"Helper function for `js--proper-indentation'.
-Depending on the value of `js-indent-first-initialiser', move
+Depending on the value of `js-indent-first-init', move
point to the end of a variable declaration keyword so that
indentation is aligned to that column."
(cond
- ((eq js-indent-first-initialiser t)
+ ((eq js-indent-first-init t)
(when (looking-at js--declaration-keyword-re)
(goto-char (1+ (match-end 0)))))
- ((eq js-indent-first-initialiser 'dynamic)
+ ((eq js-indent-first-init 'dynamic)
(let ((bracket (nth 1 parse-status))
declaration-keyword-end
at-closing-bracket-p