]> git.eshelyaron.com Git - emacs.git/commit
* lisp/treesit.el (treesit-transpose-sexps): Improve (bug#60655).
authorJuri Linkov <juri@linkov.net>
Sat, 4 Jan 2025 18:30:07 +0000 (20:30 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 4 Jan 2025 21:00:04 +0000 (22:00 +0100)
commita280078465db097629aa00917a924d12eae87173
tree855bf333a689e8c20e21d413a2cbb8d9d7ee7d78
parent220038858f60ff2a994603d87b313b4ad4df604d
* lisp/treesit.el (treesit-transpose-sexps): Improve (bug#60655).

Use 'treesit-thing-next' and 'treesit-thing-prev' with
'treesit-node-named' to transpose named siblings that leaves the right
punctuation in anonymous nodes between named siblings.  Fall back
to 'transpose-sexps-default-function' inside strings and comments.
(treesit-node-named): New helper function.

(cherry picked from commit d9a0e781978725953ab44556f5222b1be32df7a7)
lisp/treesit.el