diff --git a/base/REPLCompletions.jl b/base/REPLCompletions.jl index 82114eaa3b8b0..bf92d2ad1de48 100644 --- a/base/REPLCompletions.jl +++ b/base/REPLCompletions.jl @@ -196,11 +196,14 @@ function completions(string, pos) (length(string) <= pos || string[pos+1] != '"') # or there's already a " at the cursor. paths[1] *= "\"" end - return sort(paths), r, success + #Latex symbols can be completed for strings + (success || inc_tag==:cmd) && return sort(paths), r, success end ok, ret = latex_completions(string, pos) ok && return ret + # Make sure that only latex_completions is working on strings + inc_tag==:string && return UTF8String[], 0:-1, false if inc_tag == :other && string[pos] == '(' endpos = prevind(string, pos) diff --git a/test/replcompletions.jl b/test/replcompletions.jl index c4917f778f01c..53d64481127b6 100644 --- a/test/replcompletions.jl +++ b/test/replcompletions.jl @@ -73,6 +73,13 @@ c,r = test_latexcomplete(s) @test r == 1:length(s) @test length(c) == 1 +# test latex symbol completions in strings +s = "\"C:\\\\ \\alpha" +c,r,res = test_complete(s) +@test c[1] == "α" +@test r == 7:12 +@test length(c) == 1 + ## Test completion of packages #mkp(p) = ((@assert !isdir(p)); mkdir(p)) #temp_pkg_dir() do