mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2025-12-08 15:32:31 +01:00
Fix various bugs found while testing
This commit is contained in:
parent
e5cdbb6c33
commit
a314a01a6a
6 changed files with 30 additions and 28 deletions
|
|
@ -9,9 +9,10 @@
|
|||
_zsh_autosuggest_strategy_default() {
|
||||
local prefix="$(_zsh_autosuggest_escape_command "$1")"
|
||||
|
||||
# Get the hist number of the most recent history item that matches
|
||||
local histkey="${${(@k)history[(R)$prefix*]}[1]}"
|
||||
# Get the keys of the history items that match
|
||||
local -a histkeys
|
||||
histkeys=(${(k)history[(r)$prefix*]})
|
||||
|
||||
# Echo the history entry
|
||||
echo -E "${history[$histkey]}"
|
||||
# Echo the value of the first key
|
||||
echo -E "${history[$histkeys[1]]}"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue