on master help sign in
cargo fmt
d03982eBlaž Hrastnik
helix-term/src/commands.rs+2−5
@@ -451,14 +451,11 @@ fn goto_window(cx: &mut Context, align: Align) {
451 let (view, doc) = current!(cx.editor);
451 let (view, doc) = current!(cx.editor);
452
452
453 let height = view.area.height.saturating_sub(1) as usize; // -1 for statusline
453 let height = view.area.height.saturating_sub(1) as usize; // -1 for statusline
454+
454 // - 1 so we have at least one gap in the middle.
455 // - 1 so we have at least one gap in the middle.
455 // a height of 6 with padding of 3 on each side will keep shifting the view back and forth
456 // a height of 6 with padding of 3 on each side will keep shifting the view back and forth
456 // as we type
457 // as we type
457− let scrolloff = cx
458− .editor
459− .config
460− .scrolloff
461− .min(height.saturating_sub(1) / 2);
458+ let scrolloff = cx.editor.config.scrolloff.min(height.saturating_sub(1) / 2);
462
459
463 let last_line = view.last_line(doc);
460 let last_line = view.last_line(doc);
464
461