Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zle and unicode (run-help triggered issue)



On Wed, 7 Aug 2013 15:35:55 -0400
Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx> wrote:
> Being occasionally frivolous, a while ago I set up ☛ (BLACK RIGHT
> POINTING INDEX) as an alias for a command I use fairly often.  Heck,
> even with digraphs, it works out to be one fewer keystrokes.
> 
> Invoking the widget which calls run-help ends up corrupting the unicode
> somewhat; I'm wondering if some unmetafy is missing somewhere?

diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 610055c..e30e0b1 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -2136,8 +2136,8 @@ inststrlen(char *str, int move, int len)
 	return 0;
     if (len == -1)
 	len = strlen(str);
-    spaceinline(len);
     if (zlemetaline != NULL) {
+	spaceinline(len);
 	strncpy(zlemetaline + zlemetacs, str, len);
 	if (move)
 	    zlemetacs += len;
@@ -2148,6 +2148,7 @@ inststrlen(char *str, int move, int len)
 
 	instr = ztrduppfx(str, len);
 	zlestr = stringaszleline(instr, 0, &zlelen, NULL, NULL);
+	spaceinline(zlelen);
 	ZS_strncpy(zleline + zlecs, zlestr, zlelen);
 	free(zlestr);
 	zsfree(instr);

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



Messages sorted by: Reverse Date, Date, Thread, Author