1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-20 05:53:52 +01:00
zsh/Functions/Zle/up-line-or-beginning-search
Peter Stephenson 9763da46c8 16879: Functions/Zle/up-line-or-beginning-search,
Functions/Zle/down-line-or-beginning-search,
Doc/Zsh/contrib.yo: originally by Bart --- widgets which
combine up-line-or-search and history-beginning-search-backward
behaviour.
2002-03-21 23:03:09 +00:00

14 lines
337 B
Plaintext

# 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}