fix goto_window index crash (#1207)
This commit is contained in:
parent
c955eaa6cd
commit
418b833d2b
1 changed files with 2 additions and 2 deletions
|
@ -751,8 +751,8 @@ fn goto_window(cx: &mut Context, align: Align) {
|
|||
Align::Center => (view.offset.row + ((last_line - view.offset.row) / 2)),
|
||||
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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue