altermo / iedit.nvim

Edit one occurrence of text and simultaneously have other selected occurrences edited in the same way.
MIT License
21 stars 2 forks source link

A way to circle through selected items #3

Open viocost opened 3 months ago

viocost commented 3 months ago

Is there a way to circle through selected items while in iedit mode?

altermo commented 3 months ago

Added it. (https://github.com/altermo/iedit.nvim/commit/7863c2f0615adcd9854ab03ef7b9e76e10be5e39) Use require"iedit"._goto_next(true) for now. (I want to refactor it later to be better, and that's the reason behind it being underscored.)

viocost commented 3 months ago

Wow man, you are quick :)

I've started implementing it too, but I also added some logic to handle going back and forth, and utilizing "n" and "N" keys to trigger that.

It's quite a mess yet, but let me know if you like it, I can refine and merge it to your branch https://github.com/viocost/iedit.nvim/commit/d98af05a031649f955aac267325b1c02f4eac84e

altermo commented 3 months ago

No need, I just added an argument for going backward. (https://github.com/altermo/iedit.nvim/commit/2d723616b507da8d9e99a5aa842e30defbf1f09f)