I am trying to save changes in the Ace editor and then replay them. There's some kind of pseudo-code there - the bottom line is that the applyDeltas API doesn't seem to do anything for my editor. I am attached to the editor change event, click the delta conversion to array and try to play it later - I do not see any errors when running the code below, but I also do not see the changes in my editor.
thanks
Mustafa
shouldRecord = true; myStoredArray = new Array(); editor.on('change', function(e) { if(shouldRecord) { myStoredArray.push(e.data); } }); //on a button click shouldRecord = false; editor.getSession().setValue(''); //clear for(var currentDelta in myStoredArray) { editor.getSession().getDocument().applyDeltas(currentDelta); }
source share