forked from aniani/vim
patch 8.2.4911: the mode #defines are not clearly named
Problem: The mode #defines are not clearly named. Solution: Prepend MODE_. Renumber them to put the mapped modes first.
This commit is contained in:
17
src/menu.c
17
src/menu.c
@@ -1754,9 +1754,9 @@ get_menu_index(vimmenu_T *menu, int state)
|
||||
{
|
||||
int idx;
|
||||
|
||||
if ((state & INSERT))
|
||||
if ((state & MODE_INSERT))
|
||||
idx = MENU_INDEX_INSERT;
|
||||
else if (state & CMDLINE)
|
||||
else if (state & MODE_CMDLINE)
|
||||
idx = MENU_INDEX_CMDLINE;
|
||||
#ifdef FEAT_TERMINAL
|
||||
else if (term_use_loop())
|
||||
@@ -1769,11 +1769,11 @@ get_menu_index(vimmenu_T *menu, int state)
|
||||
else
|
||||
idx = MENU_INDEX_VISUAL;
|
||||
}
|
||||
else if (state == HITRETURN || state == ASKMORE)
|
||||
else if (state == MODE_HITRETURN || state == MODE_ASKMORE)
|
||||
idx = MENU_INDEX_CMDLINE;
|
||||
else if (finish_op)
|
||||
idx = MENU_INDEX_OP_PENDING;
|
||||
else if ((state & NORMAL))
|
||||
else if ((state & MODE_NORMAL))
|
||||
idx = MENU_INDEX_NORMAL;
|
||||
else
|
||||
idx = MENU_INDEX_INVALID;
|
||||
@@ -1929,15 +1929,16 @@ get_menu_mode(void)
|
||||
return MENU_INDEX_SELECT;
|
||||
return MENU_INDEX_VISUAL;
|
||||
}
|
||||
if (State & INSERT)
|
||||
if (State & MODE_INSERT)
|
||||
return MENU_INDEX_INSERT;
|
||||
if ((State & CMDLINE) || State == ASKMORE || State == HITRETURN)
|
||||
if ((State & MODE_CMDLINE) || State == MODE_ASKMORE
|
||||
|| State == MODE_HITRETURN)
|
||||
return MENU_INDEX_CMDLINE;
|
||||
if (finish_op)
|
||||
return MENU_INDEX_OP_PENDING;
|
||||
if (State & NORMAL)
|
||||
if (State & MODE_NORMAL)
|
||||
return MENU_INDEX_NORMAL;
|
||||
if (State & LANGMAP) // must be a "r" command, like Insert mode
|
||||
if (State & MODE_LANGMAP) // must be a "r" command, like Insert mode
|
||||
return MENU_INDEX_INSERT;
|
||||
return MENU_INDEX_INVALID;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user