'main': Fix a regression caused by the great-grandparent commit's WARN_NESTED_VAR fix.

An error message was emitted on versions of zsh that don't have the
WARN_NESTED_VAR option.

Fixes #731.
This commit is contained in:
Daniel Shahaf 2020-05-05 14:31:42 +00:00
parent 06710f3780
commit e65ebf0466

View file

@ -1689,8 +1689,13 @@ _zsh_highlight_main_highlighter_expand_path()
# -------------------------------------------------------------------------------------------------
_zsh_highlight_main__precmd_hook() {
# Unset the WARN_NESTED_VAR option, taking care not to error if the option
# doesn't exist (zsh older than zsh-5.3.1-test-2).
setopt localoptions
unsetopt warnnestedvar
if [[ -o warnnestedvar ]] 2>/dev/null; then
unsetopt warnnestedvar
fi
_zsh_highlight_main__command_type_cache=()
}