open in two tabs this link
open console in any tab and type:
var doc = editor.getSession().getDocument()
var lastRowIndex = doc.getAllLines().length - 1;
console have errors.
the problem happens when remove only last line.
I recently noticed this.It is an issue with newer versions of ACE.
In the Document's change event, line removal operations are arriving in reverse order for multi-line deletions where either the start or endpoint of the deletion is not at the beginning/end of the line.
So we don't really know how this is caused?
Turns out, this is actually bug in ace. removeLines assumes that it's second argument is smaller than doc.getLength() - 1 and emits event with wrong range when it's arguments are wrong.
doc.getLength() - 1
In my app, I am using the latest build from ajaxorg/ace-builds and no longer have this bug.
I can't confirm that @ggoodman.