mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2025-04-17 11:35:31 +08:00
12 lines
214 B
Bash
12 lines
214 B
Bash
_zsh_autosuggest_get_suggestion() {
|
|
local prefix=$1
|
|
local history_items=(${history[(R)$prefix*]})
|
|
|
|
for cmd in $history_items; do
|
|
if [ "${cmd:0:$#prefix}" = "$prefix" ]; then
|
|
echo $cmd
|
|
break
|
|
fi
|
|
done
|
|
}
|