on master help sign in
reload_all: Ensure view is synced with doc history before reload (#4965)
8291654Michael Davis
helix-term/src/commands/typed.rs+4
@@ -1068,6 +1068,10 @@ fn reload_all(
1068
1068
1069 // Every doc is guaranteed to have at least 1 view at this point.
1069 // Every doc is guaranteed to have at least 1 view at this point.
1070 let view = view_mut!(cx.editor, view_ids[0]);
1070 let view = view_mut!(cx.editor, view_ids[0]);
1071+
1072+ // Ensure that the view is synced with the document's history.
1073+ view.sync_changes(doc);
1074+
1071 let redraw_handle = cx.editor.redraw_handle.clone();
1075 let redraw_handle = cx.editor.redraw_handle.clone();
1072 doc.reload(view, &cx.editor.diff_providers, redraw_handle)?;
1076 doc.reload(view, &cx.editor.diff_providers, redraw_handle)?;
1073
1077