Using code mirror for a text editor.
When loading the editor content from a file I want to display
- if the editor text has been changed
- or is still/again the same as the file content
Broadly having 2 approaches in mind:
- Create a checksum of the files content when loading and on
update.docChanged
calculate a new one and see if they differ - Use the change descriptions / history structure
(1) should be doable, just worry about the performance/extra load.
For (2) haven’t found an exact way yet. Looked at the serializable history field which I extract anyway, but don’t see an obvious way to reuse (also since a save
shouldn’t wipe out history).
Any thoughts or advise ?