changeset 29732:89e1d67814a9 v9.0.0206

patch 9.0.0206: redraw flags are not named specifically Commit: https://github.com/vim/vim/commit/a4d158b3c839e96ed98ff87c7b7124ff4518c4ff Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 14 14:17:45 2022 +0100 patch 9.0.0206: redraw flags are not named specifically Problem: Redraw flags are not named specifically. Solution: Prefix "UPD_" to the flags, for UPDate_screen().
author Bram Moolenaar <Bram@vim.org>
date Sun, 14 Aug 2022 15:30:05 +0200
parents df7f360215b7
children 59a263545b0c
files src/buffer.c src/change.c src/channel.c src/clipboard.c src/cmdexpand.c src/debugger.c src/diff.c src/digraph.c src/drawscreen.c src/edit.c src/evalvars.c src/ex_cmds.c src/ex_docmd.c src/ex_getln.c src/fileio.c src/fold.c src/getchar.c src/gui.c src/gui_haiku.cc src/highlight.c src/if_lua.c src/if_mzsch.c src/if_perl.xs src/if_py_both.h src/if_ruby.c src/if_tcl.c src/indent.c src/main.c src/match.c src/memline.c src/menu.c src/message.c src/misc1.c src/misc2.c src/mouse.c src/move.c src/netbeans.c src/normal.c src/ops.c src/option.c src/optionstr.c src/os_unix.c src/os_win32.c src/popupmenu.c src/popupwin.c src/quickfix.c src/register.c src/screen.c src/search.c src/sign.c src/spell.c src/spellfile.c src/structs.h src/syntax.c src/tag.c src/term.c src/terminal.c src/textformat.c src/textobject.c src/textprop.c src/undo.c src/version.c src/vim.h src/window.c
diffstat 64 files changed, 382 insertions(+), 378 deletions(-) [+]
line wrap: on
line diff
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1924,7 +1924,7 @@ enter_buffer(buf_T *buf)
     curbuf->b_last_used = vim_time();
 #endif
 
-    redraw_later(NOT_VALID);
+    redraw_later(UPD_NOT_VALID);
 }
 
 #if defined(FEAT_AUTOCHDIR) || defined(PROTO)
--- a/src/change.c
+++ b/src/change.c
@@ -559,8 +559,8 @@ changed_common(
 	    linenr_T last = lnume + xtra - 1;  // last line after the change
 #endif
 	    // Mark this window to be redrawn later.
-	    if (wp->w_redr_type < VALID)
-		wp->w_redr_type = VALID;
+	    if (wp->w_redr_type < UPD_VALID)
+		wp->w_redr_type = UPD_VALID;
 
 	    // Check if a change in the buffer has invalidated the cached
 	    // values for the cursor.
@@ -648,18 +648,18 @@ changed_common(
 	    if (wp->w_p_rnu && xtra != 0)
 	    {
 		wp->w_last_cursor_lnum_rnu = 0;
-		redraw_win_later(wp, VALID);
+		redraw_win_later(wp, UPD_VALID);
 	    }
 #ifdef FEAT_SYN_HL
 	    // Cursor line highlighting probably need to be updated with
-	    // "VALID" if it's below the change.
+	    // "UPD_VALID" if it's below the change.
 	    // If the cursor line is inside the change we need to redraw more.
 	    if (wp->w_p_cul)
 	    {
 		if (xtra == 0)
-		    redraw_win_later(wp, VALID);
+		    redraw_win_later(wp, UPD_VALID);
 		else if (lnum <= wp->w_last_cursorline)
-		    redraw_win_later(wp, SOME_VALID);
+		    redraw_win_later(wp, UPD_SOME_VALID);
 	    }
 #endif
 	}
@@ -671,8 +671,8 @@ changed_common(
 
     // Call update_screen() later, which checks out what needs to be redrawn,
     // since it notices b_mod_set and then uses b_mod_*.
-    if (must_redraw < VALID)
-	must_redraw = VALID;
+    if (must_redraw < UPD_VALID)
+	must_redraw = UPD_VALID;
 
     // when the cursor line is changed always trigger CursorMoved
     if (lnum <= curwin->w_cursor.lnum
@@ -724,7 +724,7 @@ changed_bytes(linenr_T lnum, colnr_T col
 	FOR_ALL_WINDOWS(wp)
 	    if (wp->w_p_diff && wp != curwin)
 	    {
-		redraw_win_later(wp, VALID);
+		redraw_win_later(wp, UPD_VALID);
 		wlnum = diff_lnum_win(lnum, wp);
 		if (wlnum > 0)
 		    changedOneline(wp->w_buffer, wlnum);
@@ -869,7 +869,7 @@ changed_lines(
 	FOR_ALL_WINDOWS(wp)
 	    if (wp->w_p_diff && wp != curwin)
 	    {
-		redraw_win_later(wp, VALID);
+		redraw_win_later(wp, UPD_VALID);
 		wlnum = diff_lnum_win(lnum, wp);
 		if (wlnum > 0)
 		    changed_lines_buf(wp->w_buffer, wlnum,
--- a/src/channel.c
+++ b/src/channel.c
@@ -2930,7 +2930,7 @@ append_to_buffer(buf_T *buffer, char_u *
 		}
 	    }
 	}
-	redraw_buf_and_status_later(buffer, VALID);
+	redraw_buf_and_status_later(buffer, UPD_VALID);
 	channel_need_redraw = TRUE;
     }
 
--- a/src/clipboard.c
+++ b/src/clipboard.c
@@ -147,7 +147,7 @@ clip_own_selection(Clipboard_T *cbd)
 		    && (cbd == &clip_star ? clip_isautosel_star()
 						      : clip_isautosel_plus())
 		    && HL_ATTR(HLF_V) != HL_ATTR(HLF_VNC))
-		redraw_curbuf_later(INVERTED_ALL);
+		redraw_curbuf_later(UPD_INVERTED_ALL);
 	}
     }
 #else
@@ -202,7 +202,7 @@ clip_lose_selection(Clipboard_T *cbd)
 		&& HL_ATTR(HLF_V) != HL_ATTR(HLF_VNC)
 		&& !exiting)
 	{
-	    update_curbuf(INVERTED_ALL);
+	    update_curbuf(UPD_INVERTED_ALL);
 	    setcursor();
 	    cursor_on();
 	    out_flush_cursor(TRUE, FALSE);
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -3654,7 +3654,7 @@ wildmenu_cleanup(cmdline_info_T *cclp)
 	p_ls = save_p_ls;
 	p_wmh = save_p_wmh;
 	last_status(FALSE);
-	update_screen(VALID);	// redraw the screen NOW
+	update_screen(UPD_VALID);	// redraw the screen NOW
 	redrawcmd();
 	save_p_ls = -1;
     }
--- a/src/debugger.c
+++ b/src/debugger.c
@@ -285,7 +285,7 @@ do_debug(char_u *cmd)
 
     --RedrawingDisabled;
     --no_wait_return;
-    redraw_all_later(NOT_VALID);
+    redraw_all_later(UPD_NOT_VALID);
     need_wait_return = FALSE;
     msg_scroll = save_msg_scroll;
     lines_left = Rows - 1;
--- a/src/diff.c
+++ b/src/diff.c
@@ -123,7 +123,7 @@ diff_buf_delete(buf_T *buf)
 		// don't redraw right away, more might change or buffer state
 		// is invalid right now
 		need_diff_redraw = TRUE;
-		redraw_later(VALID);
+		redraw_later(UPD_VALID);
 	    }
 	}
     }
