about summary refs log tree commit diff
path: root/Functions
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-04-03 11:38:55 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-04-03 11:38:55 +0000
commit2c5ea79f1762dcbafca8d08bc5bdb47d75670f03 (patch)
tree281e1696494e62aab0602d0186669520f7ecec7b /Functions
parentb44ed0b03250e17a21194ca63602ff8dd5191583 (diff)
downloadzsh-2c5ea79f1762dcbafca8d08bc5bdb47d75670f03.tar.gz
zsh-2c5ea79f1762dcbafca8d08bc5bdb47d75670f03.tar.xz
zsh-2c5ea79f1762dcbafca8d08bc5bdb47d75670f03.zip
24782: initial go at highlighting of characters in zle command lines
Diffstat (limited to 'Functions')
-rw-r--r--Functions/Zle/read-from-minibuffer21
-rw-r--r--Functions/Zle/replace-string-again3
2 files changed, 10 insertions, 14 deletions
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
diff --git a/Functions/Zle/replace-string-again b/Functions/Zle/replace-string-again
index 122f0a8ee..3d3486437 100644
--- a/Functions/Zle/replace-string-again
+++ b/Functions/Zle/replace-string-again
@@ -9,7 +9,8 @@ local MATCH MBEGIN MEND curwidget=${1:-$WIDGET}
 local -a match mbegin mend
 
 if [[ -z $_replace_string_src ]]; then
-  zle -M No string to replace.
+  zle -M "No string to replace."
+  return 1
 fi
 
 if [[ $curwidget = *pattern* ]]; then