aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorDmitry Gutov2017-04-13 03:50:41 +0300
committerDmitry Gutov2017-04-13 03:50:41 +0300
commit6354e3c3368d99fad755d4dbd7c872ce1280f005 (patch)
tree59a6f7279c027da215dc0e57d10d48fcbfb9c93d /lisp
parent2e4f4c9d48c563ff8bec102b66da0225587786c6 (diff)
downloademacs-6354e3c3368d99fad755d4dbd7c872ce1280f005.tar.gz
emacs-6354e3c3368d99fad755d4dbd7c872ce1280f005.zip
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')
-rw-r--r--lisp/progmodes/js.el2
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'."
1788 (and (looking-at js--indent-operator-re) 1788 (and (looking-at js--indent-operator-re)
1789 (or (not (eq (char-after) ?:)) 1789 (or (not (eq (char-after) ?:))
1790 (save-excursion 1790 (save-excursion
1791 (js--backward-syntactic-ws)
1792 (when (= (char-before) ?\)) (backward-list))
1791 (and (js--re-search-backward "[?:{]\\|\\_<case\\_>" nil t) 1793 (and (js--re-search-backward "[?:{]\\|\\_<case\\_>" nil t)
1792 (eq (char-after) ??)))) 1794 (eq (char-after) ??))))
1793 (not (and 1795 (not (and