nvim-treesitter-textobjects icon indicating copy to clipboard operation
nvim-treesitter-textobjects copied to clipboard

Swap doesn't repeat with . operator

Open rgossiaux opened this issue 3 years ago • 3 comments

If I have a piece of code f(a, b, c, d) and I put my cursor on a and perform swap_next for @parameter.inner, it does not compose with .; after the initial swap I have f(b, a, c, d) with the cursor still on a, and I would expect that . would once more do another swap (leaving f(b, c, a, d)). Instead . ignores the swap does whatever happened before that (eg an insertion).

Thanks for this plugin, by the way; enabling this kind of thing is to me one of the most exciting outcomes of treesitter.

rgossiaux avatar Feb 04 '21 21:02 rgossiaux

I have to look into how this can be done... Absolutely agree that this has to be fixed.

theHamsta avatar Feb 14 '21 23:02 theHamsta

1116

Recommend Sideways plugin, I use this to do that, and it support . operator. Not base on language, but it's good too.

https://github.com/AndrewRadev/sideways.vim

singlexyz avatar Apr 14 '21 16:04 singlexyz

Well, I can do the same what sideways does: https://github.com/nvim-treesitter/nvim-treesitter-textobjects/pull/52

theHamsta avatar Apr 14 '21 19:04 theHamsta

Closing as completed with #343

kiyoon avatar Jan 05 '23 18:01 kiyoon