about summary refs log tree commit diff
path: root/Functions/Zle
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-10-22 12:59:08 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-10-22 12:59:08 +0000
commit1eb0a2d856caad3e24b6261f689dd97fbc18577e (patch)
treeade541fb00114186016fcc17435928a69a0bed17 /Functions/Zle
parent97fa7e4889341f41a3f481361b2e8a6c552d8186 (diff)
downloadzsh-1eb0a2d856caad3e24b6261f689dd97fbc18577e.tar.gz
zsh-1eb0a2d856caad3e24b6261f689dd97fbc18577e.tar.xz
zsh-1eb0a2d856caad3e24b6261f689dd97fbc18577e.zip
zsh-workers/8373
Diffstat (limited to 'Functions/Zle')
-rw-r--r--Functions/Zle/predict-on15
1 files changed, 8 insertions, 7 deletions
diff --git a/Functions/Zle/predict-on b/Functions/Zle/predict-on
index e2b6ebd5b..dbd828975 100644
--- a/Functions/Zle/predict-on
+++ b/Functions/Zle/predict-on
@@ -25,19 +25,17 @@
 # error message.
 
 predict-on() {
-    setopt localoptions nounset noksharrays
+    setopt localoptions unset noksharrays
     zle -N self-insert insert-and-predict
     zle -N magic-space insert-and-predict
     zle -N backward-delete-char delete-backward-and-predict
-    [[ $compmatchers[2] != 'r:|=*' ]] &&
-      compmatchers=('' 'r:|=*' $compmatchers)
+    zle -N delete-char-or-list delete-no-predict
 }
 predict-off() {
-    setopt localoptions nounset noksharrays
+    setopt localoptions unset noksharrays
     zle -A .self-insert self-insert
     zle -A .magic-space magic-space
     zle -A .backward-delete-char backward-delete-char
-    [[ $compmatchers[2] != 'r:|=*' ]] || shift 2 compmatchers
 }
 insert-and-predict () {
   emulate -L zsh
@@ -75,11 +73,14 @@ delete-backward-and-predict() {
       zle .history-beginning-search-forward || RBUFFER=""
       return 0
     else
-      # Depending on preference, you might call "predict-off" here,
-      # and also set up forward deletions to turn off prediction.
+      # Depending on preference, you might call "predict-off" here.
       LBUFFER="$LBUFFER[1,-2]"
     fi
   fi
 }
+delete-no-predict() {
+  predict-off
+  zle .$WIDGET "$@"
+}
 
 [[ -o kshautoload ]] || predict-on "$@"