Skip to content

Commit

Permalink
Fix path completion when UTF8 char is occurring before match characters.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhoegh committed Dec 2, 2014
1 parent 5358570 commit 864ef0d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base/REPLCompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function completions(string, pos)
inc_tag = Base.incomplete_tag(parse(partial , raise=false))
if inc_tag in [:cmd, :string]
m = match(r"[\t\n\r\"'`@\$><=;|&\{]| (?!\\)", reverse(partial))
startpos = length(partial) - (m == nothing ? 1 : m.offset) + 2
startpos = nextind(partial, nextind(partial, length(partial) - m.offset))
r = startpos:pos
paths, r, success = complete_path(replace(string[r], r"\\ ", " "), pos)
if inc_tag == :string &&
Expand Down
2 changes: 1 addition & 1 deletion test/replcompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ let #test that it can auto complete with spaces in file/path
@test r == endof(s)-4:endof(s)
@test "space\\ .file" in c

s = @windows? "cd(\"$dir_space\\\\space" : "cd(\"$dir_space/space"
s = @windows? "cd(\"β $dir_space\\\\space" : "cd(\"β $dir_space/space"
c,r = test_complete(s)
@test r == endof(s)-4:endof(s)
@test "space\\ .file\"" in c
Expand Down

0 comments on commit 864ef0d

Please sign in to comment.