Open maxrothman opened 1 week ago
Thanks for spotting this. Could you make a PR to develop?
I took a look into the places where this call could be added. My instinct was that the best place to add it would be in a single central function that handles file loading so that it always gets called whenever a file is loaded. Unfortunately there doesn't seem to be a clear candidate for such a function. Here are the candidates I found by looking through the imports of github-menu.js
:
setMeiFileInfo
is the least bad?Or is there another approach for where to add the call to doc.clearHistory()
? I could use a little guidance on this since I'm not super familiar with mei-friend's code.
Describe the bug Undo history is kept when a new document is loaded, such that if you undo immediately after loading a document you replace the entire contents of the editor with the contents of the previous document
To Reproduce Steps to reproduce the behavior:
The contents of the editor will be replaced with those of doc A
Expected behavior Undo history is cleared when a document is loaded
Notes This should be pretty straightforward to fix,
doc.clearHistory()
just needs to be called when a document is loaded. I'm happy to look into making a PR for this.