|
|
|
@ -291,14 +291,9 @@ _zsh_autosuggest_suggestion() {
|
|
|
|
|
setopt localoptions extendedglob
|
|
|
|
|
|
|
|
|
|
# Escape the prefix (requires EXTENDED_GLOB)
|
|
|
|
|
local prefix=${1//(#m)[\][()|\\*?#<>~^]/\\$MATCH}
|
|
|
|
|
local prefix="${1//(#m)[\][()|\\*?#<>~^]/\\$MATCH}"
|
|
|
|
|
|
|
|
|
|
# Get all history items (reversed) that match pattern $prefix*
|
|
|
|
|
local history_matches
|
|
|
|
|
history_matches=(${history[(R)$prefix*]})
|
|
|
|
|
|
|
|
|
|
# Echo the first item that matches
|
|
|
|
|
echo ${history_matches[1]}
|
|
|
|
|
fc -ln -m "$prefix*" 2>/dev/null | tail -1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------#
|
|
|
|
|