1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-26 16:40:29 +01:00

18394: New word movement and editing widgets.

This commit is contained in:
Peter Stephenson 2003-03-28 11:34:07 +00:00
parent 2941469f61
commit 1e57c42f47
13 changed files with 678 additions and 26 deletions

View file

@ -1,3 +1,22 @@
emulate -L zsh
setopt extendedglob
local opt keys
integer stat
while getopts "k:" opt; do
case $opt in
(k)
keys=$OPTARG
;;
(*)
return 1
;;
esac
done
(( OPTIND > 1 )) && shift $(( OPTIND - 1 ))
local savelbuffer=$LBUFFER saverbuffer=$RBUFFER
local savepredisplay=$PREDISPLAY savepostdisplay=$POSTDISPLAY
@ -7,10 +26,15 @@ PREDISPLAY="$PREDISPLAY$savelbuffer$saverbuffer$POSTDISPLAY
${1:-? }"
POSTDISPLAY=
zle recursive-edit
integer stat=$?
(( stat )) || REPLY=$BUFFER
if [[ -n $keys ]]; then
zle -R
read -k $keys
stat=$?
else
zle recursive-edit
stat=$?
(( stat )) || REPLY=$BUFFER
fi
LBUFFER=$savelbuffer
RBUFFER=$saverbuffer