aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorYuan Fu2023-12-10 18:24:27 -0800
committerYuan Fu2023-12-10 18:24:27 -0800
commit7f1bd69cd19504f2bd47e13c530a55ffca08e27d (patch)
tree6bb9aaf1a3d9969b7b757c4fa00694de618b5d86 /test
parente23068cb9a1692fc3c50b0b386237a56cae201f4 (diff)
downloademacs-7f1bd69cd19504f2bd47e13c530a55ffca08e27d.tar.gz
emacs-7f1bd69cd19504f2bd47e13c530a55ffca08e27d.zip
Fix c-ts-mode bracketless indentation for BSD style (bug#66152)
* lisp/progmodes/c-ts-mode.el: (c-ts-mode--indent-styles): Make sure the BSD rules only apply to opening bracket (compound_statement), then bracketless statements will fallback to common rules. * test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts: Copy the bracketless test from indent.erts to here.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts b/test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts
index 74e34fe821b..fa65ba83a69 100644
--- a/test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts
+++ b/test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts
@@ -91,3 +91,37 @@ main (int argc,
91 } 91 }
92} 92}
93=-=-= 93=-=-=
94
95Name: Bracketless Simple Statement (bug#66152)
96
97=-=
98for (int i = 0; i < 5; i++)
99continue;
100
101while (true)
102return 1;
103
104do
105i++;
106while (true)
107
108if (true)
109break;
110else
111break;
112=-=
113for (int i = 0; i < 5; i++)
114 continue;
115
116while (true)
117 return 1;
118
119do
120 i++;
121while (true)
122
123if (true)
124 break;
125else
126 break;
127=-=-=