1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-04 20:40:57 +02:00

16933: more sophisticated versions of these functions

This commit is contained in:
Oliver Kiddle 2002-04-04 11:59:08 +00:00
parent 41eb475f9b
commit 8ce654afb5
3 changed files with 32 additions and 16 deletions

View file

@ -1,5 +1,10 @@
2002-04-04 Oliver Kiddle <opk@zsh.org> 2002-04-04 Oliver Kiddle <opk@zsh.org>
* 16933; based on 16011 (Martin Ebourne) and 16906 (Bart):
Functions/Zle/up-line-or-beginning-search,
Functions/Zle/down-line-or-beginning-search:
more sophisticated versions of these functions
* 16923: Completion/Base/Completer/_all_matches, Doc/Zsh/compsys.yo: * 16923: Completion/Base/Completer/_all_matches, Doc/Zsh/compsys.yo:
add insert style to insert all matches instead of adding as a match add insert style to insert all matches instead of adding as a match

View file

@ -1,13 +1,19 @@
# Like down-line-or-search, but uses the whole line prefix up to the # Like down-line-or-search, but uses the whole line prefix up to the
# cursor position for searching forwards. # cursor position for searching forwards.
if [[ $LASTWIDGET != $WIDGET ]] if [[ ${+NUMERIC} -eq 0 &&
( $LASTWIDGET = $__searching || $RBUFFER != *$'\n'* ) ]]
then then
if [[ $LBUFFER == *$'\n'* ]] [[ $LASTWIDGET = $__searching ]] && CURSOR=$__savecursor
then __searching=$WIDGET
__last_down_line=down-line-or-history __savecursor=$CURSOR
else if zle .history-beginning-search-forward; then
__last_down_line=history-beginning-search-forward [[ $RBUFFER = *$'\n'* ]] ||
zstyle -T ':zle:down-line-or-beginning-search' leave-cursor &&
zle .end-of-line
return
fi fi
[[ $RBUFFER = *$'\n'* ]] || return
fi fi
zle .${__last_down_line:-beep} __searching=''
zle .down-line-or-history

View file

@ -1,13 +1,18 @@
# Like up-line-or-search, but uses the whole line prefix up to the # Like up-line-or-search, but uses the whole line prefix up to the
# cursor position for searching backwards. # cursor position for searching backwards.
if [[ $LASTWIDGET != $WIDGET ]] if [[ $LBUFFER == *$'\n'* ]]; then
zle .up-line-or-history
__searching=''
elif [[ -n $PREBUFFER ]] &&
zstyle -t ':zle:up-line-or-beginning-search' edit-buffer
then then
if [[ $LBUFFER == *$'\n'* ]] zle .push-line-or-edit
then else
__last_up_line=up-line-or-history [[ $LASTWIDGET = $__searching ]] && CURSOR=$__savecursor
else __savecursor=$CURSOR
__last_up_line=history-beginning-search-backward __searching=$WIDGET
fi zle .history-beginning-search-backward
zstyle -T ':zle:up-line-or-beginning-search' leave-cursor &&
zle .end-of-line
fi fi
zle .${__last_up_line:-beep}