···9393 # Remove the flag part
9494 $Flag, $WordToComplete = $WordToComplete.Split("=", 2)
9595 }
9696-9797- if ( $WordToComplete -eq "" -And ( -Not $IsEqualFlag )) {
9696+ $HasTrailingEmptyArg = $QuotedArgs -match "(^| )''$"
9797+ __${name}_debug "HasTrailingEmptyArg: $HasTrailingEmptyArg"
9898+9999+ if ( $WordToComplete -eq "" -And ( -Not $IsEqualFlag ) -And ( -Not $HasTrailingEmptyArg )) {
98100 # If the last parameter is complete (there is a space following it)
99101 # We add an extra empty parameter so we can indicate this to the go method.
100102 __${name}_debug "Adding extra empty parameter"
+1-1
src/zsh.ts
···48484949 # Prepare the command to obtain completions, ensuring arguments are quoted for eval
5050 local -a args_to_quote=("\${(@)words[2,-1]}")
5151- if [ "\${lastChar}" = "" ]; then
5151+ if [ "\${lastChar}" = "" ] && [ "\${args_to_quote[-1]}" != "" ]; then
5252 # If the last parameter is complete (there is a space following it)
5353 # We add an extra empty parameter so we can indicate this to the go completion code.
5454 __${name}_debug "Adding extra empty parameter"