Skip to content

Commit d48fd5e

Browse files
committed
REPL: new backslash escape hack for Windows Pkg completions
1 parent 69db0a5 commit d48fd5e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

stdlib/REPL/src/REPLCompletions.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,8 @@ function complete_path(path::AbstractString,
492492
end
493493
startpos = pos - lastindex(prefix) + 1
494494
Sys.iswindows() && map!(paths, paths) do c::PathCompletion
495-
# emulation for unnecessarily complicated return value, since / is a
496-
# perfectly acceptable path character which does not require quoting
497-
# but is required by Pkg's awkward parser handling
498-
return endswith(c.path, "/") ? PathCompletion(chop(c.path) * "\\\\") : c
495+
# HACK: Pkg requires escaped backslashes
496+
return PathCompletion(replace(c.path, "\\" => "\\\\"))
499497
end
500498
return paths, startpos:pos, success
501499
end

0 commit comments

Comments
 (0)