zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: zle wide wordchars
@ 2005-04-08 16:39 Clint Adams
  2005-04-08 16:56 ` Clint Adams
  0 siblings, 1 reply; 2+ messages in thread
From: Clint Adams @ 2005-04-08 16:39 UTC (permalink / raw)
  To: zsh-workers

Well, I'm committing this one.

M  Src/Zle/zle_main.c
M  Src/init.c
M  Src/params.c

* modified files

--- orig/Src/Zle/zle_main.c
+++ mod/Src/Zle/zle_main.c
@@ -101,6 +101,11 @@
 /**/
 mod_export int
 lastchar_wide_valid;
+
+/**/
+mod_export ZLE_STRING_T zle_wordchars;
+#else
+# define zle_wordchars wordchars;
 #endif
 
 /* the bindings for the previous and for this key */
@@ -1507,6 +1512,17 @@
 	kungetct = 0;
 }
 
+/**/
+mod_export void
+wordcharstrigger(void)
+{
+#ifdef ZLE_UNICODE_SUPPORT
+    zrealloc(zle_wordchars, strlen(wordchars)*MB_CUR_MAX);
+    mbsrtowcs(zle_wordchars, &wordchars, strlen(wordchars), NULL);
+    /* TODO: error handling here */
+#endif
+}
+
 /* Hook functions. Used to allow access to zle parameters if zle is
  * active. */
 
@@ -1572,6 +1588,7 @@
     kungetbuf = (char *) zalloc(kungetsz = 32);
     comprecursive = 0;
     rdstrs = NULL;
+    wordcharstriggerptr = wordcharstrigger;
 
     /* initialise the keymap system */
     init_keymaps();
@@ -1645,6 +1662,7 @@
     zlegetlineptr = NULL;
     zlereadptr = fallback_zleread;
     zlesetkeymapptr= noop_function_int;
+    wordcharstriggerptr = noop_function;
 
     getkeyptr = NULL;
 


--- orig/Src/init.c
+++ mod/Src/init.c
@@ -1152,6 +1152,9 @@
 #endif /* !LINKED_XMOD_zshQszle */
 
 /**/
+mod_export ZleVoidFn wordcharstriggerptr = noop_function;
+
+/**/
 unsigned char *
 autoload_zleread(char **lp, char **rp, int ha, int con)
 {


--- orig/Src/params.c
+++ mod/Src/params.c
@@ -3316,6 +3316,7 @@
     zsfree(wordchars);
     wordchars = x;
     inittyptab();
+    wordcharstriggerptr();
 }
 
 /* Function to get value for special parameter `_' */


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

* Re: PATCH: zle wide wordchars
  2005-04-08 16:39 PATCH: zle wide wordchars Clint Adams
@ 2005-04-08 16:56 ` Clint Adams
  0 siblings, 0 replies; 2+ messages in thread
From: Clint Adams @ 2005-04-08 16:56 UTC (permalink / raw)
  To: zsh-workers


This might help.

Index: Src/Zle/zle_main.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_main.c,v
retrieving revision 1.67
diff -u -r1.67 zle_main.c
--- Src/Zle/zle_main.c	8 Apr 2005 16:42:59 -0000	1.67
+++ Src/Zle/zle_main.c	8 Apr 2005 16:55:27 -0000
@@ -1589,6 +1589,7 @@
     comprecursive = 0;
     rdstrs = NULL;
     wordcharstriggerptr = wordcharstrigger;
+    wordcharstrigger();
 
     /* initialise the keymap system */
     init_keymaps();


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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-08 16:39 PATCH: zle wide wordchars Clint Adams
2005-04-08 16:56 ` Clint Adams

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