diff --git a/crates/tui/src/app.rs b/crates/tui/src/app.rs index a7dbd45..b6ea931 100644 --- a/crates/tui/src/app.rs +++ b/crates/tui/src/app.rs @@ -634,8 +634,16 @@ impl App { pub fn total_lines(&self) -> usize { match &self.loading_state { AppLoadingState::Ready { reader } => reader.line_count(), - AppLoadingState::Loading { reader, .. } => { - reader.sampled_line_count() + AppLoadingState::Loading { + reader, + estimated_lines, + .. + } => { + // Use estimated total lines (not sampled_line_count) so the user can + // scroll freely during indexing. get_line() incrementally scans + // forward on demand, so lines beyond the initial 64KB are still + // accessible. The .max() guards against under-estimates. + (*estimated_lines as usize).max(reader.sampled_line_count()) } _ => 0, }