editor: add undo stop when switching model

Since we share the same editor instance with multiple models, we need
to ensure undo stack consistency when changing the model, otherwise
we can lose some history, e.g. if a not active model is modified.
This commit is contained in:
David Lechner
2023-05-18 17:06:31 -05:00
committed by David Lechner
parent 7351dfb95c
commit 57c2b8a28b
+2
View File
@@ -265,8 +265,10 @@ function* handleEditorActivateFile(
);
}
editor.pushUndoStop();
editor.setModel(file.model);
editor.restoreViewState(file.viewState);
editor.pushUndoStop();
activeFileHistory.push(action.uuid);
editor.focus();