Skip to content

Commit 3a4b212

Browse files
committed
'main': Fix regression in zsh 5.3.1 and older: all precmd hooks later than z-sy-h would be aborted.
In those versions of zsh, «[[ -o nosuchoption ]]» is regarded as a syntax error. In newer zsh versions, it merely returns non-zero (specifically, it returns 3, unlike «[[ -o unsetoption ]]» which returns 1). Fixes #732. Fixes #733.
1 parent 0582ea1 commit 3a4b212

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777

7878
- Fix an error message on stderr before every prompt when the `WARN_NESTED_VAR` zsh option is set:
7979
`_zsh_highlight_main__precmd_hook:1: array parameter _zsh_highlight_main__command_type_cache set in enclosing scope in function _zsh_highlight_main__precmd_hook`
80-
[#727, #731]
80+
[#727, #731, #732, #733]
8181

8282
# Changes in version 0.7.1
8383

highlighters/main/main-highlighter.zsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,7 @@ _zsh_highlight_main__precmd_hook() {
16921692
# Unset the WARN_NESTED_VAR option, taking care not to error if the option
16931693
# doesn't exist (zsh older than zsh-5.3.1-test-2).
16941694
setopt localoptions
1695-
if [[ -o warnnestedvar ]] 2>/dev/null; then
1695+
if eval '[[ -o warnnestedvar ]]' 2>/dev/null; then
16961696
unsetopt warnnestedvar
16971697
fi
16981698

0 commit comments

Comments
 (0)