mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-22 07:09:54 +00:00
Handle indentation of nested ternary operators in JS
* lisp/progmodes/js.el (js--looking-at-operator-p): Handle nested ternary operators.
This commit is contained in:
parent
2e4f4c9d48
commit
6354e3c336
@ -1788,6 +1788,8 @@ This performs fontification according to `js--class-styles'."
|
||||
(and (looking-at js--indent-operator-re)
|
||||
(or (not (eq (char-after) ?:))
|
||||
(save-excursion
|
||||
(js--backward-syntactic-ws)
|
||||
(when (= (char-before) ?\)) (backward-list))
|
||||
(and (js--re-search-backward "[?:{]\\|\\_<case\\_>" nil t)
|
||||
(eq (char-after) ??))))
|
||||
(not (and
|
||||
|
@ -128,6 +128,13 @@ if (x > 72 &&
|
||||
let x = svg.mumble()
|
||||
.zzz;
|
||||
|
||||
// https://github.com/mooz/js2-mode/issues/405
|
||||
if (1) {
|
||||
isSet
|
||||
? (isEmpty ? 2 : 3)
|
||||
: 4
|
||||
}
|
||||
|
||||
// Local Variables:
|
||||
// indent-tabs-mode: nil
|
||||
// js-indent-level: 2
|
||||
|
Loading…
Reference in New Issue
Block a user