]> git.eshelyaron.com Git - emacs.git/commit
Fix c-ts-mode indentation for statement after preproc (bug#61893)
authorYuan Fu <casouri@gmail.com>
Fri, 3 Mar 2023 03:59:11 +0000 (19:59 -0800)
committerYuan Fu <casouri@gmail.com>
Fri, 3 Mar 2023 03:59:37 +0000 (19:59 -0800)
commit9e105d483fa54c5f07a42b4c0fab40507f1fd9ec
tree4f5719bc84aa98264ed8c8cd4e77edd2f9b2bbe2
parenta72a55e3e497f7451000fdcf76000eb76946d827
Fix c-ts-mode indentation for statement after preproc (bug#61893)

Originally our c-ts-mode--anchor-prev-sibling only specially handled
labeled_statements, now we add special case for preproc in the similar
fasion: instead of using the preproc directive as anchor, use the last
statement in that preproc as the anchor. Thus effectively ignore the
preproc.

There should be an accompanying test, but there are some problem in
the elif preproc directive indent so it would pass, we'll add the test
when that is fixed.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--anchor-prev-sibling): Add special case for preproc
directives.
lisp/progmodes/c-ts-mode.el