Append slash on true local directories
A slash must only be added if the current completion item starts with `./` and is actually a directory.
This commit is contained in:
parent
7c677e01cc
commit
0bd74b4f72
|
@ -160,7 +160,7 @@ function completion.shell(command, cur_pos, ncomp, shell)
|
||||||
while true do
|
while true do
|
||||||
local line = c:read("*line")
|
local line = c:read("*line")
|
||||||
if not line then break end
|
if not line then break end
|
||||||
if gfs.is_dir(line) then
|
if str_starts(line, "./") and gfs.is_dir(line) then
|
||||||
line = line .. "/"
|
line = line .. "/"
|
||||||
end
|
end
|
||||||
table.insert(output, bash_escape(line))
|
table.insert(output, bash_escape(line))
|
||||||
|
|
Loading…
Reference in New Issue