Skip to content

Commit b00be5f

Browse files
austintraverdanielshahaf
authored andcommitted
driver: Be resilient to KSH_ARRAYS being set in the calling scope
The «emulate» call isn't sufficient, since these lines are parsed before it takes effect. Fixes #689 (née #622). See also #688 for preventing these gymnastics from being needed in the first place. See also junegunn/fzf#1924 for an inter-plugin interaction that this probably fixes.
1 parent b85e313 commit b00be5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

zsh-syntax-highlighting.zsh

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ _zsh_highlight()
8686
# Before we 'emulate -L', save the user's options
8787
local -A zsyh_user_options
8888
if zmodload -e zsh/parameter; then
89-
zsyh_user_options=("${(@kv)options}")
89+
zsyh_user_options=("${(kv)options[@]}")
9090
else
9191
local canonical_options onoff option raw_options
9292
raw_options=(${(f)"$(emulate -R zsh; set -o)"})
9393
canonical_options=(${${${(M)raw_options:#*off}%% *}#no} ${${(M)raw_options:#*on}%% *})
94-
for option in $canonical_options; do
94+
for option in "${canonical_options[@]}"; do
9595
[[ -o $option ]]
9696
# This variable cannot be eliminated c.f. workers/42101.
9797
onoff=${${=:-off on}[2-$?]}

0 commit comments

Comments
 (0)