Vim icon indicating copy to clipboard operation
Vim copied to clipboard

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

Open shaladdle opened this issue 8 years ago • 8 comments

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:

  • VSCode Version: 1.10.2
  • VsCodeVim Version: 0.6.5
  • OS: OS X

shaladdle avatar Mar 12 '17 11:03 shaladdle

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.

ghost avatar Apr 25 '17 09:04 ghost

@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.

Liquidmantis avatar Aug 08 '17 13:08 Liquidmantis

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 :/

xconverge avatar Oct 05 '17 03:10 xconverge

@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 ?

Chillee avatar Oct 06 '17 01:10 Chillee

Yes I agree

xconverge avatar Oct 06 '17 01:10 xconverge

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.

  • editor.cursorSurroundingLines: 2: LLL scrolls down 2 lines at a time (bug), HHH scrolls up 2 lines at a time (bug)
  • editor.cursorSurroundingLines: 1: LLL scrolls down 1 line at a time (bug), HHH scrolls up 1 line at a time (bug)
  • editor.cursorSurroundingLines: 0: LLL scrolls down 1 line at a time (bug), HHH doesn't scroll up (correct!)

Maybe that's a helpful lead for debugging this?

jdanbrown avatar Nov 25 '20 06:11 jdanbrown

Friendly ping -- any update on this issue?

ianyepan avatar May 08 '23 10:05 ianyepan

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

hewson99 avatar Aug 01 '24 02:08 hewson99