on master help sign in
Fix :reflow panic by enusring cursor in view (#3733)
commite14b48af2ebeb84868334e3b3281844353a9371d authorA-Walrus <58790821+A-Walrus@users.noreply.github.com> dateWed 7 Sep 2022, 20:50 (4 years ago) parenta123fb6
1 file changed+2
helix-term/src/commands/typed.rs+2
helix-term/src/commands/typed.rs+2
@@ -1324,6 +1324,7 @@ fn reflow(
13241324 return Ok(());
13251325 }
13261326
1327+ let scrolloff = cx.editor.config().scrolloff;
13271328 let (view, doc) = current!(cx.editor);
13281329
13291330 const DEFAULT_MAX_LEN: usize = 79;
@@ -1354,6 +1355,7 @@ fn reflow(
13541355
13551356 doc.apply(&transaction, view.id);
13561357 doc.append_changes_to_history(view.id);
1358+ view.ensure_cursor_in_view(doc, scrolloff);
13571359
13581360 Ok(())
13591361}