about summary refs log tree commit diff
path: root/Functions/Zle/up-line-or-beginning-search
blob: 12f2edaae08f5cde9b95c5fc373525eb5e21001d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
# Like up-line-or-search, but uses the whole line prefix up to the
# cursor position for searching backwards.

if [[ $LASTWIDGET != $WIDGET ]]
then
    if [[ $LBUFFER == *$'\n'* ]]
    then
        __last_up_line=up-line-or-history
    else
        __last_up_line=history-beginning-search-backward
    fi
fi
zle .${__last_up_line:-beep}