From e65ebf04663ed49c395b6747d74a163850c0221b Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 5 May 2020 14:31:42 +0000 Subject: [PATCH] '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. --- highlighters/main/main-highlighter.zsh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index 66a3d2a..e4a17e0 100644 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -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=() }