Vim: Horizontal scroll jumps while selecting in visual line mode

Created on 10 Nov 2016  路  8Comments  路  Source: VSCodeVim/Vim

Please thumbs-up 馃憤 this issue if it personally affects you! You can do this by clicking on the emoji-face on the top right of this post. Issues with more thumbs-up will be prioritized.


What did you do?

See gif

The first selection in gif is native vscode selection. Doesn't cause horizontal scrolling
The second selection is gif is vscodevim visual line selection.

  • VSCode Version: 1.7.1
  • VsCodeVim Version: 0.4.1
  • OS: Windows 10
kinenhancement upstreavscode

Most helpful comment

this is the bane of my existence, especially when editing html.

All 8 comments

This is especially annoying if you have very long lines in a file, like a pasted data URI or SVG.

Something I noticed, if you do visual line from bottom UP this doesn't happen, it has to do with which cursor is being moved (is the cursor at the front or end of line...)

It's exactly the fact that we're setting the position of the cursor. If you do it top down, then we set the cursor is on the bottom right of the selection and hence the window scrolls to keep the cursor in view. If we do it bottom up, then we set the cursor to the top left, and the window has no need to scroll.

I'm pretty sure we need to wait for an upstream fix to this. I don't think it's possible to have a selection in vscode in which your cursor is not at the beginning or the end of the selection.

this is the bane of my existence, especially when editing html.

I think when use visual line mode curosr should at the position where it is. this drive me crazy

Reading this thread inspired me to try 0v$ when scrolling down and $v0 when scrolling up. It's not as intuitive and easy, but it saves me the pain of losing track of where I am. I'm wondering if the vim bindings code can be hacked to do something like this.

As of 1.14.2, entering visual line mode does not move the cursor (you can be in the middle of the line), so this should no longer be an issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

typeoneerror picture typeoneerror  路  3Comments

gerardmrk picture gerardmrk  路  3Comments

liamdawson picture liamdawson  路  3Comments

jaredly picture jaredly  路  3Comments

edwintorok picture edwintorok  路  3Comments