When a scene is renamed we need to re-create its model in order to keep its (Monaco) Uri in sync (as Monaco uses these to uniquely identify models, as will the language services). At the time of writing there is no API for editing the Uri of an already created model, so this is a necessary evil. Unfortunately, it means losing data associated with the model, such as the undo/redo history.
When a scene is renamed we need to re-create its model in order to keep its (Monaco) Uri in sync (as Monaco uses these to uniquely identify models, as will the language services). At the time of writing there is no API for editing the Uri of an already created model, so this is a necessary evil. Unfortunately, it means losing data associated with the model, such as the undo/redo history.