diff src/mbyte.c @ 1668:0b796e045c42 v7.2b.000

updated for version 7.2b-000
author vimboss
date Sun, 13 Jul 2008 17:41:49 +0000
parents 630eca9496e0
children ec5ed41eea2f
line wrap: on
line diff
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -3454,6 +3454,7 @@ init_preedit_start_col(void)
 # if defined(HAVE_GTK2) && !defined(PROTO)
 
 static int im_is_active	       = FALSE;	/* IM is enabled for current mode    */
+static int preedit_is_active   = FALSE;
 static int im_preedit_cursor   = 0;	/* cursor offset in characters       */
 static int im_preedit_trailing = 0;	/* number of characters after cursor */
 
@@ -3686,7 +3687,9 @@ im_preedit_start_cb(GtkIMContext *contex
 #endif
 
     im_is_active = TRUE;
+    preedit_is_active = TRUE;
     gui_update_cursor(TRUE, FALSE);
+    im_show_info();
 }
 
 /*
@@ -3707,9 +3710,11 @@ im_preedit_end_cb(GtkIMContext *context,
 
 #if 0
     /* Removal of this line suggested by Takuhiro Nishioka.  Fixes that IM was
-     * switched off unintentionally. */
+     * switched off unintentionally.  We now use preedit_is_active (added by
+     * SungHyun Nam). */
     im_is_active = FALSE;
 #endif
+    preedit_is_active = FALSE;
     gui_update_cursor(TRUE, FALSE);
     im_show_info();
 }
@@ -5723,6 +5728,14 @@ im_get_status()
 
 # endif /* !HAVE_GTK2 */
 
+# if defined(HAVE_GTK2) || defined(PROTO)
+    int
+preedit_get_status(void)
+{
+    return preedit_is_active;
+}
+# endif
+
 # if defined(FEAT_GUI_GTK) || defined(PROTO)
     int
 im_is_preediting()