Skip to content

Commit e65ebf0

Browse files
committed
'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.
1 parent 06710f3 commit e65ebf0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

highlighters/main/main-highlighter.zsh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1689,8 +1689,13 @@ _zsh_highlight_main_highlighter_expand_path()
16891689
# -------------------------------------------------------------------------------------------------
16901690

16911691
_zsh_highlight_main__precmd_hook() {
1692+
# Unset the WARN_NESTED_VAR option, taking care not to error if the option
1693+
# doesn't exist (zsh older than zsh-5.3.1-test-2).
16921694
setopt localoptions
1693-
unsetopt warnnestedvar
1695+
if [[ -o warnnestedvar ]] 2>/dev/null; then
1696+
unsetopt warnnestedvar
1697+
fi
1698+
16941699
_zsh_highlight_main__command_type_cache=()
16951700
}
16961701

0 commit comments

Comments
 (0)