nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ff0510a
)
src/location: support calling `colored_line` when `start_column == 0`
author
Alexis Laferrière
<alexis.laf@xymus.net>
Mon, 1 Dec 2014 20:38:12 +0000
(15:38 -0500)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Tue, 2 Dec 2014 21:36:42 +0000
(16:36 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
src/location.nit
patch
|
blob
|
history
diff --git
a/src/location.nit
b/src/location.nit
index
993ce7d
..
8ed4428
100644
(file)
--- 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