Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank page after undo, after setText #242

Open
sbrown345 opened this issue May 4, 2016 · 2 comments
Open

Blank page after undo, after setText #242

sbrown345 opened this issue May 4, 2016 · 2 comments

Comments

@sbrown345
Copy link

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

@mikelehen
Copy link
Collaborator

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 notifications@github.com
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
#242

@sbrown345
Copy link
Author

I guess cm.operation() is just for CodeMirror, is there an equivalent to cm.operation() for ace?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants