zsh-workers
 help / color / mirror / code / Atom feed
* false prefix-needed in _arguments
@ 2002-02-14 15:06 Oliver Kiddle
  2002-02-18 14:24 ` Sven Wischnowsky
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Kiddle @ 2002-02-14 15:06 UTC (permalink / raw)
  To: zsh-workers

The prefix-needed style in _arguments doesn't seem to be working:

_f() { _arguments '-a' '-b' '1:files:_files' }
zstyle '*' prefix-needed false
compdef _f f
f <tab>

And only files are offered. It should be offering both files and
options.

I've always had prefix-needed set to true so only noticed this when I
tried setting:
  zstyle ':completion:*:option-*:options' prefix-needed false
so that options are listed when the argument to an option is optional.

Oliver

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: false prefix-needed in _arguments
  2002-02-14 15:06 false prefix-needed in _arguments Oliver Kiddle
@ 2002-02-18 14:24 ` Sven Wischnowsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 2002-02-18 14:24 UTC (permalink / raw)
  To: zsh-workers


Oliver Kiddle wrote:

> The prefix-needed style in _arguments doesn't seem to be working:
> 
> _f() { _arguments '-a' '-b' '1:files:_files' }
> zstyle '*' prefix-needed false
> compdef _f f
> f <tab>
> 
> And only files are offered. It should be offering both files and
> options.

Yes, that was broken... but note taht you also have to set the
tag-order style to try options and the argument-completion at the same
time, otherwise arguments will always be preferred.


Bye
  Sven

Index: Completion/Base/Utility/_arguments
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_arguments,v
retrieving revision 1.10
diff -u -r1.10 _arguments
--- Completion/Base/Utility/_arguments	22 Jan 2002 10:22:48 -0000	1.10
+++ Completion/Base/Utility/_arguments	18 Feb 2002 14:24:13 -0000
@@ -331,11 +331,10 @@
           fi
         done
       fi
-      if [[ -z "$hasopts" &&
+      if _requested options &&
+         [[ -z "$hasopts" &&
             -z "$matched" &&
-            ( -z "$tried" || -n "$alwopt" ) &&
             ( -z "$aret" || "$PREFIX" = "$origpre" ) ]] &&
-          _requested options &&
           { ! zstyle -T ":completion:${curcontext}:options" prefix-needed ||
             [[ "$origpre" = [-+]* || -z "$aret$mesg$tried" ]] } ; then
 	local prevpre="$PREFIX" previpre="$IPREFIX"

-- 
Sven Wischnowsky                          wischnow@berkom.de


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-02-18 14:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-14 15:06 false prefix-needed in _arguments Oliver Kiddle
2002-02-18 14:24 ` Sven Wischnowsky

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).