fix gh issue #30

https://github.com/ajaxorg/ace/issues/#issue/30
This commit is contained in:
Fabian Jakobs 2011-01-10 23:26:29 +01:00
commit f89ed9a319

View file

@ -70,9 +70,15 @@ var Document = function(text, mode) {
this.$undoManager = null;
this.$split = function(text) {
return text.split(/\r\n|\r|\n/);
};
// check for IE split bug
if ("aaa".split(/a/).length == 0)
this.$split = function(text) {
return text.replace(/\r\n|\r/g, "\n").split("\n");
}
else
this.$split = function(text) {
return text.split(/\r\n|\r|\n/);
};
this.setValue = function(text) {
var args = [0, this.lines.length];