zsh-workers
 help / color / mirror / code / Atom feed
From: Andrey Borzenkov <arvidjaar@newmail.ru>
To: zsh-workers@sunsite.dk
Subject: [PATCH] fix recursive ZLE from completion call
Date: Mon, 15 Aug 2005 22:07:27 +0400	[thread overview]
Message-ID: <200508152207.27813.arvidjaar@newmail.ru> (raw)

[-- Attachment #1: Type: text/plain, Size: 1669 bytes --]

That is becoming ridiculous. Any chance to have single entry point (wrapper?) 
for ZLE and completion functions?

Index: Src/Zle/compcore.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compcore.c,v
retrieving revision 1.71
diff -u -p -r1.71 compcore.c
--- Src/Zle/compcore.c  10 Aug 2005 10:56:41 -0000      1.71
+++ Src/Zle/compcore.c  15 Aug 2005 18:04:45 -0000
@@ -353,8 +353,18 @@ do_completion(UNUSED(Hookdef dummy), Com
        clearlist = 1;
        ret = 1;
        minfo.cur = NULL;
-       if (useline < 0)
+       if (useline < 0) {
+           /* unmetafy line before calling ZLE */
+           int remetafy = 0;
+
+           if (zlemetaline != NULL) {
+               unmetafy_line();
+               remetafy = 1;
+           }
            ret = selfinsert(zlenoargs);
+           if (remetafy)
+               metafy_line();
+       }
        goto compend;
     }
     zsfree(lastprebr);
@@ -367,9 +377,18 @@ do_completion(UNUSED(Hookdef dummy), Com
        if (nmatches)
             do_ambig_menu();
        ret = !nmatches;
-    } else if (useline < 0)
+    } else if (useline < 0) {
+       /* unmetafy line before calling ZLE */
+       int remetafy = 0;
+
+       if (zlemetaline != NULL) {
+           unmetafy_line();
+           remetafy = 1;
+       }
        ret = selfinsert(zlenoargs);
-    else if (!useline && uselist) {
+       if (remetafy)
+           metafy_line();
+    } else if (!useline && uselist) {
        /* All this and the guy only wants to see the list, sigh. */
        zlemetacs = 0;
        foredel(zlemetall);

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2005-08-15 18:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-15 18:07 Andrey Borzenkov [this message]
2005-08-15 18:22 ` Peter Stephenson
2005-08-16 17:09 ` Andrey Borzenkov

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=200508152207.27813.arvidjaar@newmail.ru \
    --to=arvidjaar@newmail.ru \
    --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).