From 7997ec3209b5b0295b0b3e88de540d2f27e97c80 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Sun, 20 Oct 2024 13:11:09 -0400 Subject: [PATCH 1/2] REPLExt: run repl hint generation for modeswitch chars when not switching (#4054) (cherry picked from commit 3fde94ee9f0ef5f2a286dea05d36d8dae02693a6) --- ext/REPLExt/REPLExt.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/REPLExt/REPLExt.jl b/ext/REPLExt/REPLExt.jl index a88cf11427..a2f093e632 100644 --- a/ext/REPLExt/REPLExt.jl +++ b/ext/REPLExt/REPLExt.jl @@ -147,6 +147,7 @@ function create_mode(repl::REPL.AbstractREPL, main::LineEdit.Prompt) end else LineEdit.edit_insert(s, ';') + LineEdit.check_for_hint(s) && LineEdit.refresh_line(s) end end end @@ -173,6 +174,7 @@ function repl_init(repl::REPL.AbstractREPL) end else LineEdit.edit_insert(s, ']') + LineEdit.check_for_hint(s) && LineEdit.refresh_line(s) end end ) From c83160aac2bd071b9eab43969d15d720e73b1f01 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Sun, 20 Oct 2024 13:11:17 -0400 Subject: [PATCH 2/2] REPLExt: use Base.isaccessibledir rather than isdir in completions (#4053) (cherry picked from commit 799dc2d54c4e809b9779de8c604564a5b3befaa0) --- ext/REPLExt/completions.jl | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/ext/REPLExt/completions.jl b/ext/REPLExt/completions.jl index d20788e851..7bd5783242 100644 --- a/ext/REPLExt/completions.jl +++ b/ext/REPLExt/completions.jl @@ -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 @@ -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))