escape prefix before matching in match_prev_cmd strategy

This commit is contained in:
Isaac W Hanson 2017-08-18 09:37:30 -04:00
parent 9378c28134
commit 7518b8b304
2 changed files with 2 additions and 2 deletions

View file

@ -26,7 +26,7 @@ _zsh_autosuggest_strategy_match_prev_cmd() {
# 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*
local history_match_keys local history_match_keys
history_match_keys=(${(k)history[(R)$prefix*]}) history_match_keys=(${(k)history[(R)${(q)prefix}*]})
# By default we use the first history number (most recent history entry) # By default we use the first history number (most recent history entry)
local histkey="${history_match_keys[1]}" local histkey="${history_match_keys[1]}"

View file

@ -533,7 +533,7 @@ _zsh_autosuggest_strategy_match_prev_cmd() {
# 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*
local history_match_keys local history_match_keys
history_match_keys=(${(k)history[(R)$prefix*]}) history_match_keys=(${(k)history[(R)${(q)prefix}*]})
# By default we use the first history number (most recent history entry) # By default we use the first history number (most recent history entry)
local histkey="${history_match_keys[1]}" local histkey="${history_match_keys[1]}"