Sublime Forum

Word separators and selection

#1

I’ve been noticing an issue with alt-arrow movement and also with double-click drag selection.

Even though the quote character and the whitespace character are both defined in the “word_separators” preference, these characters are not used during selection (or movement) to separate words properly.

Below you will see an animated gif which illustrates a word selection passing over the quote marks and selecting too much text:

I think in the ideal solution, spaces and quotes should be treated as their own words during this selection mode. This is how native cocoa textfields (eg- TextEdit) work on OSX, and in general it feels more intuitive to be safe during word selection rather than overzealous. After all, it is easier to keep selecting over these characters instead of having to go back and manually adjust the selection after a big jump.

1 Like

#2

I agree that it would be useful to treat whitespace and quote characters differently from other word separators. Perhaps the solution is to not select consecutive word separator chars of different types. I’m sure there are use cases for when one would actually like to select a bunch of consecutive word separators, but I can’t think of one offhand. One case where I have issues is double click select of whitespace characters surrounded by other word separators. For example…

<foo>           </foo>

or…

            <foo>

Double click to select on the space will select the <> characters as well.

0 Likes

Selecting Text (HTML)
#3

Nice Post…Thanks For sharing the info.

0 Likes