1
0
Fork 0

prevent early deletion of tmp buffer file

This commit is contained in:
Andrey Orst 2018-10-02 19:44:21 +03:00
parent 981c5e8bbf
commit 8a4fcc768a

View file

@ -181,7 +181,9 @@ define-command -hidden fzf-buffer-search %{
echo "execute-keys %{%<a-|>cat<space>><space>$buffer_content<ret>;}" echo "execute-keys %{%<a-|>cat<space>><space>$buffer_content<ret>;}"
echo "execute-keys $line g $char l" echo "execute-keys $line g $char l"
echo "fzf \"execute-keys \$1 gx\" \"(nl -b a -n ln $buffer_content\" \"--reverse | cut -f 1)\"" echo "fzf \"execute-keys \$1 gx\" \"(nl -b a -n ln $buffer_content\" \"--reverse | cut -f 1)\""
echo "nop %sh{rm $buffer_content}" (echo "fzf \"execute-keys \$1 gx\" \"(nl -b a -n ln $buffer_content\" \"--reverse | cut -f 1)\"") 1>&2
# sleep 2 is needed to because everything is done asynchronously, so file should not be deleted until it was read by fzf
echo "nop %sh{sleep 2; rm $buffer_content}"
} }
} }