]> git.eshelyaron.com Git - emacs.git/commit
Fix typescript-ts-mode tenary indentation (bug#77901)
authorYuan Fu <casouri@gmail.com>
Sun, 1 Jun 2025 23:14:12 +0000 (16:14 -0700)
committerEshel Yaron <me@eshelyaron.com>
Sat, 7 Jun 2025 19:59:31 +0000 (21:59 +0200)
commit474abbd65c9d66410976e9f816d37ffa545d0aa4
tree40c6d5f64e58b2f920260850bc95c08fd714593e
parent3cf52e72b079f7a4e7ac74c606dc3da08dba7bd3
Fix typescript-ts-mode tenary indentation (bug#77901)

Fixes indentation for nested ternary expressions:

const a = cond1 ? 1 :
  cond2 ? 2 :
  cond3 ? 3 :
  cond 4: 5;

instead of

const a = cond1 ? 1 :
  cond2 ? 2 :
    cond3 ? 3 :
      cond 4: 5;

* lisp/progmodes/typescript-ts-mode.el:
(typescript-ts--standalone-parent-p): New function.
(typescript-ts-mode):
(tsx-ts-mode): Use new function.

(cherry picked from commit 8d132359d19b8efbdbd17786fa67c0c20efba35b)
lisp/progmodes/typescript-ts-mode.el
test/lisp/progmodes/typescript-ts-mode-resources/indent.erts