johtela / vscode-modaledit

Configurable Modal Editing in VS Code
https://johtela.github.io/vscode-modaledit/docs/README.html
Other
89 stars 8 forks source link

Proposal for simpler search options #17

Open haberdashPI opened 4 years ago

haberdashPI commented 4 years ago

The new master has a handy set of options in incremental search—e.g. typeBeforeNextMatch typeAfteNextMatch and so forth.

As I understand it, these help to avoid problems where searching and then moving back in typeAfterAccept, for example, leads the next search to hit the same point in the file.

However, another solution is to simply check if the search motion actually moved the cursor after completing the entire command. If not, you repeat the command, searching "twice" before terminating (e.g. add an offset to indexOf in a second call after the first call to indexOf).

You could have a single option, skipRepeats. When turned on, this would re-run the search as described above. This is a little inefficient, in that you have to search twice for each step, but the front facing interface is a lot simpler for people to think about.