Hi! With Monaco I can work with multiple files (tabs) by creating a model for each. I am trying to figure out a way to work with multiple files with y-Monaco (even if it’s just one file at a time). I’d rather not overwrite the contents with each file and lose the edit history. If there an example of how to do this?
It looks like you bind Monaco to a type, just looking for a way to switch between a pool of types without loosing history.
y-monaco binds a Y.Text to an ITextModel. ITextModel represents a specific document and maintains its own history. You can simply switch to a different ITextModel and render that without losing history from other documents. This is how VSCode implements tabs: When you click on a tab, the monaco editor renders the associated ITextModel. You simply need to maintain the editor bindings alongside.