diff options
author | Dmitry Gutov <dgutov@yandex.ru> | 2017-04-13 03:50:41 +0300 |
---|---|---|
committer | Dmitry Gutov <dgutov@yandex.ru> | 2017-04-13 03:50:41 +0300 |
commit | 6354e3c3368d99fad755d4dbd7c872ce1280f005 (patch) | |
tree | 59a6f7279c027da215dc0e57d10d48fcbfb9c93d /lisp/progmodes | |
parent | 2e4f4c9d48c563ff8bec102b66da0225587786c6 (diff) | |
download | emacs-6354e3c3368d99fad755d4dbd7c872ce1280f005.tar.gz |
Handle indentation of nested ternary operators in JS
* lisp/progmodes/js.el (js--looking-at-operator-p):
Handle nested ternary operators.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r-- | lisp/progmodes/js.el | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index c220353e9b7..bae9e52bf0f 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -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 |