1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-22 16:20:23 +02:00

24782: initial go at highlighting of characters in zle command lines

This commit is contained in:
Peter Stephenson 2008-04-03 11:38:55 +00:00
parent b44ed0b032
commit 2c5ea79f17
11 changed files with 1079 additions and 260 deletions

View file

@ -19,14 +19,14 @@ while getopts "k:" opt; do
done
(( OPTIND > 1 )) && shift $(( OPTIND - 1 ))
local savelbuffer=$LBUFFER saverbuffer=$RBUFFER
local savepredisplay=$PREDISPLAY savepostdisplay=$POSTDISPLAY
LBUFFER="$2"
RBUFFER="$3"
PREDISPLAY="$PREDISPLAY$savelbuffer$saverbuffer$POSTDISPLAY
${1:-? }"
POSTDISPLAY=
local pretext="$PREDISPLAY$LBUFFER$RBUFFER$POSTDISPLAY
"
local LBUFFER="$2"
local RBUFFER="$3"
local PREDISPLAY="$pretext${1:-? }"
local POSTDISPLAY=
local -a region_highlight
region_highlight=("P${#pretext} ${#PREDISPLAY} bold")
if [[ -n $keys ]]; then
zle -R
@ -38,9 +38,4 @@ else
(( stat )) || REPLY=$BUFFER
fi
LBUFFER=$savelbuffer
RBUFFER=$saverbuffer
PREDISPLAY=$savepredisplay
POSTDISPLAY=$savepostdisplay
return $stat