diff --git a/doc/wiki b/doc/wiki index 8bd16ba2..d93670b4 160000 --- a/doc/wiki +++ b/doc/wiki @@ -1 +1 @@ -Subproject commit 8bd16ba2eda6a1b0c6791f37d0803296ae37840f +Subproject commit d93670b47d776987b38bb2c31777c4e488338fac diff --git a/lib/ace/document.js b/lib/ace/document.js index 99afe895..3cae6399 100644 --- a/lib/ace/document.js +++ b/lib/ace/document.js @@ -326,6 +326,13 @@ var Document = function(text) { if (lines.length == 0) return {row: row, column: 0}; + // apply doesn't work for big arrays (smallest threshold is on safari 0xFFFF) + // to circumvent that we have to break huge inserts into smaller chunks here + if (lines.length > 0xFFFF) { + var end = this.insertLines(row, lines.slice(0xFFFF)); + lines = lines.slice(0, 0xFFFF); + } + var args = [row, 0]; args.push.apply(args, lines); this.$lines.splice.apply(this.$lines, args); @@ -337,7 +344,7 @@ var Document = function(text) { lines: lines }; this._emit("change", { data: delta }); - return range.end; + return end || range.end; }; /** diff --git a/lib/ace/mode/c9search_highlight_rules.js b/lib/ace/mode/c9search_highlight_rules.js index 0555963a..c16b48c0 100644 --- a/lib/ace/mode/c9search_highlight_rules.js +++ b/lib/ace/mode/c9search_highlight_rules.js @@ -47,13 +47,13 @@ var C9SearchHighlightRules = function() { // regexps are ordered -> the first match is used this.$rules = { "start" : [ + { + token : ["constant.numeric", "text", "text"], + regex : "(^\\s+[0-9]+)(:\\s*)(.+)" + }, { token : ["string", "text"], // single line regex : "(.+)(:$)" - }, - { - token : ["constant.numeric", "text"], - regex : "(^\\s*[0-9]+)(:\\s*)" } ] };