zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] fix recursive ZLE from completion call
@ 2005-08-15 18:07 Andrey Borzenkov
  2005-08-15 18:22 ` Peter Stephenson
  2005-08-16 17:09 ` Andrey Borzenkov
  0 siblings, 2 replies; 3+ messages in thread
From: Andrey Borzenkov @ 2005-08-15 18:07 UTC (permalink / raw)
  To: zsh-workers

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-08-16 17:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-15 18:07 [PATCH] fix recursive ZLE from completion call Andrey Borzenkov
2005-08-15 18:22 ` Peter Stephenson
2005-08-16 17:09 ` Andrey Borzenkov

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).