Imark 0.2.2
Undo could write one document over another. Please update.
Comment on a file, open a different one in the same window, then press ⌘Z: the first file's contents were written over the second, in full and without warning. The undo remembered the text but not which document it belonged to, so it handed it to whatever was on screen.
A second case: comment, edit the same file in another editor, let Imark reload it, then undo. That erased the outside edit. Undo was the only write in the app that did not first check whether the file had changed underneath it.
Undo now puts the text back in the document it was taken from, and refuses when that document has moved on since — with a message rather than silence.
Found by t_var_s on Discord. If you have been commenting across several files in one window, this is worth updating for today.
Updating is drag-and-drop, or brew upgrade --cask imark.