-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Vim zt / scrollCursorTop doesn't take sticky_scroll into account #48864
Copy link
Copy link
Labels
area:parity/vimFeedback for Vim parity featuresFeedback for Vim parity featuresfrequency:uncommonBugs that happen for a small subset of users, special configurations, rare circumstances, etcBugs that happen for a small subset of users, special configurations, rare circumstances, etcpriority:P3Papercuts, minor issues with a clear workaround, cosmetic bugsPapercuts, minor issues with a clear workaround, cosmetic bugsstate:reproducibleVerified steps to reproduce included and someone on the team managed to reproduceVerified steps to reproduce included and someone on the team managed to reproduce
Metadata
Metadata
Assignees
Labels
area:parity/vimFeedback for Vim parity featuresFeedback for Vim parity featuresfrequency:uncommonBugs that happen for a small subset of users, special configurations, rare circumstances, etcBugs that happen for a small subset of users, special configurations, rare circumstances, etcpriority:P3Papercuts, minor issues with a clear workaround, cosmetic bugsPapercuts, minor issues with a clear workaround, cosmetic bugsstate:reproducibleVerified steps to reproduce included and someone on the team managed to reproduceVerified steps to reproduce included and someone on the team managed to reproduce
Type
Fields
Give feedbackNo fields configured for Bug.
Reproduction steps
sticky_scroll.z t)Current vs. Expected behavior
Current behavior:
When pressing
z t, the current line is scrolled to the top of the entire screen content, disregarding the sticky headers. This causes your cursor to disappear and can be disorienting. It also means that the line that you're on, which you probably meant to use as a reference, is hidden by the sticky header.Before pressing:
After:
The relative line numbers in this screenie shows you exactly what's happened: I can move my cursor up 2 lines to reach the previous header, or down 3 lines to reach the first visible line of text.
Expected:
The
z taction should take sticky headers into consideration, such that the line is scrolled to the top of the "effective" text area. It'd look like this:Workaround and additional bug?
Moving your cursor does seem to expose it in most cases, but not always. For instance, if you place the cursor on the last line of the text ("Excepteur ...") and invoke the command, then the text content and the current level header disappears completely:
Before:
After:
Notice that the "Header level 3" has also been swallowed, although the breadcrumbs indicate that it should be there.
Now if I move my cursor once to the right (such that it moves, which appears to cause a recalculation), I get this:
And only when I move it another step, is the current line finally revealed.
Zed version and system specs
Zed: v0.223.2+preview.146.16e7dc6cfdc74af3d80fab913a694b757c3a3349 (Zed Preview)
OS: macOS 26.2
Memory: 48 GiB
Architecture: aarch64
Attach Zed log file
Zed.log
Relevant Zed settings
settings.json
{ "sticky_scroll": { "enabled": true, }, "vim_mode": true, }Relevant Keymap
keymap.json
(for AI issues) Model provider details
No response
If you are using WSL on Windows, what flavor of Linux are you using?
None