aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA-Walrus2022-09-07 17:50:54 +0000
committerGitHub2022-09-07 17:50:54 +0000
commite14b48af2ebeb84868334e3b3281844353a9371d (patch)
tree6c1df29a511f98371d2d623e96b00e1c509ab75c
parenta123fb60572720a5fd0817b194f4d34534f87b4e (diff)
Fix :reflow panic by enusring cursor in view (#3733)
-rw-r--r--helix-term/src/commands/typed.rs2
1 files changed, 2 insertions, 0 deletions
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(())
}