[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#60128: 30.0.50; [PATCH]: Add treesit-transpose-sexps
From: |
Theodor Thornhill |
Subject: |
bug#60128: 30.0.50; [PATCH]: Add treesit-transpose-sexps |
Date: |
Fri, 16 Dec 2022 21:04:28 +0100 |
Hi there!
Attached is a patch that enables transpose-sexps for tree-sitter enabled
modes.
This function will swap the node _before_ node-at-point with the node
_after_, so it would do something like:
foo a|nd bar => bar and foo|
or
foo(a + 4,| y + c * b, b, d); => foo(y + c * b, a + 4|, b, d);
It will _not_ try to swap things that are not siblings. I think that
makes sense in the case of non-lisp languages, since _most_ places you
can transpose-sexps you will end up with broken code.
What do you think? I think this makes sense on the master branch, not
release.
Theo
0001-Add-treesit-transpose-sexps.patch
Description: Text Data
- bug#60128: 30.0.50; [PATCH]: Add treesit-transpose-sexps,
Theodor Thornhill <=