fix completion with multi-level folders
1 file changed, 6 insertions(+), 1 deletion(-)
changed files
M completions/scriptura.fish → completions/scriptura.fish
@@ -35,7 +35,7 @@ complete --command scriptura \ --condition '__fish_seen_subcommand_from $(__scriptura_print $SCRIPTURA_ROOT)' \ --condition 'not __scriptura_seen_script $(commandline -xpc)' \ --condition 'not __fish_seen_argument --short n --long new' \ - --arguments '$(__scriptura_complete $SCRIPTURA_ROOT/$(commandline -xpc)[-1])' + --arguments '$(__scriptura_complete $SCRIPTURA_ROOT $(commandline -xpc))' complete --command scriptura \ --condition '__scriptura_seen_script $(commandline -xpc)' \@@ -46,6 +46,11 @@ path basename $(path filter --type file,dir --perm exec $from/*) end function __scriptura_complete --argument-names from + for arg in $argv[2..-1] + if path is --type dir $from/$arg + set --function from $from/$arg + end + end for entry in $(path filter --type file,dir --perm exec $from/*) printf "%s\t%s\n" $(path basename $entry) $(__scriptura_help $entry) end