You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the REPL, hitting tab, among others, completes for file paths, which is a wonderful feature. It also adds the final double quote, if there is a single match only. Which is rad in a plain REPL, but not so great with, e.g., OhMyREPL, which inserts double qoutes in pairs. So the closing quote is already there, it shouldn't be inserted one more time.
As I dug into this issue, I noticed the following function in REPL/REPLCompletions.jl:
functionclose_path_completion(dir, paths, str, pos)
length(paths) ==1||returnfalse# Only close if there's a single choice...
path = (paths[1]::PathCompletion).path
path =unescape_string(replace(path, "\\\$"=>"\$"))
path =joinpath(dir, path)
# ...except if it's a directory...tryisdir(path)
catch e
e isa Base.IOError ||rethrow() # `path` cannot be determined to be a fileend&&returnfalse# ...and except if there's already a " at the cursor.returnlastindex(str) <= pos || str[nextind(str, pos)] !='"'end
As the comment on the penultimate line suggests, the closing quote shouldn't be added to the input line if it's already there! So why doesn't it work? It appears that the enclosing quotes never make it as far as this function, they are already stripped earlier. So this condition (the very last) never triggers. I didn't look for the fix further up the call tree, but I'm pretty sure this is minor bug.
If I add the following to my startup.jl:
using REPL
@eval REPL.REPLCompletions close_path_completion(d, ps, s, p) =false
the issue disappears.
The text was updated successfully, but these errors were encountered:
versioninfo()
Installation method
Via mise.
Description
In the REPL, hitting tab, among others, completes for file paths, which is a wonderful feature. It also adds the final double quote, if there is a single match only. Which is rad in a plain REPL, but not so great with, e.g.,
OhMyREPL
, which inserts double qoutes in pairs. So the closing quote is already there, it shouldn't be inserted one more time.As I dug into this issue, I noticed the following function in
REPL/REPLCompletions.jl
:As the comment on the penultimate line suggests, the closing quote shouldn't be added to the input line if it's already there! So why doesn't it work? It appears that the enclosing quotes never make it as far as this function, they are already stripped earlier. So this condition (the very last) never triggers. I didn't look for the fix further up the call tree, but I'm pretty sure this is minor bug.
If I add the following to my
startup.jl
:the issue disappears.
The text was updated successfully, but these errors were encountered: