writemonkey / wm3

165 stars 5 forks source link

"Show selection matches" (Ctrl-1) should select new match if cursor selects #39

Open chrisb1978 opened 8 years ago

chrisb1978 commented 8 years ago

Follow this sequence please:

  1. select some characters
  2. press ctrl-1
  3. select some other characters
  4. press ctrl-1

Current behaviour: the first time ctrl-1 is pressed, (step 2.) all occurences of the characters are displayed (expected behaviour). the second time ctrl-1 is pressed though (step 4.), the highlighted matches are disabled.

More natural behaviour: i think it would feel more natural if ctrl-1 always shows the matching selections, if text is currently selected. only if NO text is selected, and ctrl-1 is pressed, should the selected matches be disabled.

hope this helps!

writemonkey commented 8 years ago

The problem is Ctrl+1 also works on a word under the cursor when nothing is selected.

chrisb1978 commented 8 years ago

Ah, I see. What about the following behaviour - it would keep your current selection behaviour, as well as feeling more natural to use (i think). For this, the caret position needs to be stored when the user presses CTRL-1, e.g. like this:

When CTRL-1 is pressed..

This would allow for highlighting to still work with just one key-combo. What do you think?

writemonkey commented 8 years ago

Yes, that would do it.