parent
418b7cf459
commit
594825c929
|
@ -99,9 +99,11 @@ function completion.shell(command, cur_pos, ncomp, shell)
|
||||||
local shell_cmd
|
local shell_cmd
|
||||||
if shell == "zsh" or (not shell and os.getenv("SHELL"):match("zsh$")) then
|
if shell == "zsh" or (not shell and os.getenv("SHELL"):match("zsh$")) then
|
||||||
if comptype == "file" then
|
if comptype == "file" then
|
||||||
-- NOTE: wrapped in ${} to make `${"~/.X"}*` work (`"~/X."*` does not).
|
-- NOTE: ${~:-"..."} turns on GLOB_SUBST, useful for expansion of
|
||||||
shell_cmd = "/usr/bin/env zsh -c 'local -a res; res=( "
|
-- "~/" ($HOME). ${:-"foo"} is the string "foo" as var.
|
||||||
.. string.format('${%q}', words[cword_index]) .. "* ); print -ln -- ${res[@]}'"
|
shell_cmd = "/usr/bin/env zsh -c 'local -a res; res=( ${~:-"
|
||||||
|
.. string.format('%q', words[cword_index]) .. "}* ); "
|
||||||
|
.. "print -ln -- ${res[@]}'"
|
||||||
else
|
else
|
||||||
-- check commands, aliases, builtins, functions and reswords
|
-- check commands, aliases, builtins, functions and reswords
|
||||||
shell_cmd = "/usr/bin/env zsh -c 'local -a res; "..
|
shell_cmd = "/usr/bin/env zsh -c 'local -a res; "..
|
||||||
|
|
Loading…
Reference in New Issue