zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: _history_complete_word
Date: Fri, 31 Mar 2000 10:14:03 +0200 (MET DST)	[thread overview]
Message-ID: <200003310814.KAA06936@beta.informatik.hu-berlin.de> (raw)


I think _history_complete_word could use the new tag label stuff, too.


There is something in this function I don't understand:

There is always one match inserted immediately. That's ok for a
function like this, but why does _h_c_w then test for
`$compstate[insert] = menu'? It means that this is almost unusable
without normally using menucompletion (one can't cycle through the
matches).

Or did setting compstate[insert] to a number once start menucompletion 
so that it reported `menu' in $compstate[insert] on the next
invocation? But we can test it with $compstate[old_insert] now.

No patch for this, because I'm not completely sure which behaviour is
desired.


Bye
 Sven

diff -ru ../z.old/Completion/Commands/_history_complete_word Completion/Commands/_history_complete_word
--- ../z.old/Completion/Commands/_history_complete_word	Fri Mar 31 09:19:24 2000
+++ Completion/Commands/_history_complete_word	Fri Mar 31 09:57:06 2000
@@ -67,30 +67,26 @@
 }
 
 _history_complete_word_gen_matches () {
-  if zstyle -t ":completion:${curcontext}:history-words" list; then
-    if zstyle -t ":completion:${curcontext}:history-words" sort; then
-      _description history-words expl 'history word'
-    else
-      _description -V history-words expl 'history word'
-    fi
-  else
-    if zstyle -t ":completion:${curcontext}:history-words" sort; then
-      expl=()
-    else
-      expl=('-V' '')
-    fi
-  fi
+  local opt
 
   [[ -n "$_hist_stop" ]] && PREFIX="$_hist_old_prefix"
 
-  local rem_dups
   if zstyle -t ":completion:${curcontext}:history-words" remove-all-dups; then
-    rem_dups=''
+    opt=-
   else
-    rem_dups='-1'
+    opt=-1
   fi
+  if zstyle -t ":completion:${curcontext}:history-words" sort; then
+    opt="${opt}J"
+  else
+    opt="${opt}V"
+  fi
+
+  _wanted "$opt" history-words expl 'history word' \
+      compadd -Q - "$historywords[@]"
 
-  compadd "$expl[@]" $rem_dups -Q - "${(@)historywords:#[\$'\"]*}"
+  zstyle -t ":completion:${curcontext}:history-words" list ||
+      compstate[list]=
 
   _hist_menu_length="$compstate[nmatches]"
 

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~2000-03-31  8:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-31  8:14 Sven Wischnowsky [this message]
2000-04-26 19:49 ` Adam Spiers
2002-03-06 14:56   ` Adam Spiers
2002-03-07  8:31     ` Sven Wischnowsky
2002-03-07 15:33       ` Adam Spiers
2000-04-27  9:57 Sven Wischnowsky

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=200003310814.KAA06936@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).