Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: incremental-complete-word



This fixes some display bugs that had crept in as the rest of the code
evolved around this, and adds some recommendations for common failure
cases that it's really not possible to fix within the function.  It's
unclear to me whether contrib.yo needs to be updated.

There are still some pretty nasty bugs; e.g., if you start incremental
completion in the middle of a word, and then backspace past the point
where incremental completion began, confusing things begin to happen
(which vary depending on zstyles governing completion listings, etc.).

Index: incremental-complete-word
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-4.0/Functions/Zle/incremental-complete-word,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 incremental-complete-word
--- incremental-complete-word	9 Apr 2001 20:14:12 -0000	1.1.1.1
+++ incremental-complete-word	29 Jul 2006 21:49:15 -0000
@@ -10,6 +10,15 @@
 #
 # This works only with the new function based completion system.
 
+# Recommended settings:
+#   zstyle ':completion:incremental:*' completer _complete _ignored
+#   zstyle :incremental stop-keys $'[\e\C-b\C-f\C-n\C-p\C-u-\C-x]'
+
+# BUGS:
+# The _oldlist completer breaks incremental completion.  Use a context-
+# specific completer zstyle as shown above to disable the _oldlist
+# completer in this function.
+
 # The main widget function.
 
 incremental-complete-word() {
@@ -52,7 +61,7 @@
     state=''
   fi
   zformat -f pstr "$pmpt" "u:${word}" "s:$state" "n:$num" \
-                          "l:$toolong" "c:${_lastcomp[completer][2,-1]}"
+                          "l:$toolong" "c:${_lastcomp[completer]}"
   zle -R "$pstr"
   read -k key
 
@@ -95,7 +104,7 @@
         state=''
       fi
       zformat -f pstr "$pmpt" "u:${word}" "s:$state" "n:$num" \
-                              "l:$toolong" "c:${_lastcomp[completer][2,-1]}"
+                              "l:$toolong" "c:${_lastcomp[completer]}"
       zle -R "$pstr"
     else
       zle -R



Messages sorted by: Reverse Date, Date, Thread, Author