jesseduffield.lazygit/pkg/gui/types
Stefan Haller cbf220c497 Read lines based on scroll position instead of a fixed per-notch delta
When scrolling a lazy-loaded view (a diff in the main view, the command
log, etc.), we top up the view's line buffer by reading more lines from
the still-running task. This was driven by asking the task to read a
fixed number of *additional* lines on every scroll event, which had two
problems:

- It was decoupled from the scroll position. Scrolling down, back up,
  and down again re-read lines that had already been read, so the buffer
  crept towards the end of the input regardless of where the user
  actually scrolled.

- A single wheel notch only bought a single notch worth of runway, so
  fast scrolling constantly outran the reader and had to wait for the
  next read (and re-render) on every notch.

Make ReadLines take an absolute target total instead of a delta: the
task tracks how many lines it has read and only reads the shortfall, so
requests are idempotent. Callers now ask to fill the viewport at the
current scroll position plus a few screenfuls of read-ahead, which gives
scrolling enough runway to stay smooth.

The four call sites all wanted the same "fill this view" computation, so
consolidate them into a single ReadLinesToFillView helper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 09:32:35 +02:00
..
common.go Read lines based on scroll position instead of a fixed per-notch delta 2026-07-09 09:32:35 +02:00
common_commands.go Don't refresh pull requests when checking out a local branch 2026-04-01 09:13:55 +02:00
context.go Convert keybinding fields to Keybinding 2026-05-25 15:32:47 +02:00
keybindings.go Rename Key to Keys in Binding, KeybindingsOpts, and MenuItem 2026-05-25 15:18:18 +02:00
modes.go Add a "Mark commit as base commit for rebase" command 2023-07-31 08:41:41 +02:00
ref_range.go Move the Ref interface from gui/types to models 2025-07-31 15:21:34 +02:00
refresh.go Select the checked-out branch via a refresh intent, not off-thread 2026-07-07 18:09:33 +02:00
rendering.go Cleanup: add NewRunPtyTaskWithPrefix funxtion instead of setting Prefix manually 2025-07-02 16:15:19 +02:00
search_state.go Add search history 2023-09-20 08:35:41 +03:00
suggestion.go Set groundwork for better disabled reasons with range select 2024-01-23 13:03:37 +11:00
version_number.go Show popup message with breaking changes on startup 2024-03-12 13:27:14 +01:00
version_number_test.go Show popup message with breaking changes on startup 2024-03-12 13:27:14 +01:00
views.go Copy gocui files into lazygit repo under pkg/gocui 2026-04-30 14:29:08 +02:00