#autoload
local -Pa comptags=() spacetags=()

if [[ $compstate[old_list] == keep ]]; then
  comptags=( $=_lastcomp[tags] )
else
  comptags=( $=_comp_tags )
fi
comptags=( ${(u)comptags} )

local -a match mbegin mend
builtin zstyle -a ":autocomplete:$WIDGET:" add-space spacetags ||
    spacetags=( executables aliases functions builtins reserved-words commands )

[[ -n ${comptags:*spacetags} ]]
