Skip to content

Commit c642041

Browse files
committed
Ensure that argoffset lies on a valid char index
I love dealing with variable width strings and having to remember to do nextind/thisind/prevind. Love it.
1 parent 68a9031 commit c642041

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/JuliaSyntaxHighlighting.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ function _hl_annotations!(highlights::Vector{@NamedTuple{region::UnitRange{Int},
314314
break
315315
end
316316
end
317+
argoffset = thisind(regionstr, argoffset)
317318
if isnothing(arg1)
318319
elseif kind(arg1) == K"Identifier"
319320
region = first(region):first(region)+argoffset-1

0 commit comments

Comments
 (0)