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:
parent
b44ed0b032
commit
2c5ea79f17
11 changed files with 1079 additions and 260 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue