mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-11-18 09:51:06 +01:00
11 lines
214 B
Bash
11 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
|
|
}
|