On Thu, Jul 3, 2008 at 1:24 PM, SungHyun Nam <[EMAIL PROTECTED]> wrote:
>
> mattn wrote:
> >
> > Yes, my solution is the fixing of above. CursorIM is getting status of
> > IM from "im_get_status()".
> > But vim should set status of preediting for CursorIM. My roughly patch
> > is fixing this.
>
> I am somewhat confused. Did you check my patch I sent out?
> I read your mail that your patch is same as my patch.
> http://permalink.gmane.org/gmane.editors.vim.devel/20376
>
> Or could you include your patch? At least, people including me can
> verify it works fine for them.
>
> Regards,
> namsh
>
> >
>
Ah, it's similar. sorry i didn't see your patch. X-(
And my patch include other fix.
vim should be disconnect handler of preediting signal.
Some IM which i tried was crash with typing <ESC>.
Thanks.
--
- Yasuhiro Matsumoto
Index: gui.c
===================================================================
--- gui.c (revision 1092)
+++ gui.c (working copy)
@@ -958,7 +958,13 @@
static int iid;
guicolor_T fg, bg;
- if (im_get_status())
+ if (
+#ifdef HAVE_GTK2
+ im_is_preediting()
+#else
+ im_get_status()
+#endif
+ )
{
iid = syn_name2id((char_u *)"CursorIM");
if (iid > 0)
Index: mbyte.c
===================================================================
--- mbyte.c (revision 1092)
+++ mbyte.c (working copy)
@@ -3458,6 +3458,9 @@
static int im_preedit_trailing = 0; /* number of characters after cursor */
static unsigned long im_commit_handler_id = 0;
+static unsigned long im_changed_handler_id = 0;
+static unsigned long im_start_handler_id = 0;
+static unsigned long im_end_handler_id = 0;
static unsigned int im_activatekey_keyval = GDK_VoidSymbol;
static unsigned int im_activatekey_state = 0;
@@ -3942,17 +3945,20 @@
g_return_if_fail(gui.drawarea != NULL);
g_return_if_fail(gui.drawarea->window != NULL);
- xic = gtk_im_multicontext_new();
- g_object_ref(xic);
+ if (!xic)
+ {
+ xic = gtk_im_multicontext_new();
+ g_object_ref(xic);
- im_commit_handler_id = g_signal_connect(G_OBJECT(xic), "commit",
- G_CALLBACK(&im_commit_cb), NULL);
- g_signal_connect(G_OBJECT(xic), "preedit_changed",
- G_CALLBACK(&im_preedit_changed_cb), NULL);
- g_signal_connect(G_OBJECT(xic), "preedit_start",
- G_CALLBACK(&im_preedit_start_cb), NULL);
- g_signal_connect(G_OBJECT(xic), "preedit_end",
- G_CALLBACK(&im_preedit_end_cb), NULL);
+ im_commit_handler_id = g_signal_connect(G_OBJECT(xic), "commit",
+ G_CALLBACK(&im_commit_cb), NULL);
+ im_changed_handler_id = g_signal_connect(G_OBJECT(xic),
"preedit_changed",
+ G_CALLBACK(&im_preedit_changed_cb), NULL);
+ im_start_handler_id = g_signal_connect(G_OBJECT(xic), "preedit_start",
+ G_CALLBACK(&im_preedit_start_cb), NULL);
+ im_end_handler_id = g_signal_connect(G_OBJECT(xic), "preedit_end",
+ G_CALLBACK(&im_preedit_end_cb), NULL);
+ }
gtk_im_context_set_client_window(xic, gui.drawarea->window);
}
@@ -3966,12 +3972,19 @@
if (xic != NULL)
{
+ if (im_commit_handler_id) g_signal_handler_disconnect(G_OBJECT(xic),
im_commit_handler_id);
+ if (im_changed_handler_id)
g_signal_handler_disconnect(G_OBJECT(xic), im_changed_handler_id);
+ if (im_start_handler_id) g_signal_handler_disconnect(G_OBJECT(xic),
im_start_handler_id);
+ if (im_end_handler_id) g_signal_handler_disconnect(G_OBJECT(xic),
im_end_handler_id);
gtk_im_context_focus_out(xic);
g_object_unref(xic);
xic = NULL;
}
im_is_active = FALSE;
im_commit_handler_id = 0;
+ im_changed_handler_id = 0;
+ im_start_handler_id = 0;
+ im_end_handler_id = 0;
preedit_start_col = MAXCOL;
xim_has_preediting = FALSE;
}
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---