patch 8.0.1338: USE_IM_CONTROL is confusing and incomplete
Problem: USE_IM_CONTROL is confusing and incomplete.
Solution: Just use FEAT_MBYTE. Call 'imactivatefunc' also without GUI.
diff --git a/src/edit.c b/src/edit.c
index 65c53f5..d960de3 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -516,7 +516,7 @@
*/
if (curbuf->b_p_iminsert == B_IMODE_LMAP)
State |= LANGMAP;
-#ifdef USE_IM_CONTROL
+#ifdef FEAT_MBYTE
im_set_active(curbuf->b_p_iminsert == B_IMODE_IM);
#endif
@@ -8372,7 +8372,7 @@
++no_u_sync;
if (regname == '=')
{
-# ifdef USE_IM_CONTROL
+# ifdef FEAT_MBYTE
int im_on = im_get_status();
# endif
/* Sync undo when evaluating the expression calls setline() or
@@ -8380,7 +8380,7 @@
u_sync_once = 2;
regname = get_expr_register();
-# ifdef USE_IM_CONTROL
+# ifdef FEAT_MBYTE
/* Restore the Input Method. */
if (im_on)
im_set_active(TRUE);
@@ -8509,12 +8509,12 @@
{
curbuf->b_p_iminsert = B_IMODE_LMAP;
State |= LANGMAP;
-#ifdef USE_IM_CONTROL
+#ifdef FEAT_MBYTE
im_set_active(FALSE);
#endif
}
}
-#ifdef USE_IM_CONTROL
+#ifdef FEAT_MBYTE
else
{
/* There are no ":lmap" mappings, toggle IM */
@@ -8661,7 +8661,7 @@
}
}
-#ifdef USE_IM_CONTROL
+#ifdef FEAT_MBYTE
/* Disable IM to allow typing English directly for Normal mode commands.
* When ":lmap" is enabled don't change 'iminsert' (IM can be enabled as
* well). */