thlorenz / brace

📔 browserify compatible version of the ace editor.
http://thlorenz.github.io/brace/
MIT License
1.06k stars 304 forks source link

CTRL + Z empty my content... #167

Closed bbr-yp closed 5 years ago

bbr-yp commented 5 years ago

Hi

I'm using Brace via jsonEditor, When you open an editor with content.

If you press CTRL + Z. All the content is emptied... In the same way, if you're editing a code... And cancel once too often... Everything gone..

Not a big deal because I can redo my undo. But do you have a solution for fixing this?! Thanks.

nightwing commented 5 years ago

This is a bug in jsonEditor, when initializing the editor, they need to either call session.setValue instead of editor.setValue, or call session.getUndoManager().reset() after the setValue

bbr-yp commented 5 years ago

Thanks for your answer :)