SublimeText / WordHighlight

Highlight all copies of the currently selected word.
MIT License
179 stars 24 forks source link

CTRL+D conflicts with Find and Replace settings ? #54

Open titoBouzout opened 10 years ago

titoBouzout commented 10 years ago

I'm not sure, but seems to me that CTRL+D conflicts with Find and Replace settings, then I added to this package an option to mimic CTRL+D behaviour.. The thing is that the word highlighted by this package is in almost all the situations the word that I want to select. But since Find and Replace settings(or something else??), conflicts, it also select /portions/ of words and not complete words. CTRL+D ends hindering the selection.. so here we go..

In my setup CTRL+D with "sel" selected. Highlights sel = [s for s in self.view.sel()]

With this package now..

sel = [s for s in self.view.sel()]

The explanation of how to add CTRL+D, CTRL+D + CTRL+K https://github.com/SublimeText/WordHighlight/commit/de6f919a35cf9f4e5e0b7ccdc46f4d27d9d5c237

The relevant portion https://github.com/SublimeText/WordHighlight/commit/0035911c878b8543e7cfb356ef451c1a6802f349 ...........

The question is now, should we replace the standard keymaps?

invited, @facelessuser , @FichteFoll , @iamntz

FichteFoll commented 10 years ago

Open the search panel, select "Whole word search" (alt+w).

Ctrl+D is affected by the selected search options, including whole word search and case sensitivity.

titoBouzout commented 10 years ago

Mmh, I cannot repro that, If I toggle "Whole word search", it does not change anything,

sel = [s for s in self.view.sel()]

"sel" from "self" Is still selected.

FichteFoll commented 10 years ago

... You're right, I overinterpreted. I knew for a fact that case sensitivity affected the word matches but it seems the whole word match does not.

A possibility to make it work however (which I just found "by accident") was to only place your cursor in the word sel (not select) it and press alt+f3. If you press it again (or have a word selected in general), you will get the same results as you outlined.

I also seem to remember that there were differences in behavior whether the word was selected or not, but I'm not sure if that only applies to alt+f3 since it does not work with ctrl+shift+d.

titoBouzout commented 10 years ago

No selection! weird! Thanks for the tip