Permalink
Browse files

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.
  • Loading branch information...
brammool committed Nov 25, 2017
1 parent 50d4315 commit 819edbe078c8579f3620d12dac830f12ccdc5a45
Showing with 124 additions and 124 deletions.
  1. +6 −6 src/edit.c
  2. +5 −5 src/ex_getln.c
  3. +1 −1 src/getchar.c
  4. +1 −1 src/globals.h
  5. +2 −2 src/gui.c
  6. +7 −7 src/gui_mac.c
  7. +0 −2 src/gui_w32.c
  8. +89 −82 src/mbyte.c
  9. +3 −3 src/normal.c
  10. +5 −5 src/option.c
  11. +2 −2 src/option.h
  12. +1 −1 src/ui.c
  13. +2 −0 src/version.c
  14. +0 −7 src/vim.h
View
@@ -516,7 +516,7 @@ edit(
*/
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,15 +8372,15 @@ ins_reg(void)
++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
* append(), so that it can be undone separately. */
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 @@ ins_ctrl_hat(void)
{
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 @@ ins_esc(
}
}
#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). */
View
@@ -359,11 +359,11 @@ getcmdline(
b_im_ptr = &curbuf->b_p_imsearch;
if (*b_im_ptr == B_IMODE_LMAP)
State |= LANGMAP;
#ifdef USE_IM_CONTROL
#ifdef FEAT_MBYTE
im_set_active(*b_im_ptr == B_IMODE_IM);
#endif
}
#ifdef USE_IM_CONTROL
#ifdef FEAT_MBYTE
else if (p_imcmdline)
im_set_active(TRUE);
#endif
@@ -1119,7 +1119,7 @@ getcmdline(
{
/* ":lmap" mappings exists, toggle use of mappings. */
State ^= LANGMAP;
#ifdef USE_IM_CONTROL
#ifdef FEAT_MBYTE
im_set_active(FALSE); /* Disable input method */
#endif
if (b_im_ptr != NULL)
@@ -1130,7 +1130,7 @@ getcmdline(
*b_im_ptr = B_IMODE_NONE;
}
}
#ifdef USE_IM_CONTROL
#ifdef FEAT_MBYTE
else
{
/* There are no ":lmap" mappings, toggle IM. When
@@ -2143,7 +2143,7 @@ getcmdline(
#endif
State = save_State;
#ifdef USE_IM_CONTROL
#ifdef FEAT_MBYTE
if (b_im_ptr != NULL && *b_im_ptr != B_IMODE_LMAP)
im_save_status(b_im_ptr);
im_set_active(FALSE);
View
@@ -2890,7 +2890,7 @@ vgetorpeek(int advance)
+ typebuf.tb_len] != NUL)
typebuf.tb_noremap[typebuf.tb_off
+ typebuf.tb_len++] = RM_YES;
#ifdef USE_IM_CONTROL
#ifdef FEAT_MBYTE
/* Get IM status right after getting keys, not after the
* timeout for a mapping (focus may be lost by then). */
vgetc_im_active = im_get_status();
View
@@ -1022,7 +1022,7 @@ EXTERN int stop_insert_mode; /* for ":stopinsert" and 'insertmode' */
EXTERN int KeyTyped; /* TRUE if user typed current char */
EXTERN int KeyStuffed; /* TRUE if current char from stuffbuf */
#ifdef USE_IM_CONTROL
#ifdef FEAT_MBYTE
EXTERN int vgetc_im_active; /* Input Method was active for last
character obtained from vgetc() */
#endif
View
@@ -1078,7 +1078,7 @@ gui_update_cursor(
gui_undraw_cursor();
if (gui.row < 0)
return;
#ifdef USE_IM_CONTROL
#ifdef FEAT_MBYTE
if (gui.row != gui.cursor_row || gui.col != gui.cursor_col)
im_set_position(gui.row, gui.col);
#endif
@@ -1136,7 +1136,7 @@ gui_update_cursor(
if (id > 0)
{
cattr = syn_id2colors(id, &cfg, &cbg);
#if defined(USE_IM_CONTROL) || defined(FEAT_HANGULIN)
#if defined(FEAT_MBYTE) || defined(FEAT_HANGULIN)
{
static int iid;
guicolor_T fg, bg;
View
@@ -2024,15 +2024,15 @@ gui_mac_handle_window_activate(
switch (eventKind)
{
case kEventWindowActivated:
#if defined(USE_IM_CONTROL)
# if defined(FEAT_MBYTE)
im_on_window_switch(TRUE);
#endif
# endif
return noErr;
case kEventWindowDeactivated:
#if defined(USE_IM_CONTROL)
# if defined(FEAT_MBYTE)
im_on_window_switch(FALSE);
#endif
# endif
return noErr;
}
}
@@ -6230,7 +6230,7 @@ char_u *FullPathFromFSSpec_save(FSSpec file)
#endif
}
#if (defined(USE_IM_CONTROL) || defined(PROTO)) && defined(USE_CARBONKEYHANDLER)
#if (defined(FEAT_MBYTE) || defined(PROTO)) && defined(USE_CARBONKEYHANDLER)
/*
* Input Method Control functions.
*/
@@ -6317,7 +6317,7 @@ im_set_active(int active)
ScriptLanguageRecord *slptr = NULL;
OSStatus err;
if (! gui.in_use)
if (!gui.in_use)
return;
if (im_initialized == 0)
@@ -6379,7 +6379,7 @@ im_get_status(void)
return im_is_active;
}
#endif /* defined(USE_IM_CONTROL) || defined(PROTO) */
#endif /* defined(FEAT_MBYTE) || defined(PROTO) */
View
@@ -485,12 +485,10 @@ static void TrackUserActivity(UINT uMsg);
* These LOGFONT used for IME.
*/
#ifdef FEAT_MBYTE
# ifdef USE_IM_CONTROL
/* holds LOGFONT for 'guifontwide' if available, otherwise 'guifont' */
static LOGFONT norm_logfont;
/* holds LOGFONT for 'guifont' always. */
static LOGFONT sub_logfont;
# endif
#endif
#ifdef FEAT_MBYTE_IME
Oops, something went wrong.

0 comments on commit 819edbe

Please sign in to comment.