mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-25 05:10:28 +02:00
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.
This commit is contained in:
parent
25b84ec914
commit
9763da46c8
4 changed files with 45 additions and 0 deletions
13
Functions/Zle/up-line-or-beginning-search
Normal file
13
Functions/Zle/up-line-or-beginning-search
Normal file
|
|
@ -0,0 +1,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}
|
||||
Loading…
Add table
Add a link
Reference in a new issue