fix goto_window index crash (#1207)

pull/1220/head
Bob 3 years ago committed by GitHub
parent c955eaa6cd
commit 418b833d2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -751,8 +751,8 @@ fn goto_window(cx: &mut Context, align: Align) {
Align::Center => (view.offset.row + ((last_line - view.offset.row) / 2)), Align::Center => (view.offset.row + ((last_line - view.offset.row) / 2)),
Align::Bottom => last_line.saturating_sub(scrolloff + count), Align::Bottom => last_line.saturating_sub(scrolloff + count),
} }
.min(last_line.saturating_sub(scrolloff)) .max(view.offset.row + scrolloff)
.max(view.offset.row + scrolloff); .min(last_line.saturating_sub(scrolloff));
let pos = doc.text().line_to_char(line); let pos = doc.text().line_to_char(line);

Loading…
Cancel
Save