mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-07 04:39:37 +00:00
Fix c-ts-mode indentation (bug#61291)
Fix indentation for the semicolon in while (str_a[i++] == str_b[j++]) ; * lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): New rule. * test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.
This commit is contained in:
parent
2ac8c4bbd6
commit
d68ff6016d
2 changed files with 13 additions and 0 deletions
|
@ -285,6 +285,8 @@ MODE is either `c' or `cpp'."
|
||||||
((node-is "}") point-min c-ts-common-statement-offset)
|
((node-is "}") point-min c-ts-common-statement-offset)
|
||||||
;; Opening bracket.
|
;; Opening bracket.
|
||||||
((node-is "compound_statement") point-min c-ts-common-statement-offset)
|
((node-is "compound_statement") point-min c-ts-common-statement-offset)
|
||||||
|
;; Bug#61291.
|
||||||
|
((match "expression_statement" nil "body") point-min c-ts-common-statement-offset)
|
||||||
|
|
||||||
,@(when (eq mode 'cpp)
|
,@(when (eq mode 'cpp)
|
||||||
`(((node-is "field_initializer_list") parent-bol ,(* c-ts-mode-indent-offset 2)))))))
|
`(((node-is "field_initializer_list") parent-bol ,(* c-ts-mode-indent-offset 2)))))))
|
||||||
|
|
|
@ -144,6 +144,17 @@ int f2(int x,
|
||||||
};
|
};
|
||||||
=-=-=
|
=-=-=
|
||||||
|
|
||||||
|
Name: Semi-colon in While Loop (bug#61291)
|
||||||
|
|
||||||
|
=-=
|
||||||
|
while (true)
|
||||||
|
;
|
||||||
|
for (int i = 0;
|
||||||
|
i < 5;
|
||||||
|
i++)
|
||||||
|
;
|
||||||
|
=-=-=
|
||||||
|
|
||||||
Name: Multiline Block Comments 1 (bug#60270)
|
Name: Multiline Block Comments 1 (bug#60270)
|
||||||
|
|
||||||
=-=
|
=-=
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue