Skip to content

Commit

Permalink
Fix #9209
Browse files Browse the repository at this point in the history
Regression from #9137. The problem was that the Latex completion code
might access an invalid index in the unicode string, if the previous
character from a `\\` was a multibyte character.
  • Loading branch information
ivarne committed Dec 1, 2014
1 parent 6b0fcce commit 4f2681f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/REPLCompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ end

function latex_completions(string, pos)
slashpos = rsearch(string, '\\', pos)
if rsearch(string, whitespace_chars, pos) < slashpos && !(1 < slashpos && (string[slashpos-1]=='\\'))
if rsearch(string, whitespace_chars, pos) < slashpos && !(1 < slashpos && (string[prevind(string, slashpos)]=='\\'))
# latex symbol substitution
s = string[slashpos:pos]
latex = get(latex_symbols, s, "")
Expand Down

0 comments on commit 4f2681f

Please sign in to comment.