1
0
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:
Dmitry Gutov 2017-04-13 03:50:41 +03:00
parent 2e4f4c9d48
commit 6354e3c336
2 changed files with 9 additions and 0 deletions

View File

@ -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

View File

@ -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