@@ -1337,7 +1337,9 @@ impl Component for EditorView {
13371337 cx.editor.status_msg = None;
13381338
13391339 let mode = cx.editor.mode();
1340− let (view, _) = current!(cx.editor);
1340+ let (view, doc) = current!(cx.editor);
1341+ let original_doc_id = doc.id();
1342+ let original_doc_revision = doc.get_current_revision();
13411343 let focus = view.id;
13421344
13431345 if let Some(on_next_key) = self.on_next_key.take() {
@@ -1413,13 +1415,31 @@ impl Component for EditorView {
14131415 let view = view_mut!(cx.editor, focus);
14141416 let doc = doc_mut!(cx.editor, &view.doc);
14151417
1416− view.ensure_cursor_in_view(doc, config.scrolloff);
1417−
14181418 // Store a history state if not in insert mode. This also takes care of
14191419 // committing changes when leaving insert mode.
14201420 if mode != Mode::Insert {
14211421 doc.append_changes_to_history(view.id);
14221422 }
1423+
1424+ // If the current document has been changed, apply the changes to all views.
1425+ // This ensures that selections in jumplists follow changes.
1426+ if doc.id() == original_doc_id
1427+ && doc.get_current_revision() > original_doc_revision
1428+ {
1429+ if let Some(transaction) =
1430+ doc.history.get_mut().changes_since(original_doc_revision)
1431+ {
1432+ let doc = doc!(cx.editor, &original_doc_id);
1433+ for (view, _focused) in cx.editor.tree.views_mut() {
1434+ view.apply(&transaction, doc);
1435+ }
1436+ }
1437+ }
1438+
1439+ let view = view_mut!(cx.editor, focus);
1440+ let doc = doc_mut!(cx.editor, &view.doc);
1441+
1442+ view.ensure_cursor_in_view(doc, config.scrolloff);
14231443 }
14241444
14251445 EventResult::Consumed(callback)