From: Alexis Laferrière Date: Mon, 1 Dec 2014 20:38:12 +0000 (-0500) Subject: src/location: support calling `colored_line` when `start_column == 0` X-Git-Tag: v0.7~84^2~4 X-Git-Url: http://nitlanguage.org src/location: support calling `colored_line` when `start_column == 0` Signed-off-by: Alexis Laferrière --- diff --git a/src/location.nit b/src/location.nit index 993ce7d..8ed4428 100644 --- a/src/location.nit +++ b/src/location.nit @@ -174,7 +174,12 @@ class Location while line_end+1 < string.length and string.chars[line_end+1] != '\n' and string.chars[line_end+1] != '\r' do line_end += 1 end - var lstart = string.substring(line_start, l.column_start - 1) + var lstart + if l.column_start > 0 then + lstart = string.substring(line_start, l.column_start - 1) + else + lstart = "" + end var cend if i != l.line_end then cend = line_end - line_start + 1