Skip to content

Commit

Permalink
Merge pull request #8989 from dhoegh/Latex_completion_string
Browse files Browse the repository at this point in the history
Latex completion in string, fix #8983
  • Loading branch information
nolta committed Nov 19, 2014
2 parents d6c63fd + 8089dc4 commit d68c42a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion base/REPLCompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions test/replcompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d68c42a

Please sign in to comment.