ryu1kn / vscode-text-marker

Visual Studio Code Extension. Select text in your code and mark all matches. The marking colour is configurable
https://marketplace.visualstudio.com/items?itemName=ryu1kn.text-marker
MIT License
87 stars 17 forks source link

[Feature Request] Jump to the next/previous same text patterns #14

Closed afeblot closed 6 years ago

afeblot commented 6 years ago

Hi, I'd love to see those functions added to your extension:

They would highlight based on current settings (CaseSensitivity and WholeMatch), then jump to the next or previous highlighted occurrence. A second call to the function would not need to highlight anything more (it would be idempotent regarding highlighting) but would just jump to the 3rd occurrence, and so on.

ryu1kn commented 6 years ago

Hi @afeblot , jumping to the next or previous match sounds like a great idea to me! 👍

I wonder if highlight and jump should be separate commands so that you can jump to the regex patters as well.

afeblot commented 6 years ago

Well, you could indeed also add functions to just jump to the next/previous highlighted occurrence. But I'd be very sad if you did not implement the joined highlight+jump functions I proposed: That would force to always use 2 different keyboard shortcuts instead of one. When your usual workflow relies on this feature (as it used to be for me with my previous editor), it is a real pain.

ryu1kn commented 6 years ago

Ok, then I'm thinking to go like this.

afeblot commented 6 years ago

That looks perfect, thanks a lot! I can't wait to see it implemented :-)

ryu1kn commented 6 years ago

Published as v1.4.0! 🎉

@afeblot Can you see if you're happy with it? Sorry it took me a while to work on it 😉

afeblot commented 6 years ago

Hi, yes, I'm totally happy, thanks a lot :-D

ryu1kn commented 6 years ago

Great to hear that! Thanks for confirming it 😉

ryu1kn commented 6 years ago

When the cursor jumps to a highlight that is outside of current visible area, the window should auto-scroll to the cursor position. I'll create a separate issue for it.