on master help sign in
fix goto_window index crash (#1207)
commit418b833d2b64ed986cfc84ca023e1a6ca5080008 authorBob <QiBaobin@users.noreply.github.com> dateThu 2 Dec 2021, 12:42 (5 years ago) parentc955eaa
1 file changed+2−2
helix-term/src/commands.rs+2−2
helix-term/src/commands.rs+2−2
@@ -751,8 +751,8 @@ fn goto_window(cx: &mut Context, align: Align) {
751751 Align::Center => (view.offset.row + ((last_line - view.offset.row) / 2)),
752752 Align::Bottom => last_line.saturating_sub(scrolloff + count),
753753 }
754− .min(last_line.saturating_sub(scrolloff))
755− .max(view.offset.row + scrolloff);
754+ .max(view.offset.row + scrolloff)
755+ .min(last_line.saturating_sub(scrolloff));
756756
757757 let pos = doc.text().line_to_char(line);
758758