vimium
vimium copied to clipboard
Cannot go to caret mode from normal mode
In recent releases, I cannot go to the caret mode (by press "vc") from Normal mode. So I create this patch to have it back.
Hi, thanks for fixing the caret mode. :)
But there's one little bug here: In caret mode, forward word jumping using w
or e
acts just like in visual mode, but the selection only jumps forward the first time the key is pressed and then stops there. While in visual mode w
and e
do act properly.
I suppose it's due to the altering below (starting from line 55):
// Native word movements behave differently on Linux and Windows, see #1441. So we implement some of them
// character-by-character.
if (granularity === vimword && direction === forward) {
while (this.nextCharacterIsWordCharacter())
if (this.extendByOneCharacter(forward) === 0)
return;
while (this.getNextForwardCharacter() && !this.nextCharacterIsWordCharacter())
if (this.extendByOneCharacter(forward) === 0)
return;
} else if (granularity === vimword) {
return this.selection.modify(this.alterMethod, backward, word);
}
FYI: I'm using Chrome 96 on Mac 10.15
Would love to see his merged!
@tuanbass Hello, you have pushed some new commits to the master
branch of your repo, while it's about scrolling, but not VisualMode. This affects this PR because the PR is bound to tuanbass:master
directly.
@tuanbass Hello, you have pushed some new commits to the
master
branch of your repo, while it's about scrolling, but not VisualMode. This affects this PR because the PR is bound totuanbass:master
directly.
Thanks for pointing out. As the PR was opened for a long time, I have nearly forgotten about it, and tried to fix another bug. Anyway, I reverted the last commit, and hope the PR will be merged soon.
Any idea when this will be merged? Would really benefit from this functionality. Thank you.
This is great; thanks for the cleanup and the fix @tuanbass !
Just now I reviewed all my code in #3867, and I found this PR lacks a place: https://github.com/philc/vimium/blob/66adcdeaaf914f6ffc1c3c11e30c7f269ae15ac7/content_scripts/mode_visual.js#L380-L383
Here a following .init()
for new VisualMode()
is also necessary. @philc
Good catch @gdh1995; fixed in 5c00e2e029ed0f40a63054cdebfc75615721175a