Skip to content

Commit 819edbe

Browse files
committed
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.
1 parent 50d4315 commit 819edbe

14 files changed

Lines changed: 124 additions & 124 deletions

File tree

src/edit.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ edit(
516516
*/
517517
if (curbuf->b_p_iminsert == B_IMODE_LMAP)
518518
State |= LANGMAP;
519-
#ifdef USE_IM_CONTROL
519+
#ifdef FEAT_MBYTE
520520
im_set_active(curbuf->b_p_iminsert == B_IMODE_IM);
521521
#endif
522522

@@ -8372,15 +8372,15 @@ ins_reg(void)
83728372
++no_u_sync;
83738373
if (regname == '=')
83748374
{
8375-
# ifdef USE_IM_CONTROL
8375+
# ifdef FEAT_MBYTE
83768376
int im_on = im_get_status();
83778377
# endif
83788378
/* Sync undo when evaluating the expression calls setline() or
83798379
* append(), so that it can be undone separately. */
83808380
u_sync_once = 2;
83818381

83828382
regname = get_expr_register();
8383-
# ifdef USE_IM_CONTROL
8383+
# ifdef FEAT_MBYTE
83848384
/* Restore the Input Method. */
83858385
if (im_on)
83868386
im_set_active(TRUE);
@@ -8509,12 +8509,12 @@ ins_ctrl_hat(void)
85098509
{
85108510
curbuf->b_p_iminsert = B_IMODE_LMAP;
85118511
State |= LANGMAP;
8512-
#ifdef USE_IM_CONTROL
8512+
#ifdef FEAT_MBYTE
85138513
im_set_active(FALSE);
85148514
#endif
85158515
}
85168516
}
8517-
#ifdef USE_IM_CONTROL
8517+
#ifdef FEAT_MBYTE
85188518
else
85198519
{
85208520
/* There are no ":lmap" mappings, toggle IM */
@@ -8661,7 +8661,7 @@ ins_esc(
86618661
}
86628662
}
86638663

8664-
#ifdef USE_IM_CONTROL
8664+
#ifdef FEAT_MBYTE
86658665
/* Disable IM to allow typing English directly for Normal mode commands.
86668666
* When ":lmap" is enabled don't change 'iminsert' (IM can be enabled as
86678667
* well). */

src/ex_getln.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -359,11 +359,11 @@ getcmdline(
359359
b_im_ptr = &curbuf->b_p_imsearch;
360360
if (*b_im_ptr == B_IMODE_LMAP)
361361
State |= LANGMAP;
362-
#ifdef USE_IM_CONTROL
362+
#ifdef FEAT_MBYTE
363363
im_set_active(*b_im_ptr == B_IMODE_IM);
364364
#endif
365365
}
366-
#ifdef USE_IM_CONTROL
366+
#ifdef FEAT_MBYTE
367367
else if (p_imcmdline)
368368
im_set_active(TRUE);
369369
#endif
@@ -1119,7 +1119,7 @@ getcmdline(
11191119
{
11201120
/* ":lmap" mappings exists, toggle use of mappings. */
11211121
State ^= LANGMAP;
1122-
#ifdef USE_IM_CONTROL
1122+
#ifdef FEAT_MBYTE
11231123
im_set_active(FALSE); /* Disable input method */
11241124
#endif
11251125
if (b_im_ptr != NULL)
@@ -1130,7 +1130,7 @@ getcmdline(
11301130
*b_im_ptr = B_IMODE_NONE;
11311131
}
11321132
}
1133-
#ifdef USE_IM_CONTROL
1133+
#ifdef FEAT_MBYTE
11341134
else
11351135
{
11361136
/* There are no ":lmap" mappings, toggle IM. When
@@ -2143,7 +2143,7 @@ getcmdline(
21432143
#endif
21442144

21452145
State = save_State;
2146-
#ifdef USE_IM_CONTROL
2146+
#ifdef FEAT_MBYTE
21472147
if (b_im_ptr != NULL && *b_im_ptr != B_IMODE_LMAP)
21482148
im_save_status(b_im_ptr);
21492149
im_set_active(FALSE);

src/getchar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2890,7 +2890,7 @@ vgetorpeek(int advance)
28902890
+ typebuf.tb_len] != NUL)
28912891
typebuf.tb_noremap[typebuf.tb_off
28922892
+ typebuf.tb_len++] = RM_YES;
2893-
#ifdef USE_IM_CONTROL
2893+
#ifdef FEAT_MBYTE
28942894
/* Get IM status right after getting keys, not after the
28952895
* timeout for a mapping (focus may be lost by then). */
28962896
vgetc_im_active = im_get_status();

src/globals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ EXTERN int stop_insert_mode; /* for ":stopinsert" and 'insertmode' */
10221022

10231023
EXTERN int KeyTyped; /* TRUE if user typed current char */
10241024
EXTERN int KeyStuffed; /* TRUE if current char from stuffbuf */
1025-
#ifdef USE_IM_CONTROL
1025+
#ifdef FEAT_MBYTE
10261026
EXTERN int vgetc_im_active; /* Input Method was active for last
10271027
character obtained from vgetc() */
10281028
#endif

src/gui.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ gui_update_cursor(
10781078
gui_undraw_cursor();
10791079
if (gui.row < 0)
10801080
return;
1081-
#ifdef USE_IM_CONTROL
1081+
#ifdef FEAT_MBYTE
10821082
if (gui.row != gui.cursor_row || gui.col != gui.cursor_col)
10831083
im_set_position(gui.row, gui.col);
10841084
#endif
@@ -1136,7 +1136,7 @@ gui_update_cursor(
11361136
if (id > 0)
11371137
{
11381138
cattr = syn_id2colors(id, &cfg, &cbg);
1139-
#if defined(USE_IM_CONTROL) || defined(FEAT_HANGULIN)
1139+
#if defined(FEAT_MBYTE) || defined(FEAT_HANGULIN)
11401140
{
11411141
static int iid;
11421142
guicolor_T fg, bg;

src/gui_mac.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,15 +2024,15 @@ gui_mac_handle_window_activate(
20242024
switch (eventKind)
20252025
{
20262026
case kEventWindowActivated:
2027-
#if defined(USE_IM_CONTROL)
2027+
# if defined(FEAT_MBYTE)
20282028
im_on_window_switch(TRUE);
2029-
#endif
2029+
# endif
20302030
return noErr;
20312031

20322032
case kEventWindowDeactivated:
2033-
#if defined(USE_IM_CONTROL)
2033+
# if defined(FEAT_MBYTE)
20342034
im_on_window_switch(FALSE);
2035-
#endif
2035+
# endif
20362036
return noErr;
20372037
}
20382038
}
@@ -6230,7 +6230,7 @@ char_u *FullPathFromFSSpec_save(FSSpec file)
62306230
#endif
62316231
}
62326232

6233-
#if (defined(USE_IM_CONTROL) || defined(PROTO)) && defined(USE_CARBONKEYHANDLER)
6233+
#if (defined(FEAT_MBYTE) || defined(PROTO)) && defined(USE_CARBONKEYHANDLER)
62346234
/*
62356235
* Input Method Control functions.
62366236
*/
@@ -6317,7 +6317,7 @@ im_set_active(int active)
63176317
ScriptLanguageRecord *slptr = NULL;
63186318
OSStatus err;
63196319

6320-
if (! gui.in_use)
6320+
if (!gui.in_use)
63216321
return;
63226322

63236323
if (im_initialized == 0)
@@ -6379,7 +6379,7 @@ im_get_status(void)
63796379
return im_is_active;
63806380
}
63816381

6382-
#endif /* defined(USE_IM_CONTROL) || defined(PROTO) */
6382+
#endif /* defined(FEAT_MBYTE) || defined(PROTO) */
63836383

63846384

63856385

src/gui_w32.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,12 +485,10 @@ static void TrackUserActivity(UINT uMsg);
485485
* These LOGFONT used for IME.
486486
*/
487487
#ifdef FEAT_MBYTE
488-
# ifdef USE_IM_CONTROL
489488
/* holds LOGFONT for 'guifontwide' if available, otherwise 'guifont' */
490489
static LOGFONT norm_logfont;
491490
/* holds LOGFONT for 'guifont' always. */
492491
static LOGFONT sub_logfont;
493-
# endif
494492
#endif
495493

496494
#ifdef FEAT_MBYTE_IME

0 commit comments

Comments
 (0)