completion: append / to directories
Here is a small patch that appends a / to directories names in bash completion, it does not seems to add noticeable overhead, but I only tested it on my (rather fast) system. Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
d08b04ce9d
commit
1276c215e7
|
@ -7,6 +7,7 @@
|
|||
|
||||
-- Grab environment we need
|
||||
local io = io
|
||||
local os = os
|
||||
local table = table
|
||||
local math = math
|
||||
local print = print
|
||||
|
@ -105,6 +106,9 @@ function bash(command, cur_pos, ncomp)
|
|||
while true do
|
||||
local line = c:read("*line")
|
||||
if not line then break end
|
||||
if os.execute("test -d " .. line) == 0 then
|
||||
line = line .. "/"
|
||||
end
|
||||
table.insert(output, bash_escape(line))
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue