File: up-line-or-beginning-search

package info (click to toggle)
zsh-beta 4.3.0-dev-1%2B20050424-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 18,240 kB
  • ctags: 6,564
  • sloc: ansic: 79,241; sh: 4,874; perl: 748; makefile: 676; awk: 341; sed: 16
file content (18 lines) | stat: -rw-r--r-- 548 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Like up-line-or-search, but uses the whole line prefix up to the
# cursor position for searching backwards.

if [[ $LBUFFER == *$'\n'* ]]; then
  zle .up-line-or-history
  __searching=''
elif [[ -n $PREBUFFER ]] && 
    zstyle -t ':zle:up-line-or-beginning-search' edit-buffer
then
  zle .push-line-or-edit
else
  [[ $LASTWIDGET = $__searching ]] && CURSOR=$__savecursor
  __savecursor=$CURSOR
  __searching=$WIDGET
  zle .history-beginning-search-backward
  zstyle -T ':zle:up-line-or-beginning-search' leave-cursor &&
      zle .end-of-line
fi