@@ -1324,6 +1324,7 @@ fn reflow(
1324 return Ok(());
1324 return Ok(());
1327+ let scrolloff = cx.editor.config().scrolloff;
1327 let (view, doc) = current!(cx.editor);
1328 let (view, doc) = current!(cx.editor);
1329 const DEFAULT_MAX_LEN: usize = 79;
1330 const DEFAULT_MAX_LEN: usize = 79;
@@ -1354,6 +1355,7 @@ fn reflow(
1355 doc.apply(&transaction, view.id);
1356 doc.apply(&transaction, view.id);
1356 doc.append_changes_to_history(view.id);
1357 doc.append_changes_to_history(view.id);
1358+ view.ensure_cursor_in_view(doc, scrolloff);