vimium icon indicating copy to clipboard operation
vimium copied to clipboard

Unexpected behaviour of `w` and `e` in caret mode

Open kwsp opened this issue 4 years ago • 8 comments

Describe the bug In vim, w and e are word motions, but currently in caret mode (just c, not v), both w and e move the cursor one character forward. This only happens on firefox and not on chromium for me.

To Reproduce Enter caret mode on any website using firefox and try e and w.

Browser and Vimium version

  • Firefox 85.0.2 (64-bit)
  • OS: Darwin 19.6.0 Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05 PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64
  • Vimium 1.66

kwsp avatar Feb 22 '21 06:02 kwsp

This seems like a regression introduced from the migration from coffee script. The chrome version of vimium (v1.66) was last updated on 2 March 2020, while the [firefox version of vimium (also v1.66) was last updated on 20 February 2021]. Note that this isn't the dev version I installed manually. Screen Shot 2021-02-22 at 3 17 40 PM

Weird because on addons.mozilla.com vimium was last updated on 3 Mar 2020. So for some reason, when I installed Vimium from the firefox addons page it installed a very recent build.

I tested HEAD on chromium and the same bug in visual/caret mode is also present.

kwsp avatar Feb 22 '21 07:02 kwsp

Can Confirm this

action-server avatar Feb 26 '21 04:02 action-server

Same Issue

JojiiOfficial avatar Nov 16 '22 14:11 JojiiOfficial

I've noticed in the last few months that the latest version of Vimium in both Chrome and Firefox, caret mode exhibits same behavior. When in caret mode, it is possible to navigate the cursor as usual using h, j, k and l, but when attempting to move a word forward, either by using w or e, then the situation is following:

Expected behavior: cursor is moved forward by one word, as is expected every time w or e are pressed and this can be repeated multiple times, as long as there are words to be navigated.

Observed behavior: cursor is moved forward by one word, but that word has been selected (this shouldn't happen) and pressing once again either w or e will not move the cursor forward.

This looks like a related issue to the current one, I can create a new issue describing this, if it is necessary.

Note that usage of b (moving a word backwards in caret mode) works as expected.

dorescanin avatar Jan 15 '23 09:01 dorescanin

I have the same issue

Nosp1 avatar Mar 30 '23 20:03 Nosp1

If anyone can point me to the code where caret mode is defined, i'd be happy to try and fix this. My inital guess is that upon entering caret mode the motion for w and e are being used as visual selection, whilst b has the correct configuration

Nosp1 avatar Mar 31 '23 15:03 Nosp1

Same issue

dlloyd616 avatar May 09 '23 21:05 dlloyd616

https://github.com/philc/vimium/blob/131e2404268322aaa25f99fd23032f6d06d820f8/content_scripts/mode_visual.js#L534

If anyone can point me to the code where caret mode is defined, i'd be happy to try and fix this. My inital guess is that upon entering caret mode the motion for w and e are being used as visual selection, whilst b has the correct configuration

S3r4f1n avatar Mar 22 '24 13:03 S3r4f1n