]> git.eshelyaron.com Git - emacs.git/commit
Improve indentation in 'lua-ts-mode' (bug#70785)
authorjohn muhl <jm@pub.pink>
Fri, 3 May 2024 20:51:01 +0000 (15:51 -0500)
committerEshel Yaron <me@eshelyaron.com>
Fri, 10 May 2024 13:33:32 +0000 (15:33 +0200)
commit9a9ebd1c2cad0bd976f22c3ac8a068abc8d71f89
tree457c16c34e8e44f3d788e40c96bb0c7b1bc73d12
parentf38d62be8289c7afea9e201c979038aa49cc1efa
Improve indentation in 'lua-ts-mode' (bug#70785)

* lisp/progmodes/lua-ts-mode.el (lua-ts--simple-indent-rules):
- Ignore comments when aligning arguments, parameters and fields.
- Apply simpler rules to simpler usage of anonymous functions.
- Better handling of table as a function argument.
(lua-ts--comment-first-sibling-matcher):
(lua-ts--first-real-sibling-anchor):
(lua-ts--last-arg-function-call-matcher):
(lua-ts--top-level-function-call-matcher): New function.
(lua-ts--g-parent):
(lua-ts--g-g-parent): New function.
(lua-ts--g-g-g-parent): Use it.
* test/lisp/progmodes/lua-ts-mode-resources/indent.erts:
Add tests.

(cherry picked from commit 73d2b829f06124fec8b65eebc68e87da48808086)
lisp/progmodes/lua-ts-mode.el
test/lisp/progmodes/lua-ts-mode-resources/indent.erts