Don't crash on error at end-of-file.

BUG=

Review URL: https://codereview.chromium.org/1415883011.
This commit is contained in:
Johnni Winther 2015-11-02 14:05:56 +01:00
parent c0d5f73bd0
commit d4021e92a1

View file

@ -137,6 +137,11 @@ abstract class SourceFile implements LineColumnProvider {
if (colorize == null) {
colorize = (text) => text;
}
if (end > length) {
start = length - 1;
end = length;
}
int lineStart = getLine(start);
int columnStart = getColumn(lineStart, start);
int lineEnd = getLine(end);