From: Peter Stephenson <pws@ifh.de>
To: zsh-workers@math.gatech.edu (Zsh hackers list)
Subject: completion fix
Date: Fri, 07 Feb 1997 12:16:49 +0100 [thread overview]
Message-ID: <199702071116.MAA12975@hydra.ifh.de> (raw)
A couple of tests in do_single() looks for menucur (the current menu
completion entry) being set instead of menucmp (the flag for menu
completion), which seems to be necessary since the new completion may
be a menu completion even though no previous menu completion needs to
be removed. The problem is menucur is not automatically reset, so
that causes the types of problem listed below. The patch fixes it by
setting menucur to zero when the list is invalidated; I can't see how
this can be wrong, since if the list is invalid menucur is pointing at
garbage (it points into amatches which has just been freed).
% zsh -f
% mkdir foi foi/bar foo
% setopt menucomplete
# I see some kind soul has decided it's unnecessary to have a
# pre-defined completion for setopt, probably saving less space than
# it takes the average user to define it in .zshrc, so I have to
# type it out by hand. Thanks. (That's not the bug.)
% echo fo<TAB>
foi foo
% echo foi/
# ^ cursor here. To see what's in foi with ^D, we need to stop
# menucompletion, so I type `!<DEL>'; line remains the same.
# (Actually, I have some binding to do it for me, but it doesn't matter.)
% echo foi/^D
bar/
# So far so good. Now I want to complete in foi/, so I type <TAB>
% echo fobar/
Ooops. The completion code thinks it still has a menu entry to delete
when it inserts the new `bar'.
*** Src/Zle/zle_tricky.c.il Wed Feb 5 09:31:35 1997
--- Src/Zle/zle_tricky.c Fri Feb 7 11:22:40 1997
***************
*** 2973,2978 ****
--- 2973,2979 ----
freecompctl(ccmain);
}
lastambig = menucmp = showinglist = validlist = 0;
+ menucur = NULL;
}
/* Get the words from a variable or a compctl -k list. */
--
Peter Stephenson <pws@ifh.de> Tel: +49 33762 77366
WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77413
Deutsches Elektronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.
next reply other threads:[~1997-02-07 11:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-02-07 11:16 Peter Stephenson [this message]
-- strict thread matches above, loose matches on Subject: below --
1996-03-18 20:05 Completion fix Zoltan Hidvegi
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=199702071116.MAA12975@hydra.ifh.de \
--to=pws@ifh.de \
--cc=zsh-workers@math.gatech.edu \
/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).