@@ -683,7 +683,7 @@ diff_redraw(
 	if (!wp->w_p_diff || !buf_valid(wp->w_buffer))
 	    continue;
 
-	redraw_win_later(wp, SOME_VALID);
+	redraw_win_later(wp, UPD_SOME_VALID);
 	if (wp != curwin)
 	    wp_other = wp;
 #ifdef FEAT_FOLDING
@@ -1336,7 +1336,7 @@ ex_diffpatch(exarg_T *eap)
 #endif
 
     // patch probably has written over the screen
-    redraw_later(CLEAR);
+    redraw_later(UPD_CLEAR);
 
     // Delete any .orig or .rej file created.
     STRCPY(buf, tmp_new);
@@ -1544,7 +1544,7 @@ diff_win_options(
 
     if (addbuf)
 	diff_buf_add(wp->w_buffer);
-    redraw_win_later(wp, NOT_VALID);
+    redraw_win_later(wp, UPD_NOT_VALID);
 }
 
 /*
--- a/src/digraph.c
+++ b/src/digraph.c
@@ -2025,8 +2025,10 @@ listdigraphs(int use_headers)
 	ui_breakcheck();
 	++dp;
     }
-    must_redraw = CLEAR;    // clear screen, because some digraphs may be
-			    // wrong, in which case we messed up ScreenLines
+
+    // clear screen, because some digraphs may be wrong, in which case we
+    // messed up ScreenLines
+    must_redraw = UPD_CLEAR;
 }
 
     static void
--- a/src/drawscreen.c
+++ b/src/drawscreen.c
@@ -28,7 +28,7 @@
  *
  * Commands that scroll a window change w_topline and must call
  * check_cursor() to move the cursor into the visible part of the window, and
- * call redraw_later(VALID) to have the window displayed by update_screen()
+ * call redraw_later(UPD_VALID) to have the window displayed by update_screen()
  * later.
  *
  * Commands that change text in the buffer must call changed_bytes() or
@@ -40,23 +40,23 @@
  *
  * Commands that change how a window is displayed (e.g., setting 'list') or
  * invalidate the contents of a window in another way (e.g., change fold
- * settings), must call redraw_later(NOT_VALID) to have the whole window
+ * settings), must call redraw_later(UPD_NOT_VALID) to have the whole window
  * redisplayed by update_screen() later.
  *
  * Commands that change how a buffer is displayed (e.g., setting 'tabstop')
- * must call redraw_curbuf_later(NOT_VALID) to have all the windows for the
+ * must call redraw_curbuf_later(UPD_NOT_VALID) to have all the windows for the
  * buffer redisplayed by update_screen() later.
  *
  * Commands that change highlighting and possibly cause a scroll too must call
- * redraw_later(SOME_VALID) to update the whole window but still use scrolling
- * to avoid redrawing everything.  But the length of displayed lines must not
- * change, use NOT_VALID then.
+ * redraw_later(UPD_SOME_VALID) to update the whole window but still use
+ * scrolling to avoid redrawing everything.  But the length of displayed lines
+ * must not change, use UPD_NOT_VALID then.
  *
- * Commands that move the window position must call redraw_later(NOT_VALID).
+ * Commands that move the window position must call redraw_later(UPD_NOT_VALID).
  * TODO: should minimize redrawing by scrolling when possible.
  *
  * Commands that change everything (e.g., resizing the screen) must call
- * redraw_all_later(NOT_VALID) or redraw_all_later(CLEAR).
+ * redraw_all_later(UPD_NOT_VALID) or redraw_all_later(UPD_CLEAR).
  *
  * Things that are handled indirectly:
  * - When messages scroll the screen up, msg_scrolled will be set and
@@ -99,7 +99,7 @@ update_screen(int type_arg)
     if (!screen_valid(TRUE))
 	return FAIL;
 
-    if (type == VALID_NO_UPDATE)
+    if (type == UPD_VALID_NO_UPDATE)
     {
 	no_update = TRUE;
 	type = 0;
@@ -134,12 +134,12 @@ update_screen(int type_arg)
     }
 
     // May need to update w_lines[].
-    if (curwin->w_lines_valid == 0 && type < NOT_VALID
+    if (curwin->w_lines_valid == 0 && type < UPD_NOT_VALID
 #ifdef FEAT_TERMINAL
 	    && !term_do_update_window(curwin)
 #endif
 		)
-	type = NOT_VALID;
+	type = UPD_NOT_VALID;
 
     // Postpone the redrawing when it's not needed and when being called
     // recursively.
@@ -147,7 +147,7 @@ update_screen(int type_arg)
     {
 	redraw_later(type);		// remember type for next time
 	must_redraw = type;
-	if (type > INVERTED_ALL)
+	if (type > UPD_INVERTED_ALL)
 	    curwin->w_lines_valid = 0;	// don't use w_lines[].wl_size now
 	return FAIL;
     }
@@ -171,28 +171,28 @@ update_screen(int type_arg)
     {
 	clear_cmdline = TRUE;
 	if (msg_scrolled > Rows - 5)	    // clearing is faster
-	    type = CLEAR;
-	else if (type != CLEAR)
+	    type = UPD_CLEAR;
+	else if (type != UPD_CLEAR)
 	{
 	    check_for_delay(FALSE);
 	    if (screen_ins_lines(0, 0, msg_scrolled, (int)Rows, 0, NULL)
 								       == FAIL)
-		type = CLEAR;
+		type = UPD_CLEAR;
 	    FOR_ALL_WINDOWS(wp)
 	    {
 		if (wp->w_winrow < msg_scrolled)
 		{
 		    if (W_WINROW(wp) + wp->w_height > msg_scrolled
-			    && wp->w_redr_type < REDRAW_TOP
+			    && wp->w_redr_type < UPD_REDRAW_TOP
 			    && wp->w_lines_valid > 0
 			    && wp->w_topline == wp->w_lines[0].wl_lnum)
 		    {
 			wp->w_upd_rows = msg_scrolled - W_WINROW(wp);
-			wp->w_redr_type = REDRAW_TOP;
+			wp->w_redr_type = UPD_REDRAW_TOP;
 		    }
 		    else
 		    {
-			wp->w_redr_type = NOT_VALID;
+			wp->w_redr_type = UPD_NOT_VALID;
 			if (W_WINROW(wp) + wp->w_height + wp->w_status_height
 							       <= msg_scrolled)
 			    wp->w_redr_status = TRUE;
@@ -214,10 +214,10 @@ update_screen(int type_arg)
     if (need_highlight_changed)
 	highlight_changed();
 
-    if (type == CLEAR)		// first clear screen
+    if (type == UPD_CLEAR)		// first clear screen
     {
 	screenclear();		// will reset clear_cmdline
-	type = NOT_VALID;
+	type = UPD_NOT_VALID;
 	// must_redraw may be set indirectly, avoid another redraw later
 	must_redraw = 0;
     }
@@ -228,24 +228,24 @@ update_screen(int type_arg)
 #ifdef FEAT_LINEBREAK
     // Force redraw when width of 'number' or 'relativenumber' column
     // changes.
-    if (curwin->w_redr_type < NOT_VALID
+    if (curwin->w_redr_type < UPD_NOT_VALID
 	   && curwin->w_nrwidth != ((curwin->w_p_nu || curwin->w_p_rnu)
 				    ? number_width(curwin) : 0))
-	curwin->w_redr_type = NOT_VALID;
+	curwin->w_redr_type = UPD_NOT_VALID;
 #endif
 
     // Only start redrawing if there is really something to do.
-    if (type == INVERTED)
+    if (type == UPD_INVERTED)
 	update_curswant();
     if (curwin->w_redr_type < type
-	    && !((type == VALID
+	    && !((type == UPD_VALID
 		    && curwin->w_lines[0].wl_valid
 #ifdef FEAT_DIFF
 		    && curwin->w_topfill == curwin->w_old_topfill
 		    && curwin->w_botfill == curwin->w_old_botfill
 #endif
 		    && curwin->w_topline == curwin->w_lines[0].wl_lnum)
-		|| (type == INVERTED
+		|| (type == UPD_INVERTED
 		    && VIsual_active
 		    && curwin->w_old_cursor_lnum == curwin->w_cursor.lnum
 		    && curwin->w_old_visual_mode == VIsual_mode
@@ -255,7 +255,7 @@ update_screen(int type_arg)
 	curwin->w_redr_type = type;
 
     // Redraw the tab pages line if needed.
-    if (redraw_tabline || type >= NOT_VALID)
+    if (redraw_tabline || type >= UPD_NOT_VALID)
 	draw_tabline();
 
 #ifdef FEAT_SYN_HL
@@ -1408,12 +1408,13 @@ fold_line(
  *
  * How the window is redrawn depends on wp->w_redr_type.  Each type also
  * implies the one below it.
- * NOT_VALID	redraw the whole window
- * SOME_VALID	redraw the whole window but do scroll when possible
- * REDRAW_TOP	redraw the top w_upd_rows window lines, otherwise like VALID
- * INVERTED	redraw the changed part of the Visual area
- * INVERTED_ALL	redraw the whole Visual area
- * VALID	1. scroll up/down to adjust for a changed w_topline
+ * UPD_NOT_VALID	redraw the whole window
+ * UPD_SOME_VALID	redraw the whole window but do scroll when possible
+ * UPD_REDRAW_TOP	redraw the top w_upd_rows window lines, otherwise like
+ *			UPD_VALID
+ * UPD_INVERTED		redraw the changed part of the Visual area
+ * UPD_INVERTED_ALL	redraw the whole Visual area
+ * UPD_VALID	1. scroll up/down to adjust for a changed w_topline
  *		2. update lines at the top when scrolled down
  *		3. redraw changed text:
  *		   - if wp->w_buffer->b_mod_set set, update lines between
@@ -1500,7 +1501,7 @@ win_update(win_T *wp)
 
     type = wp->w_redr_type;
 
-    if (type == NOT_VALID)
+    if (type == UPD_NOT_VALID)
     {
 	wp->w_redr_status = TRUE;
 	wp->w_lines_valid = 0;
@@ -1552,7 +1553,7 @@ win_update(win_T *wp)
     i = (wp->w_p_nu || wp->w_p_rnu) ? number_width(wp) : 0;
     if (wp->w_nrwidth != i)
     {
-	type = NOT_VALID;
+	type = UPD_NOT_VALID;
 	wp->w_nrwidth = i;
     }
     else
@@ -1563,7 +1564,7 @@ win_update(win_T *wp)
 	// When there are both inserted/deleted lines and specific lines to be
 	// redrawn, w_redraw_top and w_redraw_bot may be invalid, just redraw
 	// everything (only happens when redrawing is off for while).
-	type = NOT_VALID;
+	type = UPD_NOT_VALID;
     }
     else
     {
@@ -1705,7 +1706,7 @@ win_update(win_T *wp)
 
     // When only displaying the lines at the top, set top_end.  Used when
     // window has scrolled down for msg_scrolled.
-    if (type == REDRAW_TOP)
+    if (type == UPD_REDRAW_TOP)
     {
 	j = 0;
 	for (i = 0; i < wp->w_lines_valid; ++i)
@@ -1719,10 +1720,10 @@ win_update(win_T *wp)
 	}
 	if (top_end == 0)
 	    // not found (cannot happen?): redraw everything
-	    type = NOT_VALID;
+	    type = UPD_NOT_VALID;
 	else
-	    // top area defined, the rest is VALID
-	    type = VALID;
+	    // top area defined, the rest is UPD_VALID
+	    type = UPD_VALID;
     }
 
     // Trick: we want to avoid clearing the screen twice.  screenclear() will
@@ -1738,8 +1739,8 @@ win_update(win_T *wp)
     // 2: wp->w_topline is below wp->w_lines[0].wl_lnum: may scroll up
     // 3: wp->w_topline is wp->w_lines[0].wl_lnum: find first entry in
     //    w_lines[] that needs updating.
-    if ((type == VALID || type == SOME_VALID
-				  || type == INVERTED || type == INVERTED_ALL)
+    if ((type == UPD_VALID || type == UPD_SOME_VALID
+			   || type == UPD_INVERTED || type == UPD_INVERTED_ALL)
 #ifdef FEAT_DIFF
 	    && !wp->w_botfill && !wp->w_old_botfill
 #endif
@@ -1942,35 +1943,35 @@ win_update(win_T *wp)
 	// When win_del_lines() or win_ins_lines() caused the screen to be
 	// cleared (only happens for the first window) or when screenclear()
 	// was called directly above, "must_redraw" will have been set to
-	// NOT_VALID, need to reset it here to avoid redrawing twice.
+	// UPD_NOT_VALID, need to reset it here to avoid redrawing twice.
 	if (screen_cleared == TRUE)
 	    must_redraw = 0;
     }
     else
     {
-	// Not VALID or INVERTED: redraw all lines.
+	// Not UPD_VALID or UPD_INVERTED: redraw all lines.
 	mid_start = 0;
 	mid_end = wp->w_height;
     }
 
-    if (type == SOME_VALID)
+    if (type == UPD_SOME_VALID)
     {
-	// SOME_VALID: redraw all lines.
+	// UPD_SOME_VALID: redraw all lines.
 	mid_start = 0;
 	mid_end = wp->w_height;
-	type = NOT_VALID;
+	type = UPD_NOT_VALID;
     }
 
     // check if we are updating or removing the inverted part
     if ((VIsual_active && buf == curwin->w_buffer)
-	    || (wp->w_old_cursor_lnum != 0 && type != NOT_VALID))
+	    || (wp->w_old_cursor_lnum != 0 && type != UPD_NOT_VALID))
     {
 	linenr_T    from, to;
 
 	if (VIsual_active)
 	{
 	    if (VIsual_mode != wp->w_old_visual_mode
-		|| type == INVERTED_ALL)
+		|| type == UPD_INVERTED_ALL)
 	    {
 		// If the type of Visual selection changed, redraw the whole
 		// selection.  Also when the ownership of the X selection is
@@ -3114,7 +3115,7 @@ redraw_after_callback(int call_update_sc
 	validate_cursor();
 
 	// keep the command line if possible
-	update_screen(VALID_NO_UPDATE);
+	update_screen(UPD_VALID_NO_UPDATE);
 	setcursor();
 
 	if (msg_scrolled == 0)
@@ -3140,7 +3141,7 @@ redraw_after_callback(int call_update_sc
 /*
  * Redraw the current window later, with update_screen(type).
  * Set must_redraw only if not already set to a higher value.
- * E.g. if must_redraw is CLEAR, type NOT_VALID will do nothing.
+ * E.g. if must_redraw is UPD_CLEAR, type UPD_NOT_VALID will do nothing.
  */
     void
 redraw_later(int type)
@@ -3156,7 +3157,7 @@ redraw_win_later(
     if (!exiting && wp->w_redr_type < type)
     {
 	wp->w_redr_type = type;
-	if (type >= NOT_VALID)
+	if (type >= UPD_NOT_VALID)
 	    wp->w_lines_valid = 0;
 	if (must_redraw < type)	// must_redraw is the maximum of all windows
 	    must_redraw = type;
@@ -3170,7 +3171,7 @@ redraw_win_later(
     void
 redraw_later_clear(void)
 {
-    redraw_all_later(CLEAR);
+    redraw_all_later(UPD_CLEAR);
     reset_screen_attr();
 }
 
@@ -3263,7 +3264,7 @@ status_redraw_all(void)
 	if (wp->w_status_height)
 	{
 	    wp->w_redr_status = TRUE;
-	    redraw_later(VALID);
+	    redraw_later(UPD_VALID);
 	}
 }
 
@@ -3279,7 +3280,7 @@ status_redraw_curbuf(void)
 	if (wp->w_status_height != 0 && wp->w_buffer == curbuf)
 	{
 	    wp->w_redr_status = TRUE;
-	    redraw_later(VALID);
+	    redraw_later(UPD_VALID);
 	}
 }
 
@@ -3339,5 +3340,5 @@ redrawWinline(
 	wp->w_redraw_top = lnum;
     if (wp->w_redraw_bot == 0 || wp->w_redraw_bot < lnum)
 	wp->w_redraw_bot = lnum;
-    redraw_win_later(wp, VALID);
+    redraw_win_later(wp, UPD_VALID);
 }
--- a/src/edit.c
+++ b/src/edit.c
@@ -4701,7 +4701,7 @@ ins_up(
 		|| old_topfill != curwin->w_topfill
 #endif
 		)
-	    redraw_later(VALID);
+	    redraw_later(UPD_VALID);
 	start_arrow(&tpos);
 	can_cindent = TRUE;
     }
@@ -4758,7 +4758,7 @@ ins_down(
 		|| old_topfill != curwin->w_topfill
 #endif
 		)
-	    redraw_later(VALID);
+	    redraw_later(UPD_VALID);
 	start_arrow(&tpos);
 	can_cindent = TRUE;
     }
@@ -5283,7 +5283,7 @@ ins_ctrl_ey(int tc)
 	    scrolldown_clamp();
 	else
 	    scrollup_clamp();
-	redraw_later(VALID);
+	redraw_later(UPD_VALID);
     }
     else
     {
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -3827,7 +3827,7 @@ set_var_const(
 		else if (STRCMP(varname, "hlsearch") == 0)
 		{
 		    no_hlsearch = !di->di_tv.vval.v_number;
-		    redraw_all_later(SOME_VALID);
+		    redraw_all_later(UPD_SOME_VALID);
 		}
 #endif
 		goto failed;
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -1184,7 +1184,7 @@ do_filter(
 	    vim_free(cmd_buf);
 	    goto error;
 	}
-	redraw_curbuf_later(VALID);
+	redraw_curbuf_later(UPD_VALID);
     }
     read_linecount = curbuf->b_ml.ml_line_count;
 
@@ -3184,7 +3184,7 @@ do_ecmd(
 	update_topline();
 	curwin->w_scbind_pos = curwin->w_topline;
 	*so_ptr = n;
-	redraw_curbuf_later(NOT_VALID);	// redraw this buffer later
+	redraw_curbuf_later(UPD_NOT_VALID);	// redraw this buffer later
     }
 
     if (p_im && (State & MODE_INSERT) == 0)
@@ -4324,9 +4324,9 @@ ex_substitute(exarg_T *eap)
 
 			    update_topline();
 			    validate_cursor();
-			    update_screen(SOME_VALID);
+			    update_screen(UPD_SOME_VALID);
 			    highlight_match = FALSE;
-			    redraw_later(SOME_VALID);
+			    redraw_later(UPD_SOME_VALID);
 
 #ifdef FEAT_FOLDING
 			    curwin->w_p_fen = save_p_fen;
@@ -5270,7 +5270,7 @@ prepare_tagpreview(
 		    popup_hide(wp);
 		// When the popup moves or resizes it may reveal part of
 		// another window.  TODO: can this be done more efficiently?
-		redraw_all_later(NOT_VALID);
+		redraw_all_later(UPD_NOT_VALID);
 	    }
 	}
 	else
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -551,7 +551,7 @@ do_exmode(
 #endif
     --RedrawingDisabled;
     --no_wait_return;
-    update_screen(CLEAR);
+    update_screen(UPD_CLEAR);
     need_wait_return = FALSE;
     msg_scroll = save_msg_scroll;
 }
@@ -5777,7 +5777,7 @@ ex_colorscheme(exarg_T *eap)
     else if (has_vtp_working())
     {
 	// background color change requires clear + redraw
-	update_screen(CLEAR);
+	update_screen(UPD_CLEAR);
 	redrawcmd();
     }
 #endif
@@ -7116,7 +7116,7 @@ do_exedit(
 #ifdef FEAT_GUI
 		hold_gui_events = 0;
 #endif
-		must_redraw = CLEAR;
+		must_redraw = UPD_CLEAR;
 		pending_exmode_active = TRUE;
 
 		main_loop(FALSE, TRUE);
@@ -7342,7 +7342,7 @@ ex_syncbind(exarg_T *eap UNUSED)
 	    else
 		scrolldown(-y, TRUE);
 	    curwin->w_scbind_pos = topline;
-	    redraw_later(VALID);
+	    redraw_later(UPD_VALID);
 	    cursor_correct();
 	    curwin->w_redr_status = TRUE;
 	}
@@ -7438,7 +7438,7 @@ ex_read(exarg_T *eap)
 		    deleted_lines_mark(lnum, 1L);
 		}
 	    }
-	    redraw_curbuf_later(VALID);
+	    redraw_curbuf_later(UPD_VALID);
 	}
     }
 }
@@ -8370,7 +8370,7 @@ ex_redraw(exarg_T *eap)
     p_lz = FALSE;
     validate_cursor();
     update_topline();
-    update_screen(eap->forceit ? CLEAR : VIsual_active ? INVERTED : 0);
+    update_screen(eap->forceit ? UPD_CLEAR : VIsual_active ? UPD_INVERTED : 0);
     if (need_maketitle)
 	maketitle();
 #if defined(MSWIN) && (!defined(FEAT_GUI_MSWIN) || defined(VIMDLL))
@@ -8414,7 +8414,7 @@ ex_redrawstatus(exarg_T *eap UNUSED)
 	status_redraw_all();
     else
 	status_redraw_curbuf();
-    update_screen(VIsual_active ? INVERTED : 0);
+    update_screen(VIsual_active ? UPD_INVERTED : 0);
     RedrawingDisabled = r;
     p_lz = p;
     out_flush();
@@ -8937,7 +8937,7 @@ ex_pedit(exarg_T *eap)
     {
 	// Return cursor to where we were
 	validate_cursor();
-	redraw_later(VALID);
+	redraw_later(UPD_VALID);
 	win_enter(curwin_save, TRUE);
     }
 # ifdef FEAT_PROP_POPUP
@@ -9685,7 +9685,7 @@ set_no_hlsearch(int flag)
 ex_nohlsearch(exarg_T *eap UNUSED)
 {
     set_no_hlsearch(TRUE);
-    redraw_all_later(SOME_VALID);
+    redraw_all_later(UPD_SOME_VALID);
 }
 #endif
 
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -397,9 +397,9 @@ finish_incsearch_highlighting(
 	magic_overruled = is_state->magic_overruled_save;
 
 	validate_cursor();	// needed for TAB
-	redraw_all_later(SOME_VALID);
+	redraw_all_later(UPD_SOME_VALID);
 	if (call_update_screen)
-	    update_screen(SOME_VALID);
+	    update_screen(UPD_SOME_VALID);
     }
 }
 
