feat: restore scroll behavior from working commit#353
feat: restore scroll behavior from working commit#353sudo-tee merged 6 commits intosudo-tee:mainfrom
Conversation
Allow users to customize window-local options for the input window via `ui.input.win_options` in config. Any valid Neovim window option can be set, such as signcolumn, cursorline, number, relativenumber, etc. This improves flexibility for user preferences and editor appearance.
Restore ed0c078 scroll behavior Replace the sticky `_was_at_bottom_by_win` flag with a new approach that tracks the previous line count per window. The `is_at_bottom` logic now compares the cursor position to the previous and current line counts, making auto-scroll behavior more robust and less dependent on viewport events. This also removes redundant comments and unused code, and ensures scroll tracking state is reset consistently.
Update tests to reflect the new cursor-based scroll tracking logic in output_window. Remove references to the old viewport-based flag and simulate user actions by moving the cursor instead. This ensures tests align with the simplified auto-scroll behavior.
| end | ||
|
|
||
| -- Prefer the sticky flag when it has been set by scroll/WinScrolled events. | ||
| -- Fall back to a live viewport check on the very first call (flag is nil). |
There was a problem hiding this comment.
Quick question: does viewport position still drive is_at_bottom() tracking in this change, or is it now cursor-only?
I often pull the viewport away from the bottom using the touchpad, so I want to confirm whether this part will cause a change in behavior.
|
Additionally, I cannot reproduce this issue locally ( |
|
@jensenojs i dont know, the breaking code was introduced in this commit commit 2f73a21 in this PR i am just trying to restore the code as it was before this commit Anyway i think you could checkout my branch and test your usecases I tested it and now it has the best behavior, which is to behave like a terminal buffer, when the cursorline is at the end of the buffer, and new content is appended, then the cursorline scrolls with the new content, and when the cursorline is not at the end of the buffer, that means the users is reading something, so the cursorline is not scrolled down as new content is rendered |
|
I see what is your intent there. But I changed the scroll behavior in my last refactor because it would often stop scrolling even if the cursor didn't move in the output. Most of the time It would stop scrolling before the last message. So basically what it not working for you ? Scroll just don't work ? |
|
@sudo-tee with the refactor code, every time new content is added to the output window, the cursor is placed at the end of the new content, making a scroll effect, and also, if i press "k" several times to move up the cursor when new content is rendered, then cursor keeps going down as new content comes i think the best behavior is like i said, to make it work like in neovim terminal buffers: --> cursor is at end of line --> keep moving cursorline to the new appended content |
|
I don't have this issue myself on main, it behave exactly how you describe it. But I will still merge it if it helps |
@sudo-tee in your main branch the scroll behavior is not working, i mean, no matter how you define the always scroll to bottom setting, that the buffer is always scrolled to bottom
This pr is to restore working scroll behavior from previous commit