summaryrefslogtreecommitdiffstats
path: root/src/gui_xim.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-05-07 20:01:16 +0100
committerBram Moolenaar <Bram@vim.org>2022-05-07 20:01:16 +0100
commit249591057b4840785c50e41dd850efb8a8faf435 (patch)
treee9ba171529cf753e7aab0ec9adf5be3fedc17d00 /src/gui_xim.c
parent9ff7d717aa3176de5c61de340deb93f41c7780fc (diff)
patch 8.2.4911: the mode #defines are not clearly namedv8.2.4911
Problem: The mode #defines are not clearly named. Solution: Prepend MODE_. Renumber them to put the mapped modes first.
Diffstat (limited to 'src/gui_xim.c')
-rw-r--r--src/gui_xim.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/gui_xim.c b/src/gui_xim.c
index 1dfb1056da..9f3181e769 100644
--- a/src/gui_xim.c
+++ b/src/gui_xim.c
@@ -156,7 +156,7 @@ static int xim_has_preediting INIT(= FALSE); // IM current status
static void
init_preedit_start_col(void)
{
- if (State & CMDLINE)
+ if (State & MODE_CMDLINE)
preedit_start_col = cmdline_getvcol_cursor();
else if (curwin != NULL && curwin->w_buffer != NULL)
getvcol(curwin, &curwin->w_cursor, &preedit_start_col, NULL, NULL);
@@ -420,7 +420,7 @@ im_delete_preedit(void)
return;
}
- if (State & NORMAL
+ if (State & MODE_NORMAL
#ifdef FEAT_TERMINAL
&& !term_use_loop()
#endif
@@ -446,10 +446,10 @@ im_correct_cursor(int num_move_back)
{
char_u backkey[] = {CSI, 'k', 'l'};
- if (State & NORMAL)
+ if (State & MODE_NORMAL)
return;
# ifdef FEAT_RIGHTLEFT
- if ((State & CMDLINE) == 0 && curwin != NULL && curwin->w_p_rl)
+ if ((State & MODE_CMDLINE) == 0 && curwin != NULL && curwin->w_p_rl)
backkey[2] = 'r';
# endif
for (; num_move_back > 0; --num_move_back)
@@ -471,7 +471,7 @@ im_show_info(void)
vgetc_busy = TRUE;
showmode();
vgetc_busy = old_vgetc_busy;
- if ((State & NORMAL) || (State & INSERT))
+ if ((State & MODE_NORMAL) || (State & MODE_INSERT))
setcursor();
out_flush();
}
@@ -1078,7 +1078,8 @@ xim_queue_key_press_event(GdkEventKey *event, int down)
// gtk_im_context_filter_keypress() in Normal mode.
// And while doing :sh too.
if (xic != NULL && !p_imdisable
- && (State & (INSERT | CMDLINE | NORMAL | EXTERNCMD)) != 0)
+ && (State & (MODE_INSERT | MODE_CMDLINE
+ | MODE_NORMAL | MODE_EXTERNCMD)))
{
// Filter 'imactivatekey' and map it to CTRL-^. This way, Vim is
// always aware of the current status of IM, and can even emulate
@@ -1102,21 +1103,21 @@ xim_queue_key_press_event(GdkEventKey *event, int down)
if (event->type != GDK_KEY_PRESS)
return TRUE;
- if (map_to_exists_mode((char_u *)"", LANGMAP, FALSE))
+ if (map_to_exists_mode((char_u *)"", MODE_LANGMAP, FALSE))
{
im_set_active(FALSE);
// ":lmap" mappings exists, toggle use of mappings.
- State ^= LANGMAP;
- if (State & LANGMAP)
+ State ^= MODE_LANGMAP;
+ if (State & MODE_LANGMAP)
{
curbuf->b_p_iminsert = B_IMODE_NONE;
- State &= ~LANGMAP;
+ State &= ~MODE_LANGMAP;
}
else
{
curbuf->b_p_iminsert = B_IMODE_LMAP;
- State |= LANGMAP;
+ State |= MODE_LANGMAP;
}
return TRUE;
}