@@ -473,7 +473,7 @@ may_do_incsearch_highlighting(
     {
 	found = 0;
 	set_no_hlsearch(TRUE); // turn off previous highlight
-	redraw_all_later(SOME_VALID);
+	redraw_all_later(UPD_SOME_VALID);
     }
     else
     {
@@ -556,7 +556,7 @@ may_do_incsearch_highlighting(
 	if (empty_pattern(ccline.cmdbuff + skiplen, search_delim)
 							       && !no_hlsearch)
 	{
-	    redraw_all_later(SOME_VALID);
+	    redraw_all_later(UPD_SOME_VALID);
 	    set_no_hlsearch(TRUE);
 	}
 	ccline.cmdbuff[skiplen + patlen] = next_char;
@@ -567,7 +567,7 @@ may_do_incsearch_highlighting(
     if (p_ru && curwin->w_status_height > 0)
 	curwin->w_redr_status = TRUE;
 
-    update_screen(SOME_VALID);
+    update_screen(UPD_SOME_VALID);
     highlight_match = FALSE;
     restore_last_search_pattern();
 
@@ -692,7 +692,7 @@ may_adjust_incsearch_highlighting(
 	validate_cursor();
 	highlight_match = TRUE;
 	save_viewstate(&is_state->old_viewstate);
-	update_screen(NOT_VALID);
+	update_screen(UPD_NOT_VALID);
 	highlight_match = FALSE;
 	redrawcmdline();
 	curwin->w_cursor = is_state->match_end;
@@ -1623,7 +1623,7 @@ getcmdline_int(
 	made_cmdheight_nonzero = TRUE;
 	lastwin->w_p_so = 0;
 	set_option_value((char_u *)"ch", 1L, NULL, 0);
-	update_screen(VALID);                 // redraw the screen NOW
+	update_screen(UPD_VALID);                 // redraw the screen NOW
 	made_cmdheight_nonzero = FALSE;
 	lastwin->w_p_so = save_so;
     }
@@ -2616,7 +2616,7 @@ theend:
 	    made_cmdheight_nonzero = TRUE;
 	    set_option_value((char_u *)"ch", 0L, NULL, 0);
 	    // Redraw is needed for command line completion
-	    redraw_all_later(CLEAR);
+	    redraw_all_later(UPD_CLEAR);
 	    made_cmdheight_nonzero = FALSE;
 	}
 
@@ -4541,7 +4541,7 @@ open_cmdwin(void)
     curwin->w_cursor.col = ccline.cmdpos;
     changed_line_abv_curs();
     invalidate_botline();
-    redraw_later(SOME_VALID);
+    redraw_later(UPD_SOME_VALID);
 
     // No Ex mode here!
     exmode_active = 0;
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2375,7 +2375,7 @@ failed:
 	    linecnt = 0;
 	if (newfile || read_buffer)
 	{
-	    redraw_curbuf_later(NOT_VALID);
+	    redraw_curbuf_later(UPD_NOT_VALID);
 #ifdef FEAT_DIFF
 	    // After reading the text into the buffer the diff info needs to
 	    // be updated.
--- a/src/fold.c
+++ b/src/fold.c
@@ -413,7 +413,7 @@ opFoldRange(
 	emsg(_(e_no_fold_found));
     // Force a redraw to remove the Visual highlighting.
     if (had_visual)
-	redraw_curbuf_later(INVERTED);
+	redraw_curbuf_later(UPD_INVERTED);
 }
 
 // openFold() {{{2
@@ -786,7 +786,7 @@ deleteFold(
 	emsg(_(e_no_fold_found));
 	// Force a redraw to remove the Visual highlighting.
 	if (had_visual)
-	    redraw_curbuf_later(INVERTED);
+	    redraw_curbuf_later(UPD_INVERTED);
     }
     else
 	// Deleting markers may make cursor column invalid.
@@ -875,7 +875,7 @@ foldUpdate(win_T *wp, linenr_T top, line
 foldUpdateAll(win_T *win)
 {
     win->w_foldinvalid = TRUE;
-    redraw_win_later(win, NOT_VALID);
+    redraw_win_later(win, UPD_NOT_VALID);
 }
 
 // foldMoveTo() {{{2
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -2098,7 +2098,7 @@ getchar_common(typval_T *argvars, typval
 
     // redraw the screen after getchar()
     if (p_ch == 0)
-	update_screen(CLEAR);
+	update_screen(UPD_CLEAR);
 
     set_vim_var_nr(VV_MOUSE_WIN, 0);
     set_vim_var_nr(VV_MOUSE_WINID, 0);
--- a/src/gui.c
+++ b/src/gui.c
@@ -4516,11 +4516,11 @@ gui_do_scroll(void)
 #endif
 	    )
     {
-	int type = VALID;
+	int type = UPD_VALID;
 
 	if (pum_visible())
 	{
-	    type = NOT_VALID;
+	    type = UPD_NOT_VALID;
 	    wp->w_lines_valid = 0;
 	}
 
@@ -5527,7 +5527,7 @@ drop_callback(void *cookie)
     }
 
     // Update the screen display
-    update_screen(NOT_VALID);
+    update_screen(UPD_NOT_VALID);
 # ifdef FEAT_MENU
     gui_update_menus(0);
 # endif
--- a/src/gui_haiku.cc
+++ b/src/gui_haiku.cc
@@ -656,7 +656,7 @@ drop_callback(void *cookie)
     // TODO here we could handle going to a specific position in the dropped
     // file (see src/gui_mac.c, deleted in 8.2.1422)
     // Update the screen display
-    update_screen(NOT_VALID);
+    update_screen(UPD_NOT_VALID);
 }
 
     // Really handle dropped files and folders.
--- a/src/highlight.c
+++ b/src/highlight.c
@@ -696,7 +696,7 @@ highlight_group_link(
 	    hlgroup->sg_script_ctx.sc_lnum += SOURCING_LNUM;
 #endif
 	    hlgroup->sg_cleared = FALSE;
-	    redraw_all_later(SOME_VALID);
+	    redraw_all_later(UPD_SOME_VALID);
 
 	    // Only call highlight_changed() once after multiple changes.
 	    need_highlight_changed = TRUE;
@@ -939,7 +939,7 @@ highlight_set_ctermfg(int idx, int color
 	if (!gui.in_use && !gui.starting)
 #endif
 	{
-	    must_redraw = CLEAR;
+	    must_redraw = UPD_CLEAR;
 	    if (termcap_active && color >= 0)
 		term_fg_color(color);
 	}
@@ -962,7 +962,7 @@ highlight_set_ctermbg(int idx, int color
 	if (!gui.in_use && !gui.starting)
 #endif
 	{
-	    must_redraw = CLEAR;
+	    must_redraw = UPD_CLEAR;
 	    if (color >= 0)
 	    {
 		int dark = -1;
@@ -1005,7 +1005,7 @@ highlight_set_ctermul(int idx, int color
 	if (!gui.in_use && !gui.starting)
 #endif
 	{
-	    must_redraw = CLEAR;
+	    must_redraw = UPD_CLEAR;
 	    if (termcap_active && color >= 0)
 		term_ul_color(color);
 	}
@@ -1725,7 +1725,7 @@ do_highlight(
 	    {
 		highlight_gui_started();
 		did_highlight_changed = TRUE;
-		redraw_all_later(NOT_VALID);
+		redraw_all_later(UPD_NOT_VALID);
 	    }
 #endif
 #ifdef FEAT_VTP
@@ -1779,7 +1779,7 @@ do_highlight(
 	// redrawing.  This may happen when evaluating 'statusline' changes the
 	// StatusLine group.
 	if (!updating_screen)
-	    redraw_all_later(NOT_VALID);
+	    redraw_all_later(UPD_NOT_VALID);
 	need_highlight_changed = TRUE;
     }
 }
@@ -1919,7 +1919,7 @@ set_normal_colors(void)
 				 FALSE, TRUE, FALSE))
 	{
 	    gui_mch_new_colors();
-	    must_redraw = CLEAR;
+	    must_redraw = UPD_CLEAR;
 	}
 #  ifdef FEAT_GUI_X11
 	if (set_group_colors((char_u *)"Menu",
@@ -1929,7 +1929,7 @@ set_normal_colors(void)
 #   ifdef FEAT_MENU
 	    gui_mch_new_menu_colors();
 #   endif
-	    must_redraw = CLEAR;
+	    must_redraw = UPD_CLEAR;
 	}
 #   ifdef FEAT_BEVAL_GUI
 	if (set_group_colors((char_u *)"Tooltip",
@@ -1939,7 +1939,7 @@ set_normal_colors(void)
 #    ifdef FEAT_TOOLBAR
 	    gui_mch_new_tooltip_colors();
 #    endif
-	    must_redraw = CLEAR;
+	    must_redraw = UPD_CLEAR;
 	}
 #   endif
 	if (set_group_colors((char_u *)"Scrollbar",
@@ -1947,7 +1947,7 @@ set_normal_colors(void)
 			FALSE, FALSE, FALSE))
 	{
 	    gui_new_scrollbar_colors();
-	    must_redraw = CLEAR;
+	    must_redraw = UPD_CLEAR;
 	}
 #  endif
     }
@@ -1973,7 +1973,7 @@ set_normal_colors(void)
 		// color
 		cterm_normal_fg_gui_color = HL_TABLE()[idx].sg_gui_fg;
 		cterm_normal_bg_gui_color = HL_TABLE()[idx].sg_gui_bg;
-		must_redraw = CLEAR;
+		must_redraw = UPD_CLEAR;
 	    }
 	}
     }
@@ -2545,7 +2545,7 @@ get_attr_entry(garray_T *table, attrentr
 
 	clear_hl_tables();
 
-	must_redraw = CLEAR;
+	must_redraw = UPD_CLEAR;
 
 	for (i = 0; i < highlight_ga.ga_len; ++i)
 	    set_hl_attr(i);
--- a/src/if_lua.c
+++ b/src/if_lua.c
@@ -1543,7 +1543,7 @@ luaV_buffer_insert(lua_State *L)
     else
 	appended_lines_mark(n, 1L);
     curbuf = buf;
-    update_screen(VALID);
+    update_screen(UPD_VALID);
     return 0;
 }
 
@@ -1645,7 +1645,7 @@ luaV_window_newindex(lua_State *L)
 	if (v < 1 || v > w->w_buffer->b_ml.ml_line_count)
 	    luaL_error(L, "line out of range");
 	w->w_cursor.lnum = v;
-	update_screen(VALID);
+	update_screen(UPD_VALID);
     }
     else if (strncmp(s, "col", 3) == 0)
     {
@@ -1654,7 +1654,7 @@ luaV_window_newindex(lua_State *L)
 #endif
 	w->w_cursor.col = v - 1;
 	w->w_set_curswant = TRUE;
-	update_screen(VALID);
+	update_screen(UPD_VALID);
     }
     else if (strncmp(s, "width", 5) == 0)
     {
@@ -1914,7 +1914,7 @@ luaV_command(lua_State *L)
 
     execute_cmds_from_string(s);
     vim_free(s);
-    update_screen(VALID);
+    update_screen(UPD_VALID);
     return 0;
 }
 
@@ -2661,7 +2661,7 @@ ex_luado(exarg_T *eap)
     }
     lua_pop(L, 1); // function
     check_cursor();
-    update_screen(NOT_VALID);
+    update_screen(UPD_NOT_VALID);
 }
 
     void
--- a/src/if_mzsch.c
+++ b/src/if_mzsch.c
@@ -1631,7 +1631,7 @@ vim_command(void *data, int argc, Scheme
 
     // may be use do_cmdline_cmd?
     do_cmdline(BYTE_STRING_VALUE(cmd), NULL, NULL, DOCMD_NOWAIT|DOCMD_VERBOSE);
-    update_screen(VALID);
+    update_screen(UPD_VALID);
 
     MZ_GC_UNREG();
     raise_if_error();
@@ -1836,7 +1836,7 @@ set_option(void *data, int argc, Scheme_
     MZ_GC_UNREG();
     do_set(command, scope);
     vim_free(command);
-    update_screen(NOT_VALID);
+    update_screen(UPD_NOT_VALID);
     curbuf = save_curb;
     curwin = save_curw;
     raise_if_error();
@@ -2106,7 +2106,7 @@ set_cursor(void *data, int argc, Scheme_
     win->win->w_cursor.lnum = lnum;
     win->win->w_cursor.col = col;
     win->win->w_set_curswant = TRUE;
-    update_screen(VALID);
+    update_screen(UPD_VALID);
 
     raise_if_error();
     return scheme_void;
@@ -2781,7 +2781,7 @@ insert_buffer_line_list(void *data, int 
 	}
 
 	curbuf = savebuf;
-	update_screen(VALID);
+	update_screen(UPD_VALID);
 
 	MZ_GC_UNREG();
 	raise_if_error();
@@ -2841,7 +2841,7 @@ insert_buffer_line_list(void *data, int 
 	free_array(array);
 	MZ_GC_UNREG();
 	curbuf = savebuf;
-	update_screen(VALID);
+	update_screen(UPD_VALID);
     }
 
     MZ_GC_UNREG();
--- a/src/if_perl.xs
+++ b/src/if_perl.xs
@@ -1460,7 +1460,7 @@ ex_perldo(exarg_T *eap)
     FREETMPS;
     LEAVE;
     check_cursor();
-    update_screen(NOT_VALID);
+    update_screen(UPD_NOT_VALID);
     if (!length)
 	return;
 
@@ -1584,7 +1584,7 @@ SetOption(line)
     PPCODE:
     if (line != NULL)
 	do_set((char_u *)line, 0);
-    update_screen(NOT_VALID);
+    update_screen(UPD_NOT_VALID);
 
 void
 DoCommand(line)
@@ -1777,7 +1777,7 @@ Cursor(win, ...)
       win->w_cursor.col = col;
       win->w_set_curswant = TRUE;
       check_cursor();		    /* put cursor on an existing line */
-      update_screen(NOT_VALID);
+      update_screen(UPD_NOT_VALID);
     }
 
 MODULE = VIM	    PACKAGE = VIBUF
@@ -1929,7 +1929,7 @@ Delete(vimbuf, ...)
 		    aucmd_restbuf(&aco);
 		    /* Careful: autocommands may have made "vimbuf" invalid! */
 
-		    update_curbuf(VALID);
+		    update_curbuf(UPD_VALID);
 		}
 	    }
 	}
@@ -1970,7 +1970,7 @@ Append(vimbuf, ...)
 		aucmd_restbuf(&aco);
 		/* Careful: autocommands may have made "vimbuf" invalid! */
 
-		update_curbuf(VALID);
+		update_curbuf(UPD_VALID);
 	    }
 	}
     }
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -697,7 +697,7 @@ VimCommand(PyObject *self UNUSED, PyObje
 
     VimTryStart();
     do_cmdline_cmd(cmd);
-    update_screen(VALID);
+    update_screen(UPD_VALID);
 
     Python_Release_Vim();
     Py_END_ALLOW_THREADS
@@ -4067,7 +4067,7 @@ WindowSetattr(WindowObject *self, char *
 	// When column is out of range silently correct it.
 	check_cursor_col_win(self->win);
 
-	update_screen(VALID);
+	update_screen(UPD_VALID);
 	return 0;
     }
     else if (strcmp(name, "height") == 0)
@@ -4745,7 +4745,7 @@ InsertBufferLines(buf_T *buf, PyInt n, P
 
 	vim_free(str);
 	restore_win_for_buf(&switchwin, &save_curbuf);
-	update_screen(VALID);
+	update_screen(UPD_VALID);
 
 	if (VimTryEnd())
 	    return FAIL;
@@ -4816,7 +4816,7 @@ InsertBufferLines(buf_T *buf, PyInt n, P
 	PyMem_Free(array);
 	restore_win_for_buf(&switchwin, &save_curbuf);
 
-	update_screen(VALID);
+	update_screen(UPD_VALID);
 
 	if (VimTryEnd())
 	    return FAIL;
@@ -5825,7 +5825,7 @@ out:
     if (status)
 	return;
     check_cursor();
-    update_curbuf(NOT_VALID);
+    update_curbuf(UPD_NOT_VALID);
 }
 
     static void
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -988,7 +988,7 @@ ex_rubydo(exarg_T *eap)
 	    }
 	}
 	check_cursor();
