mirror of
https://github.com/patriceckhart/zot.git
synced 2026-06-27 05:46:34 +02:00
scrollOffset is measured from the bottom of the chat buffer, so when the agent appends new lines while the user has scrolled up to read history, the visible window slides down through the buffer and the content the user was reading drifts off the top. Track the previous chat line count and column width across redraws. While the user is in free-scroll (scrollOffset > 0) and the terminal hasn't been resized, bump scrollOffset by the chat-length delta so the visible content stays pinned. Compensation is skipped on resize (line counts aren't comparable across reflows) and when following the tail (scrollOffset == 0), where new content should keep pushing the viewport as before. |
||
|---|---|---|
| .. | ||
| extensions | ||
| modes | ||
| tools | ||
| args.go | ||
| botcmd.go | ||
| botcmd_unix.go | ||
| botcmd_windows.go | ||
| build.go | ||
| changelog.go | ||
| cli.go | ||
| config.go | ||
| extcmd.go | ||
| modelsync.go | ||
| rpc.go | ||
| systemprompt.go | ||
| update.go | ||