]> git.eshelyaron.com Git - emacs.git/commit
Fix statement indent for c-ts-mode (bug#59686) (bug#60280)
authorYuan Fu <casouri@gmail.com>
Sun, 15 Jan 2023 08:16:58 +0000 (00:16 -0800)
committerYuan Fu <casouri@gmail.com>
Sun, 15 Jan 2023 09:11:37 +0000 (01:11 -0800)
commit189d976dbaed9067b21dbc372c52be104ef33417
tree7e1d2b3457c47eafd04234ba37ef0e0a1ab14b68
parentc78e19d99c01660284c6c4d58a2e98e1ba93fb6d
Fix statement indent for c-ts-mode (bug#59686) (bug#60280)

Instead of trying to figure out the correct anchor, now we just count
the layers of {} blocks between the node and the root node.

* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-styles): Use new offset functions
c-ts-mode--close-bracket-offset and c-ts-mode--statement-offset.
(c-ts-mode--bracket-children-anchor): Remove function.
(c-ts-mode--top-level-label-matcher): New variable.
(c-ts-mode--statement-offset)
(c-ts-mode--close-bracket-offset): New offset functions.
lisp/progmodes/c-ts-mode.el