mirror of
https://github.com/neovim/neovim.git
synced 2025-09-20 02:08:17 +00:00
Remove code defined under USE_IM_CONTROL #ifdefs
This is not being used and should not be part of the core anyway.
This commit is contained in:
@@ -578,12 +578,7 @@ struct file_buffer {
|
||||
#define B_IMODE_USE_INSERT -1 /* Use b_p_iminsert value for search */
|
||||
#define B_IMODE_NONE 0 /* Input via none */
|
||||
#define B_IMODE_LMAP 1 /* Input via langmap */
|
||||
#ifndef USE_IM_CONTROL
|
||||
# define B_IMODE_LAST 1
|
||||
#else
|
||||
# define B_IMODE_IM 2 /* Input via input method */
|
||||
# define B_IMODE_LAST 2
|
||||
#endif
|
||||
|
||||
short b_kmap_state; /* using "lmap" mappings */
|
||||
# define KEYMAP_INIT 1 /* 'keymap' was set, call keymap_init() */
|
||||
|
@@ -391,9 +391,6 @@ edit (
|
||||
*/
|
||||
if (curbuf->b_p_iminsert == B_IMODE_LMAP)
|
||||
State |= LANGMAP;
|
||||
#ifdef USE_IM_CONTROL
|
||||
im_set_active(curbuf->b_p_iminsert == B_IMODE_IM);
|
||||
#endif
|
||||
|
||||
setmouse();
|
||||
clear_showcmd();
|
||||
@@ -6758,19 +6755,11 @@ static void ins_reg(void)
|
||||
* message for it. Only call it explicitly. */
|
||||
++no_u_sync;
|
||||
if (regname == '=') {
|
||||
# ifdef USE_IM_CONTROL
|
||||
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
|
||||
/* Restore the Input Method. */
|
||||
if (im_on)
|
||||
im_set_active(TRUE);
|
||||
# endif
|
||||
}
|
||||
if (regname == NUL || !valid_yank_reg(regname, FALSE)) {
|
||||
vim_beep();
|
||||
@@ -6867,24 +6856,8 @@ static void ins_ctrl_hat(void)
|
||||
} else {
|
||||
curbuf->b_p_iminsert = B_IMODE_LMAP;
|
||||
State |= LANGMAP;
|
||||
#ifdef USE_IM_CONTROL
|
||||
im_set_active(FALSE);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef USE_IM_CONTROL
|
||||
else {
|
||||
/* There are no ":lmap" mappings, toggle IM */
|
||||
if (im_get_status()) {
|
||||
curbuf->b_p_iminsert = B_IMODE_NONE;
|
||||
im_set_active(FALSE);
|
||||
} else {
|
||||
curbuf->b_p_iminsert = B_IMODE_IM;
|
||||
State &= ~LANGMAP;
|
||||
im_set_active(TRUE);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
set_iminsert_global();
|
||||
showmode();
|
||||
/* Show/unshow value of 'keymap' in status lines. */
|
||||
@@ -6984,14 +6957,6 @@ ins_esc (
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef USE_IM_CONTROL
|
||||
/* 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). */
|
||||
if (!(State & LANGMAP))
|
||||
im_save_status(&curbuf->b_p_iminsert);
|
||||
im_set_active(FALSE);
|
||||
#endif
|
||||
|
||||
State = NORMAL;
|
||||
/* need to position cursor again (e.g. when on a TAB ) */
|
||||
|
@@ -265,14 +265,7 @@ getcmdline (
|
||||
b_im_ptr = &curbuf->b_p_imsearch;
|
||||
if (*b_im_ptr == B_IMODE_LMAP)
|
||||
State |= LANGMAP;
|
||||
#ifdef USE_IM_CONTROL
|
||||
im_set_active(*b_im_ptr == B_IMODE_IM);
|
||||
#endif
|
||||
}
|
||||
#ifdef USE_IM_CONTROL
|
||||
else if (p_imcmdline)
|
||||
im_set_active(TRUE);
|
||||
#endif
|
||||
|
||||
setmouse();
|
||||
ui_cursor_shape(); /* may show different cursor shape */
|
||||
@@ -867,9 +860,6 @@ getcmdline (
|
||||
if (map_to_exists_mode((char_u *)"", LANGMAP, FALSE)) {
|
||||
/* ":lmap" mappings exists, toggle use of mappings. */
|
||||
State ^= LANGMAP;
|
||||
#ifdef USE_IM_CONTROL
|
||||
im_set_active(FALSE); /* Disable input method */
|
||||
#endif
|
||||
if (b_im_ptr != NULL) {
|
||||
if (State & LANGMAP)
|
||||
*b_im_ptr = B_IMODE_LMAP;
|
||||
@@ -877,23 +867,6 @@ getcmdline (
|
||||
*b_im_ptr = B_IMODE_NONE;
|
||||
}
|
||||
}
|
||||
#ifdef USE_IM_CONTROL
|
||||
else {
|
||||
/* There are no ":lmap" mappings, toggle IM. When
|
||||
* 'imdisable' is set don't try getting the status, it's
|
||||
* always off. */
|
||||
if ((p_imdisable && b_im_ptr != NULL)
|
||||
? *b_im_ptr == B_IMODE_IM : im_get_status()) {
|
||||
im_set_active(FALSE); /* Disable input method */
|
||||
if (b_im_ptr != NULL)
|
||||
*b_im_ptr = B_IMODE_NONE;
|
||||
} else {
|
||||
im_set_active(TRUE); /* Enable input method */
|
||||
if (b_im_ptr != NULL)
|
||||
*b_im_ptr = B_IMODE_IM;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (b_im_ptr != NULL) {
|
||||
if (b_im_ptr == &curbuf->b_p_iminsert)
|
||||
set_iminsert_global();
|
||||
@@ -1542,11 +1515,6 @@ returncmd:
|
||||
need_wait_return = FALSE;
|
||||
|
||||
State = save_State;
|
||||
#ifdef USE_IM_CONTROL
|
||||
if (b_im_ptr != NULL && *b_im_ptr != B_IMODE_LMAP)
|
||||
im_save_status(b_im_ptr);
|
||||
im_set_active(FALSE);
|
||||
#endif
|
||||
setmouse();
|
||||
ui_cursor_shape(); /* may show different cursor shape */
|
||||
|
||||
|
@@ -2349,11 +2349,6 @@ static int vgetorpeek(int advance)
|
||||
+ typebuf.tb_len] != NUL)
|
||||
typebuf.tb_noremap[typebuf.tb_off
|
||||
+ typebuf.tb_len++] = RM_YES;
|
||||
#ifdef USE_IM_CONTROL
|
||||
/* 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();
|
||||
#endif
|
||||
}
|
||||
} /* for (;;) */
|
||||
} /* if (!character from stuffbuf) */
|
||||
|
@@ -897,10 +897,6 @@ 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
|
||||
EXTERN int vgetc_im_active; /* Input Method was active for last
|
||||
character obtained from vgetc() */
|
||||
#endif
|
||||
EXTERN int maptick INIT(= 0); /* tick for each non-mapped char */
|
||||
|
||||
EXTERN char_u chartab[256]; /* table used in charset.c; See
|
||||
|
@@ -717,9 +717,6 @@ getcount:
|
||||
bool lit = false; /* get extra character literally */
|
||||
bool langmap_active = false; /* using :lmap mappings */
|
||||
int lang; /* getting a text character */
|
||||
#ifdef USE_IM_CONTROL
|
||||
bool save_smd; /* saved value of p_smd */
|
||||
#endif
|
||||
|
||||
++no_mapping;
|
||||
++allow_keys; /* no mapping for nchar, but allow key codes */
|
||||
@@ -768,12 +765,6 @@ getcount:
|
||||
State = LANGMAP;
|
||||
langmap_active = true;
|
||||
}
|
||||
#ifdef USE_IM_CONTROL
|
||||
save_smd = p_smd;
|
||||
p_smd = false; /* Don't let the IM code show the mode here */
|
||||
if (lang && curbuf->b_p_iminsert == B_IMODE_IM)
|
||||
im_set_active(true);
|
||||
#endif
|
||||
|
||||
*cp = plain_vgetc();
|
||||
|
||||
@@ -783,14 +774,6 @@ getcount:
|
||||
++allow_keys;
|
||||
State = NORMAL_BUSY;
|
||||
}
|
||||
#ifdef USE_IM_CONTROL
|
||||
if (lang) {
|
||||
if (curbuf->b_p_iminsert != B_IMODE_LMAP)
|
||||
im_save_status(&curbuf->b_p_iminsert);
|
||||
im_set_active(false);
|
||||
}
|
||||
p_smd = save_smd;
|
||||
#endif
|
||||
State = NORMAL_BUSY;
|
||||
need_flushbuf |= add_to_showcmd(*cp);
|
||||
|
||||
|
@@ -912,18 +912,10 @@ static struct vimoption
|
||||
(char_u *)NULL, PV_NONE,
|
||||
{(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
|
||||
{"imcmdline", "imc", P_BOOL|P_VI_DEF,
|
||||
#ifdef USE_IM_CONTROL
|
||||
(char_u *)&p_imcmdline, PV_NONE,
|
||||
#else
|
||||
(char_u *)NULL, PV_NONE,
|
||||
#endif
|
||||
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"imdisable", "imd", P_BOOL|P_VI_DEF,
|
||||
#ifdef USE_IM_CONTROL
|
||||
(char_u *)&p_imdisable, PV_NONE,
|
||||
#else
|
||||
(char_u *)NULL, PV_NONE,
|
||||
#endif
|
||||
{(char_u *)FALSE, (char_u *)0L}
|
||||
SCRIPTID_INIT},
|
||||
{"iminsert", "imi", P_NUM|P_VI_DEF,
|
||||
@@ -5134,18 +5126,6 @@ set_bool_option (
|
||||
foldUpdateAll(curwin);
|
||||
}
|
||||
|
||||
#ifdef USE_IM_CONTROL
|
||||
/* 'imdisable' */
|
||||
else if ((int *)varp == &p_imdisable) {
|
||||
/* Only de-activate it here, it will be enabled when changing mode. */
|
||||
if (p_imdisable)
|
||||
im_set_active(FALSE);
|
||||
else if (State & INSERT)
|
||||
/* When the option is set from an autocommand, it may need to take
|
||||
* effect right away. */
|
||||
im_set_active(curbuf->b_p_iminsert == B_IMODE_IM);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* 'spell' */
|
||||
else if ((int *)varp == &curwin->w_p_spell) {
|
||||
|
@@ -416,10 +416,6 @@ EXTERN int p_arshape; /* 'arabicshape' */
|
||||
EXTERN int p_icon; /* 'icon' */
|
||||
EXTERN char_u *p_iconstring; /* 'iconstring' */
|
||||
EXTERN int p_ic; /* 'ignorecase' */
|
||||
#ifdef USE_IM_CONTROL
|
||||
EXTERN int p_imcmdline; /* 'imcmdline' */
|
||||
EXTERN int p_imdisable; /* 'imdisable' */
|
||||
#endif
|
||||
EXTERN int p_is; /* 'incsearch' */
|
||||
EXTERN int p_im; /* 'insertmode' */
|
||||
EXTERN char_u *p_isf; /* 'isfname' */
|
||||
|
@@ -125,29 +125,3 @@ int check_row(int row)
|
||||
return (int)screen_Rows - 1;
|
||||
return row;
|
||||
}
|
||||
|
||||
|
||||
#if defined(USE_IM_CONTROL) || defined(PROTO)
|
||||
/*
|
||||
* Save current Input Method status to specified place.
|
||||
*/
|
||||
void im_save_status(long *psave)
|
||||
{
|
||||
/* Don't save when 'imdisable' is set or "xic" is NULL, IM is always
|
||||
* disabled then (but might start later).
|
||||
* Also don't save when inside a mapping, vgetc_im_active has not been set
|
||||
* then.
|
||||
* And don't save when the keys were stuffed (e.g., for a "." command).
|
||||
* And don't save when the GUI is running but our window doesn't have
|
||||
* input focus (e.g., when a find dialog is open). */
|
||||
if (!p_imdisable && KeyTyped && !KeyStuffed
|
||||
) {
|
||||
/* Do save when IM is on, or IM is off and saved status is on. */
|
||||
if (vgetc_im_active)
|
||||
*psave = B_IMODE_IM;
|
||||
else if (*psave == B_IMODE_IM)
|
||||
*psave = B_IMODE_NONE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user