zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: RE: PATCH: Re: General comments on completion
Date: Thu, 8 Jul 1999 16:20:05 +0200 (MET DST)	[thread overview]
Message-ID: <199907081420.QAA12601@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Andrej Borsenkow"'s message of Thu, 8 Jul 1999 17:20:32 +0400


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@informatik.hu-berlin.de


             reply	other threads:[~1999-07-08 14:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-08 14:20 Sven Wischnowsky [this message]
1999-07-08 15:53 ` Andrej Borsenkow
  -- strict thread matches above, loose matches on Subject: below --
1999-07-08  9:04 Sven Wischnowsky
1999-07-08 13:20 ` Andrej Borsenkow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199907081420.QAA12601@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).