Repository navigation
feat(editor): remember counted half-page scrolling - #432
Merged
Merged
Conversation
Ctrl-D and Ctrl-U keep a window-local scroll distance, and Ctrl-Y and Alt-E scroll the view by a count without moving the cursor until it would leave the screen.
fcoury
marked this pull request as ready for review
November 3, 2026 03:30
Contributor
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 59a7f42d6c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The next event checks bounds before the action runs, so clearing the preserve flag at the end of Ctrl-D let a following count pull the cursor back into the scrolloff margin.
fcoury
marked this pull request as ready for review
November 3, 2026 03:42
Keep counted half-page scrolling and the -c key=value flags together. # Conflicts: # CHANGELOG.md
Keep counted scrolling together with the latest main.
A file created in the same timestamp tick does not change the directory mtime, so the non-recursive snapshot can stay identical until the clock moves.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Neovim's
[count]CTRL-Dand[count]CTRL-Udo more than jump half a page. A count sets the window-local'scroll'option, and later plainCTRL-D/CTRL-Ureuse that distance. The cursor moves the same number of lines and keeps its screen row until the start or end of the file, whereCTRL-Dlands on the last line.CTRL-YandCTRL-Ethen nudge the view by one line and leave the cursor put until it would leave the screen.Red already had
HalfPageDown/HalfPageUpand a count prefix. This extends that path instead of adding a second one. Each window remembers the distance from the last countedCtrl-DorCtrl-U. With no count yet, the distance is half the window height. A resize, or any other change to that window's content height, drops the remembered value so the next plain press is half the new height again. The cursor keeps its screen row; near the end of the fileCtrl-Dmoves it to the last line and leaves the viewport where it is.Ctrl-YisScrollLineUp. It scrolls the view up[count]lines (default 1) and does not move the cursor unless the cursor would leave the scrolloff margin. Neovim's scroll-down isCTRL-E, and that key already toggles the file tree.Alt-Eis the default forScrollLineDown. It is unbound in normal mode, soCtrl-Estays NeoTree, and it keeps theEmnemonic ("extra" lines) from Neovim. Both actions take[count], use0in the keymap to mean the default of one line, and can be remapped in[keys.normal].Soft-wrapped continuations count as screen rows, so a long line does not jump a whole buffer line per count. Red has no folds, so a count never skips a hidden line. Inline comment cards and Markdown table projections insert virtual rows; a step follows the next source segment, which can cover more than one terminal row while those decorations are on screen.
The recording unsets
NO_COLORand uses Catppuccin Mocha, so syntax highlighting, the status line, and the Nerd Font icon stay in color.How to Test
In normal mode:
5thenCtrl-D. The view and cursor move 5 lines, and the cursor stays on the same screen row.Ctrl-Dagain. It moves another 5 lines, not half the window.Ctrl-U. It moves back 5 lines.Ctrl-Dputs the cursor on the last line.Ctrl-Yscrolls the view up one line.3 Ctrl-Yscrolls three. The cursor stays until it would cross the scrolloff margin.Alt-Escrolls the view down the same way.Ctrl-Estill toggles the file tree.Ctrl-D. The distance is half the new height.cargo test --test editing counted_half_page half_page_down resizing_the_window ctrl_y_and_alt scroll_line_down half_page_counts nowrap_half vim_half_pagecovers the remembered distance, the end-of-file clamp, resize, wrapped rows,Ctrl-Y/Alt-Ewith and without a count, and a remapped scroll-down key.