Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
RE: PATCH: Re: General comments on completion
- X-seq: zsh-workers 7043
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: RE: PATCH: Re: General comments on completion
- Date: Thu, 8 Jul 1999 16:20:05 +0200 (MET DST)
- In-reply-to: "Andrej Borsenkow"'s message of Thu, 8 Jul 1999 17:20:32 +0400
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
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