Fixes: 659ecd0388 plugins: percol: Check for alias zz before unalias

The original patch (659ecd0388)
unaliases the percol alias, however, does not validate if the alias
is already defined. This leads to the following message that is shown
everytime a new bash session is spawned where this variable is not
defined when the percol plugin is enabled.

bash: unalias: zz: not found
pull/1129/head
Adam Wallis 2018-01-10 19:51:49 -05:00
parent 886b1d3f1e
commit 3651a31c5e
1 changed files with 4 additions and 1 deletions

View File

@ -35,7 +35,10 @@ if command -v percol>/dev/null; then
bind -x '"\C-r": _replace_by_history' bind -x '"\C-r": _replace_by_history'
# bind zz to percol if fasd enable # bind zz to percol if fasd enable
if [[ $(type -t zz) == 'alias' ]]; then
unalias zz unalias zz
fi
if command -v fasd>/dev/null; then if command -v fasd>/dev/null; then
function zz() { function zz() {
local l=$(fasd -d | awk '{print $2}' | percol) local l=$(fasd -d | awk '{print $2}' | percol)