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

Question: Why "goToNextHighlight" command will make VIM extension enter Visual mode, while "toggleHighlight" won't? #57

Open fiddleyuan opened 3 years ago

fiddleyuan commented 3 years ago

I'm using VSCode + VIM extension, I like text marker very much. But I'm recently confused by the different behavior between "goToNextHighlight" command and "toggleHighlight" command. The first command (which I made keybinding) will make VIM extension enter Visual mode, but the second command won't.

I would expect "goToNextHighlight" command behave like what "toggleHighlight" command does, with regard to the VIM mode.

fiddleyuan commented 3 years ago

BTW, let me explain a little more here. Once VIM enters Visual mode after invoking "goToNextHighlight" command, then I press "j" or "k" to navigate lines, it will select lines.

If this is expected behavior, any workaround can bypass this? Thanks

ryu1kn commented 3 years ago

Hi @fiddleyuan , thanks for raising this. I installed Vim extension and could reproduce the behaviour. Though I haven't been developing Text Marker specifically Vim extension in mind, this goToNextHighlight behaviour (i.e. go into the visual mode) is unexpected. I would like to see it staying on the same mode (if it was on command mode, stay on command mode. If it was insert mode, stay on insert mode).

ryu1kn commented 3 years ago

What is the operation Text Marker issues causing Vim extension to go visual mode?? 🤔

rcywongaa commented 2 years ago

My guess is that setting editor.selection here automatically triggers visual mode. The same happens when making a selection by dragging the cursor while clicked.

Perhaps a simple solution would be to just move the cursor without doing a highlight.