Skip to content

Commit e14b48a

Browse files
authored
Fix :reflow panic by enusring cursor in view (#3733)
1 parent a123fb6 commit e14b48a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

helix-term/src/commands/typed.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

0 commit comments

Comments
 (0)