Skip to content

Commit

Permalink
REPLExt: use Base.isaccessibledir rather than isdir in completions
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Oct 20, 2024
1 parent 27c1b1e commit bc608ef
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions ext/REPLExt/completions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function _shared_envs()
possible = String[]
for depot in Base.DEPOT_PATH
envdir = joinpath(depot, "environments")
isdir(envdir) || continue
Base.isaccessibledir(envdir) || continue
append!(possible, readdir(envdir))
end
return possible
Expand Down Expand Up @@ -38,15 +38,7 @@ function complete_expanded_local_dir(s, i1, i2, expanded_user, oldi2)
cmp2 = cmp[2]
completions = [REPL.REPLCompletions.completion_text(p) for p in cmp[1]]
completions = filter!(completions) do x
try
isdir(s[1:prevind(s, first(cmp2)-i1+1)]*x)
catch e
if e isa Base.IOError && e.code == Base.UV_EACCES
return false
else
rethrow()
end
end
Base.isaccessibledir(s[1:prevind(s, first(cmp2)-i1+1)]*x)
end
if expanded_user
if length(completions) == 1 && endswith(joinpath(homedir(), ""), first(completions))
Expand Down

0 comments on commit bc608ef

Please sign in to comment.