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

Wrapped line support #305

Closed alisonatwork closed 2 years ago

alisonatwork commented 2 years ago

This is a basic implementation of the motions g 0, g $, g j and j k to navigate around with wrapped lines. See #116.

Due to the way VS Code works, we have to jump the cursor around a little bit to plan the motion before we actually execute it, which causes some unfortunate flickering, but at least the functionality is there if you need it. I wasn't easily able to add tests for this because I'm still not sure how to set up the test VS Code instance with non-default settings for line wrap.

There are a couple of known issues:

  1. Visual mode sometimes switches mysteriously between one character to the left and one character to the right of where you expect it to be, specifically when you cross over the starting point of your visual selection.
  2. VS Code does not remember what column you were in when you navigate up or down from a shorter wrapped line back to a longer wrapped line. The new column will just end up being the shorter one.

This addresses #116