Change command verification

Changed command verification because 'which' does sometimes produce an empty tac variable.
This commit is contained in:
Lucas
2016-04-19 19:44:23 +02:00
parent cbff1feafd
commit bcd50ef67f

View File

@@ -8,8 +8,8 @@
if which peco &> /dev/null; then
function peco_select_history() {
local tac
(which gtac &> /dev/null && tac="gtac") || \
(which tac &> /dev/null && tac="tac") || \
((($+commands[gtac])) && tac="gtac") || \
(($+commands[tac])) && tac="tac" || \
tac="tail -r"
BUFFER=$(fc -l -n 1 | eval $tac | \
peco --layout=bottom-up --query "$LBUFFER")