diff --git a/src/strategies/match_prev_cmd.zsh b/src/strategies/match_prev_cmd.zsh index bf8bdd9..632a24b 100644 --- a/src/strategies/match_prev_cmd.zsh +++ b/src/strategies/match_prev_cmd.zsh @@ -21,7 +21,7 @@ # `HIST_EXPIRE_DUPS_FIRST`. _zsh_autosuggest_strategy_match_prev_cmd() { - local prefix="$1" + local prefix="${1//(#m)[\\()\[\]|*?~]/\\$MATCH}" # Get all history event numbers that correspond to history # entries that match pattern $prefix* diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index a438c65..b72f3e2 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -453,7 +453,7 @@ _zsh_autosuggest_strategy_default() { # `HIST_EXPIRE_DUPS_FIRST`. _zsh_autosuggest_strategy_match_prev_cmd() { - local prefix="$1" + local prefix="${1//(#m)[\\()\[\]|*?~]/\\$MATCH}" # Get all history event numbers that correspond to history # entries that match pattern $prefix*