zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: Completion of prefix redirections is -command- instead of -redirect-
Date: Thu, 27 Aug 2015 09:42:09 +0100	[thread overview]
Message-ID: <20150827094209.4c428b0a@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <150826221413.ZM25355@torch.brasslantern.com>

On Wed, 26 Aug 2015 22:14:13 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
> The below seems to make it better, the only case that is still wrong
> after this is "foo < ; <tab>".  But I haven't more than minimally
> checked that completing in e.g. "for" loops still works properly.
> 
> diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
> index cb17bde..97bdcc0 100644
> --- a/Src/Zle/zle_tricky.c
> +++ b/Src/Zle/zle_tricky.c
> @@ -1185,7 +1185,7 @@ get_comp_string(void)
>  	 * relatively harmless by itself, it's probably incomplete.
>  	 */
>  	linredir = (inredir && !ins);
> -	lincmd = !linredir &&
> +	lincmd = !inredir &&
>  	    ((incmdpos && !ins && !incond) ||
>  	     (oins == 2 && wordpos == 2) ||
>  	     (ins == 3 && wordpos == 1) ||

That certainly ought to be on the right lines.  I would vaguely imagine
the incond and inredir ought to be doing roughly the same job, so maybe
if this works !incond should be pulled out.  The oins / ins / wordpos are
doing the cleverness with complex commands that no one quite
understands, which probably don't apply to either redirections or
conditions.

(You'd think there was a better way to do this using a state machine of
some sort.  There's a project for someone.)

pws


      parent reply	other threads:[~2015-08-27  8:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-26  5:39 Daniel Shahaf
2015-08-26 18:18 ` Bart Schaefer
2015-08-27  0:16   ` Mikael Magnusson
2015-08-27  4:35     ` Bart Schaefer
2015-08-27  4:47       ` Bart Schaefer
2015-08-27  4:54         ` Mikael Magnusson
2015-08-27  5:14           ` Bart Schaefer
2015-08-27  6:22             ` Mikael Magnusson
2015-08-27 16:47               ` Bart Schaefer
2015-08-27 18:54                 ` Mikael Magnusson
2015-08-27 19:00                   ` Mikael Magnusson
2015-08-27 23:20                   ` Bart Schaefer
2015-08-27  8:42             ` Peter Stephenson [this message]

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=20150827094209.4c428b0a@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /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).