vimium-c
vimium-c copied to clipboard
Movement bug of key "zero" in visual mode. 19 j works, but 20j works as j because 0 cancels 2 and j works singly
Describe the bug When in cater mode and as 0-key is pressed, the hover element is moved to the head of its line. However, this zero-key action happens even after another number key has been pressed and waiting for movement. As an example, 9j works by moving the selection 9 lines down, while 10j works seperately as first 1 and 0 cancels 1's effect and j works by moving seletion one line down.
To Reproduce
Steps to reproduce the behavior:
- open a page where vimium-c works
- press ’y' and 'v' and select a text to highlight
- press '1' and '0'
- press 'j', you should find the highlighted position is moved by 1 line not 10.
Browser, OS and Vimium C versions
- Browser name: Chrome
- Browser version: Version 119.0.6045.212 (Official Build) (64-bit)
- Vimium C version: 1.99.99.
- OS name and version: Chrome OS and Version 119.0.6045.212 (Official Build) (64-bit)
this bug happens only in Visual Mode, it won't appear in normal mode
Well it's not a bug, but indeed a feature, which was not well-designed:
- by default, VisualMode uses
0
to modify a current selection to select from line beginning to current caret - so
10
made Vimium C "create such a selection by 1 times"
I'll add a special check for this, to prevent 0
after a number prefix being triggered.