mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2025-12-08 15:32:31 +01:00
Cleanup
This commit is contained in:
parent
7dc9e0f926
commit
fc3f368acf
15 changed files with 224 additions and 708 deletions
11
lib/get_suggestion.zsh
Normal file
11
lib/get_suggestion.zsh
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
_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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue