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

Setting a mark while the cursor is on marked text could remove that mark #6

Closed kristiandupont closed 7 years ago

kristiandupont commented 7 years ago

This is the way I am used to using markers in most other editors: if the cursor is on text that is already marked, marking it again will remove the mark instead.

ryu1kn commented 7 years ago

If you don't select any text, TextMarker selects and marks/unmarks the word under the cursor. So if the marked text doesn't match the word under the cursor, TextMarker recognises the word as a new pattern and marks it instead of unmarking the marked text.

[marked text]       # "marked text" is marked
↓
[marked tex|t]      # Place the cursor on "text", and execute "mark/unmark text" command
↓
[marked [text]]     # "text" is recognised as a new pattern
                    # and both "text" and "marked text" will be marked

If you're seeing this behaviour, this is actually what I'm expecting.

kristiandupont commented 7 years ago

Yeah, I've noticed that. It's not my personal preference, but this is your project so obviously it's up to you :-) Thank you for the extension by the way, it seems to work nicely!

ryu1kn commented 7 years ago

I actually haven't thought about that way of unmarking text, but I can see the advantages of it.

As I'm not too sure if I like it more, I'm not gonna change it right now. But thank you for your suggestion ;)

ryu1kn commented 7 years ago

After introduced highlighting with regex, I like the idea you suggested better. With this way, we can remove a mark that is specified by regex.

ryu1kn commented 7 years ago

Published as v0.9.0! Thank you for your suggestion @kristiandupont 👍

kristiandupont commented 7 years ago

Awesome, looking forward to using it! :-)