zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@u.genie.co.uk>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: Improve handling of b/n/s subscript flags
Date: Tue, 08 May 2001 12:51:07 +0100	[thread overview]
Message-ID: <3AF7DDAB.72A6000F@u.genie.co.uk> (raw)
In-Reply-To: <1010506194240.ZM21879@candle.brasslantern.com>

This is great, thanks. There was one tiny mistake which I fix here.

Bart Schaefer wrote:
> 
> I've included code to handle e.g. (s[string]), but with `$scalar[(s[' on the
> line we arrive in _subscript with the `(s[' already moved into $IPREFIX and
> so `compset -P \(' fails and we branch into `_contexts -math-'.  I'm not
> sure what code has to change to fix this; I suspect it's in C somewhere.

It'll be whatever C code decides the current context. This has never
been perfect for determining whether we are in a subscript hence the
completion of character classes in _subscript. If we want similar
completion for zsh's various other flags, then I expect it is the same
bit of code that needs updating to give us access to those areas in
shell code.

> The next change to make to this is to discover that i/I/r/R are in the flags
> and NOT complete in math context (for arrays) or association keys (assoc's).

Yes, and complete array style indexes for split scalars.

Oliver

Index: Completion/Zsh/Context/_subscript
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Context/_subscript,v
retrieving revision 1.4
diff -u -r1.4 _subscript
--- Completion/Zsh/Context/_subscript   2001/05/06 22:35:08     1.4
+++ Completion/Zsh/Context/_subscript   2001/05/08 11:49:49
@@ -20,7 +20,7 @@
 
   if [[ $PREFIX = (#b)*([bns])(?|)(*) ]]; then
     local f=$match[1] d=$match[2] e=$match[2] v=$match[3]
-    [[ $f = s && ${(Pt)${compstate[parameter]}} != scalar ]] && return 1
+    [[ $f = s && ${(Pt)${compstate[parameter]}} != scalar* ]] && return 1
     if [[ -z $d ]]; then
       _message 'delimiter'
       return


  reply	other threads:[~2001-05-08 11:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-06 19:42 Bart Schaefer
2001-05-08 11:51 ` Oliver Kiddle [this message]
2001-05-08 12:31   ` 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=3AF7DDAB.72A6000F@u.genie.co.uk \
    --to=opk@u.genie.co.uk \
    --cc=zsh-workers@sunsite.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).