Skip to content

Commit

Permalink
Fix error regarding unescape_string introduced by commit adca441 and …
Browse files Browse the repository at this point in the history
…introduced some visual spaces.
  • Loading branch information
dhoegh committed Nov 25, 2014
1 parent 63b2ae9 commit 5f2ba35
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions base/REPLCompletions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,13 @@ function completions(string, pos)
partial = string[1: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
m = match(r"[\t\n\r\"'`@\$><=;|&\{]| (?!\\)", reverse(partial))
startpos = length(partial) - (m == nothing ? 1 : m.offset) + 2
r = startpos:pos
paths, r, success = complete_path(unescape_string(string[r]), pos)
paths, r, success = complete_path(replace(string[r], r"\\ ", " "), pos)
if inc_tag == :string &&
length(paths) == 1 && # Only close if there's a single choice,
!isdir(unescape_string(string[startpos:start(r)-1] * paths[1])) && # except if it's a directory
!isdir(replace(string[startpos:start(r)-1] * paths[1], r"\\ ", " ")) && # except if it's a directory
(length(string) <= pos || string[pos+1] != '"') # or there's already a " at the cursor.
paths[1] *= "\""
end
Expand Down

0 comments on commit 5f2ba35

Please sign in to comment.