Skip to content

Commit

Permalink
Fix :reflow panic by enusring cursor in view (helix-editor#3733)
Browse files Browse the repository at this point in the history
  • Loading branch information
A-Walrus authored and Shekhinah Memmel committed Dec 11, 2022
1 parent b373039 commit c7fc5d7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions helix-term/src/commands/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(())
}
Expand Down

0 comments on commit c7fc5d7

Please sign in to comment.