Quick way to check if ACE content has changed

838 views
Skip to first unread message

Steve Kong

unread,
Jun 19, 2013, 11:16:45 PM6/19/13
to ace-d...@googlegroups.com
Hi guys,

Does anyone know if there is an easy way to tell if the content of ACE has changed (and therefore needs to be saved)?

Or do I need to subscribe to an onChange() event, and hold my own "changed" state?

   editor.getSession().on('change', function(e...

Thanks.

Steve

Harutyun Amirjanyan

unread,
Jun 20, 2013, 12:07:08 AM6/20/13
to ace-d...@googlegroups.com
Hi

you can use
session.getUndoManager().markClean()
session.getUndoManager().isClean()
methods

https://github.com/ajaxorg/ace/blob/master/lib/ace/undomanager.js#L148
Reply all
Reply to author
Forward
0 new messages