VSCodeVim / Vim

:star: Vim for Visual Studio Code
http://aka.ms/vscodevim
MIT License
14.02k stars 1.32k forks source link

`L` selects the right line, but also scrolls down one #1393

Open shaladdle opened 7 years ago

shaladdle commented 7 years ago

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?

I pressed L in an editor window.

What did you expect to happen?

The cursor should go to the last visible line of the current file.

What happened instead?

The cursor went to the last visible line of the current file and the the window scrolled down to reveal the next line after that. If you were to keep typing L, you would eventually scroll to the bottom of the file. In Vim this is not the behavior.

Technical details:

ghost commented 7 years ago

This appears to be a VSCode behaviour as you move past the second to last bottom line in the window it auto scrolls the window one line up.

Liquidmantis commented 7 years ago

@Chillee I haven't really used Vim for anything more than quick config file edits, but L stops 5 lines from the lowest line. I think it's to keep the lower area clear for a pop-up buffer. It seems like a [hack] solution here would be to stop at the next to last line in VSCodeVim. I know that I personally would prefer that behavior over the current "ratchet" scrolling.

xconverge commented 7 years ago

I implemented a move to last line then up one, but the problem is the initial move to last line still causes the scroll.

The problem is the vscode api does not give us any way of knowing what the bottom displayed line is, they only give us a command to move to the bottom displayed line :/

Chillee commented 7 years ago

@xconverge I think this is a VSCode API mistake. VSCode effectively simulates a :set scrolloff=1, and H and L should respect that scrolloff.

@rebornix ?

xconverge commented 7 years ago

Yes I agree

jdanbrown commented 4 years ago

What's weird is that with editor.cursorSurroundingLines > 0, H and L both have the same (buggy) behavior, but with editor.cursorSurroundingLines = 0, only L has the buggy behavior and H doesn't.

Maybe that's a helpful lead for debugging this?

ianyepan commented 1 year ago

Friendly ping -- any update on this issue?

hewson99 commented 4 months ago

when you press L vim actually did 1 + L , but there is a bug in vscode that scrolls down one so you can press 2 + L to fix it