aioutecism / amVim-for-VSCode

The Vim mode for Visual Studio Code(vscode) that works as expected.
https://marketplace.visualstudio.com/items/auiworks.amvim
456 stars 42 forks source link

Vgg does not work #292

Closed cpetrov closed 3 years ago

cpetrov commented 3 years ago

gg does not work in visual mode.

Example document:

1
2
3

Go to line 3. Press V. amVim will enter visual mode. Press gg. The cursor should jump to the first line, but it doesn't.

alisonatwork commented 3 years ago

Great bug report, thanks @cpetrov.

It seems the ROT13 feature of #235 has hijacked the g motions in visual mode. This is a similar problem to what we had with gD and gd in the first iteration, before we refactored that into a motion.

@mtsknn I think it would be better to revert the ROT13 change for now so that gg and other motions continue to work in visual mode. To be honest, the g? command doesn't work for me in visual mode either in the current HEAD. Are you interested to work on a patch for that?

Edit to add: it might be that the reason why g? didn't/doesn't work for me (but it does work in the unit tests) is because I have ? keybound to /, i.e. search (backwards), and somehow that overrides the command. Other possibility is because I have a non-US/international keyboard, the question mark is not registering the same way.

alisonatwork commented 3 years ago

@cpetrov I have now fixed this in master. Can you compile and check master? Otherwise it should be released in the next version as per #291 (CC: @aioutecism)

cpetrov commented 3 years ago

@alisonatwork It works! Thank you!

mtsknn commented 3 years ago

Heh, I don't know if there's any practical use for g? so removing the feature is fine for me. 😄 I don't use it myself (despite having implemented it in 2019) so I'm not interested in re-implementing it unless there's demand for it.

alisonatwork commented 3 years ago

@mtsknn fair enough! It's definitely a fun feature to have, but I think most people would prefer Vgg to work. I am sure if someone else is keen they can implement it using your original work as a reference 👍