@@ -124,6 +124,10 @@ function Base.thisind(source::SourceFile, i::Int)
124
124
thisind (source. code, i - source. byte_offset) + source. byte_offset
125
125
end
126
126
127
+ function Base. nextind (source:: SourceFile , i:: Integer )
128
+ nextind (source. code, i - source. byte_offset) + source. byte_offset
129
+ end
130
+
127
131
Base. firstindex (source:: SourceFile ) = firstindex (source. code) + source. byte_offset
128
132
Base. lastindex (source:: SourceFile ) = lastindex (source. code) + source. byte_offset
129
133
@@ -218,7 +222,8 @@ function highlight(io::IO, source::SourceFile, range::UnitRange;
218
222
hitext = source[p: q]
219
223
print (io, source[x: p- 1 ])
220
224
_printstyled (io, hitext; bgcolor= color)
221
- print (io, source[q+ 1 : d])
225
+ # print(io, source[q+1:d])
226
+ print (io, source[nextind (source,q): d])
222
227
if d >= firstindex (source) && source[thisind (source, d)] != ' \n '
223
228
print (io, " \n " )
224
229
end
@@ -249,7 +254,7 @@ function highlight(io::IO, source::SourceFile, range::UnitRange;
249
254
print (io, " ⋮\n " )
250
255
_printstyled (io, source[z: q]; bgcolor= color)
251
256
end
252
- print (io, source[q + 1 : d])
257
+ print (io, source[nextind (source, q) : d])
253
258
source[thisind (source, d)] == ' \n ' || print (io, " \n " )
254
259
qline = source[c: q]
255
260
_print_marker_line (io, " " , qline, true , false , marker_line_color, note, notecolor)
0 commit comments