From 2c5ea79f1762dcbafca8d08bc5bdb47d75670f03 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 3 Apr 2008 11:38:55 +0000 Subject: 24782: initial go at highlighting of characters in zle command lines --- Functions/Zle/read-from-minibuffer | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'Functions/Zle/read-from-minibuffer') diff --git a/Functions/Zle/read-from-minibuffer b/Functions/Zle/read-from-minibuffer index 30dfe8338..8c9051551 100644 --- a/Functions/Zle/read-from-minibuffer +++ b/Functions/Zle/read-from-minibuffer @@ -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 -- cgit v1.2.3