]> git.eshelyaron.com Git - emacs.git/commit
Improve treesit list navigation support for #if/#endif (bug#73404)
authorJuri Linkov <juri@linkov.net>
Sat, 11 Jan 2025 18:28:43 +0000 (20:28 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sun, 12 Jan 2025 14:58:37 +0000 (15:58 +0100)
commit9ce2ea2cac3d17f5847b125a3f053f0a0d085f6e
treec0b41bff3289a76cfb2f43d1500d1ef01c91ceb3
parentaf658f2cef356d6d3908e0e6f8bb310c98a84fc6
Improve treesit list navigation support for #if/#endif (bug#73404)

* lisp/treesit.el (treesit--forward-list-with-default): Improve to
better support the case when point is inside an opening/closing node
with a name longer than 1 character such as "#if" and "#endif".
(treesit-navigate-thing): No need to check for thing 'list'
since list commands now use other functions.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--thing-settings): Add
more preproc nodes such as #if/#endif and #ifdef/#endif and their
variants to the 'list' thing.

(cherry picked from commit db4bf410f2bae6c77f2a0e660dcc680d73a18cd1)
lisp/progmodes/c-ts-mode.el
lisp/treesit.el