Fix: boundary fix in help/dict views

This commit is contained in:
2026-02-25 23:29:11 +01:00
parent aa607a78d8
commit 6dd265067f
5 changed files with 11 additions and 3 deletions

View File

@@ -160,6 +160,7 @@ fn render_words(frame: &mut Frame, app: &App, area: Rect, is_searching: bool) {
let visible_height = content_area.height.saturating_sub(2) as usize;
let total_lines = lines.len();
let max_scroll = total_lines.saturating_sub(visible_height);
app.ui.dict_max_scroll.set(max_scroll);
let scroll = app.ui.dict_scroll().min(max_scroll);
let title = if is_searching {

View File

@@ -223,6 +223,7 @@ fn render_content(frame: &mut Frame, app: &App, area: Rect) {
.map(|l| wrapped_line_count(l, content_width))
.sum();
let max_scroll = total_wrapped.saturating_sub(visible_height);
app.ui.help_max_scroll.set(max_scroll);
let scroll = app.ui.help_scroll().min(max_scroll);
let mut lines = parsed.lines.clone();