2
0
mirror of https://github.com/junegunn/fzf synced 2024-10-30 09:20:14 +00:00

fix typo in argument of head

at least my version of head wants -n1 to only display the first line
This commit is contained in:
Robin Roth 2015-05-09 21:11:01 +02:00
parent 683abb86ef
commit 01405ad92e

View File

@ -37,7 +37,7 @@ bindkey '\ec' fzf-cd-widget
fzf-history-widget() {
local selected restore_no_bang_hist
if selected=$(fc -l 1 | $(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r -q "$LBUFFER"); then
num=$(echo "$selected" | head -1 | awk '{print $1}' | sed 's/[^0-9]//g')
num=$(echo "$selected" | head -n1 | awk '{print $1}' | sed 's/[^0-9]//g')
if [ -n "$num" ]; then
LBUFFER=!$num
if setopt | grep nobanghist > /dev/null; then