guillermooo / Vintageous

Vi/Vim emulation for Sublime Text 3
http://guillermooo.bitbucket.org/Vintageous/
Other
1.64k stars 115 forks source link

'vw' selects extra character #645

Open escherpf opened 10 years ago

escherpf commented 10 years ago

In VIM, entering visual mode ('v') followed by 'w' should select the word under the cursor and the white space after the word. In Vintageous, 'vw' does this, but also selects the first character of the next word.

--- Want to back this issue? **[Place a bounty on it!](https://www.bountysource.com/issues/2749263-vw-selects-extra-character?utm_campaign=plugin&utm_content=tracker%2F204305&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F204305&utm_medium=issues&utm_source=github).
guillermooo commented 10 years ago

This seems to be also the way Vim works. Simply reopen if you see other behavior.

skube commented 9 years ago

I'm no Vim expert but this isn't how my (windows) Vim works. I just tried in Vim with something like <span>test</span>. Using the vw when the cursor is on the t only selects test. Whereas in Sublime Text 3 with Vintageous it selects test<.

albertdev commented 9 years ago

Vim actually has a configuration option for that. If you enter :set selection?, what does Vim print? My Vim prints "selection=inclusive" and will select the next character of a word (also, the selection is always 1 char long, it can't be empty.

skube commented 9 years ago

My shows "selection=exclusive" but I would suspect that's default behaviour because I didn't know that was even an option.

Doesn't it make more sense to be exclusive?

albertdev commented 9 years ago

Windows supposedly uses "selection=exclusive" by default, maybe other platforms do as well. My Linux installs all seem to use "selection=inclusive".

Allowing the user to switch introduces lots of tiny subtleties though, mostly because the cursor is now after the selection instead of on the last selected character. Then again, exclusive selection is what modern editors tend to use, so it might indeed make sense to make that the default.

princemaple commented 9 years ago

So is exclusive selection mode going to be added? I found it annoying when doing vw on a word followed by ", that it highlights the " as well

escherpf commented 9 years ago

+1: Finding this behavior as well on Windows.

guillermooo commented 9 years ago

AFAICT, inclusive seems to be the default on Windows and Linux.