mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 09:36:27 +00:00
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:
committed by
David Lechner
parent
7351dfb95c
commit
57c2b8a28b
@@ -265,8 +265,10 @@ function* handleEditorActivateFile(
|
||||
);
|
||||
}
|
||||
|
||||
editor.pushUndoStop();
|
||||
editor.setModel(file.model);
|
||||
editor.restoreViewState(file.viewState);
|
||||
editor.pushUndoStop();
|
||||
activeFileHistory.push(action.uuid);
|
||||
|
||||
editor.focus();
|
||||
|
||||
Reference in New Issue
Block a user