diff options
author | 林千里 <lincheney@gmail.com> | 2024-11-12 02:53:36 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-12 00:53:36 +0900 |
commit | 0c64c6878154da1db90084dddc81608e47bd7e33 (patch) | |
tree | ff6df787cbf7f2cbd660774e24b7cff3980fa10f | |
parent | 3ec035c68bd48cdb619f1329c21eaf53d77abc81 (diff) |
Fix zsh $+name syntax does not work with setopt ksh_arrays (#4084)
-rw-r--r-- | shell/completion.zsh | 2 | ||||
-rw-r--r-- | shell/key-bindings.zsh | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/shell/completion.zsh b/shell/completion.zsh index a6d686e9..171a1b2b 100644 --- a/shell/completion.zsh +++ b/shell/completion.zsh @@ -308,7 +308,7 @@ fzf-completion() { setopt localoptions noshwordsplit noksh_arrays noposixbuiltins # Check if at least one completion system (old or new) is active - if ! zmodload -F zsh/parameter p:functions 2>/dev/null || ! (( $+functions[compdef] )); then + if ! zmodload -F zsh/parameter p:functions 2>/dev/null || ! (( ${+functions[compdef]} )); then if ! zmodload -e zsh/compctl; then zmodload -i zsh/compctl fi diff --git a/shell/key-bindings.zsh b/shell/key-bindings.zsh index c8c20767..36881185 100644 --- a/shell/key-bindings.zsh +++ b/shell/key-bindings.zsh @@ -111,7 +111,7 @@ fzf-history-widget() { # Ensure the module is loaded if not already, and the required features, such # as the associative 'history' array, which maps event numbers to full history # lines, are set. Also, make sure Perl is installed for multi-line output. - if zmodload -F zsh/parameter p:{commands,history} 2>/dev/null && (( $+commands[perl] )); then + if zmodload -F zsh/parameter p:{commands,history} 2>/dev/null && (( ${+commands[perl]} )); then # Import commands from other shells if SHARE_HISTORY is enabled, as the # 'history' array only updates after executing a non-empty command. selected="$( |