From afee79ef5b8070350126b805e98ca92f0395fef6 Mon Sep 17 00:00:00 2001 From: druckdev Date: Wed, 14 Jul 2021 16:56:00 +0200 Subject: [PATCH] Make `$key` in match_prev_cmd local --- src/strategies/match_prev_cmd.zsh | 1 + zsh-autosuggestions.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/src/strategies/match_prev_cmd.zsh b/src/strategies/match_prev_cmd.zsh index b709783..a2a852f 100644 --- a/src/strategies/match_prev_cmd.zsh +++ b/src/strategies/match_prev_cmd.zsh @@ -49,6 +49,7 @@ _zsh_autosuggest_strategy_match_prev_cmd() { local prev_cmd="$(_zsh_autosuggest_escape_command "${history[$((HISTCMD-1))]}")" # Iterate up to the first 200 history event numbers that match $prefix + local key for key in "${(@)history_match_keys[1,200]}"; do # Stop if we ran out of history [[ $key -gt 1 ]] || break diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index b19cac7..08a399f 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -711,6 +711,7 @@ _zsh_autosuggest_strategy_match_prev_cmd() { local prev_cmd="$(_zsh_autosuggest_escape_command "${history[$((HISTCMD-1))]}")" # Iterate up to the first 200 history event numbers that match $prefix + local key for key in "${(@)history_match_keys[1,200]}"; do # Stop if we ran out of history [[ $key -gt 1 ]] || break