-	update_curbuf(NOT_VALID);
+	update_curbuf(UPD_NOT_VALID);
     }
 }
 
@@ -1195,7 +1195,7 @@ vim_message(VALUE self UNUSED, VALUE str
 vim_set_option(VALUE self UNUSED, VALUE str)
 {
     do_set((char_u *)StringValuePtr(str), 0);
-    update_screen(NOT_VALID);
+    update_screen(UPD_NOT_VALID);
     return Qnil;
 }
 
@@ -1492,7 +1492,7 @@ set_buffer_line(buf_T *buf, linenr_T n, 
 	aucmd_restbuf(&aco);
 	// Careful: autocommands may have made "buf" invalid!
 
-	update_curbuf(NOT_VALID);
+	update_curbuf(UPD_NOT_VALID);
     }
     else
     {
@@ -1538,7 +1538,7 @@ buffer_delete(VALUE self, VALUE num)
 	aucmd_restbuf(&aco);
 	// Careful: autocommands may have made "buf" invalid!
 
-	update_curbuf(NOT_VALID);
+	update_curbuf(UPD_NOT_VALID);
     }
     else
     {
@@ -1579,7 +1579,7 @@ buffer_append(VALUE self, VALUE num, VAL
 	aucmd_restbuf(&aco);
 	// Careful: autocommands may have made "buf" invalid!
 
-	update_curbuf(NOT_VALID);
+	update_curbuf(UPD_NOT_VALID);
     }
     else
     {
@@ -1774,7 +1774,7 @@ window_set_cursor(VALUE self, VALUE pos)
     win->w_cursor.col = NUM2UINT(col);
     win->w_set_curswant = TRUE;
     check_cursor();		    // put cursor on an existing line
-    update_screen(NOT_VALID);
+    update_screen(UPD_NOT_VALID);
     return Qnil;
 }
 
--- a/src/if_tcl.c
+++ b/src/if_tcl.c
@@ -931,13 +931,13 @@ bufselfcmd(
     }
 
     if (flags & FL_UPDATE_CURBUF)
-	redraw_curbuf_later(NOT_VALID);
+	redraw_curbuf_later(UPD_NOT_VALID);
     curbuf = savebuf;
     curwin = savewin;
     if (flags & FL_ADJUST_CURSOR)
 	check_cursor();
     if (flags & (FL_UPDATE_SCREEN | FL_UPDATE_CURBUF))
-	update_screen(NOT_VALID);
+	update_screen(UPD_NOT_VALID);
 
     return err;
 }
@@ -1115,7 +1115,7 @@ winselfcmd(
     curwin = savewin;
     curbuf = savebuf;
     if (flags & FL_UPDATE_SCREEN)
-	update_screen(NOT_VALID);
+	update_screen(UPD_NOT_VALID);
 
     return err;
 }
@@ -1131,7 +1131,7 @@ commandcmd(
     int		err;
 
     err = tcldoexcommand(interp, objc, objv, 1);
-    update_screen(VALID);
+    update_screen(UPD_VALID);
     return err;
 }
 
@@ -1145,7 +1145,7 @@ optioncmd(
     int		err;
 
     err = tclsetoption(interp, objc, objv, 1);
-    update_screen(VALID);
+    update_screen(UPD_VALID);
     return err;
 }
 
--- a/src/indent.c
+++ b/src/indent.c
@@ -1132,7 +1132,7 @@ op_reindent(oparg_T *oap, int (*how)(voi
 		oap->is_VIsual ? start_lnum + oap->line_count :
 		last_changed + 1, 0L);
     else if (oap->is_VIsual)
-	redraw_curbuf_later(INVERTED);
+	redraw_curbuf_later(UPD_INVERTED);
 
     if (oap->line_count > p_report)
     {
@@ -1830,10 +1830,10 @@ ex_retab(exarg_T *eap)
 	&& tabstop_eq(curbuf->b_p_vts_array, new_vts_array))
 	; // not changed
     else
-	redraw_curbuf_later(NOT_VALID);
+	redraw_curbuf_later(UPD_NOT_VALID);
 #else
     if (curbuf->b_p_ts != new_ts)
-	redraw_curbuf_later(NOT_VALID);
+	redraw_curbuf_later(UPD_NOT_VALID);
 #endif
     if (first_line != 0)
 	changed_lines(first_line, 0, last_line + 1, 0L);
--- a/src/main.c
+++ b/src/main.c
@@ -686,7 +686,7 @@ vim_main2(void)
 			&& !gui.in_use
 #endif
 					)
-	must_redraw = CLEAR;
+	must_redraw = UPD_CLEAR;
     else
     {
 	screenclear();			// clear screen
@@ -788,7 +788,7 @@ vim_main2(void)
 #endif
 
     RedrawingDisabled = 0;
-    redraw_all_later(NOT_VALID);
+    redraw_all_later(UPD_NOT_VALID);
     no_wait_return = FALSE;
 
     // 'autochdir' has been postponed
@@ -1412,7 +1412,7 @@ main_loop(
 	    validate_cursor();
 
 	    if (VIsual_active)
-		update_curbuf(INVERTED); // update inverted part
+		update_curbuf(UPD_INVERTED); // update inverted part
 	    else if (must_redraw)
 	    {
 		mch_disable_flush();	// Stop issuing gui_mch_flush().
--- a/src/match.c
+++ b/src/match.c
@@ -39,7 +39,7 @@ match_add(
     matchitem_T	*m;
     int		hlg_id;
     regprog_T	*regprog = NULL;
-    int		rtype = SOME_VALID;
+    int		rtype = UPD_SOME_VALID;
 
     if (*grp == NUL || (pat != NULL && *pat == NUL))
 	return -1;
@@ -192,7 +192,7 @@ match_add(
 	    }
 	    m->pos.toplnum = toplnum;
 	    m->pos.botlnum = botlnum;
-	    rtype = VALID;
+	    rtype = UPD_VALID;
 	}
     }
 
@@ -228,7 +228,7 @@ match_delete(win_T *wp, int id, int perr
 {
     matchitem_T	*cur = wp->w_match_head;
     matchitem_T	*prev = cur;
-    int		rtype = SOME_VALID;
+    int		rtype = UPD_SOME_VALID;
 
     if (id < 1)
     {
@@ -269,7 +269,7 @@ match_delete(win_T *wp, int id, int perr
 	    wp->w_buffer->b_mod_bot = cur->pos.botlnum;
 	    wp->w_buffer->b_mod_xlines = 0;
 	}
-	rtype = VALID;
+	rtype = UPD_VALID;
     }
     vim_free(cur);
     redraw_win_later(wp, rtype);
@@ -292,7 +292,7 @@ clear_matches(win_T *wp)
 	vim_free(wp->w_match_head);
 	wp->w_match_head = m;
     }
-    redraw_win_later(wp, SOME_VALID);
+    redraw_win_later(wp, UPD_SOME_VALID);
 }
 
 /*
--- a/src/memline.c
+++ b/src/memline.c
@@ -1763,7 +1763,7 @@ ml_recover(int checkext)
 	set_option_value_give_err((char_u *)"key", 0L, buf->b_p_key, OPT_LOCAL);
     }
 #endif
-    redraw_curbuf_later(NOT_VALID);
+    redraw_curbuf_later(UPD_NOT_VALID);
 
 theend:
     vim_free(fname_used);
@@ -3074,8 +3074,6 @@ ml_append_int(
 	 */
 	if (lines_moved)
 	{
-	    /*
-	     */
 	    dp_right->db_txt_start -= data_moved;
 	    dp_right->db_free -= total_moved;
 	    mch_memmove((char *)dp_right + dp_right->db_txt_start,
@@ -3433,7 +3431,7 @@ ml_append_buf(
  * Do not use it after calling ml_replace().
  *
  * Check: The caller of this function should probably also call
- * changed_lines(), unless update_screen(NOT_VALID) is used.
+ * changed_lines(), unless update_screen(UPD_NOT_VALID) is used.
  *
  * return FAIL for failure, OK otherwise
  */
@@ -5145,7 +5143,7 @@ findswapname(
 
 			// pretend screen didn't scroll, need redraw anyway
 			msg_scrolled = 0;
-			redraw_all_later(NOT_VALID);
+			redraw_all_later(UPD_NOT_VALID);
 		    }
 #endif
 
--- a/src/menu.c
+++ b/src/menu.c
@@ -299,7 +299,7 @@ ex_menu(
     root_menu_ptr = get_root_menu(menu_path);
     if (root_menu_ptr == &curwin->w_winbar)
 	// Assume the window toolbar menu will change.
-	redraw_later(NOT_VALID);
+	redraw_later(UPD_NOT_VALID);
 
     if (enable != MAYBE)
     {
--- a/src/message.c
+++ b/src/message.c
@@ -1138,7 +1138,7 @@ wait_return(int redraw)
     FILE	*save_scriptout;
 
     if (redraw == TRUE)
-	must_redraw = CLEAR;
+	must_redraw = UPD_CLEAR;
 
     // If using ":silent cmd", don't wait for a return.  Also don't set
     // need_wait_return to do it later.
@@ -1362,7 +1362,7 @@ wait_return(int redraw)
 	    && (redraw == TRUE || (msg_scrolled != 0 && redraw != -1)))
     {
 	starttermcap();		    // start termcap before redrawing
-	redraw_later(VALID);
+	redraw_later(UPD_VALID);
     }
 }
 
@@ -2485,8 +2485,8 @@ inc_msg_scrolled(void)
     }
 #endif
     ++msg_scrolled;
-    if (must_redraw < VALID)
-	must_redraw = VALID;
+    if (must_redraw < UPD_VALID)
+	must_redraw = UPD_VALID;
 }
 
 /*
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -585,8 +585,8 @@ check_status(buf_T *buf)
 	if (wp->w_buffer == buf && wp->w_status_height)
 	{
 	    wp->w_redr_status = TRUE;
-	    if (must_redraw < VALID)
-		must_redraw = VALID;
+	    if (must_redraw < UPD_VALID)
+		must_redraw = UPD_VALID;
 	}
 }
 
@@ -1149,7 +1149,7 @@ vim_beep(unsigned val)
 # endif
 			)
 		    {
-			redraw_later(CLEAR);
+			redraw_later(UPD_CLEAR);
 			update_screen(0);
 			redrawcmd();
 		    }
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -719,7 +719,7 @@ leftcol_changed(void)
 
     if (retval)
 	curwin->w_set_curswant = TRUE;
-    redraw_later(NOT_VALID);
+    redraw_later(UPD_NOT_VALID);
     return retval;
 }
 
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -624,7 +624,7 @@ do_mouse(
 	    if (jump_flags)
 	    {
 		jump_flags = jump_to_mouse(jump_flags, NULL, which_button);
-		update_curbuf(VIsual_active ? INVERTED : VALID);
+		update_curbuf(VIsual_active ? UPD_INVERTED : UPD_VALID);
 		setcursor();
 		out_flush();    // Update before showing popup menu
 	    }
@@ -1027,7 +1027,7 @@ do_mouse(
 	    curwin->w_set_curswant = TRUE;
 	}
 	if (is_click)
-	    redraw_curbuf_later(INVERTED);	// update the inversion
+	    redraw_curbuf_later(UPD_INVERTED);	// update the inversion
     }
     else if (VIsual_active && !old_active)
     {
@@ -1164,7 +1164,7 @@ ins_mousescroll(int dir)
     // overlapped by the popup menu.
     if (pum_visible() && did_scroll)
     {
-	redraw_all_later(NOT_VALID);
+	redraw_all_later(UPD_NOT_VALID);
 	ins_compl_show_pum();
     }
 
@@ -1597,7 +1597,7 @@ retnomove:
 	if (flags & MOUSE_MAY_STOP_VIS)
 	{
 	    end_visual_mode_keep_button();
-	    redraw_curbuf_later(INVERTED);	// delete the inversion
+	    redraw_curbuf_later(UPD_INVERTED);	// delete the inversion
 	}
 #if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD)
 	// Continue a modeless selection in another window.
@@ -1738,7 +1738,7 @@ retnomove:
 			&& (flags & MOUSE_MAY_STOP_VIS))))
 	{
 	    end_visual_mode_keep_button();
-	    redraw_curbuf_later(INVERTED);	// delete the inversion
+	    redraw_curbuf_later(UPD_INVERTED);	// delete the inversion
 	}
 #ifdef FEAT_CMDWIN
 	if (cmdwin_type != 0 && wp != curwin)
@@ -1842,7 +1842,7 @@ retnomove:
 	if (flags & MOUSE_MAY_STOP_VIS)
 	{
 	    end_visual_mode_keep_button();
-	    redraw_curbuf_later(INVERTED);	// delete the inversion
+	    redraw_curbuf_later(UPD_INVERTED);	// delete the inversion
 	}
 
 #if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD)
@@ -1904,7 +1904,7 @@ retnomove:
 #endif
 	    curwin->w_valid &=
 		      ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_BOTLINE_AP);
-	    redraw_later(VALID);
+	    redraw_later(UPD_VALID);
 	    row = 0;
 	}
 	else if (row >= curwin->w_height)
@@ -1942,7 +1942,7 @@ retnomove:
 #ifdef FEAT_DIFF
 	    check_topfill(curwin, FALSE);
 #endif
-	    redraw_later(VALID);
+	    redraw_later(UPD_VALID);
 	    curwin->w_valid &=
 		      ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_BOTLINE_AP);
 	    row = curwin->w_height - 1;
@@ -1968,7 +1968,7 @@ retnomove:
 	// Only use ScreenCols[] after the window was redrawn.  Mainly matters
 	// for tests, a user would not click before redrawing.
 	// Do not use when 'virtualedit' is active.
-	if (curwin->w_redr_type <= VALID_NO_UPDATE && !virtual_active())
+	if (curwin->w_redr_type <= UPD_VALID_NO_UPDATE && !virtual_active())
 	    col_from_screen = ScreenCols[off];
 #ifdef FEAT_FOLDING
 	// Remember the character under the mouse, it might be a '-' or '+' in
--- a/src/move.c
+++ b/src/move.c
@@ -131,7 +131,7 @@ redraw_for_cursorline(win_T *wp)
 	    && !pum_visible())
     {
 	// win_line() will redraw the number column and cursorline only.
-	redraw_win_later(wp, VALID);
+	redraw_win_later(wp, UPD_VALID);
     }
 }
 
@@ -145,12 +145,13 @@ redraw_for_cursorcolumn(win_T *wp)
 {
     if ((wp->w_valid & VALID_VIRTCOL) == 0 && !pum_visible())
     {
-	// When 'cursorcolumn' is set need to redraw with SOME_VALID.
+	// When 'cursorcolumn' is set need to redraw with UPD_SOME_VALID.
 	if (wp->w_p_cuc)
-	    redraw_win_later(wp, SOME_VALID);
-	// When 'cursorlineopt' contains "screenline" need to redraw with VALID.
+	    redraw_win_later(wp, UPD_SOME_VALID);
+	// When 'cursorlineopt' contains "screenline" need to redraw with
+	// UPD_VALID.
 	else if (wp->w_p_cul && (wp->w_p_culopt_flags & CULOPT_SCRLINE))
-	    redraw_win_later(wp, VALID);
+	    redraw_win_later(wp, UPD_VALID);
     }
 }
 #endif
@@ -218,7 +219,7 @@ update_topline(void)
     if (BUFEMPTY())		// special case - file is empty
     {
 	if (curwin->w_topline != 1)
-	    redraw_later(NOT_VALID);
+	    redraw_later(UPD_NOT_VALID);
 	curwin->w_topline = 1;
 	curwin->w_botline = 2;
 	curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP;
@@ -401,10 +402,10 @@ update_topline(void)
 	if (curwin->w_skipcol != 0)
 	{
 	    curwin->w_skipcol = 0;
-	    redraw_later(NOT_VALID);
+	    redraw_later(UPD_NOT_VALID);
 	}
 	else
-	    redraw_later(VALID);
+	    redraw_later(UPD_VALID);
 	// May need to set w_skipcol when cursor in w_topline.
 	if (curwin->w_cursor.lnum == curwin->w_topline)
 	    validate_cursor();
@@ -522,7 +523,7 @@ changed_window_setting_win(win_T *wp)
     wp->w_lines_valid = 0;
     changed_line_abv_curs_win(wp);
     wp->w_valid &= ~(VALID_BOTLINE|VALID_BOTLINE_AP|VALID_TOPLINE);
-    redraw_win_later(wp, NOT_VALID);
+    redraw_win_later(wp, UPD_NOT_VALID);
 }
 
 /*
@@ -552,7 +553,7 @@ set_topline(win_T *wp, linenr_T lnum)
 #endif
     wp->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_TOPLINE);
     // Don't set VALID_TOPLINE here, 'scrolloff' needs to be checked.
-    redraw_later(VALID);
+    redraw_later(UPD_VALID);
 }
 
 /*
@@ -1089,7 +1090,7 @@ curs_columns(
 	    {
 		curwin->w_leftcol = new_leftcol;
 		// screen has to be redrawn with new curwin->w_leftcol
-		redraw_later(NOT_VALID);
+		redraw_later(UPD_NOT_VALID);
 	    }
 	}
 	curwin->w_wcol -= curwin->w_leftcol;
@@ -1202,7 +1203,7 @@ curs_columns(
     else
 	curwin->w_skipcol = 0;
     if (prev_skipcol != curwin->w_skipcol)
-	redraw_later(NOT_VALID);
+	redraw_later(UPD_NOT_VALID);
 
 #ifdef FEAT_SYN_HL
     redraw_for_cursorcolumn(curwin);
@@ -2672,7 +2673,7 @@ onepage(int dir, long count)
 #endif
     }
 
-    redraw_later(VALID);
+    redraw_later(UPD_VALID);
     return retval;
 }
 
@@ -2924,7 +2925,7 @@ halfpage(int flag, linenr_T Prenum)
 #endif
     cursor_correct();
     beginline(BL_SOL | BL_FIX);
-    redraw_later(VALID);
+    redraw_later(UPD_VALID);
 }
 
     void
@@ -2978,7 +2979,7 @@ do_check_cursorbind(void)
 	    // Correct cursor for multi-byte character.
 	    if (has_mbyte)
 		mb_adjust_cursor();
-	    redraw_later(VALID);
+	    redraw_later(UPD_VALID);
 
 	    // Only scroll when 'scrollbind' hasn't done this.
 	    if (!curwin->w_p_scb)
--- a/src/netbeans.c
+++ b/src/netbeans.c
@@ -116,7 +116,7 @@ netbeans_close(void)
     // remove all signs and update the screen after gutter removal
     coloncmd(":sign unplace *");
     changed_window_setting();
-    update_screen(CLEAR);
+    update_screen(UPD_CLEAR);
     setcursor();
     cursor_on();
     out_flush_cursor(TRUE, FALSE);
@@ -1835,9 +1835,9 @@ nb_do_cmd(
 	    }
 
 	    // gui_update_cursor(TRUE, FALSE);
-	    // update_curbuf(NOT_VALID);
+	    // update_curbuf(UPD_NOT_VALID);
 	    update_topline();		// scroll to show the line
-	    update_screen(VALID);
+	    update_screen(UPD_VALID);
 	    setcursor();
 	    cursor_on();
 	    out_flush_cursor(TRUE, FALSE);
@@ -2027,7 +2027,7 @@ nb_do_cmd(
 	    args = (char_u *)cp;
 	    coloncmd(":sign unplace %d buffer=%d",
 		     serNum, buf->bufp->b_fnum);
-	    redraw_buf_later(buf->bufp, NOT_VALID);
+	    redraw_buf_later(buf->bufp, UPD_NOT_VALID);
 #endif
 // =====================================================================
 	}
@@ -2113,7 +2113,7 @@ nb_do_cmd(
 			}
 		    }
 #endif
-		    redraw_buf_later(buf->bufp, NOT_VALID);
+		    redraw_buf_later(buf->bufp, UPD_NOT_VALID);
 		}
 	    }
 // =====================================================================
@@ -2223,7 +2223,7 @@ nb_do_cmd(
      */
     if (buf != NULL && buf->initDone && do_update)
     {
-	update_screen(NOT_VALID);
+	update_screen(UPD_NOT_VALID);
 	setcursor();
 	cursor_on();
 	out_flush_cursor(TRUE, FALSE);
@@ -2528,7 +2528,7 @@ netbeans_open(char *params, int doabort)
 
     // update the screen after having added the gutter
     changed_window_setting();
-    update_screen(CLEAR);
+    update_screen(UPD_CLEAR);
     setcursor();
     cursor_on();
     out_flush_cursor(TRUE, FALSE);
--- a/src/normal.c
+++ b/src/normal.c
@@ -830,7 +830,7 @@ normal_cmd(
 		&& !(mod_mask & MOD_MASK_SHIFT))
 	{
 	    end_visual_mode();
-	    redraw_curbuf_later(INVERTED);
+	    redraw_curbuf_later(UPD_INVERTED);
 	}
 
 	// Keys that work different when 'keymodel' contains "startsel"
@@ -1172,7 +1172,7 @@ reset_VIsual_and_resel(void)
     if (VIsual_active)
     {
 	end_visual_mode();
-	redraw_curbuf_later(INVERTED);	// delete the inversion later
+	redraw_curbuf_later(UPD_INVERTED);	// delete the inversion later
     }
     VIsual_reselect = FALSE;
 }
@@ -1186,7 +1186,7 @@ reset_VIsual(void)
     if (VIsual_active)
     {
 	end_visual_mode();
-	redraw_curbuf_later(INVERTED);	// delete the inversion later
+	redraw_curbuf_later(UPD_INVERTED);	// delete the inversion later
 	VIsual_reselect = FALSE;
     }
 }
@@ -1945,7 +1945,7 @@ check_scrollbind(linenr_T topline_diff, 
 		    scrolldown(-y, FALSE);
 	    }
 
-	    redraw_later(VALID);
+	    redraw_later(UPD_VALID);
 	    cursor_correct();
 	    curwin->w_redr_status = TRUE;
 	}
@@ -2515,7 +2515,7 @@ scroll_redraw(int up, long count)
     }
     if (curwin->w_cursor.lnum != prev_lnum)
 	coladvance(curwin->w_curswant);
-    redraw_later(VALID);
+    redraw_later(UPD_VALID);
 }
 
 /*
@@ -2709,7 +2709,7 @@ nv_zet(cmdarg_T *cap)
 		// FALLTHROUGH
 
     case 't':	scroll_cursor_top(0, TRUE);
-		redraw_later(VALID);
+		redraw_later(UPD_VALID);
 		set_fraction(curwin);
 		break;
 
@@ -2718,7 +2718,7 @@ nv_zet(cmdarg_T *cap)
 		// FALLTHROUGH
 
     case 'z':	scroll_cursor_halfway(TRUE);
-		redraw_later(VALID);
+		redraw_later(UPD_VALID);
 		set_fraction(curwin);
 		break;
 
@@ -2741,7 +2741,7 @@ nv_zet(cmdarg_T *cap)
 		// FALLTHROUGH
 
     case 'b':	scroll_cursor_bot(0, TRUE);
-		redraw_later(VALID);
+		redraw_later(UPD_VALID);
 		set_fraction(curwin);
 		break;
 
@@ -2794,7 +2794,7 @@ nv_zet(cmdarg_T *cap)
 		    if (curwin->w_leftcol != col)
 		    {
 			curwin->w_leftcol = col;
-			redraw_later(NOT_VALID);
+			redraw_later(UPD_NOT_VALID);
 		    }
 		}
 		break;
@@ -2816,7 +2816,7 @@ nv_zet(cmdarg_T *cap)
 		    if (curwin->w_leftcol != col)
 		    {
 			curwin->w_leftcol = col;
-			redraw_later(NOT_VALID);
+			redraw_later(UPD_NOT_VALID);
 		    }
 		}
 		break;
@@ -3277,7 +3277,7 @@ nv_clear(cmdarg_T *cap)
 	}
 # endif
 #endif
-	redraw_later(CLEAR);
+	redraw_later(UPD_CLEAR);
 #if defined(MSWIN) && (!defined(FEAT_GUI_MSWIN) || defined(VIMDLL))
 # ifdef VIMDLL
 	if (!gui.in_use)
@@ -4193,7 +4193,7 @@ nv_next(cmdarg_T *cap)
 #ifdef FEAT_SEARCH_EXTRA
     // Redraw the window to refresh the highlighted matches.
     if (i > 0 && p_hls && !no_hlsearch)
-	redraw_later(SOME_VALID);
+	redraw_later(UPD_SOME_VALID);
 #endif
 }
 
@@ -4241,7 +4241,7 @@ normal_search(
 #ifdef FEAT_SEARCH_EXTRA
     // Redraw the window to refresh the highlighted matches.
     if (!EQUAL_POS(curwin->w_cursor, prev_cursor) && p_hls && !no_hlsearch)
-	redraw_later(SOME_VALID);
+	redraw_later(UPD_SOME_VALID);
 #endif
 
     // "/$" will put the cursor after the end of the line, may need to
@@ -5462,7 +5462,7 @@ nv_visual(cmdarg_T *cap)
 	    showmode();
 	    may_trigger_modechanged();
 	}
-	redraw_curbuf_later(INVERTED);	    // update the inversion
+	redraw_curbuf_later(UPD_INVERTED);	    // update the inversion
     }
     else		    // start Visual mode
     {
@@ -5515,7 +5515,7 @@ nv_visual(cmdarg_T *cap)
 	    }
 	    else
 		curwin->w_set_curswant = TRUE;
-	    redraw_curbuf_later(INVERTED);	// show the inversion
+	    redraw_curbuf_later(UPD_INVERTED);	// show the inversion
 	}
 	else
 	{
@@ -5605,7 +5605,7 @@ n_start_visual_mode(int c)
 
     // Only need to redraw this line, unless still need to redraw an old
     // Visual area (when 'lazyredraw' is set).
-    if (curwin->w_redr_type < INVERTED)
+    if (curwin->w_redr_type < UPD_INVERTED)
     {
 	curwin->w_old_cursor_lnum = curwin->w_cursor.lnum;
 	curwin->w_old_visual_lnum = curwin->w_cursor.lnum;
@@ -5716,7 +5716,7 @@ nv_gv_cmd(cmdarg_T *cap)
     // end are still the same, and the selection needs to be owned
     clip_star.vmode = NUL;
 #endif
-    redraw_curbuf_later(INVERTED);
+    redraw_curbuf_later(UPD_INVERTED);
     showmode();
 }
 
@@ -6753,7 +6753,7 @@ nv_normal(cmdarg_T *cap)
 	if (VIsual_active)
 	{
 	    end_visual_mode();		// stop Visual
-	    redraw_curbuf_later(INVERTED);
+	    redraw_curbuf_later(UPD_INVERTED);
 	}
 	// CTRL-\ CTRL-G restarts Insert mode when 'insertmode' is set.
 	if (cap->nchar == Ctrl_G && p_im)
@@ -6825,7 +6825,7 @@ nv_esc(cmdarg_T *cap)
 	end_visual_mode();	// stop Visual
 	check_cursor_col();	// make sure cursor is not beyond EOL
 	curwin->w_set_curswant = TRUE;
-	redraw_curbuf_later(INVERTED);
+	redraw_curbuf_later(UPD_INVERTED);
     }
     else if (no_reason)
 	vim_beep(BO_ESC);
--- a/src/ops.c
+++ b/src/ops.c
@@ -1358,7 +1358,7 @@ op_tilde(oparg_T *oap)
 
     if (!did_change && oap->is_VIsual)
 	// No change: need to remove the Visual selection
-	redraw_curbuf_later(INVERTED);
+	redraw_curbuf_later(UPD_INVERTED);
 
     if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
     {
@@ -1493,7 +1493,7 @@ op_insert(oparg_T *oap, long count1)
 
     // vis block is still marked. Get rid of it now.
     curwin->w_cursor.lnum = oap->start.lnum;
-    update_screen(INVERTED);
+    update_screen(UPD_INVERTED);
 
     if (oap->block_mode)
     {
@@ -2485,7 +2485,7 @@ op_addsub(
 
 	if (!change_cnt && oap->is_VIsual)
 	    // No change: need to remove the Visual selection
-	    redraw_curbuf_later(INVERTED);
+	    redraw_curbuf_later(UPD_INVERTED);
 
 	// Set '[ mark if something changed. Keep the last end
 	// position from do_addsub().
@@ -3908,7 +3908,7 @@ do_pending_operator(cmdarg_T *cap, int o
 		    // make sure redrawing is correct
 		    curwin->w_p_lbr = lbr_saved;
 #endif
-		    redraw_curbuf_later(INVERTED);
+		    redraw_curbuf_later(UPD_INVERTED);
 		}
 	    }
 	}
@@ -3948,7 +3948,7 @@ do_pending_operator(cmdarg_T *cap, int o
 #ifdef FEAT_LINEBREAK
 	    curwin->w_p_lbr = lbr_saved;
 #endif
-	    redraw_curbuf_later(INVERTED);
+	    redraw_curbuf_later(UPD_INVERTED);
 	}
 
 	// If the end of an operator is in column one while oap->motion_type
--- a/src/option.c
+++ b/src/option.c
@@ -1278,7 +1278,7 @@ do_set(
 		set_options_default(OPT_FREE | opt_flags);
 		didset_options();
 		didset_options2();
-		redraw_all_later(CLEAR);
+		redraw_all_later(UPD_CLEAR);
 	    }
 	    else
 	    {
@@ -2147,7 +2147,7 @@ do_set(
 			}
 			if (full_screen)
 			    ttest(FALSE);
-			redraw_all_later(CLEAR);
+			redraw_all_later(UPD_CLEAR);
 		    }
 		}
 
@@ -2923,7 +2923,7 @@ set_bool_option(
     // when 'ignorecase' is set or reset and 'hlsearch' is set, redraw
     else if ((int *)varp == &p_ic && p_hls)
     {
-	redraw_all_later(SOME_VALID);
+	redraw_all_later(UPD_SOME_VALID);
     }
 
 #ifdef FEAT_SEARCH_EXTRA
@@ -3206,7 +3206,7 @@ set_bool_option(
 	// 'relativenumber' option is toggled, then don't refresh the screen
 	// (optimization).
 	if (!(curwin->w_p_nu && ((int *)varp == &curwin->w_p_rnu)))
-	    redraw_all_later(CLEAR);
+	    redraw_all_later(UPD_CLEAR);
     }
 #endif
 
@@ -3849,13 +3849,13 @@ check_redraw(long_u flags)
     if ((flags & P_RBUF) || (flags & P_RWIN) || all)
 	changed_window_setting();
     if (flags & P_RBUF)
-	redraw_curbuf_later(NOT_VALID);
+	redraw_curbuf_later(UPD_NOT_VALID);
     if (flags & P_RWINONLY)
-	redraw_later(NOT_VALID);
+	redraw_later(UPD_NOT_VALID);
     if (doclear)
-	redraw_all_later(CLEAR);
+	redraw_all_later(UPD_CLEAR);
     else if (all)
-	redraw_all_later(NOT_VALID);
+	redraw_all_later(UPD_NOT_VALID);
 }
 
 /*
@@ -4348,7 +4348,7 @@ set_option_value(
 	    add_termcode(key_name, string, FALSE);
 	    if (full_screen)
 		ttest(FALSE);
-	    redraw_all_later(CLEAR);
+	    redraw_all_later(UPD_CLEAR);
 	    return NULL;
 	}
 
@@ -5213,12 +5213,12 @@ unset_global_local_option(char_u *name, 
 	case PV_LCS:
 	    clear_string_option(&((win_T *)from)->w_p_lcs);
 	    set_chars_option((win_T *)from, &((win_T *)from)->w_p_lcs, TRUE);
-	    redraw_later(NOT_VALID);
+	    redraw_later(UPD_NOT_VALID);
 	    break;
 	case PV_FCS:
 	    clear_string_option(&((win_T *)from)->w_p_fcs);
 	    set_chars_option((win_T *)from, &((win_T *)from)->w_p_fcs, TRUE);
-	    redraw_later(NOT_VALID);
+	    redraw_later(UPD_NOT_VALID);
 	    break;
 	case PV_VE:
 	    clear_string_option(&((win_T *)from)->w_p_ve);
--- a/src/optionstr.c
+++ b/src/optionstr.c
@@ -758,7 +758,7 @@ did_set_string_option(
 	    errmsg = e_invalid_argument;
 	// list setting requires a redraw
 	if (curwin->w_briopt_list)
-	    redraw_all_later(NOT_VALID);
+	    redraw_all_later(UPD_NOT_VALID);
     }
 #endif
 
@@ -1121,7 +1121,7 @@ did_set_string_option(
 	    // Redraw needed when switching to/from "mac": a CR in the text
 	    // will be displayed differently.
 	    if (get_fileformat(curbuf) == EOL_MAC || *oldval == 'm')
-		redraw_curbuf_later(NOT_VALID);
+		redraw_curbuf_later(UPD_NOT_VALID);
 	}
     }
 
@@ -1316,7 +1316,7 @@ did_set_string_option(
 		    (void)set_chars_option(wp, local_ptr, TRUE);
 	    }
 
-	    redraw_all_later(NOT_VALID);
+	    redraw_all_later(UPD_NOT_VALID);
 	}
     }
     // local 'listchars'
@@ -1441,7 +1441,7 @@ did_set_string_option(
 	if (varp == &T_ME)
 	{
 	    out_str(T_ME);
-	    redraw_later(CLEAR);
+	    redraw_later(UPD_CLEAR);
 #if defined(MSWIN) && (!defined(FEAT_GUI_MSWIN) || defined(VIMDLL))
 	    // Since t_me has been set, this probably means that the user
 	    // wants to use this as default colors.  Need to reset default
@@ -1773,7 +1773,7 @@ did_set_string_option(
 	    if (curwin->w_status_height)
 	    {
 		curwin->w_redr_status = TRUE;
-		redraw_later(VALID);
+		redraw_later(UPD_VALID);
 	    }
 	    curbuf->b_help = (curbuf->b_p_bt[0] == 'h');
 	    redraw_titles();
@@ -2581,7 +2581,7 @@ did_set_string_option(
     // redraw
     if ((varp == &p_flp || varp == &(curbuf->b_p_flp))
 	    && curwin->w_briopt_list)
-	redraw_all_later(NOT_VALID);
+	redraw_all_later(UPD_NOT_VALID);
 #endif
 
     if (curwin->w_curswant != MAXCOL
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -1228,7 +1228,7 @@ sigcont_handler SIGDEFARG(sigarg)
 	// back to a sane mode. We should redraw, but we can't really do that
 	// in a signal handler, do a redraw later.
 	after_sigcont();
-	redraw_later(CLEAR);
+	redraw_later(UPD_CLEAR);
 	cursor_on_force();
 	out_flush();
     }
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -1692,7 +1692,7 @@ WaitForChar(long msec, int ignore_input)
 		{
 		    // The screen is now messed up, must redraw the command
 		    // line and later all the windows.
-		    redraw_all_later(CLEAR);
+		    redraw_all_later(UPD_CLEAR);
 		    compute_cmdrow();
 		    redrawcmd();
 		}
@@ -6483,7 +6483,7 @@ mch_write(
 	// sequence may be inserted asynchronously.
 	if (len < 0)
 	{
-	    redraw_all_later(CLEAR);
+	    redraw_all_later(UPD_CLEAR);
 	    return;
 	}
 
--- a/src/popupmenu.c
+++ b/src/popupmenu.c
@@ -943,7 +943,7 @@ pum_set_selected(int n, int repeat UNUSE
 		    {
 			pum_position_info_popup(curwin);
 			if (win_valid(curwin_save))
-			    redraw_win_later(curwin_save, SOME_VALID);
+			    redraw_win_later(curwin_save, UPD_SOME_VALID);
 		    }
 # endif
 		    if ((curwin != curwin_save && win_valid(curwin_save))
@@ -963,7 +963,7 @@ pum_set_selected(int n, int repeat UNUSE
 
 			// Return cursor to where we were
 			validate_cursor();
-			redraw_later(SOME_VALID);
+			redraw_later(UPD_SOME_VALID);
 
 			// When the preview window was resized we need to
 			// update the view on the buffer.  Only go back to
@@ -1048,7 +1048,7 @@ pum_set_selected(int n, int repeat UNUSE
 pum_undisplay(void)
 {
     pum_array = NULL;
-    redraw_all_later(NOT_VALID);
+    redraw_all_later(UPD_NOT_VALID);
     redraw_tabline = TRUE;
     status_redraw_all();
 #if defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX)
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -406,7 +406,7 @@ popup_handle_scrollbar_click(win_T *wp, 
 		}
 	    }
 	    popup_set_firstline(wp);
-	    redraw_win_later(wp, NOT_VALID);
+	    redraw_win_later(wp, UPD_NOT_VALID);
 	}
     }
 }
@@ -674,7 +674,7 @@ popup_highlight_curline(win_T *wp)
 
 	sign_place(&sign_id, (char_u *)"PopUpMenu", sign_name,
 			       wp->w_buffer, wp->w_cursor.lnum, SIGN_DEF_PRIO);
-	redraw_win_later(wp, NOT_VALID);
+	redraw_win_later(wp, UPD_NOT_VALID);
     }
     else
 	sign_undefine_by_name(sign_name, FALSE);
@@ -1223,7 +1223,7 @@ popup_adjust_position(win_T *wp)
 	    {
 		wp->w_popup_flags |= POPF_HIDDEN;
 		if (win_valid(wp->w_popup_prop_win))
-		    redraw_win_later(wp->w_popup_prop_win, SOME_VALID);
+		    redraw_win_later(wp->w_popup_prop_win, UPD_SOME_VALID);
 	    }
 	    return;
 	}
@@ -1636,7 +1636,7 @@ popup_adjust_position(win_T *wp)
 	    || org_width != wp->w_width
 	    || org_height != wp->w_height)
     {
-	redraw_win_later(wp, NOT_VALID);
+	redraw_win_later(wp, UPD_NOT_VALID);
 	if (wp->w_popup_flags & POPF_ON_CMDLINE)
 	    clear_cmdline = TRUE;
 	popup_mask_refresh = TRUE;
@@ -2211,7 +2211,7 @@ popup_create(typval_T *argvars, typval_T
 
     wp->w_vsep_width = 0;
 
-    redraw_all_later(NOT_VALID);
+    redraw_all_later(UPD_NOT_VALID);
     popup_mask_refresh = TRUE;
 
 #ifdef FEAT_TERMINAL
@@ -2640,7 +2640,7 @@ popup_hide(win_T *wp)
     {
 	wp->w_popup_flags |= POPF_HIDDEN;
 	// Do not decrement b_nwindows, we still reference the buffer.
-	redraw_all_later(NOT_VALID);
+	redraw_all_later(UPD_NOT_VALID);
 	popup_mask_refresh = TRUE;
     }
 }
@@ -2672,7 +2672,7 @@ popup_show(win_T *wp)
     if ((wp->w_popup_flags & POPF_HIDDEN) != 0)
     {
 	wp->w_popup_flags &= ~POPF_HIDDEN;
-	redraw_all_later(NOT_VALID);
+	redraw_all_later(UPD_NOT_VALID);
 	popup_mask_refresh = TRUE;
     }
 }
@@ -2725,7 +2725,7 @@ f_popup_settext(typval_T *argvars, typva
 	else
 	{
 	    popup_set_buffer_text(wp->w_buffer, argvars[1]);
-	    redraw_win_later(wp, NOT_VALID);
+	    redraw_win_later(wp, UPD_NOT_VALID);
 	    popup_adjust_position(wp);
 	}
     }
@@ -2740,7 +2740,7 @@ popup_free(win_T *wp)
 	clear_cmdline = TRUE;
     win_free_popup(wp);
 
-    redraw_all_later(NOT_VALID);
+    redraw_all_later(UPD_NOT_VALID);
     popup_mask_refresh = TRUE;
 }
 
@@ -2919,7 +2919,7 @@ f_popup_setoptions(typval_T *argvars, ty
     apply_options(wp, dict, FALSE);
 
     if (old_firstline != wp->w_firstline)
-	redraw_win_later(wp, NOT_VALID);
+	redraw_win_later(wp, UPD_NOT_VALID);
     popup_adjust_position(wp);
 }
 
@@ -3675,9 +3675,9 @@ may_update_popup_mask(int type)
     int		redrawing_all_win;
 
     // Need to recompute when switching tabs.
-    // Also recompute when the type is CLEAR or NOT_VALID, something basic
-    // (such as the screen size) must have changed.
-    if (popup_mask_tab != curtab || type >= NOT_VALID)
+    // Also recompute when the type is UPD_CLEAR or UPD_NOT_VALID, something
+    // basic (such as the screen size) must have changed.
+    if (popup_mask_tab != curtab || type >= UPD_NOT_VALID)
     {
 	popup_mask_refresh = TRUE;
 	redraw_all_popups = TRUE;
@@ -3709,7 +3709,7 @@ may_update_popup_mask(int type)
     // compare with "popup_mask" to see what changed.
     redrawing_all_win = TRUE;
     FOR_ALL_WINDOWS(wp)
-	if (wp->w_redr_type < SOME_VALID)
+	if (wp->w_redr_type < UPD_SOME_VALID)
 	    redrawing_all_win = FALSE;
     if (redrawing_all_win)
 	mask = popup_mask;
@@ -3796,7 +3796,7 @@ may_update_popup_mask(int type)
 #if defined(FEAT_TERMINAL)
 			    // A terminal window needs to be redrawn.
 			    if (bt_terminal(wp->w_buffer))
-				redraw_win_later(wp, NOT_VALID);
+				redraw_win_later(wp, UPD_NOT_VALID);
 			    else
 #endif
 			    {
@@ -4454,7 +4454,7 @@ popup_set_title(win_T *wp)
 	if (wp->w_popup_title != NULL)
 	    vim_snprintf((char *)wp->w_popup_title, len, " %s ",
 							wp->w_buffer->b_fname);
-	redraw_win_later(wp, VALID);
+	redraw_win_later(wp, UPD_VALID);
     }
 }
 
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -4352,7 +4352,7 @@ qf_win_goto(win_T *win, linenr_T lnum)
     curwin->w_cursor.coladd = 0;
     curwin->w_curswant = 0;
     update_topline();		// scroll to show the line
-    redraw_later(VALID);
+    redraw_later(UPD_VALID);
     curwin->w_redr_status = TRUE;	// update ruler
     curwin = old_curwin;
     curbuf = curwin->w_buffer;
@@ -4573,7 +4573,7 @@ qf_update_buffer(qf_info_T *qi, qfline_T
 	// Only redraw when added lines are visible.  This avoids flickering
 	// when the added lines are not visible.
 	if ((win = qf_find_win(qi)) != NULL && old_line_count < win->w_botline)
-	    redraw_buf_later(buf, NOT_VALID);
+	    redraw_buf_later(buf, UPD_NOT_VALID);
     }
 }
 
@@ -4827,7 +4827,7 @@ qf_fill_buffer(qf_list_T *qfl, buf_T *bu
 	--curbuf_lock;
 
 	// make sure it will be redrawn
-	redraw_curbuf_later(NOT_VALID);
+	redraw_curbuf_later(UPD_NOT_VALID);
     }
 
     // Restore KeyTyped, setting 'filetype' may reset it.
@@ -6468,7 +6468,7 @@ ex_vimgrep(exarg_T *eap)
 #ifdef FEAT_FOLDING
 	foldUpdateAll(curwin);
 #else
-	redraw_later(NOT_VALID);
+	redraw_later(UPD_NOT_VALID);
 #endif
     }
 
--- a/src/register.c
+++ b/src/register.c
@@ -391,7 +391,7 @@ do_record(int c)
 	    {
 		// Enable macro indicator temporarily
 		set_option_value((char_u *)"ch", 1L, NULL, 0);
-		update_screen(VALID);
+		update_screen(UPD_VALID);
 
 		changed_cmdheight = TRUE;
 	    }
@@ -427,7 +427,7 @@ do_record(int c)
 	{
 	    // Restore cmdheight
 	    set_option_value((char_u *)"ch", 0L, NULL, 0);
-	    redraw_all_later(CLEAR);
+	    redraw_all_later(UPD_CLEAR);
 	}
     }
     return retval;
--- a/src/screen.c
+++ b/src/screen.c
@@ -2906,7 +2906,7 @@ give_up:
     screen_Rows = Rows;
     screen_Columns = Columns;
 
-    must_redraw = CLEAR;	// need to clear the screen later
+    must_redraw = UPD_CLEAR;	// need to clear the screen later
     if (doclear)
 	screenclear2();
 #ifdef FEAT_GUI
@@ -3028,8 +3028,8 @@ screenclear2(void)
     win_rest_invalid(firstwin);
     redraw_cmdline = TRUE;
     redraw_tabline = TRUE;
-    if (must_redraw == CLEAR)	// no need to clear again
-	must_redraw = NOT_VALID;
+    if (must_redraw == UPD_CLEAR)	// no need to clear again
+	must_redraw = UPD_NOT_VALID;
     compute_cmdrow();
     msg_row = cmdline_row;	// put cursor on last line for messages
     msg_col = 0;
@@ -3652,7 +3652,7 @@ win_rest_invalid(win_T *wp)
 {
     while (wp != NULL)
     {
-	redraw_win_later(wp, NOT_VALID);
+	redraw_win_later(wp, UPD_NOT_VALID);
 	wp->w_redr_status = TRUE;
 	wp = wp->w_next;
     }
--- a/src/search.c
+++ b/src/search.c
@@ -253,7 +253,7 @@ save_re_pat(int idx, char_u *pat, int ma
 #ifdef FEAT_SEARCH_EXTRA
 	// If 'hlsearch' set and search pat changed: need redraw.
 	if (p_hls)
-	    redraw_all_later(SOME_VALID);
+	    redraw_all_later(UPD_SOME_VALID);
 	set_no_hlsearch(FALSE);
 #endif
     }
@@ -577,7 +577,7 @@ set_last_search_pat(
 # ifdef FEAT_SEARCH_EXTRA
     // If 'hlsearch' set and search pat changed: need redraw.
     if (p_hls && idx == last_idx && !no_hlsearch)
-	redraw_all_later(SOME_VALID);
+	redraw_all_later(UPD_SOME_VALID);
 # endif
 }
 #endif
@@ -1284,7 +1284,7 @@ do_search(
      */
     if (no_hlsearch && !(options & SEARCH_KEEP))
     {
-	redraw_all_later(SOME_VALID);
+	redraw_all_later(UPD_SOME_VALID);
 	set_no_hlsearch(FALSE);
     }
 #endif
