Skip to content

Commit

Permalink
[zsh] Handle '*' suffix in history line numbers
Browse files Browse the repository at this point in the history
Fix #3591
  • Loading branch information
junegunn committed Jan 20, 2024
1 parent 8a2c41e commit e90bb71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions shell/key-bindings.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e90bb71

Please sign in to comment.