Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH?] Re: Autocorrect for commands with a hyphen (dash) in the name

On Sat, May 23, 2020 at 1:31 PM Peter Stephenson
<p.w.stephenson@xxxxxxxxxxxx> wrote:
> On Sat, 2020-05-23 at 12:54 -0700, Bart Schaefer wrote:
> > > > >
> > > > >             if (*w == Tilde || *w == Equals || *w == String)
> > > > >                 *x = *w;
> Yes, I guess you need to skip over those before untokenizing.

zle_tricky is actually re-tokenizing them again after untokenizing but
before calling spckword().

> That matches this line in spckword():
>     if (*t == Tilde || *t == Equals || *t == String)
>         t++;

Right, and then it uses those tokens to decide which hash table to
search.  OK, I think that answers the question.

> But still not sure we
> actually need two separate token-based interventions.

Which two are we talking about?  You mean you think we can unify lex.c
and zle_tricky.c inside spckword()?  Yes, we could move the whole
thing to utils.c, and then spckword() would be expecting to take a
tokenized string rather than an untokenized one.

Messages sorted by: Reverse Date, Date, Thread, Author