File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -43,16 +43,13 @@ function __%[1]s_perform_completion
4343 end
4444 __%[1]s_debug "emptyArg: $emptyArg"
4545
46- if not type -q "$args[1]"
47- # This can happen when "complete --do-complete %[2]s" is called when running this script.
48- __%[1]s_debug "Cannot find $args[1]. No completions."
49- return
50- end
51-
5246 set requestComp "$args[1] %[3]s $args[2..-1] $emptyArg"
5347 __%[1]s_debug "Calling $requestComp"
5448
55- set results (eval $requestComp 2> /dev/null)
49+ # Call the command as a sub-shell so that we can redirect any errors
50+ # For example, if $requestComp has an unmatched quote
51+ # https://github.com/spf13/cobra/issues/1214
52+ set results (fish -c "$requestComp" 2> /dev/null)
5653 set comps $results[1..-2]
5754 set directiveLine $results[-1]
5855
You can’t perform that action at this time.
0 commit comments