firepad
firepad copied to clipboard
When Firepad is disposed, CodeMirror undo/redo don't return to their original state
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