From e14b48af2ebeb84868334e3b3281844353a9371d Mon Sep 17 00:00:00 2001 From: A-Walrus Date: Wed, 7 Sep 2022 20:50:54 +0300 Subject: Fix :reflow panic by enusring cursor in view (#3733) --- helix-term/src/commands/typed.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'helix-term/src') diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index ad4e7f4c..f005d9bf 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -1324,6 +1324,7 @@ fn reflow( return Ok(()); } + let scrolloff = cx.editor.config().scrolloff; let (view, doc) = current!(cx.editor); const DEFAULT_MAX_LEN: usize = 79; @@ -1354,6 +1355,7 @@ fn reflow( doc.apply(&transaction, view.id); doc.append_changes_to_history(view.id); + view.ensure_cursor_in_view(doc, scrolloff); Ok(()) } -- cgit v1.2.3-70-g09d2