From: Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: PATCH: fix 3, was Re: unpatch: metafying zle line
Date: Wed, 10 Aug 2005 20:53:52 +0100 [thread overview]
Message-ID: <20050810195354.B5F508664@pwstephenson.fsnet.co.uk> (raw)
In-Reply-To: <200508101319.j7ADJ6mx002062@news01.csr.com>
Two more:
which-command and run-help were broken because I forgot to copy the code
that moves the cursor to the end, so the strings were inserted in the
wrong order.
Some more advanced menu features including accept-and-menu-complete were
broken by yet another complication with the metafication state when
using menus.
Index: Src/Zle/compresult.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compresult.c,v
retrieving revision 1.55
diff -u -r1.55 compresult.c
--- Src/Zle/compresult.c 10 Aug 2005 10:56:41 -0000 1.55
+++ Src/Zle/compresult.c 10 Aug 2005 19:44:28 -0000
@@ -687,6 +687,8 @@
mod_export int
hasbrpsfx(Cmatch m, char *pre, char *suf)
{
+ METACHECK();
+
if (m->flags & CMF_ALL)
return 1;
else {
@@ -1153,6 +1155,15 @@
mod_export void
do_menucmp(int lst)
{
+ int was_meta;
+
+ /* Already metafied when called from domenuselect already */
+ if (zlemetaline == NULL) {
+ was_meta = 0;
+ metafy_line();
+ } else
+ was_meta = 1;
+
/* Just list the matches if the list was requested. */
if (lst == COMP_LIST_COMPLETE) {
showinglist = -2;
@@ -1173,13 +1184,10 @@
(((*minfo.cur)->flags & (CMF_NOLIST | CMF_MULT)) &&
(!(*minfo.cur)->str || !*(*minfo.cur)->str)));
/* ... and insert it into the command line. */
- /* Already metafied when called from domenuselect already */
- if (zlemetaline == NULL) {
- metafy_line();
- do_single(*minfo.cur);
+ do_single(*minfo.cur);
+
+ if (!was_meta)
unmetafy_line();
- } else
- do_single(*minfo.cur);
}
/**/
Index: Src/Zle/zle_tricky.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v
retrieving revision 1.54
diff -u -r1.54 zle_tricky.c
--- Src/Zle/zle_tricky.c 10 Aug 2005 10:56:41 -0000 1.54
+++ Src/Zle/zle_tricky.c 10 Aug 2005 19:44:51 -0000
@@ -1800,6 +1800,8 @@
ZS_strncpy(zleline + zlecs, zlestr, zlelen);
free(zlestr);
zsfree((char *)instr);
+ if (move)
+ zlecs += len;
}
return len;
}
--
Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
Work: pws@csr.com
Web: http://www.pwstephenson.fsnet.co.uk
next prev parent reply other threads:[~2005-08-10 19:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-10 10:34 Peter Stephenson
2005-08-10 11:31 ` DervishD
2005-08-10 11:57 ` PATCH: fix 1, was " Peter Stephenson
2005-08-10 13:19 ` PATCH: fix 2, " Peter Stephenson
2005-08-10 19:53 ` Peter Stephenson [this message]
2005-08-10 14:04 ` David Gómez
2005-08-10 17:34 ` David Gómez
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=20050810195354.B5F508664@pwstephenson.fsnet.co.uk \
--to=pws@pwstephenson.fsnet.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).