codemirror / codemirror5

In-browser code editor (version 5, legacy)
http://codemirror.net/5/
MIT License
26.77k stars 4.97k forks source link

[vim] Visual by-word movement keys are one char off #2913

Closed daveosborne closed 9 years ago

daveosborne commented 9 years ago

In vim proper, ve selects to the end of the current word, in the vim demo it is short one character.

vw is one character short as well, it selects to just before the next word. It should select the first character of the next word as well.

vb selects one too many characters backwards, but vbb selects the to the beginning of the second word correctly.

mightyguava commented 9 years ago

Gah, that's definitely a regression, probably came out of the block selection work...

mightyguava commented 9 years ago

Update here, I'm working on a fix, but it's going to take a bit... The visual mode logic is quite convoluted.

daveosborne commented 9 years ago

I also just noticed that in visual mode, the enter key doesn't move down a line.

I see only one key binding for in vim.js, but it's specifically for normal mode.

mightyguava commented 9 years ago

The visual mode off-by-one is be fixed