mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-11-18 09:51:06 +01:00
Escape the prefix passed into the match_prev_cmd strategy
This commit is contained in:
parent
0305908adf
commit
50e6832b8c
2 changed files with 2 additions and 2 deletions
|
@ -21,7 +21,7 @@
|
||||||
# `HIST_EXPIRE_DUPS_FIRST`.
|
# `HIST_EXPIRE_DUPS_FIRST`.
|
||||||
|
|
||||||
_zsh_autosuggest_strategy_match_prev_cmd() {
|
_zsh_autosuggest_strategy_match_prev_cmd() {
|
||||||
local prefix="$1"
|
local prefix="${1//(#m)[\\()\[\]|*?~]/\\$MATCH}"
|
||||||
|
|
||||||
# Get all history event numbers that correspond to history
|
# Get all history event numbers that correspond to history
|
||||||
# entries that match pattern $prefix*
|
# entries that match pattern $prefix*
|
||||||
|
|
|
@ -453,7 +453,7 @@ _zsh_autosuggest_strategy_default() {
|
||||||
# `HIST_EXPIRE_DUPS_FIRST`.
|
# `HIST_EXPIRE_DUPS_FIRST`.
|
||||||
|
|
||||||
_zsh_autosuggest_strategy_match_prev_cmd() {
|
_zsh_autosuggest_strategy_match_prev_cmd() {
|
||||||
local prefix="$1"
|
local prefix="${1//(#m)[\\()\[\]|*?~]/\\$MATCH}"
|
||||||
|
|
||||||
# Get all history event numbers that correspond to history
|
# Get all history event numbers that correspond to history
|
||||||
# entries that match pattern $prefix*
|
# entries that match pattern $prefix*
|
||||||
|
|
Loading…
Reference in a new issue