summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/Zle/compcore.c25
2 files changed, 25 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 3660ebac3..4a456f9fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
 	* 21622: Src/Zle/zle_refresh.c: metafy line back before calling
 	completion code in zrefresh()
 
+	* 21627: Src/Zle/compcore.c: unmetafy line back before calling
+	ZLE from within complection code in do_completion()
+
 2005-08-15  Clint Adams  <clint@zsh.org>
 
 	* 21619: Src/string.c, Src/utils.c, Src/Zle/zle.h: define wide
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index df43cc1ac..3a86eb793 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -353,8 +353,18 @@ do_completion(UNUSED(Hookdef dummy), Compldat dat)
 	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), Compldat dat)
 	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);