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.
diff --git a/src/terminal.c b/src/terminal.c
index 6cac1a8..a33a3a3 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -1267,7 +1267,7 @@
// cleared.
// TODO: only update once in a while.
ch_log(term->tl_job->jv_channel, "updating screen");
- if (buffer == curbuf && (State & CMDLINE) == 0)
+ if (buffer == curbuf && (State & MODE_CMDLINE) == 0)
{
update_screen(VALID_NO_UPDATE);
// update_screen() can be slow, check the terminal wasn't closed
@@ -2129,7 +2129,7 @@
int modify_other_keys = curbuf->b_term->tl_vterm == NULL ? FALSE
: vterm_is_modify_other_keys(curbuf->b_term->tl_vterm);
- State = TERMINAL;
+ State = MODE_TERMINAL;
got_int = FALSE;
#ifdef MSWIN
ctrl_break_was_pressed = FALSE;
@@ -2508,7 +2508,7 @@
if (term_use_loop_check(TRUE))
{
reset_VIsual_and_resel();
- if (State & INSERT)
+ if (State & MODE_INSERT)
stop_insert_mode = TRUE;
}
mouse_was_outside = FALSE;