Blank page after undo, after setText
http://plnkr.co/edit/eHfBW8vHac7033PoNQwk?p=preview
Start with a firepad with some content in. Use setText to set some arbitary text, and then undo. The first undo state is a blank page, you have to undo again to get back to the previous text.
I'd expect the first undo to be the original content, not a blank page.
It happens with codemirror, ace, and the rich text editor. I've even tried using ace editor's 'setValue' with the same result. Once I disconnected firepad from the ace editor and used setValue it worked as expected: http://plnkr.co/edit/DoZ5RsyI5crU1ZbhAqYG?p=preview
Good point. The fix is probably to wrap the setText implementation (the setValue and insertText calls at least) here https://github.com/firebase/firepad/blob/master/lib/firepad.js#L185 in a cm.operation() [see here https://github.com/firebase/firepad/blob/master/lib/firepad.js#L207 for example].
On Wed, May 4, 2016 at 12:10 PM, Simon Brown [email protected] wrote:
http://plnkr.co/edit/eHfBW8vHac7033PoNQwk?p=preview
Start with a firepad with some content in. Use setText to set some arbitary text, and then undo. The first undo state is a blank page, you have to undo again to get back to the previous text.
I'd expect the first undo to be the original content, not a blank page.
It happens with codemirror, ace, and the rich text editor. I've even tried using ace editor's 'setValue' with the same result. Once I disconnected firepad from the ace editor and used setValue it worked as expected: http://plnkr.co/edit/DoZ5RsyI5crU1ZbhAqYG?p=preview
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/firebase/firepad/issues/242
I guess cm.operation() is just for CodeMirror, is there an equivalent to cm.operation() for ace?