unblevable / quick-scope

Lightning fast left-right movement in Vim
MIT License
1.43k stars 54 forks source link

[Bug] count for motion not respected #84

Closed mrossinek closed 2 years ago

mrossinek commented 2 years ago

I just noticed that <count>f no longer jumps to the correct character. The highlighting works just as expected but the motion afterwards simply ignores the count. I did a bisect and found https://github.com/unblevable/quick-scope/commit/da2045728804ad6dbc54054b29f4a04b78a11c4e to be the first bad commit. I am not sure what motivated that change so I am opening this issue to discuss a solution.

bradford-smith94 commented 2 years ago

This change was done to fix plugin interactions and/or neovim sometimes throwing "E523: not allowed here". https://github.com/unblevable/quick-scope/issues/80 has the context for that.

I did forget to test that with counts though. Basically the fix for that issue changed the plugin behavior so that it executes normal mode commands itself instead of just returning the motion for vim to handle and not it needs to also have count in there.

I'll double check a couple things and should be pushing a fix soon.

mrossinek commented 2 years ago

Thanks! I can verify that the original bug is fixed now! However, I found another bug. Say you have this sentence:

A sentence with many duplicate letters.

And your cursor is at the very beginning. Pressing fe and 2fe works as expected. However, if you are on the second e and press fe in order to jump to the next occurrence of e you actually jump to the first e on the entire line. This was working correctly in v2.5.13 so this commit somehow caused that.

bradford-smith94 commented 2 years ago

Yeah, I mixed up v:count and v:count1 because I forgot to test a couple cases. Should be really fixed in v2.5.15.

mrossinek commented 2 years ago

Thanks! Yes it now seems to be fully fixed :+1: