diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2024-01-20 13:43:15 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2024-01-20 13:43:15 +0900 |
commit | e90bb7169c04f5d5f1d19eba2bb41dc2b13391d0 (patch) | |
tree | f63abd0c430ca91a6fe5f4b1e20c64d70dc1a32f | |
parent | 8a2c41e183386ed6f073c6f41b2c580799553ae3 (diff) |
[zsh] Handle '*' suffix in history line numbers
Fix #3591
-rw-r--r-- | shell/key-bindings.zsh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/shell/key-bindings.zsh b/shell/key-bindings.zsh index 8a77047c..7d0a14d6 100644 --- a/shell/key-bindings.zsh +++ b/shell/key-bindings.zsh @@ -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 |