summaryrefslogtreecommitdiff
path: root/lisp/progmodes/c-ts-mode.el
diff options
context:
space:
mode:
authorYuan Fu <casouri@gmail.com>2023-03-01 14:01:47 -0800
committerYuan Fu <casouri@gmail.com>2023-03-01 14:07:01 -0800
commitb06d5519664b0f417be7f415964b0a4decc0f732 (patch)
treef5e166d0dfd03ab1ad9419faed4da1493ee681f5 /lisp/progmodes/c-ts-mode.el
parent6b2720778dc9531c0157bc7e773d2011bdf905e3 (diff)
downloademacs-b06d5519664b0f417be7f415964b0a4decc0f732.tar.gz
emacs-b06d5519664b0f417be7f415964b0a4decc0f732.tar.bz2
emacs-b06d5519664b0f417be7f415964b0a4decc0f732.zip
Fix c-ts-mode empty line indentation (bug#61893)
* lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-styles): Make the "rest sibling" matchers catch the case where NODE is nil, when indenting an empty line. * test/lisp/progmodes/c-ts-mode-resources/indent.erts: New test.
Diffstat (limited to 'lisp/progmodes/c-ts-mode.el')
-rw-r--r--lisp/progmodes/c-ts-mode.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index cc99b8e213e..259b96d342e 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -356,17 +356,17 @@ MODE is either `c' or `cpp'."
;; int[5] a = { 0, 0, 0, 0 };
((match nil "initializer_list" nil 1 1) parent-bol c-ts-mode-indent-offset)
- ((match nil "initializer_list" nil 2) c-ts-mode--anchor-prev-sibling 0)
+ ((parent-is "initializer_list") c-ts-mode--anchor-prev-sibling 0)
;; Statement in enum.
((match nil "enumerator_list" nil 1 1) standalone-parent c-ts-mode-indent-offset)
- ((match nil "enumerator_list" nil 2) c-ts-mode--anchor-prev-sibling 0)
+ ((parent-is "enumerator_list") c-ts-mode--anchor-prev-sibling 0)
;; Statement in struct and union.
((match nil "field_declaration_list" nil 1 1) standalone-parent c-ts-mode-indent-offset)
- ((match nil "field_declaration_list" nil 2) c-ts-mode--anchor-prev-sibling 0)
+ ((parent-is "field_declaration_list") c-ts-mode--anchor-prev-sibling 0)
;; Statement in {} blocks.
((match nil "compound_statement" nil 1 1) standalone-parent c-ts-mode-indent-offset)
- ((match nil "compound_statement" nil 2) c-ts-mode--anchor-prev-sibling 0)
+ ((parent-is "compound_statement") c-ts-mode--anchor-prev-sibling 0)
;; Opening bracket.
((node-is "compound_statement") standalone-parent c-ts-mode-indent-offset)
;; Bug#61291.