VSCodeVim / Vim

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

Sticky Scroll partially breaks zt #9141

Open e-sp opened 1 month ago

e-sp commented 1 month ago

Describe the bug When stick scroll is enabled, zt behaves as if it can never go to the top of the file but is restricted to go as far as "top" - editor.stickyScroll.maxLineCount. Which means that, if editor.stickyScroll.maxLineCount is 20, zt will always have a scroll offset of 20, independent of how many lines stick scroll may actually be showing/using.

To Reproduce

  1. Set editor.stickyScroll.maxLineCount option to 20
  2. Use zt in normal mode
  3. Observe that "top" of zt is 20 lines below the top.

Expected behavior Either go to the actual top as if no scroll offset would exist, independent of what sticky scrolling may be showing, or to to the line directly below the actual content of sticky scroll. Don't use editor.stickyScroll.maxLineCount as fixed scroll offset.

Screenshots

Environment (please complete the following information):

Additional context