From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: Re: diff completion problem.
Date: Thu, 13 Jul 2000 13:01:24 +0200 (MET DST) [thread overview]
Message-ID: <200007131101.NAA23190@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Tanaka Akira's message of 13 Jul 2000 19:36:50 +0900
Tanaka Akira wrote:
> Z(2):akr@flux% Src/zsh -f
> flux% bindkey -e; autoload -U compinit; compinit -D; compdef _tst tst
> flux% zstyle '*:descriptions' format '%d'
> flux% diff -ur <TAB>
> new file
> CVS/ LICENCE _w3m config.sub*
> ChangeLog META-FAQ acconfig.h configure*
> ...
>
> Hm. zsh completes files as new file. It should be `original file'.
Whoa. How did that survive?
Wrong return value in the function testing for multiple single-letter
options in the same string.
That stuff in _main_complete tries to do the right thing when a
completion function uses _message, i.e. it stops trying other
completers and doesn't print the warnings. Sorry for putting this in
the same patch.
Bye
Sven
Index: Completion/Core/_main_complete
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_main_complete,v
retrieving revision 1.36
diff -u -r1.36 _main_complete
--- Completion/Core/_main_complete 2000/07/12 09:25:18 1.36
+++ Completion/Core/_main_complete 2000/07/13 10:59:26
@@ -156,6 +156,8 @@
fi
(( _matcher_num++ ))
done
+ [[ -n "$_comp_mesg" ]] && break
+
(( _completer_num++ ))
done
@@ -265,7 +267,7 @@
elif [[ nm -le 1 && -n "$_comp_mesg" ]]; then
compstate[insert]=''
compstate[list]='list force messages'
-elif [[ nm -eq 0 &&
+elif [[ nm -eq 0 && -z "$_comp_mesg" &&
$#_lastdescr -ne 0 && $compstate[old_list] != keep ]] &&
zstyle -s ":completion:${curcontext}:warnings" format format; then
Index: Src/Zle/computil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v
retrieving revision 1.36
diff -u -r1.36 computil.c
--- Src/Zle/computil.c 2000/06/26 08:36:43 1.36
+++ Src/Zle/computil.c 2000/07/13 10:59:38
@@ -1088,7 +1088,7 @@
static Caopt
ca_get_sopt(Cadef d, char *line, char **end, LinkList *lp)
{
- Caopt p;
+ Caopt p, pp = NULL;
char pre = *line++;
LinkList l = NULL;
@@ -1112,11 +1112,12 @@
}
} else if (!p || (p && !p->active))
return NULL;
+ pp = p;
p = NULL;
}
- if (p && end)
+ if (pp && end)
*end = line;
- return p;
+ return pp;
}
/* Return the n'th argument definition. */
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
reply other threads:[~2000-07-13 11:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200007131101.NAA23190@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.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).