Add missing indent rule for c-ts-mode
* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): New rule for case. * test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.
This commit is contained in:
parent
8b6a0de964
commit
df669c5a11
2 changed files with 32 additions and 0 deletions
|
@ -434,6 +434,8 @@ MODE is either `c' or `cpp'."
|
|||
((parent-is "while_statement") standalone-parent c-ts-mode-indent-offset)
|
||||
((parent-is "do_statement") standalone-parent c-ts-mode-indent-offset)
|
||||
|
||||
((parent-is "case_statement") standalone-parent c-ts-mode-indent-offset)
|
||||
|
||||
,@(when (eq mode 'cpp)
|
||||
`(((node-is "field_initializer_list") parent-bol ,(* c-ts-mode-indent-offset 2)))))))
|
||||
`((gnu
|
||||
|
|
|
@ -188,6 +188,36 @@ int main()
|
|||
}
|
||||
=-=-=
|
||||
|
||||
Name: Switch-Case statement
|
||||
|
||||
=-=
|
||||
int main() {
|
||||
switch (a) {
|
||||
case 1:
|
||||
b = c;
|
||||
return 10;
|
||||
case 2:
|
||||
{
|
||||
a = b;
|
||||
return 12
|
||||
}
|
||||
}
|
||||
}
|
||||
=-=
|
||||
int main() {
|
||||
switch (a) {
|
||||
case 1:
|
||||
b = c;
|
||||
return 10;
|
||||
case 2:
|
||||
{
|
||||
a = b;
|
||||
return 12
|
||||
}
|
||||
}
|
||||
}
|
||||
=-=-=
|
||||
|
||||
Name: Multiline Block Comments 1 (bug#60270)
|
||||
|
||||
=-=
|
||||
|
|
Loading…
Add table
Reference in a new issue