aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNoah Peart2023-11-21 15:59:48 +0200
committerDmitry Gutov2023-11-21 16:26:54 +0200
commit9af03e0e1897bce2fce71b79549d4461d7ea1dad (patch)
tree4f2903b14f6543c23f50ddd758f30b16a7c91635 /test
parent61cdf42a48fab24b7ee4098ffedf7254080f808b (diff)
downloademacs-9af03e0e1897bce2fce71b79549d4461d7ea1dad.tar.gz
emacs-9af03e0e1897bce2fce71b79549d4461d7ea1dad.zip
typescript-ts-mode: Support indentation for conditionals without braces
* lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--indent-rules): Support indentation for conditionals without braces (bug#67031). * test/lisp/progmodes/typescript-ts-mode-resources/indent.erts (Statement indentation without braces): New test.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/progmodes/typescript-ts-mode-resources/indent.erts22
1 files changed, 22 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 146ee76574e..20f423259b4 100644
--- a/test/lisp/progmodes/typescript-ts-mode-resources/indent.erts
+++ b/test/lisp/progmodes/typescript-ts-mode-resources/indent.erts
@@ -23,6 +23,28 @@ const foo = () => {
23} 23}
24=-=-= 24=-=-=
25 25
26Name: Statement indentation without braces
27
28=-=
29const foo = () => {
30 if (true)
31 console.log("if_statement");
32 else if (false)
33 console.log("if_statement");
34 else
35 console.log("else_clause");
36 for (let i = 0; i < 1; i++)
37 console.log("for_statement");
38 for (let i of [true])
39 console.log("for_in_statement");
40 while (false)
41 console.log("while_statement");
42 do
43 console.log("do_statement");
44 while (false)
45};
46=-=-=
47
26Code: 48Code:
27 (lambda () 49 (lambda ()
28 (setq indent-tabs-mode nil) 50 (setq indent-tabs-mode nil)