Fix: boundary fix in help/dict views
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user