From 0f9bcfbc7da5d553baa94c5ad79e3b1ac1d6017b Mon Sep 17 00:00:00 2001 From: Tim Caswell Date: Fri, 7 Feb 2014 13:05:43 -0600 Subject: [PATCH] Fix out-of-range error when parsing certain files. An example file that breaks on this is https://github.com/ajaxorg/ace-builds/blob/b2f8bf1e745250596afea5b39c70b94421af906d/kitchen-sink/demo.js#L1000 --- lib/ace/ext/whitespace.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ace/ext/whitespace.js b/lib/ace/ext/whitespace.js index cbbdbb43..583464ab 100644 --- a/lib/ace/ext/whitespace.js +++ b/lib/ace/ext/whitespace.js @@ -61,7 +61,7 @@ exports.$detectIndentation = function(lines, fallback) { prevSpaces = spaces; // ignore lines ending with backslash - while (line[line.length - 1] == "\\") + while (i < max && line[line.length - 1] == "\\") line = lines[i++]; }