philc / vimium

The hacker's browser.
https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb
MIT License
23k stars 2.47k forks source link

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

Open kwsp opened 3 years ago

kwsp commented 3 years ago

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

kwsp commented 3 years ago

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.

action-server commented 3 years ago

Can Confirm this

JojiiOfficial commented 1 year ago

Same Issue

dorescanin commented 1 year ago

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.

Nosp1 commented 1 year ago

I have the same issue

Nosp1 commented 1 year ago

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

dlloyd616 commented 1 year ago

Same issue

S3r4f1n commented 5 months ago

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