mirror of
https://github.com/helix-editor/helix.git
synced 2025-01-31 10:34:04 +04:00
Fix :reflow panic by enusring cursor in view (#3733)
This commit is contained in:
parent
a123fb6057
commit
e14b48af2e
@ -1324,6 +1324,7 @@ fn reflow(
|
|||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let scrolloff = cx.editor.config().scrolloff;
|
||||||
let (view, doc) = current!(cx.editor);
|
let (view, doc) = current!(cx.editor);
|
||||||
|
|
||||||
const DEFAULT_MAX_LEN: usize = 79;
|
const DEFAULT_MAX_LEN: usize = 79;
|
||||||
@ -1354,6 +1355,7 @@ fn reflow(
|
|||||||
|
|
||||||
doc.apply(&transaction, view.id);
|
doc.apply(&transaction, view.id);
|
||||||
doc.append_changes_to_history(view.id);
|
doc.append_changes_to_history(view.id);
|
||||||
|
view.ensure_cursor_in_view(doc, scrolloff);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user