Skip to content

Commit 0c64c68

Browse files
authored
Fix zsh $+name syntax does not work with setopt ksh_arrays (#4084)
1 parent 3ec035c commit 0c64c68

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

shell/completion.zsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ fzf-completion() {
308308
setopt localoptions noshwordsplit noksh_arrays noposixbuiltins
309309

310310
# Check if at least one completion system (old or new) is active
311-
if ! zmodload -F zsh/parameter p:functions 2>/dev/null || ! (( $+functions[compdef] )); then
311+
if ! zmodload -F zsh/parameter p:functions 2>/dev/null || ! (( ${+functions[compdef]} )); then
312312
if ! zmodload -e zsh/compctl; then
313313
zmodload -i zsh/compctl
314314
fi

shell/key-bindings.zsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ fzf-history-widget() {
111111
# Ensure the module is loaded if not already, and the required features, such
112112
# as the associative 'history' array, which maps event numbers to full history
113113
# lines, are set. Also, make sure Perl is installed for multi-line output.
114-
if zmodload -F zsh/parameter p:{commands,history} 2>/dev/null && (( $+commands[perl] )); then
114+
if zmodload -F zsh/parameter p:{commands,history} 2>/dev/null && (( ${+commands[perl]} )); then
115115
# Import commands from other shells if SHARE_HISTORY is enabled, as the
116116
# 'history' array only updates after executing a non-empty command.
117117
selected="$(

0 commit comments

Comments
 (0)