@@ -2800,7 +2800,7 @@ showmatch(
 	    if (dollar_vcol >= 0 && dollar_vcol == curwin->w_virtcol)
 		dollar_vcol = -1;
 	    ++curwin->w_virtcol;	// do display ')' just before "$"
-	    update_screen(VALID);	// show the new char first
+	    update_screen(UPD_VALID);	// show the new char first
 
 	    save_dollar_vcol = dollar_vcol;
 #ifdef CURSOR_SHAPE
@@ -3056,7 +3056,7 @@ current_search(
     // end are still the same, and the selection needs to be owned
     clip_star.vmode = NUL;
 #endif
-    redraw_curbuf_later(INVERTED);
+    redraw_curbuf_later(UPD_INVERTED);
     showmode();
 
     return OK;
@@ -3877,7 +3877,7 @@ search_line:
 		{
 		    // Return cursor to where we were
 		    validate_cursor();
-		    redraw_later(VALID);
+		    redraw_later(UPD_VALID);
 		    win_enter(curwin_save, TRUE);
 		}
 # ifdef FEAT_PROP_POPUP
--- a/src/sign.c
+++ b/src/sign.c
@@ -248,7 +248,7 @@ insert_sign(
 	    // column for signs.
 	    if (buf->b_signlist == NULL)
 	    {
-		redraw_buf_later(buf, NOT_VALID);
+		redraw_buf_later(buf, UPD_NOT_VALID);
 		changed_line_abv_curs();
 	    }
 
@@ -616,7 +616,7 @@ buf_delsign(
     // sign columns no longer shows.  And the 'signcolumn' may be hidden.
     if (buf->b_signlist == NULL)
     {
-	redraw_buf_later(buf, NOT_VALID);
+	redraw_buf_later(buf, UPD_NOT_VALID);
 	changed_line_abv_curs();
     }
 
@@ -757,7 +757,7 @@ buf_delete_signs(buf_T *buf, char_u *gro
     // sign column. Not when curwin is NULL (this means we're exiting).
     if (buf->b_signlist != NULL && curwin != NULL)
     {
-	redraw_buf_later(buf, NOT_VALID);
+	redraw_buf_later(buf, UPD_NOT_VALID);
 	changed_line_abv_curs();
     }
 
@@ -1073,7 +1073,7 @@ sign_define_by_name(
 	// non-empty sign list.
 	FOR_ALL_WINDOWS(wp)
 	    if (wp->w_buffer->b_signlist != NULL)
-		redraw_buf_later(wp->w_buffer, NOT_VALID);
+		redraw_buf_later(wp->w_buffer, UPD_NOT_VALID);
     }
 
     // set values for a defined sign.
@@ -1243,7 +1243,7 @@ sign_unplace(int sign_id, char_u *sign_g
     if (sign_id == 0)
     {
 	// Delete all the signs in the specified buffer
-	redraw_buf_later(buf, NOT_VALID);
+	redraw_buf_later(buf, UPD_NOT_VALID);
 	buf_delete_signs(buf, sign_group);
     }
     else
--- a/src/spell.c
+++ b/src/spell.c
@@ -2284,7 +2284,7 @@ did_set_spelllang(win_T *wp)
 		}
 	    }
     }
-    redraw_win_later(wp, NOT_VALID);
+    redraw_win_later(wp, UPD_NOT_VALID);
 
 theend:
     vim_free(spl_copy);
@@ -3854,7 +3854,7 @@ ex_spelldump(exarg_T *eap)
     if (curbuf->b_ml.ml_line_count > 1)
 	ml_delete(curbuf->b_ml.ml_line_count);
 
-    redraw_later(NOT_VALID);
+    redraw_later(UPD_NOT_VALID);
 }
 
 /*
--- a/src/spellfile.c
+++ b/src/spellfile.c
@@ -1759,7 +1759,7 @@ spell_reload_one(
 	    if (spell_load_file(fname, NULL, slang, FALSE) == NULL)
 		// reloading failed, clear the language
 		slang_clear(slang);
-	    redraw_all_later(SOME_VALID);
+	    redraw_all_later(UPD_SOME_VALID);
 	    didit = TRUE;
 	}
     }
@@ -6367,7 +6367,7 @@ spell_add_word(
 	if (buf != NULL)
 	    buf_reload(buf, buf->b_orig_mode, FALSE);
 
-	redraw_all_later(SOME_VALID);
+	redraw_all_later(UPD_SOME_VALID);
     }
     vim_free(fnamebuf);
 }
--- a/src/structs.h
+++ b/src/structs.h
@@ -3698,7 +3698,7 @@ struct window_S
 
     int		w_redr_type;	    // type of redraw to be performed on win
     int		w_upd_rows;	    // number of window lines to update when
-				    // w_redr_type is REDRAW_TOP
+				    // w_redr_type is UPD_REDRAW_TOP
     linenr_T	w_redraw_top;	    // when != 0: first line needing redraw
     linenr_T	w_redraw_bot;	    // when != 0: last line needing redraw
     int		w_redr_status;	    // if TRUE status line must be redrawn
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -3416,7 +3416,7 @@ syn_cmd_spell(exarg_T *eap, int syncing 
     }
 
     // assume spell checking changed, force a redraw
-    redraw_win_later(curwin, NOT_VALID);
+    redraw_win_later(curwin, UPD_NOT_VALID);
 }
 
 /*
@@ -3467,7 +3467,7 @@ syn_cmd_iskeyword(exarg_T *eap, int sync
 	    curbuf->b_p_isk = save_isk;
 	}
     }
-    redraw_win_later(curwin, NOT_VALID);
+    redraw_win_later(curwin, UPD_NOT_VALID);
 }
 
 /*
@@ -3697,7 +3697,7 @@ syn_cmd_clear(exarg_T *eap, int syncing)
 	    arg = skipwhite(arg_end);
 	}
     }
-    redraw_curbuf_later(SOME_VALID);
+    redraw_curbuf_later(UPD_SOME_VALID);
     syn_stack_free_all(curwin->w_s);		// Need to recompute all syntax.
 }
 
@@ -4890,7 +4890,7 @@ error:
     else
 	semsg(_(e_invalid_argument_str), arg);
 
-    redraw_curbuf_later(SOME_VALID);
+    redraw_curbuf_later(UPD_SOME_VALID);
     syn_stack_free_all(curwin->w_s);		// Need to recompute all syntax.
 }
 
@@ -4981,7 +4981,7 @@ syn_cmd_match(
 		++curwin->w_s->b_syn_folditems;
 #endif
 
-	    redraw_curbuf_later(SOME_VALID);
+	    redraw_curbuf_later(UPD_SOME_VALID);
 	    syn_stack_free_all(curwin->w_s);	// Need to recompute all syntax.
 	    return;	// don't free the progs and patterns now
 	}
@@ -5233,7 +5233,7 @@ syn_cmd_region(
 		}
 	    }
 
-	    redraw_curbuf_later(SOME_VALID);
+	    redraw_curbuf_later(UPD_SOME_VALID);
 	    syn_stack_free_all(curwin->w_s);	// Need to recompute all syntax.
 	    success = TRUE;	    // don't free the progs and patterns now
 	}
@@ -5585,7 +5585,7 @@ syn_cmd_cluster(exarg_T *eap, int syncin
 
 	if (got_clstr)
 	{
-	    redraw_curbuf_later(SOME_VALID);
+	    redraw_curbuf_later(UPD_SOME_VALID);
 	    syn_stack_free_all(curwin->w_s);	// Need to recompute all.
 	}
     }
@@ -5862,7 +5862,7 @@ syn_cmd_sync(exarg_T *eap, int syncing U
     else if (!finished)
     {
 	set_nextcmd(eap, arg_start);
-	redraw_curbuf_later(SOME_VALID);
+	redraw_curbuf_later(UPD_SOME_VALID);
 	syn_stack_free_all(curwin->w_s);	// Need to recompute all syntax.
     }
 }
--- a/src/tag.c
+++ b/src/tag.c
@@ -4024,7 +4024,7 @@ jumpto_tag(
 	{
 	    // Return cursor to where we were
 	    validate_cursor();
-	    redraw_later(VALID);
+	    redraw_later(UPD_VALID);
 	    win_enter(curwin_save, TRUE);
 	}
 #endif
--- a/src/term.c
+++ b/src/term.c
@@ -1628,12 +1628,12 @@ may_adjust_color_count(int val)
 	init_highlight(TRUE, FALSE);
 # ifdef DEBUG_TERMRESPONSE
 	{
-	    int r = redraw_asap(CLEAR);
+	    int r = redraw_asap(UPD_CLEAR);
 
 	    log_tr("Received t_Co, redraw_asap(): %d", r);
 	}
 # else
-	redraw_asap(CLEAR);
+	redraw_asap(UPD_CLEAR);
 # endif
     }
 }
@@ -3551,7 +3551,7 @@ set_shellsize(int width, int height, int
 		do_check_scrollbind(TRUE);
 	    if (State & MODE_CMDLINE)
 	    {
-		update_screen(NOT_VALID);
+		update_screen(UPD_NOT_VALID);
 		redrawcmdline();
 	    }
 	    else
@@ -3559,10 +3559,10 @@ set_shellsize(int width, int height, int
 		update_topline();
 		if (pum_visible())
 		{
-		    redraw_later(NOT_VALID);
+		    redraw_later(UPD_NOT_VALID);
 		    ins_compl_show_pum();
 		}
-		update_screen(NOT_VALID);
+		update_screen(UPD_NOT_VALID);
 		if (redrawing())
 		    setcursor();
 	    }
@@ -3920,8 +3920,8 @@ log_tr(const char *fmt, ...)
     now = start;
     profile_end(&now);
     fprintf(fd_tr, "%s: %s ", profile_msg(&now),
-					must_redraw == NOT_VALID ? "NV"
-					: must_redraw == CLEAR ? "CL" : "  ");
+				must_redraw == UPD_NOT_VALID ? "NV"
+				     : must_redraw == UPD_CLEAR ? "CL" : "  ");
     va_start(ap, fmt);
     vfprintf(fd_tr, fmt, ap);
     va_end(ap);
@@ -4624,12 +4624,12 @@ handle_u7_response(int *arg, char_u *tp 
 	    set_option_value_give_err((char_u *)"ambw", 0L, (char_u *)aw, 0);
 # ifdef DEBUG_TERMRESPONSE
 	    {
-		int r = redraw_asap(CLEAR);
+		int r = redraw_asap(UPD_CLEAR);
 
 		log_tr("set 'ambiwidth', redraw_asap(): %d", r);
 	    }
 # else
-	    redraw_asap(CLEAR);
+	    redraw_asap(UPD_CLEAR);
 # endif
 # ifdef FEAT_EVAL
 	    set_vim_var_string(VV_TERMU7RESP, tp, csi_len);
@@ -5167,7 +5167,7 @@ handle_osc(char_u *tp, char_u *argp, int
 			    set_option_value_give_err((char_u *)"bg",
 						  0L, (char_u *)new_bg_val, 0);
 			    reset_option_was_set((char_u *)"bg");
-			    redraw_asap(CLEAR);
+			    redraw_asap(UPD_CLEAR);
 			}
 		    }
 # ifdef FEAT_TERMINAL
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -1286,7 +1286,7 @@ write_to_term(buf_T *buffer, char_u *msg
 	ch_log(term->tl_job->jv_channel, "updating screen");
 	if (buffer == curbuf && (State & MODE_CMDLINE) == 0)
 	{
-	    update_screen(VALID_NO_UPDATE);
+	    update_screen(UPD_VALID_NO_UPDATE);
 	    // update_screen() can be slow, check the terminal wasn't closed
 	    // already
 	    if (buffer == curbuf && curbuf->b_term != NULL)
@@ -2017,7 +2017,7 @@ may_move_terminal_to_buffer(term_T *term
 		    if (wp->w_topline < min_topline)
 			wp->w_topline = min_topline;
 		}
-		redraw_win_later(wp, NOT_VALID);
+		redraw_win_later(wp, UPD_NOT_VALID);
 	    }
 	}
     }
@@ -2136,10 +2136,10 @@ term_enter_job_mode()
 
     if (term->tl_channel_closed)
 	cleanup_vterm(term);
-    redraw_buf_and_status_later(curbuf, NOT_VALID);
+    redraw_buf_and_status_later(curbuf, UPD_NOT_VALID);
 #ifdef FEAT_PROP_POPUP
     if (WIN_IS_POPUP(curwin))
-	redraw_later(NOT_VALID);
+	redraw_later(UPD_NOT_VALID);
 #endif
 }
 
@@ -3015,7 +3015,7 @@ handle_damage(VTermRect rect, void *user
     term->tl_dirty_row_start = MIN(term->tl_dirty_row_start, rect.start_row);
     term->tl_dirty_row_end = MAX(term->tl_dirty_row_end, rect.end_row);
     set_dirty_snapshot(term);
-    redraw_buf_later(term->tl_buffer, SOME_VALID);
+    redraw_buf_later(term->tl_buffer, UPD_SOME_VALID);
     return 1;
 }
 
@@ -3068,7 +3068,7 @@ handle_moverect(VTermRect dest, VTermRec
 
     // Note sure if the scrolling will work correctly, let's do a complete
     // redraw later.
-    redraw_buf_later(term->tl_buffer, NOT_VALID);
+    redraw_buf_later(term->tl_buffer, UPD_NOT_VALID);
     return 1;
 }
 
@@ -3222,7 +3222,7 @@ handle_resize(int rows, int cols, void *
 		win_setwidth_win(cols, wp);
 	    }
 	}
-	redraw_buf_later(term->tl_buffer, NOT_VALID);
+	redraw_buf_later(term->tl_buffer, UPD_NOT_VALID);
     }
     return 1;
 }
@@ -3511,7 +3511,7 @@ term_after_channel_closed(term_T *term)
 	    ch_log(NULL, "terminal job finished");
     }
 
-    redraw_buf_and_status_later(term->tl_buffer, NOT_VALID);
+    redraw_buf_and_status_later(term->tl_buffer, UPD_NOT_VALID);
     return FALSE;
 }
 
@@ -3816,9 +3816,9 @@ term_update_window(win_T *wp)
     screen = vterm_obtain_screen(vterm);
     state = vterm_obtain_state(vterm);
 
-    // We use NOT_VALID on a resize or scroll, redraw everything then.  With
-    // SOME_VALID only redraw what was marked dirty.
-    if (wp->w_redr_type > SOME_VALID)
+    // We use UPD_NOT_VALID on a resize or scroll, redraw everything then.
+    // With UPD_SOME_VALID only redraw what was marked dirty.
+    if (wp->w_redr_type > UPD_SOME_VALID)
     {
 	term->tl_dirty_row_start = 0;
 	term->tl_dirty_row_end = MAX_ROW;
@@ -3955,7 +3955,7 @@ term_change_in_curbuf(void)
     if (term_is_finished(curbuf) && term->tl_scrollback.ga_len > 0)
     {
 	free_scrollback(term);
-	redraw_buf_later(term->tl_buffer, NOT_VALID);
+	redraw_buf_later(term->tl_buffer, UPD_NOT_VALID);
 
 	// The buffer is now like a normal buffer, it cannot be easily
 	// abandoned when changed.
@@ -5538,7 +5538,7 @@ term_load_dump(typval_T *argvars, typval
 	    while (!(curbuf->b_ml.ml_flags & ML_EMPTY))
 		ml_delete((linenr_T)1);
 	    free_scrollback(curbuf->b_term);
-	    redraw_later(NOT_VALID);
+	    redraw_later(UPD_NOT_VALID);
 	}
     }
     else
@@ -5831,7 +5831,7 @@ term_swap_diff()
     term->tl_top_diff_rows = bot_rows;
     term->tl_bot_diff_rows = top_rows;
 
-    update_screen(NOT_VALID);
+    update_screen(UPD_NOT_VALID);
     return OK;
 }
 
--- a/src/textformat.c
+++ b/src/textformat.c
@@ -461,7 +461,7 @@ internal_format(
     if (!format_only && haveto_redraw)
     {
 	update_topline();
-	redraw_curbuf_later(VALID);
+	redraw_curbuf_later(UPD_VALID);
     }
 }
 
@@ -840,7 +840,7 @@ op_format(
 
     if (oap->is_VIsual)
 	// When there is no change: need to remove the Visual selection
-	redraw_curbuf_later(INVERTED);
+	redraw_curbuf_later(UPD_INVERTED);
 
     if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0)
 	// Set '[ mark at the start of the formatted area
@@ -903,7 +903,7 @@ op_formatexpr(oparg_T *oap)
 {
     if (oap->is_VIsual)
 	// When there is no change: need to remove the Visual selection
-	redraw_curbuf_later(INVERTED);
+	redraw_curbuf_later(UPD_INVERTED);
 
     if (fex_format(oap->start.lnum, oap->line_count, NUL) != 0)
 	// As documented: when 'formatexpr' returns non-zero fall back to
--- a/src/textobject.c
+++ b/src/textobject.c
@@ -740,7 +740,7 @@ current_word(
 	{
 	    // should do something when inclusive == FALSE !
 	    VIsual = start_pos;
-	    redraw_curbuf_later(INVERTED);	// update the inversion
+	    redraw_curbuf_later(UPD_INVERTED);	// update the inversion
 	}
 	else
 	{
@@ -1010,7 +1010,7 @@ extend:
 	VIsual = start_pos;
 	VIsual_mode = 'v';
 	redraw_cmdline = TRUE;		// show mode later
-	redraw_curbuf_later(INVERTED);	// update the inversion
+	redraw_curbuf_later(UPD_INVERTED);	// update the inversion
     }
     else
     {
@@ -1167,7 +1167,7 @@ current_block(
 	    inc(&curwin->w_cursor);	// include the line break
 	VIsual = start_pos;
 	VIsual_mode = 'v';
-	redraw_curbuf_later(INVERTED);	// update the inversion
+	redraw_curbuf_later(UPD_INVERTED);	// update the inversion
 	showmode();
     }
     else
@@ -1447,7 +1447,7 @@ again:
 	    inc_cursor();
 	VIsual = start_pos;
 	VIsual_mode = 'v';
-	redraw_curbuf_later(INVERTED);	// update the inversion
+	redraw_curbuf_later(UPD_INVERTED);	// update the inversion
 	showmode();
     }
     else
@@ -1630,7 +1630,7 @@ extend:
 	    VIsual.col = 0;
 	}
 	VIsual_mode = 'V';
-	redraw_curbuf_later(INVERTED);	// update the inversion
+	redraw_curbuf_later(UPD_INVERTED);	// update the inversion
 	showmode();
     }
     else
@@ -1933,7 +1933,7 @@ current_quote(
 				|| line[VIsual.col - 1] != quotechar)))))
 	{
 	    VIsual = curwin->w_cursor;
-	    redraw_curbuf_later(INVERTED);
+	    redraw_curbuf_later(UPD_INVERTED);
 	}
     }
     else
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -395,7 +395,7 @@ f_prop_add_list(typval_T *argvars, typva
 	    return;
     }
 
-    redraw_buf_later(buf, VALID);
+    redraw_buf_later(buf, UPD_VALID);
 }
 
 /*
@@ -550,7 +550,7 @@ prop_add_common(
 				    start_lnum, end_lnum, start_col, end_col);
     text = NULL;
 
-    redraw_buf_later(buf, VALID);
+    redraw_buf_later(buf, UPD_VALID);
 
 theend:
     vim_free(text);
@@ -909,7 +909,7 @@ f_prop_clear(typval_T *argvars, typval_T
 	}
     }
     if (did_clear)
-	redraw_buf_later(buf, NOT_VALID);
+	redraw_buf_later(buf, UPD_NOT_VALID);
 }
 
 /*
@@ -1525,7 +1525,7 @@ f_prop_remove(typval_T *argvars, typval_
     {
 	changed_line_display_buf(buf);
 	changed_lines_buf(buf, first_changed, last_changed + 1, 0);
-	redraw_buf_later(buf, VALID);
+	redraw_buf_later(buf, UPD_VALID);
     }
 
     if (did_remove_text)
--- a/src/undo.c
+++ b/src/undo.c
@@ -3038,7 +3038,7 @@ u_undo_end(
 	FOR_ALL_WINDOWS(wp)
 	{
 	    if (wp->w_buffer == curbuf && wp->w_p_cole > 0)
-		redraw_win_later(wp, NOT_VALID);
+		redraw_win_later(wp, UPD_NOT_VALID);
 	}
     }
 #endif
--- a/src/version.c
+++ b/src/version.c
@@ -736,6 +736,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    206,
+/**/
     205,
 /**/
     204,
--- a/src/vim.h
+++ b/src/vim.h
@@ -579,19 +579,19 @@ extern int (*dyn_libintl_wputenv)(const 
 #endif
 
 /*
- * flags for update_screen()
- * The higher the value, the higher the priority
+ * Flags for update_screen().
+ * The higher the value, the higher the priority.
  */
-#define VALID_NO_UPDATE		 5  // no new changes, keep the command line if
+#define UPD_VALID_NO_UPDATE	 5  // no new changes, keep the command line if
 				    // possible
-#define VALID			10  // buffer not changed, or changes marked
+#define UPD_VALID		10  // buffer not changed, or changes marked
 				    // with b_mod_*
-#define INVERTED		20  // redisplay inverted part that changed
-#define INVERTED_ALL		25  // redisplay whole inverted part
-#define REDRAW_TOP		30  // display first w_upd_rows screen lines
-#define SOME_VALID		35  // like NOT_VALID but may scroll
-#define NOT_VALID		40  // buffer needs complete redraw
-#define CLEAR			50  // screen messed up, clear it
+#define UPD_INVERTED		20  // redisplay inverted part that changed
+#define UPD_INVERTED_ALL	25  // redisplay whole inverted part
+#define UPD_REDRAW_TOP		30  // display first w_upd_rows screen lines
+#define UPD_SOME_VALID		35  // like UPD_NOT_VALID but may scroll
+#define UPD_NOT_VALID		40  // buffer needs complete redraw
+#define UPD_CLEAR		50  // screen messed up, clear it
 
 // flags for screen_line()
 #define SLF_RIGHTLEFT	1
--- a/src/window.c
+++ b/src/window.c
@@ -1313,8 +1313,8 @@ win_split_ins(
 
      // Both windows need redrawing.  Update all status lines, in case they
      // show something related to the window count or position.
-    redraw_win_later(wp, NOT_VALID);
-    redraw_win_later(oldwin, NOT_VALID);
+    redraw_win_later(wp, UPD_NOT_VALID);
+    redraw_win_later(oldwin, UPD_NOT_VALID);
     status_redraw_all();
 
     if (need_status)
@@ -1718,7 +1718,7 @@ win_exchange(long Prenum)
 	wp->w_cursor = curwin->w_cursor;
 
     win_enter(wp, TRUE);
-    redraw_all_later(NOT_VALID);
+    redraw_all_later(UPD_NOT_VALID);
 }
 
 /*
@@ -1801,7 +1801,7 @@ win_rotate(int upwards, int count)
 	(void)win_comp_pos();
     }
 
-    redraw_all_later(NOT_VALID);
+    redraw_all_later(UPD_NOT_VALID);
 }
 
 /*
@@ -1903,7 +1903,7 @@ win_move_after(win_T *win1, win_T *win2)
 	frame_append(win2->w_frame, win1->w_frame);
 
 	(void)win_comp_pos();	// recompute w_winrow for all windows
-	redraw_later(NOT_VALID);
+	redraw_later(UPD_NOT_VALID);
     }
     win_enter(win1, FALSE);
 }
@@ -1966,7 +1966,7 @@ win_equal_rec(
 	    frame_new_height(topfr, height, FALSE, FALSE);
 	    topfr->fr_win->w_wincol = col;
 	    frame_new_width(topfr, width, FALSE, FALSE);
-	    redraw_all_later(NOT_VALID);
+	    redraw_all_later(UPD_NOT_VALID);
 	}
     }
     else if (topfr->fr_layout == FR_ROW)
@@ -2296,7 +2296,7 @@ entering_window(win_T *win)
     static void
 win_init_empty(win_T *wp)
 {
-    redraw_win_later(wp, NOT_VALID);
+    redraw_win_later(wp, UPD_NOT_VALID);
     wp->w_lines_valid = 0;
     wp->w_cursor.lnum = 1;
     wp->w_curswant = wp->w_cursor.col = 0;
@@ -2786,7 +2786,7 @@ win_close(win_T *win, int free_buf)
 	gui_init_which_components(NULL);
 #endif
 
-    redraw_all_later(NOT_VALID);
+    redraw_all_later(UPD_NOT_VALID);
     return OK;
 }
 
@@ -4075,7 +4075,7 @@ win_new_tabpage(int after)
 	entering_window(curwin);
 #endif
 
-	redraw_all_later(NOT_VALID);
+	redraw_all_later(UPD_NOT_VALID);
 	apply_autocmds(EVENT_WINNEW, NULL, NULL, FALSE, curbuf);
 	apply_autocmds(EVENT_WINENTER, NULL, NULL, FALSE, curbuf);
 	apply_autocmds(EVENT_TABNEW, NULL, NULL, FALSE, curbuf);
@@ -4373,7 +4373,7 @@ enter_tabpage(
 	    apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf);
     }
 
-    redraw_all_later(NOT_VALID);
+    redraw_all_later(UPD_NOT_VALID);
 }
 
 /*
@@ -4970,7 +4970,7 @@ win_enter_ext(win_T *wp, int flags)
 #endif
     redraw_tabline = TRUE;
     if (restart_edit)
-	redraw_later(VALID);	// causes status line redraw
+	redraw_later(UPD_VALID);	// causes status line redraw
 
     // set window height to desired minimal value
     if (curwin->w_height < p_wh && !curwin->w_p_wfh
@@ -5589,7 +5589,7 @@ frame_comp_pos(frame_T *topfrp, int *row
 	    // position changed, redraw
 	    wp->w_winrow = *row;
 	    wp->w_wincol = *col;
-	    redraw_win_later(wp, NOT_VALID);
+	    redraw_win_later(wp, UPD_NOT_VALID);
 	    wp->w_redr_status = TRUE;
 	}
 	// WinBar will not show if the window height is zero
@@ -5669,7 +5669,7 @@ win_setheight_win(int height, win_T *win
     msg_row = row;
     msg_col = 0;
 
-    redraw_all_later(NOT_VALID);
+    redraw_all_later(UPD_NOT_VALID);
 }
 
 /*
@@ -5880,7 +5880,7 @@ win_setwidth_win(int width, win_T *wp)
     // recompute the window positions
     (void)win_comp_pos();
 
-    redraw_all_later(NOT_VALID);
+    redraw_all_later(UPD_NOT_VALID);
 }
 
 /*
@@ -6206,7 +6206,7 @@ win_drag_status_line(win_T *dragwin, int
     cmdline_row = row;
     p_ch = MAX(Rows - cmdline_row, p_ch_was_zero ? 0 : 1);
     curtab->tp_ch_used = p_ch;
-    redraw_all_later(SOME_VALID);
+    redraw_all_later(UPD_SOME_VALID);
     showmode();
 }
 
@@ -6312,7 +6312,7 @@ win_drag_vsep_line(win_T *dragwin, int o
 	    fr = fr->fr_next;
     }
     (void)win_comp_pos();
-    redraw_all_later(NOT_VALID);
+    redraw_all_later(UPD_NOT_VALID);
 }
 
 #define FRACTION_MULT	16384L
@@ -6491,7 +6491,7 @@ scroll_to_fraction(win_T *wp, int prev_h
 	wp->w_prev_fraction_row = wp->w_wrow;
 
     win_comp_scroll(wp);
-    redraw_win_later(wp, SOME_VALID);
+    redraw_win_later(wp, UPD_SOME_VALID);
     wp->w_redr_status = TRUE;
     invalidate_botline_win(wp);
 }
@@ -6511,7 +6511,7 @@ win_new_width(win_T *wp, int width)
 	update_topline();
 	curs_columns(TRUE);	// validate w_wrow
     }
-    redraw_win_later(wp, NOT_VALID);
+    redraw_win_later(wp, UPD_NOT_VALID);
     wp->w_redr_status = TRUE;
 }
 
@@ -6692,7 +6692,7 @@ last_status_rec(frame_T *fr, int statusl
 	    else
 		win_new_height(wp, wp->w_height - 1);
 	    comp_col();
-	    redraw_all_later(SOME_VALID);
+	    redraw_all_later(UPD_SOME_VALID);
 	}
     }
     else if (fr->fr_layout == FR_ROW)
@@ -6984,7 +6984,7 @@ restore_snapshot(
 	win_comp_pos();
 	if (wp != NULL && close_curwin)
 	    win_goto(wp);
-	redraw_all_later(NOT_VALID);
+	redraw_all_later(UPD_NOT_VALID);
     }
     clear_snapshot(curtab, idx);
 }