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

RE: PATCH: Re: General comments on completion



Andrej Borsenkow wrote:

> bor@itsrm2:~/test/match%> ls /h/b/t/m/a?a/<12->TAB
> bor@itsrm2:~/test/match%> ls /home/bor/test/match/a/\<12-\>
> axa/  aya/                                         ^ cursor here; after TAB
> bor@itsrm2:~/test/match%> l /home/bor/test/match/axa/\<12-\>CURSOR HERE
> axa/  aya/                                                  ^

This makes _oldlist try to retain the cursor-positioning in cases like 
these (when re-using a list from a certain completer).

Bye
 Sven

diff -u oc/Core/_oldlist Completion/Core/_oldlist
--- oc/Core/_oldlist	Thu Jul  8 11:11:49 1999
+++ Completion/Core/_oldlist	Thu Jul  8 16:18:04 1999
@@ -6,13 +6,17 @@
 # (even if it was generated by another widget).
 # Do this also if there is an old list and it was generated by the
 # completer named by the oldlist_list key.
-if [[ -n $compstate[old_list] && $compconfig[oldlist_list] != never &&
-      ( ( $WIDGET = *list* &&
-          ( $compconfig[oldlist_list] = always ||
-            $compstate[old_list] != shown ) ) ||
-        $compconfig[oldlist_list] = *${_lastcomp[completer]}* ) ]]; then
-  compstate[old_list]=keep
-  return 0
+if [[ -n $compstate[old_list] && $compconfig[oldlist_list] != never ]]; then
+  if [[ $WIDGET = *list* &&
+        ( $compconfig[oldlist_list] = always ||
+	  $compstate[old_list] != shown ) ]]; then
+    compstate[old_list]=keep
+    return 0
+  elif [[ $compconfig[oldlist_list] = *${_lastcomp[completer]}* ]]; then
+    [[ "$_lastcomp[insert]" = unambig* ]] && compstate[to_end]=single
+    compstate[old_list]=keep
+    return 0
+  fi
 fi
 
 # If this is a completion widget, and we have a completion inserted already,

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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