firepad icon indicating copy to clipboard operation
firepad copied to clipboard

When Firepad is disposed, CodeMirror undo/redo don't return to their original state

Open mig8447 opened this issue 5 years ago • 0 comments

Firepad replaces CodeMirror redo/undo functions with its own handlers for undo and redo but when disposing Firepad, it doesn't return them to their original functions and this causes unexpected behavior in CodeMirror, leaving it in an inconsistent state leading to potential data loss

See https://github.com/FirebaseExtended/firepad/blob/master/lib/rich-text-codemirror-adapter.js#L299 and https://github.com/FirebaseExtended/firepad/blob/master/lib/rich-text-codemirror-adapter.js#L303

When detaching the CodeMirror adapter, those functions should return to their original state. See:

https://github.com/FirebaseExtended/firepad/blob/602138d9f983ce43a6c54791451e592ae76bdf4c/lib/rich-text-codemirror-adapter.js#L29

mig8447 avatar Aug 12 '20 13:08 mig8447