VSCodeVim / VSCodeVim/Vim

Sticky Scroll partially breaks zt

Open
#9,141 1 comment 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

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

  • Extension (VsCodeVim) version: v1.27.3
  • VSCode version: 1.91.1
  • OS: Linux

Additional context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in VS Code 1.91.1 with VSCodeVim v1.27.3, editor.stickyScroll.maxLineCount set to 20, and zt in normal mode. Compare zt's top position with sticky scroll disabled and with different visible sticky-content lengths; the fix is complete when zt can reach the actual top or the line directly below the displayed sticky content rather than using the configured maximum as a fixed offset.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.