[zsh] Handle '*' suffix in history line numbers

Fix #3591
pull/3593/head
Junegunn Choi 4 months ago
parent 8a2c41e183
commit e90bb7169c
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

@ -103,8 +103,8 @@ fzf-history-widget() {
local ret=$?
if [ -n "$selected" ]; then
num=$(awk '{print $1}' <<< "$selected")
if [[ "$num" =~ ^[1-9][0-9]*$ ]]; then
zle vi-fetch-history -n $num
if [[ "$num" =~ '^[1-9][0-9]*\*?$' ]]; then
zle vi-fetch-history -n ${num%\*}
else # selected is a custom query, not from history
LBUFFER="$selected"
fi

Loading…
Cancel
Save