aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorYuan Fu2025-06-01 16:14:12 -0700
committerYuan Fu2025-06-01 16:14:12 -0700
commit8d132359d19b8efbdbd17786fa67c0c20efba35b (patch)
treeee3f00aae8a2d5567b5f29a8737fb595ea800488 /test
parentc3f4e6ca0e379bf082b1262ff5d4c07a79a434f7 (diff)
downloademacs-8d132359d19b8efbdbd17786fa67c0c20efba35b.tar.gz
emacs-8d132359d19b8efbdbd17786fa67c0c20efba35b.zip
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.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/progmodes/typescript-ts-mode-resources/indent.erts5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/lisp/progmodes/typescript-ts-mode-resources/indent.erts b/test/lisp/progmodes/typescript-ts-mode-resources/indent.erts
index 210bfcabd41..ba41c10c08c 100644
--- a/test/lisp/progmodes/typescript-ts-mode-resources/indent.erts
+++ b/test/lisp/progmodes/typescript-ts-mode-resources/indent.erts
@@ -96,6 +96,11 @@ const foo = () => {
96Name: Chained ternary expressions 96Name: Chained ternary expressions
97 97
98=-= 98=-=
99const a = cond1 ? 1 :
100 cond2 ? 2 :
101 cond3 ? 3 :
102 cond 4: 5;
103
99const a = cond1 ? 1 104const a = cond1 ? 1
100 : cond2 ? 2 105 : cond2 ? 2
101 : cond3 ? 3 106 : cond3 ? 3