on master help sign in
cargo fmt
commitd03982ee432bb418e1e74d490ae66371e201cee2 authorBlaž Hrastnik <blaz@mxxn.io> dateThu 12 Aug 2021, 10:18 (5 years ago) parent25a8a47
1 file changed+2−5
helix-term/src/commands.rs+2−5
helix-term/src/commands.rs+2−5
@@ -451,14 +451,11 @@ fn goto_window(cx: &mut Context, align: Align) {
451451 let (view, doc) = current!(cx.editor);
452452
453453 let height = view.area.height.saturating_sub(1) as usize; // -1 for statusline
454+
454455 // - 1 so we have at least one gap in the middle.
455456 // a height of 6 with padding of 3 on each side will keep shifting the view back and forth
456457 // 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);
462459
463460 let last_line = view.last_line(doc);
464461