To: vim_dev@googlegroups.com Subject: Patch 9.0.0206 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0206 Problem: Redraw flags are not named specifically. Solution: Prefix "UPD_" to the flags, for UPDate_screen(). 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/vim.h, src/window.c *** ../vim-9.0.0205/src/buffer.c 2022-08-13 14:09:40.979749238 +0100 --- src/buffer.c 2022-08-14 14:04:11.427607354 +0100 *************** *** 1924,1930 **** curbuf->b_last_used = vim_time(); #endif ! redraw_later(NOT_VALID); } #if defined(FEAT_AUTOCHDIR) || defined(PROTO) --- 1924,1930 ---- curbuf->b_last_used = vim_time(); #endif ! redraw_later(UPD_NOT_VALID); } #if defined(FEAT_AUTOCHDIR) || defined(PROTO) *** ../vim-9.0.0205/src/change.c 2022-08-12 13:05:27.563326167 +0100 --- src/change.c 2022-08-14 14:02:12.659593904 +0100 *************** *** 559,566 **** 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; // Check if a change in the buffer has invalidated the cached // values for the cursor. --- 559,566 ---- linenr_T last = lnume + xtra - 1; // last line after the change #endif // Mark this window to be redrawn later. ! 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,665 **** if (wp->w_p_rnu && xtra != 0) { wp->w_last_cursor_lnum_rnu = 0; ! redraw_win_later(wp, VALID); } #ifdef FEAT_SYN_HL // Cursor line highlighting probably need to be updated with ! // "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); else if (lnum <= wp->w_last_cursorline) ! redraw_win_later(wp, SOME_VALID); } #endif } --- 648,665 ---- if (wp->w_p_rnu && xtra != 0) { wp->w_last_cursor_lnum_rnu = 0; ! redraw_win_later(wp, UPD_VALID); } #ifdef FEAT_SYN_HL // Cursor line highlighting probably need to be updated with ! // "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, UPD_VALID); else if (lnum <= wp->w_last_cursorline) ! redraw_win_later(wp, UPD_SOME_VALID); } #endif } *************** *** 671,678 **** // 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; // when the cursor line is changed always trigger CursorMoved if (lnum <= curwin->w_cursor.lnum --- 671,678 ---- // 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 < UPD_VALID) ! must_redraw = UPD_VALID; // when the cursor line is changed always trigger CursorMoved if (lnum <= curwin->w_cursor.lnum *************** *** 724,730 **** FOR_ALL_WINDOWS(wp) if (wp->w_p_diff && wp != curwin) { ! redraw_win_later(wp, VALID); wlnum = diff_lnum_win(lnum, wp); if (wlnum > 0) changedOneline(wp->w_buffer, wlnum); --- 724,730 ---- FOR_ALL_WINDOWS(wp) if (wp->w_p_diff && wp != curwin) { ! redraw_win_later(wp, UPD_VALID); wlnum = diff_lnum_win(lnum, wp); if (wlnum > 0) changedOneline(wp->w_buffer, wlnum); *************** *** 869,875 **** FOR_ALL_WINDOWS(wp) if (wp->w_p_diff && wp != curwin) { ! redraw_win_later(wp, VALID); wlnum = diff_lnum_win(lnum, wp); if (wlnum > 0) changed_lines_buf(wp->w_buffer, wlnum, --- 869,875 ---- FOR_ALL_WINDOWS(wp) if (wp->w_p_diff && wp != curwin) { ! redraw_win_later(wp, UPD_VALID); wlnum = diff_lnum_win(lnum, wp); if (wlnum > 0) changed_lines_buf(wp->w_buffer, wlnum, *** ../vim-9.0.0205/src/channel.c 2022-06-16 11:35:29.000000000 +0100 --- src/channel.c 2022-08-14 13:55:35.919411090 +0100 *************** *** 2930,2936 **** } } } ! redraw_buf_and_status_later(buffer, VALID); channel_need_redraw = TRUE; } --- 2930,2936 ---- } } } ! redraw_buf_and_status_later(buffer, UPD_VALID); channel_need_redraw = TRUE; } *** ../vim-9.0.0205/src/clipboard.c 2022-05-07 18:19:41.000000000 +0100 --- src/clipboard.c 2022-08-14 14:01:02.067578774 +0100 *************** *** 147,153 **** && (cbd == &clip_star ? clip_isautosel_star() : clip_isautosel_plus()) && HL_ATTR(HLF_V) != HL_ATTR(HLF_VNC)) ! redraw_curbuf_later(INVERTED_ALL); } } #else --- 147,153 ---- && (cbd == &clip_star ? clip_isautosel_star() : clip_isautosel_plus()) && HL_ATTR(HLF_V) != HL_ATTR(HLF_VNC)) ! redraw_curbuf_later(UPD_INVERTED_ALL); } } #else *************** *** 202,208 **** && HL_ATTR(HLF_V) != HL_ATTR(HLF_VNC) && !exiting) { ! update_curbuf(INVERTED_ALL); setcursor(); cursor_on(); out_flush_cursor(TRUE, FALSE); --- 202,208 ---- && HL_ATTR(HLF_V) != HL_ATTR(HLF_VNC) && !exiting) { ! update_curbuf(UPD_INVERTED_ALL); setcursor(); cursor_on(); out_flush_cursor(TRUE, FALSE); *** ../vim-9.0.0205/src/cmdexpand.c 2022-07-26 22:01:32.377972135 +0100 --- src/cmdexpand.c 2022-08-14 13:55:41.839415974 +0100 *************** *** 3654,3660 **** p_ls = save_p_ls; p_wmh = save_p_wmh; last_status(FALSE); ! update_screen(VALID); // redraw the screen NOW redrawcmd(); save_p_ls = -1; } --- 3654,3660 ---- p_ls = save_p_ls; p_wmh = save_p_wmh; last_status(FALSE); ! update_screen(UPD_VALID); // redraw the screen NOW redrawcmd(); save_p_ls = -1; } *** ../vim-9.0.0205/src/debugger.c 2022-05-09 19:07:10.000000000 +0100 --- src/debugger.c 2022-08-14 14:04:15.431607576 +0100 *************** *** 285,291 **** --RedrawingDisabled; --no_wait_return; ! redraw_all_later(NOT_VALID); need_wait_return = FALSE; msg_scroll = save_msg_scroll; lines_left = Rows - 1; --- 285,291 ---- --RedrawingDisabled; --no_wait_return; ! redraw_all_later(UPD_NOT_VALID); need_wait_return = FALSE; msg_scroll = save_msg_scroll; lines_left = Rows - 1; *** ../vim-9.0.0205/src/diff.c 2022-07-31 18:34:28.238324299 +0100 --- src/diff.c 2022-08-14 14:08:42.647595849 +0100 *************** *** 123,129 **** // don't redraw right away, more might change or buffer state // is invalid right now need_diff_redraw = TRUE; ! redraw_later(VALID); } } } --- 123,129 ---- // don't redraw right away, more might change or buffer state // is invalid right now need_diff_redraw = TRUE; ! redraw_later(UPD_VALID); } } } *************** *** 683,689 **** if (!wp->w_p_diff || !buf_valid(wp->w_buffer)) continue; ! redraw_win_later(wp, SOME_VALID); if (wp != curwin) wp_other = wp; #ifdef FEAT_FOLDING --- 683,689 ---- if (!wp->w_p_diff || !buf_valid(wp->w_buffer)) continue; ! redraw_win_later(wp, UPD_SOME_VALID); if (wp != curwin) wp_other = wp; #ifdef FEAT_FOLDING *************** *** 1336,1342 **** #endif // patch probably has written over the screen ! redraw_later(CLEAR); // Delete any .orig or .rej file created. STRCPY(buf, tmp_new); --- 1336,1342 ---- #endif // patch probably has written over the screen ! redraw_later(UPD_CLEAR); // Delete any .orig or .rej file created. STRCPY(buf, tmp_new); *************** *** 1544,1550 **** if (addbuf) diff_buf_add(wp->w_buffer); ! redraw_win_later(wp, NOT_VALID); } /* --- 1544,1550 ---- if (addbuf) diff_buf_add(wp->w_buffer); ! redraw_win_later(wp, UPD_NOT_VALID); } /* *** ../vim-9.0.0205/src/digraph.c 2022-06-16 11:07:03.000000000 +0100 --- src/digraph.c 2022-08-14 14:09:04.835592929 +0100 *************** *** 2025,2032 **** ui_breakcheck(); ++dp; } ! must_redraw = CLEAR; // clear screen, because some digraphs may be ! // wrong, in which case we messed up ScreenLines } static void --- 2025,2034 ---- ui_breakcheck(); ++dp; } ! ! // clear screen, because some digraphs may be wrong, in which case we ! // messed up ScreenLines ! must_redraw = UPD_CLEAR; } static void *** ../vim-9.0.0205/src/drawscreen.c 2022-08-11 15:52:10.576940817 +0100 --- src/drawscreen.c 2022-08-14 14:09:17.787591112 +0100 *************** *** 28,34 **** * * 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() * later. * * Commands that change text in the buffer must call changed_bytes() or --- 28,34 ---- * * 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(UPD_VALID) to have the window displayed by update_screen() * later. * * Commands that change text in the buffer must call changed_bytes() or *************** *** 40,62 **** * * 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 * 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 * 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. * ! * Commands that move the window position must call redraw_later(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). * * Things that are handled indirectly: * - When messages scroll the screen up, msg_scrolled will be set and --- 40,62 ---- * * 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(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(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(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(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(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,105 **** if (!screen_valid(TRUE)) return FAIL; ! if (type == VALID_NO_UPDATE) { no_update = TRUE; type = 0; --- 99,105 ---- if (!screen_valid(TRUE)) return FAIL; ! if (type == UPD_VALID_NO_UPDATE) { no_update = TRUE; type = 0; *************** *** 134,145 **** } // May need to update w_lines[]. ! if (curwin->w_lines_valid == 0 && type < NOT_VALID #ifdef FEAT_TERMINAL && !term_do_update_window(curwin) #endif ) ! type = NOT_VALID; // Postpone the redrawing when it's not needed and when being called // recursively. --- 134,145 ---- } // May need to update w_lines[]. ! if (curwin->w_lines_valid == 0 && type < UPD_NOT_VALID #ifdef FEAT_TERMINAL && !term_do_update_window(curwin) #endif ) ! type = UPD_NOT_VALID; // Postpone the redrawing when it's not needed and when being called // recursively. *************** *** 147,153 **** { redraw_later(type); // remember type for next time must_redraw = type; ! if (type > INVERTED_ALL) curwin->w_lines_valid = 0; // don't use w_lines[].wl_size now return FAIL; } --- 147,153 ---- { redraw_later(type); // remember type for next time must_redraw = type; ! if (type > UPD_INVERTED_ALL) curwin->w_lines_valid = 0; // don't use w_lines[].wl_size now return FAIL; } *************** *** 171,198 **** { clear_cmdline = TRUE; if (msg_scrolled > Rows - 5) // clearing is faster ! type = CLEAR; ! else if (type != CLEAR) { check_for_delay(FALSE); if (screen_ins_lines(0, 0, msg_scrolled, (int)Rows, 0, NULL) == FAIL) ! type = 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_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; } else { ! wp->w_redr_type = NOT_VALID; if (W_WINROW(wp) + wp->w_height + wp->w_status_height <= msg_scrolled) wp->w_redr_status = TRUE; --- 171,198 ---- { clear_cmdline = TRUE; if (msg_scrolled > Rows - 5) // clearing is faster ! 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 = 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 < 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 = UPD_REDRAW_TOP; } else { ! 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,223 **** if (need_highlight_changed) highlight_changed(); ! if (type == CLEAR) // first clear screen { screenclear(); // will reset clear_cmdline ! type = NOT_VALID; // must_redraw may be set indirectly, avoid another redraw later must_redraw = 0; } --- 214,223 ---- if (need_highlight_changed) highlight_changed(); ! if (type == UPD_CLEAR) // first clear screen { screenclear(); // will reset clear_cmdline ! type = UPD_NOT_VALID; // must_redraw may be set indirectly, avoid another redraw later must_redraw = 0; } *************** *** 228,251 **** #ifdef FEAT_LINEBREAK // Force redraw when width of 'number' or 'relativenumber' column // changes. ! if (curwin->w_redr_type < NOT_VALID && curwin->w_nrwidth != ((curwin->w_p_nu || curwin->w_p_rnu) ? number_width(curwin) : 0)) ! curwin->w_redr_type = NOT_VALID; #endif // Only start redrawing if there is really something to do. ! if (type == INVERTED) update_curswant(); if (curwin->w_redr_type < type ! && !((type == 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 && VIsual_active && curwin->w_old_cursor_lnum == curwin->w_cursor.lnum && curwin->w_old_visual_mode == VIsual_mode --- 228,251 ---- #ifdef FEAT_LINEBREAK // Force redraw when width of 'number' or 'relativenumber' column // changes. ! 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 = UPD_NOT_VALID; #endif // Only start redrawing if there is really something to do. ! if (type == UPD_INVERTED) update_curswant(); if (curwin->w_redr_type < type ! && !((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 == UPD_INVERTED && VIsual_active && curwin->w_old_cursor_lnum == curwin->w_cursor.lnum && curwin->w_old_visual_mode == VIsual_mode *************** *** 255,261 **** curwin->w_redr_type = type; // Redraw the tab pages line if needed. ! if (redraw_tabline || type >= NOT_VALID) draw_tabline(); #ifdef FEAT_SYN_HL --- 255,261 ---- curwin->w_redr_type = type; // Redraw the tab pages line if needed. ! if (redraw_tabline || type >= UPD_NOT_VALID) draw_tabline(); #ifdef FEAT_SYN_HL *************** *** 1408,1419 **** * * 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 * 2. update lines at the top when scrolled down * 3. redraw changed text: * - if wp->w_buffer->b_mod_set set, update lines between --- 1408,1420 ---- * * How the window is redrawn depends on wp->w_redr_type. Each type also * implies the one below it. ! * 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,1506 **** type = wp->w_redr_type; ! if (type == NOT_VALID) { wp->w_redr_status = TRUE; wp->w_lines_valid = 0; --- 1501,1507 ---- type = wp->w_redr_type; ! if (type == UPD_NOT_VALID) { wp->w_redr_status = TRUE; wp->w_lines_valid = 0; *************** *** 1552,1558 **** i = (wp->w_p_nu || wp->w_p_rnu) ? number_width(wp) : 0; if (wp->w_nrwidth != i) { ! type = NOT_VALID; wp->w_nrwidth = i; } else --- 1553,1559 ---- i = (wp->w_p_nu || wp->w_p_rnu) ? number_width(wp) : 0; if (wp->w_nrwidth != i) { ! type = UPD_NOT_VALID; wp->w_nrwidth = i; } else *************** *** 1563,1569 **** // 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; } else { --- 1564,1570 ---- // 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 = UPD_NOT_VALID; } else { *************** *** 1705,1711 **** // When only displaying the lines at the top, set top_end. Used when // window has scrolled down for msg_scrolled. ! if (type == REDRAW_TOP) { j = 0; for (i = 0; i < wp->w_lines_valid; ++i) --- 1706,1712 ---- // When only displaying the lines at the top, set top_end. Used when // window has scrolled down for msg_scrolled. ! if (type == UPD_REDRAW_TOP) { j = 0; for (i = 0; i < wp->w_lines_valid; ++i) *************** *** 1719,1728 **** } if (top_end == 0) // not found (cannot happen?): redraw everything ! type = NOT_VALID; else ! // top area defined, the rest is VALID ! type = VALID; } // Trick: we want to avoid clearing the screen twice. screenclear() will --- 1720,1729 ---- } if (top_end == 0) // not found (cannot happen?): redraw everything ! type = UPD_NOT_VALID; else ! // top area defined, the rest is UPD_VALID ! type = UPD_VALID; } // Trick: we want to avoid clearing the screen twice. screenclear() will *************** *** 1738,1745 **** // 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) #ifdef FEAT_DIFF && !wp->w_botfill && !wp->w_old_botfill #endif --- 1739,1746 ---- // 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 == 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,1976 **** // 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. if (screen_cleared == TRUE) must_redraw = 0; } else { ! // Not VALID or INVERTED: redraw all lines. mid_start = 0; mid_end = wp->w_height; } ! if (type == SOME_VALID) { ! // SOME_VALID: redraw all lines. mid_start = 0; mid_end = wp->w_height; ! type = 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)) { linenr_T from, to; if (VIsual_active) { if (VIsual_mode != wp->w_old_visual_mode ! || type == INVERTED_ALL) { // If the type of Visual selection changed, redraw the whole // selection. Also when the ownership of the X selection is --- 1943,1977 ---- // 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 ! // UPD_NOT_VALID, need to reset it here to avoid redrawing twice. if (screen_cleared == TRUE) must_redraw = 0; } else { ! // Not UPD_VALID or UPD_INVERTED: redraw all lines. mid_start = 0; mid_end = wp->w_height; } ! if (type == UPD_SOME_VALID) { ! // UPD_SOME_VALID: redraw all lines. mid_start = 0; mid_end = wp->w_height; ! 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 != UPD_NOT_VALID)) { linenr_T from, to; if (VIsual_active) { if (VIsual_mode != wp->w_old_visual_mode ! || 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,3120 **** validate_cursor(); // keep the command line if possible ! update_screen(VALID_NO_UPDATE); setcursor(); if (msg_scrolled == 0) --- 3115,3121 ---- validate_cursor(); // keep the command line if possible ! update_screen(UPD_VALID_NO_UPDATE); setcursor(); if (msg_scrolled == 0) *************** *** 3140,3146 **** /* * 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. */ void redraw_later(int type) --- 3141,3147 ---- /* * 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 UPD_CLEAR, type UPD_NOT_VALID will do nothing. */ void redraw_later(int type) *************** *** 3156,3162 **** if (!exiting && wp->w_redr_type < type) { wp->w_redr_type = type; ! if (type >= NOT_VALID) wp->w_lines_valid = 0; if (must_redraw < type) // must_redraw is the maximum of all windows must_redraw = type; --- 3157,3163 ---- if (!exiting && wp->w_redr_type < type) { wp->w_redr_type = type; ! 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,3176 **** void redraw_later_clear(void) { ! redraw_all_later(CLEAR); reset_screen_attr(); } --- 3171,3177 ---- void redraw_later_clear(void) { ! redraw_all_later(UPD_CLEAR); reset_screen_attr(); } *************** *** 3263,3269 **** if (wp->w_status_height) { wp->w_redr_status = TRUE; ! redraw_later(VALID); } } --- 3264,3270 ---- if (wp->w_status_height) { wp->w_redr_status = TRUE; ! redraw_later(UPD_VALID); } } *************** *** 3279,3285 **** if (wp->w_status_height != 0 && wp->w_buffer == curbuf) { wp->w_redr_status = TRUE; ! redraw_later(VALID); } } --- 3280,3286 ---- if (wp->w_status_height != 0 && wp->w_buffer == curbuf) { wp->w_redr_status = TRUE; ! redraw_later(UPD_VALID); } } *************** *** 3339,3343 **** 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); } --- 3340,3344 ---- 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, UPD_VALID); } *** ../vim-9.0.0205/src/drawscreen.c 2022-08-11 15:52:10.576940817 +0100 --- src/drawscreen.c 2022-08-14 14:09:17.787591112 +0100 *************** *** 28,34 **** * * 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() * later. * * Commands that change text in the buffer must call changed_bytes() or --- 28,34 ---- * * 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(UPD_VALID) to have the window displayed by update_screen() * later. * * Commands that change text in the buffer must call changed_bytes() or *************** *** 40,62 **** * * 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 * 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 * 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. * ! * Commands that move the window position must call redraw_later(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). * * Things that are handled indirectly: * - When messages scroll the screen up, msg_scrolled will be set and --- 40,62 ---- * * 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(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(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(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(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(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,105 **** if (!screen_valid(TRUE)) return FAIL; ! if (type == VALID_NO_UPDATE) { no_update = TRUE; type = 0; --- 99,105 ---- if (!screen_valid(TRUE)) return FAIL; ! if (type == UPD_VALID_NO_UPDATE) { no_update = TRUE; type = 0; *************** *** 134,145 **** } // May need to update w_lines[]. ! if (curwin->w_lines_valid == 0 && type < NOT_VALID #ifdef FEAT_TERMINAL && !term_do_update_window(curwin) #endif ) ! type = NOT_VALID; // Postpone the redrawing when it's not needed and when being called // recursively. --- 134,145 ---- } // May need to update w_lines[]. ! if (curwin->w_lines_valid == 0 && type < UPD_NOT_VALID #ifdef FEAT_TERMINAL && !term_do_update_window(curwin) #endif ) ! type = UPD_NOT_VALID; // Postpone the redrawing when it's not needed and when being called // recursively. *************** *** 147,153 **** { redraw_later(type); // remember type for next time must_redraw = type; ! if (type > INVERTED_ALL) curwin->w_lines_valid = 0; // don't use w_lines[].wl_size now return FAIL; } --- 147,153 ---- { redraw_later(type); // remember type for next time must_redraw = type; ! if (type > UPD_INVERTED_ALL) curwin->w_lines_valid = 0; // don't use w_lines[].wl_size now return FAIL; } *************** *** 171,198 **** { clear_cmdline = TRUE; if (msg_scrolled > Rows - 5) // clearing is faster ! type = CLEAR; ! else if (type != CLEAR) { check_for_delay(FALSE); if (screen_ins_lines(0, 0, msg_scrolled, (int)Rows, 0, NULL) == FAIL) ! type = 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_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; } else { ! wp->w_redr_type = NOT_VALID; if (W_WINROW(wp) + wp->w_height + wp->w_status_height <= msg_scrolled) wp->w_redr_status = TRUE; --- 171,198 ---- { clear_cmdline = TRUE; if (msg_scrolled > Rows - 5) // clearing is faster ! 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 = 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 < 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 = UPD_REDRAW_TOP; } else { ! 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,223 **** if (need_highlight_changed) highlight_changed(); ! if (type == CLEAR) // first clear screen { screenclear(); // will reset clear_cmdline ! type = NOT_VALID; // must_redraw may be set indirectly, avoid another redraw later must_redraw = 0; } --- 214,223 ---- if (need_highlight_changed) highlight_changed(); ! if (type == UPD_CLEAR) // first clear screen { screenclear(); // will reset clear_cmdline ! type = UPD_NOT_VALID; // must_redraw may be set indirectly, avoid another redraw later must_redraw = 0; } *************** *** 228,251 **** #ifdef FEAT_LINEBREAK // Force redraw when width of 'number' or 'relativenumber' column // changes. ! if (curwin->w_redr_type < NOT_VALID && curwin->w_nrwidth != ((curwin->w_p_nu || curwin->w_p_rnu) ? number_width(curwin) : 0)) ! curwin->w_redr_type = NOT_VALID; #endif // Only start redrawing if there is really something to do. ! if (type == INVERTED) update_curswant(); if (curwin->w_redr_type < type ! && !((type == 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 && VIsual_active && curwin->w_old_cursor_lnum == curwin->w_cursor.lnum && curwin->w_old_visual_mode == VIsual_mode --- 228,251 ---- #ifdef FEAT_LINEBREAK // Force redraw when width of 'number' or 'relativenumber' column // changes. ! 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 = UPD_NOT_VALID; #endif // Only start redrawing if there is really something to do. ! if (type == UPD_INVERTED) update_curswant(); if (curwin->w_redr_type < type ! && !((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 == UPD_INVERTED && VIsual_active && curwin->w_old_cursor_lnum == curwin->w_cursor.lnum && curwin->w_old_visual_mode == VIsual_mode *************** *** 255,261 **** curwin->w_redr_type = type; // Redraw the tab pages line if needed. ! if (redraw_tabline || type >= NOT_VALID) draw_tabline(); #ifdef FEAT_SYN_HL --- 255,261 ---- curwin->w_redr_type = type; // Redraw the tab pages line if needed. ! if (redraw_tabline || type >= UPD_NOT_VALID) draw_tabline(); #ifdef FEAT_SYN_HL *************** *** 1408,1419 **** * * 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 * 2. update lines at the top when scrolled down * 3. redraw changed text: * - if wp->w_buffer->b_mod_set set, update lines between --- 1408,1420 ---- * * How the window is redrawn depends on wp->w_redr_type. Each type also * implies the one below it. ! * 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,1506 **** type = wp->w_redr_type; ! if (type == NOT_VALID) { wp->w_redr_status = TRUE; wp->w_lines_valid = 0; --- 1501,1507 ---- type = wp->w_redr_type; ! if (type == UPD_NOT_VALID) { wp->w_redr_status = TRUE; wp->w_lines_valid = 0; *************** *** 1552,1558 **** i = (wp->w_p_nu || wp->w_p_rnu) ? number_width(wp) : 0; if (wp->w_nrwidth != i) { ! type = NOT_VALID; wp->w_nrwidth = i; } else --- 1553,1559 ---- i = (wp->w_p_nu || wp->w_p_rnu) ? number_width(wp) : 0; if (wp->w_nrwidth != i) { ! type = UPD_NOT_VALID; wp->w_nrwidth = i; } else *************** *** 1563,1569 **** // 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; } else { --- 1564,1570 ---- // 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 = UPD_NOT_VALID; } else { *************** *** 1705,1711 **** // When only displaying the lines at the top, set top_end. Used when // window has scrolled down for msg_scrolled. ! if (type == REDRAW_TOP) { j = 0; for (i = 0; i < wp->w_lines_valid; ++i) --- 1706,1712 ---- // When only displaying the lines at the top, set top_end. Used when // window has scrolled down for msg_scrolled. ! if (type == UPD_REDRAW_TOP) { j = 0; for (i = 0; i < wp->w_lines_valid; ++i) *************** *** 1719,1728 **** } if (top_end == 0) // not found (cannot happen?): redraw everything ! type = NOT_VALID; else ! // top area defined, the rest is VALID ! type = VALID; } // Trick: we want to avoid clearing the screen twice. screenclear() will --- 1720,1729 ---- } if (top_end == 0) // not found (cannot happen?): redraw everything ! type = UPD_NOT_VALID; else ! // top area defined, the rest is UPD_VALID ! type = UPD_VALID; } // Trick: we want to avoid clearing the screen twice. screenclear() will *************** *** 1738,1745 **** // 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) #ifdef FEAT_DIFF && !wp->w_botfill && !wp->w_old_botfill #endif --- 1739,1746 ---- // 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 == 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,1976 **** // 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. if (screen_cleared == TRUE) must_redraw = 0; } else { ! // Not VALID or INVERTED: redraw all lines. mid_start = 0; mid_end = wp->w_height; } ! if (type == SOME_VALID) { ! // SOME_VALID: redraw all lines. mid_start = 0; mid_end = wp->w_height; ! type = 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)) { linenr_T from, to; if (VIsual_active) { if (VIsual_mode != wp->w_old_visual_mode ! || type == INVERTED_ALL) { // If the type of Visual selection changed, redraw the whole // selection. Also when the ownership of the X selection is --- 1943,1977 ---- // 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 ! // UPD_NOT_VALID, need to reset it here to avoid redrawing twice. if (screen_cleared == TRUE) must_redraw = 0; } else { ! // Not UPD_VALID or UPD_INVERTED: redraw all lines. mid_start = 0; mid_end = wp->w_height; } ! if (type == UPD_SOME_VALID) { ! // UPD_SOME_VALID: redraw all lines. mid_start = 0; mid_end = wp->w_height; ! 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 != UPD_NOT_VALID)) { linenr_T from, to; if (VIsual_active) { if (VIsual_mode != wp->w_old_visual_mode ! || 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,3120 **** validate_cursor(); // keep the command line if possible ! update_screen(VALID_NO_UPDATE); setcursor(); if (msg_scrolled == 0) --- 3115,3121 ---- validate_cursor(); // keep the command line if possible ! update_screen(UPD_VALID_NO_UPDATE); setcursor(); if (msg_scrolled == 0) *************** *** 3140,3146 **** /* * 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. */ void redraw_later(int type) --- 3141,3147 ---- /* * 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 UPD_CLEAR, type UPD_NOT_VALID will do nothing. */ void redraw_later(int type) *************** *** 3156,3162 **** if (!exiting && wp->w_redr_type < type) { wp->w_redr_type = type; ! if (type >= NOT_VALID) wp->w_lines_valid = 0; if (must_redraw < type) // must_redraw is the maximum of all windows must_redraw = type; --- 3157,3163 ---- if (!exiting && wp->w_redr_type < type) { wp->w_redr_type = type; ! 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,3176 **** void redraw_later_clear(void) { ! redraw_all_later(CLEAR); reset_screen_attr(); } --- 3171,3177 ---- void redraw_later_clear(void) { ! redraw_all_later(UPD_CLEAR); reset_screen_attr(); } *************** *** 3263,3269 **** if (wp->w_status_height) { wp->w_redr_status = TRUE; ! redraw_later(VALID); } } --- 3264,3270 ---- if (wp->w_status_height) { wp->w_redr_status = TRUE; ! redraw_later(UPD_VALID); } } *************** *** 3279,3285 **** if (wp->w_status_height != 0 && wp->w_buffer == curbuf) { wp->w_redr_status = TRUE; ! redraw_later(VALID); } } --- 3280,3286 ---- if (wp->w_status_height != 0 && wp->w_buffer == curbuf) { wp->w_redr_status = TRUE; ! redraw_later(UPD_VALID); } } *************** *** 3339,3343 **** 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); } --- 3340,3344 ---- 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, UPD_VALID); } *** ../vim-9.0.0205/src/edit.c 2022-08-01 15:52:51.727352432 +0100 --- src/edit.c 2022-08-14 13:56:59.023472435 +0100 *************** *** 4701,4707 **** || old_topfill != curwin->w_topfill #endif ) ! redraw_later(VALID); start_arrow(&tpos); can_cindent = TRUE; } --- 4701,4707 ---- || old_topfill != curwin->w_topfill #endif ) ! redraw_later(UPD_VALID); start_arrow(&tpos); can_cindent = TRUE; } *************** *** 4758,4764 **** || old_topfill != curwin->w_topfill #endif ) ! redraw_later(VALID); start_arrow(&tpos); can_cindent = TRUE; } --- 4758,4764 ---- || old_topfill != curwin->w_topfill #endif ) ! redraw_later(UPD_VALID); start_arrow(&tpos); can_cindent = TRUE; } *************** *** 5283,5289 **** scrolldown_clamp(); else scrollup_clamp(); ! redraw_later(VALID); } else { --- 5283,5289 ---- scrolldown_clamp(); else scrollup_clamp(); ! redraw_later(UPD_VALID); } else { *** ../vim-9.0.0205/src/evalvars.c 2022-07-27 14:39:57.308548748 +0100 --- src/evalvars.c 2022-08-14 14:02:38.427598020 +0100 *************** *** 3827,3833 **** else if (STRCMP(varname, "hlsearch") == 0) { no_hlsearch = !di->di_tv.vval.v_number; ! redraw_all_later(SOME_VALID); } #endif goto failed; --- 3827,3833 ---- else if (STRCMP(varname, "hlsearch") == 0) { no_hlsearch = !di->di_tv.vval.v_number; ! redraw_all_later(UPD_SOME_VALID); } #endif goto failed; *** ../vim-9.0.0205/src/ex_cmds.c 2022-08-05 19:46:44.550471107 +0100 --- src/ex_cmds.c 2022-08-14 14:04:58.799609120 +0100 *************** *** 1184,1190 **** vim_free(cmd_buf); goto error; } ! redraw_curbuf_later(VALID); } read_linecount = curbuf->b_ml.ml_line_count; --- 1184,1190 ---- vim_free(cmd_buf); goto error; } ! redraw_curbuf_later(UPD_VALID); } read_linecount = curbuf->b_ml.ml_line_count; *************** *** 3184,3190 **** update_topline(); curwin->w_scbind_pos = curwin->w_topline; *so_ptr = n; ! redraw_curbuf_later(NOT_VALID); // redraw this buffer later } if (p_im && (State & MODE_INSERT) == 0) --- 3184,3190 ---- update_topline(); curwin->w_scbind_pos = curwin->w_topline; *so_ptr = n; ! redraw_curbuf_later(UPD_NOT_VALID); // redraw this buffer later } if (p_im && (State & MODE_INSERT) == 0) *************** *** 4324,4332 **** update_topline(); validate_cursor(); ! update_screen(SOME_VALID); highlight_match = FALSE; ! redraw_later(SOME_VALID); #ifdef FEAT_FOLDING curwin->w_p_fen = save_p_fen; --- 4324,4332 ---- update_topline(); validate_cursor(); ! update_screen(UPD_SOME_VALID); highlight_match = FALSE; ! redraw_later(UPD_SOME_VALID); #ifdef FEAT_FOLDING curwin->w_p_fen = save_p_fen; *************** *** 5270,5276 **** 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); } } else --- 5270,5276 ---- 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(UPD_NOT_VALID); } } else *** ../vim-9.0.0205/src/ex_docmd.c 2022-08-06 22:12:59.994474165 +0100 --- src/ex_docmd.c 2022-08-14 14:09:24.863590087 +0100 *************** *** 551,557 **** #endif --RedrawingDisabled; --no_wait_return; ! update_screen(CLEAR); need_wait_return = FALSE; msg_scroll = save_msg_scroll; } --- 551,557 ---- #endif --RedrawingDisabled; --no_wait_return; ! update_screen(UPD_CLEAR); need_wait_return = FALSE; msg_scroll = save_msg_scroll; } *************** *** 5777,5783 **** else if (has_vtp_working()) { // background color change requires clear + redraw ! update_screen(CLEAR); redrawcmd(); } #endif --- 5777,5783 ---- else if (has_vtp_working()) { // background color change requires clear + redraw ! update_screen(UPD_CLEAR); redrawcmd(); } #endif *************** *** 7116,7122 **** #ifdef FEAT_GUI hold_gui_events = 0; #endif ! must_redraw = CLEAR; pending_exmode_active = TRUE; main_loop(FALSE, TRUE); --- 7116,7122 ---- #ifdef FEAT_GUI hold_gui_events = 0; #endif ! must_redraw = UPD_CLEAR; pending_exmode_active = TRUE; main_loop(FALSE, TRUE); *************** *** 7342,7348 **** else scrolldown(-y, TRUE); curwin->w_scbind_pos = topline; ! redraw_later(VALID); cursor_correct(); curwin->w_redr_status = TRUE; } --- 7342,7348 ---- else scrolldown(-y, TRUE); curwin->w_scbind_pos = topline; ! redraw_later(UPD_VALID); cursor_correct(); curwin->w_redr_status = TRUE; } *************** *** 7438,7444 **** deleted_lines_mark(lnum, 1L); } } ! redraw_curbuf_later(VALID); } } } --- 7438,7444 ---- deleted_lines_mark(lnum, 1L); } } ! redraw_curbuf_later(UPD_VALID); } } } *************** *** 8370,8376 **** p_lz = FALSE; validate_cursor(); update_topline(); ! update_screen(eap->forceit ? CLEAR : VIsual_active ? INVERTED : 0); if (need_maketitle) maketitle(); #if defined(MSWIN) && (!defined(FEAT_GUI_MSWIN) || defined(VIMDLL)) --- 8370,8376 ---- p_lz = FALSE; validate_cursor(); update_topline(); ! 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,8420 **** status_redraw_all(); else status_redraw_curbuf(); ! update_screen(VIsual_active ? INVERTED : 0); RedrawingDisabled = r; p_lz = p; out_flush(); --- 8414,8420 ---- status_redraw_all(); else status_redraw_curbuf(); ! update_screen(VIsual_active ? UPD_INVERTED : 0); RedrawingDisabled = r; p_lz = p; out_flush(); *************** *** 8937,8943 **** { // Return cursor to where we were validate_cursor(); ! redraw_later(VALID); win_enter(curwin_save, TRUE); } # ifdef FEAT_PROP_POPUP --- 8937,8943 ---- { // Return cursor to where we were validate_cursor(); ! redraw_later(UPD_VALID); win_enter(curwin_save, TRUE); } # ifdef FEAT_PROP_POPUP *************** *** 9685,9691 **** ex_nohlsearch(exarg_T *eap UNUSED) { set_no_hlsearch(TRUE); ! redraw_all_later(SOME_VALID); } #endif --- 9685,9691 ---- ex_nohlsearch(exarg_T *eap UNUSED) { set_no_hlsearch(TRUE); ! redraw_all_later(UPD_SOME_VALID); } #endif *** ../vim-9.0.0205/src/ex_getln.c 2022-07-30 19:10:03.569318597 +0100 --- src/ex_getln.c 2022-08-14 14:09:28.191589594 +0100 *************** *** 397,405 **** magic_overruled = is_state->magic_overruled_save; validate_cursor(); // needed for TAB ! redraw_all_later(SOME_VALID); if (call_update_screen) ! update_screen(SOME_VALID); } } --- 397,405 ---- magic_overruled = is_state->magic_overruled_save; validate_cursor(); // needed for TAB ! redraw_all_later(UPD_SOME_VALID); if (call_update_screen) ! update_screen(UPD_SOME_VALID); } } *************** *** 473,479 **** { found = 0; set_no_hlsearch(TRUE); // turn off previous highlight ! redraw_all_later(SOME_VALID); } else { --- 473,479 ---- { found = 0; set_no_hlsearch(TRUE); // turn off previous highlight ! redraw_all_later(UPD_SOME_VALID); } else { *************** *** 556,562 **** if (empty_pattern(ccline.cmdbuff + skiplen, search_delim) && !no_hlsearch) { ! redraw_all_later(SOME_VALID); set_no_hlsearch(TRUE); } ccline.cmdbuff[skiplen + patlen] = next_char; --- 556,562 ---- if (empty_pattern(ccline.cmdbuff + skiplen, search_delim) && !no_hlsearch) { ! redraw_all_later(UPD_SOME_VALID); set_no_hlsearch(TRUE); } ccline.cmdbuff[skiplen + patlen] = next_char; *************** *** 567,573 **** if (p_ru && curwin->w_status_height > 0) curwin->w_redr_status = TRUE; ! update_screen(SOME_VALID); highlight_match = FALSE; restore_last_search_pattern(); --- 567,573 ---- if (p_ru && curwin->w_status_height > 0) curwin->w_redr_status = TRUE; ! update_screen(UPD_SOME_VALID); highlight_match = FALSE; restore_last_search_pattern(); *************** *** 692,698 **** validate_cursor(); highlight_match = TRUE; save_viewstate(&is_state->old_viewstate); ! update_screen(NOT_VALID); highlight_match = FALSE; redrawcmdline(); curwin->w_cursor = is_state->match_end; --- 692,698 ---- validate_cursor(); highlight_match = TRUE; save_viewstate(&is_state->old_viewstate); ! update_screen(UPD_NOT_VALID); highlight_match = FALSE; redrawcmdline(); curwin->w_cursor = is_state->match_end; *************** *** 1623,1629 **** 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 made_cmdheight_nonzero = FALSE; lastwin->w_p_so = save_so; } --- 1623,1629 ---- made_cmdheight_nonzero = TRUE; lastwin->w_p_so = 0; set_option_value((char_u *)"ch", 1L, NULL, 0); ! update_screen(UPD_VALID); // redraw the screen NOW made_cmdheight_nonzero = FALSE; lastwin->w_p_so = save_so; } *************** *** 2616,2622 **** made_cmdheight_nonzero = TRUE; set_option_value((char_u *)"ch", 0L, NULL, 0); // Redraw is needed for command line completion ! redraw_all_later(CLEAR); made_cmdheight_nonzero = FALSE; } --- 2616,2622 ---- made_cmdheight_nonzero = TRUE; set_option_value((char_u *)"ch", 0L, NULL, 0); // Redraw is needed for command line completion ! redraw_all_later(UPD_CLEAR); made_cmdheight_nonzero = FALSE; } *************** *** 4541,4547 **** curwin->w_cursor.col = ccline.cmdpos; changed_line_abv_curs(); invalidate_botline(); ! redraw_later(SOME_VALID); // No Ex mode here! exmode_active = 0; --- 4541,4547 ---- curwin->w_cursor.col = ccline.cmdpos; changed_line_abv_curs(); invalidate_botline(); ! redraw_later(UPD_SOME_VALID); // No Ex mode here! exmode_active = 0; *** ../vim-9.0.0205/src/fileio.c 2022-07-23 09:52:00.333814262 +0100 --- src/fileio.c 2022-08-14 14:05:06.079609228 +0100 *************** *** 2375,2381 **** linecnt = 0; if (newfile || read_buffer) { ! redraw_curbuf_later(NOT_VALID); #ifdef FEAT_DIFF // After reading the text into the buffer the diff info needs to // be updated. --- 2375,2381 ---- linecnt = 0; if (newfile || read_buffer) { ! redraw_curbuf_later(UPD_NOT_VALID); #ifdef FEAT_DIFF // After reading the text into the buffer the diff info needs to // be updated. *** ../vim-9.0.0205/src/fold.c 2022-05-23 15:26:29.000000000 +0100 --- src/fold.c 2022-08-14 14:05:09.835609269 +0100 *************** *** 413,419 **** emsg(_(e_no_fold_found)); // Force a redraw to remove the Visual highlighting. if (had_visual) ! redraw_curbuf_later(INVERTED); } // openFold() {{{2 --- 413,419 ---- emsg(_(e_no_fold_found)); // Force a redraw to remove the Visual highlighting. if (had_visual) ! redraw_curbuf_later(UPD_INVERTED); } // openFold() {{{2 *************** *** 786,792 **** emsg(_(e_no_fold_found)); // Force a redraw to remove the Visual highlighting. if (had_visual) ! redraw_curbuf_later(INVERTED); } else // Deleting markers may make cursor column invalid. --- 786,792 ---- emsg(_(e_no_fold_found)); // Force a redraw to remove the Visual highlighting. if (had_visual) ! redraw_curbuf_later(UPD_INVERTED); } else // Deleting markers may make cursor column invalid. *************** *** 875,881 **** foldUpdateAll(win_T *win) { win->w_foldinvalid = TRUE; ! redraw_win_later(win, NOT_VALID); } // foldMoveTo() {{{2 --- 875,881 ---- foldUpdateAll(win_T *win) { win->w_foldinvalid = TRUE; ! redraw_win_later(win, UPD_NOT_VALID); } // foldMoveTo() {{{2 *** ../vim-9.0.0205/src/getchar.c 2022-07-30 16:54:01.863698294 +0100 --- src/getchar.c 2022-08-14 14:09:31.079589166 +0100 *************** *** 2098,2104 **** // redraw the screen after getchar() if (p_ch == 0) ! update_screen(CLEAR); set_vim_var_nr(VV_MOUSE_WIN, 0); set_vim_var_nr(VV_MOUSE_WINID, 0); --- 2098,2104 ---- // redraw the screen after getchar() if (p_ch == 0) ! update_screen(UPD_CLEAR); set_vim_var_nr(VV_MOUSE_WIN, 0); set_vim_var_nr(VV_MOUSE_WINID, 0); *** ../vim-9.0.0205/src/gui.c 2022-07-12 17:34:25.105070059 +0100 --- src/gui.c 2022-08-14 14:05:14.239609301 +0100 *************** *** 4516,4526 **** #endif ) { ! int type = VALID; if (pum_visible()) { ! type = NOT_VALID; wp->w_lines_valid = 0; } --- 4516,4526 ---- #endif ) { ! int type = UPD_VALID; if (pum_visible()) { ! type = UPD_NOT_VALID; wp->w_lines_valid = 0; } *************** *** 5527,5533 **** } // Update the screen display ! update_screen(NOT_VALID); # ifdef FEAT_MENU gui_update_menus(0); # endif --- 5527,5533 ---- } // Update the screen display ! update_screen(UPD_NOT_VALID); # ifdef FEAT_MENU gui_update_menus(0); # endif *** ../vim-9.0.0205/src/gui_haiku.cc 2021-12-31 20:49:07.000000000 +0000 --- src/gui_haiku.cc 2022-08-14 14:08:05.227600197 +0100 *************** *** 656,662 **** // 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); } // Really handle dropped files and folders. --- 656,662 ---- // 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(UPD_NOT_VALID); } // Really handle dropped files and folders. *** ../vim-9.0.0205/src/highlight.c 2022-08-13 21:37:24.955160678 +0100 --- src/highlight.c 2022-08-14 14:09:42.127587482 +0100 *************** *** 696,702 **** hlgroup->sg_script_ctx.sc_lnum += SOURCING_LNUM; #endif hlgroup->sg_cleared = FALSE; ! redraw_all_later(SOME_VALID); // Only call highlight_changed() once after multiple changes. need_highlight_changed = TRUE; --- 696,702 ---- hlgroup->sg_script_ctx.sc_lnum += SOURCING_LNUM; #endif hlgroup->sg_cleared = FALSE; ! redraw_all_later(UPD_SOME_VALID); // Only call highlight_changed() once after multiple changes. need_highlight_changed = TRUE; *************** *** 939,945 **** if (!gui.in_use && !gui.starting) #endif { ! must_redraw = CLEAR; if (termcap_active && color >= 0) term_fg_color(color); } --- 939,945 ---- if (!gui.in_use && !gui.starting) #endif { ! must_redraw = UPD_CLEAR; if (termcap_active && color >= 0) term_fg_color(color); } *************** *** 962,968 **** if (!gui.in_use && !gui.starting) #endif { ! must_redraw = CLEAR; if (color >= 0) { int dark = -1; --- 962,968 ---- if (!gui.in_use && !gui.starting) #endif { ! must_redraw = UPD_CLEAR; if (color >= 0) { int dark = -1; *************** *** 1005,1011 **** if (!gui.in_use && !gui.starting) #endif { ! must_redraw = CLEAR; if (termcap_active && color >= 0) term_ul_color(color); } --- 1005,1011 ---- if (!gui.in_use && !gui.starting) #endif { ! must_redraw = UPD_CLEAR; if (termcap_active && color >= 0) term_ul_color(color); } *************** *** 1725,1731 **** { highlight_gui_started(); did_highlight_changed = TRUE; ! redraw_all_later(NOT_VALID); } #endif #ifdef FEAT_VTP --- 1725,1731 ---- { highlight_gui_started(); did_highlight_changed = TRUE; ! redraw_all_later(UPD_NOT_VALID); } #endif #ifdef FEAT_VTP *************** *** 1779,1785 **** // redrawing. This may happen when evaluating 'statusline' changes the // StatusLine group. if (!updating_screen) ! redraw_all_later(NOT_VALID); need_highlight_changed = TRUE; } } --- 1779,1785 ---- // redrawing. This may happen when evaluating 'statusline' changes the // StatusLine group. if (!updating_screen) ! redraw_all_later(UPD_NOT_VALID); need_highlight_changed = TRUE; } } *************** *** 1919,1925 **** FALSE, TRUE, FALSE)) { gui_mch_new_colors(); ! must_redraw = CLEAR; } # ifdef FEAT_GUI_X11 if (set_group_colors((char_u *)"Menu", --- 1919,1925 ---- FALSE, TRUE, FALSE)) { gui_mch_new_colors(); ! must_redraw = UPD_CLEAR; } # ifdef FEAT_GUI_X11 if (set_group_colors((char_u *)"Menu", *************** *** 1929,1935 **** # ifdef FEAT_MENU gui_mch_new_menu_colors(); # endif ! must_redraw = CLEAR; } # ifdef FEAT_BEVAL_GUI if (set_group_colors((char_u *)"Tooltip", --- 1929,1935 ---- # ifdef FEAT_MENU gui_mch_new_menu_colors(); # endif ! must_redraw = UPD_CLEAR; } # ifdef FEAT_BEVAL_GUI if (set_group_colors((char_u *)"Tooltip", *************** *** 1939,1945 **** # ifdef FEAT_TOOLBAR gui_mch_new_tooltip_colors(); # endif ! must_redraw = CLEAR; } # endif if (set_group_colors((char_u *)"Scrollbar", --- 1939,1945 ---- # ifdef FEAT_TOOLBAR gui_mch_new_tooltip_colors(); # endif ! must_redraw = UPD_CLEAR; } # endif if (set_group_colors((char_u *)"Scrollbar", *************** *** 1947,1953 **** FALSE, FALSE, FALSE)) { gui_new_scrollbar_colors(); ! must_redraw = CLEAR; } # endif } --- 1947,1953 ---- FALSE, FALSE, FALSE)) { gui_new_scrollbar_colors(); ! must_redraw = UPD_CLEAR; } # endif } *************** *** 1973,1979 **** // 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; } } } --- 1973,1979 ---- // 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 = UPD_CLEAR; } } } *************** *** 2545,2551 **** clear_hl_tables(); ! must_redraw = CLEAR; for (i = 0; i < highlight_ga.ga_len; ++i) set_hl_attr(i); --- 2545,2551 ---- clear_hl_tables(); ! must_redraw = UPD_CLEAR; for (i = 0; i < highlight_ga.ga_len; ++i) set_hl_attr(i); *** ../vim-9.0.0205/src/if_lua.c 2022-08-08 15:49:14.192115015 +0100 --- src/if_lua.c 2022-08-14 14:05:21.123609324 +0100 *************** *** 1543,1549 **** else appended_lines_mark(n, 1L); curbuf = buf; ! update_screen(VALID); return 0; } --- 1543,1549 ---- else appended_lines_mark(n, 1L); curbuf = buf; ! update_screen(UPD_VALID); return 0; } *************** *** 1645,1651 **** 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); } else if (strncmp(s, "col", 3) == 0) { --- 1645,1651 ---- 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(UPD_VALID); } else if (strncmp(s, "col", 3) == 0) { *************** *** 1654,1660 **** #endif w->w_cursor.col = v - 1; w->w_set_curswant = TRUE; ! update_screen(VALID); } else if (strncmp(s, "width", 5) == 0) { --- 1654,1660 ---- #endif w->w_cursor.col = v - 1; w->w_set_curswant = TRUE; ! update_screen(UPD_VALID); } else if (strncmp(s, "width", 5) == 0) { *************** *** 1914,1920 **** execute_cmds_from_string(s); vim_free(s); ! update_screen(VALID); return 0; } --- 1914,1920 ---- execute_cmds_from_string(s); vim_free(s); ! update_screen(UPD_VALID); return 0; } *************** *** 2661,2667 **** } lua_pop(L, 1); // function check_cursor(); ! update_screen(NOT_VALID); } void --- 2661,2667 ---- } lua_pop(L, 1); // function check_cursor(); ! update_screen(UPD_NOT_VALID); } void *** ../vim-9.0.0205/src/if_mzsch.c 2022-05-18 16:23:24.000000000 +0100 --- src/if_mzsch.c 2022-08-14 14:05:23.967609323 +0100 *************** *** 1631,1637 **** // may be use do_cmdline_cmd? do_cmdline(BYTE_STRING_VALUE(cmd), NULL, NULL, DOCMD_NOWAIT|DOCMD_VERBOSE); ! update_screen(VALID); MZ_GC_UNREG(); raise_if_error(); --- 1631,1637 ---- // may be use do_cmdline_cmd? do_cmdline(BYTE_STRING_VALUE(cmd), NULL, NULL, DOCMD_NOWAIT|DOCMD_VERBOSE); ! update_screen(UPD_VALID); MZ_GC_UNREG(); raise_if_error(); *************** *** 1836,1842 **** MZ_GC_UNREG(); do_set(command, scope); vim_free(command); ! update_screen(NOT_VALID); curbuf = save_curb; curwin = save_curw; raise_if_error(); --- 1836,1842 ---- MZ_GC_UNREG(); do_set(command, scope); vim_free(command); ! update_screen(UPD_NOT_VALID); curbuf = save_curb; curwin = save_curw; raise_if_error(); *************** *** 2106,2112 **** win->win->w_cursor.lnum = lnum; win->win->w_cursor.col = col; win->win->w_set_curswant = TRUE; ! update_screen(VALID); raise_if_error(); return scheme_void; --- 2106,2112 ---- win->win->w_cursor.lnum = lnum; win->win->w_cursor.col = col; win->win->w_set_curswant = TRUE; ! update_screen(UPD_VALID); raise_if_error(); return scheme_void; *************** *** 2781,2787 **** } curbuf = savebuf; ! update_screen(VALID); MZ_GC_UNREG(); raise_if_error(); --- 2781,2787 ---- } curbuf = savebuf; ! update_screen(UPD_VALID); MZ_GC_UNREG(); raise_if_error(); *************** *** 2841,2847 **** free_array(array); MZ_GC_UNREG(); curbuf = savebuf; ! update_screen(VALID); } MZ_GC_UNREG(); --- 2841,2847 ---- free_array(array); MZ_GC_UNREG(); curbuf = savebuf; ! update_screen(UPD_VALID); } MZ_GC_UNREG(); *** ../vim-9.0.0205/src/if_perl.xs 2022-05-10 21:07:44.000000000 +0100 --- src/if_perl.xs 2022-08-14 14:07:59.319600815 +0100 *************** *** 1460,1466 **** FREETMPS; LEAVE; check_cursor(); ! update_screen(NOT_VALID); if (!length) return; --- 1460,1466 ---- FREETMPS; LEAVE; check_cursor(); ! update_screen(UPD_NOT_VALID); if (!length) return; *************** *** 1584,1590 **** PPCODE: if (line != NULL) do_set((char_u *)line, 0); ! update_screen(NOT_VALID); void DoCommand(line) --- 1584,1590 ---- PPCODE: if (line != NULL) do_set((char_u *)line, 0); ! update_screen(UPD_NOT_VALID); void DoCommand(line) *************** *** 1777,1783 **** win->w_cursor.col = col; win->w_set_curswant = TRUE; check_cursor(); /* put cursor on an existing line */ ! update_screen(NOT_VALID); } MODULE = VIM PACKAGE = VIBUF --- 1777,1783 ---- win->w_cursor.col = col; win->w_set_curswant = TRUE; check_cursor(); /* put cursor on an existing line */ ! update_screen(UPD_NOT_VALID); } MODULE = VIM PACKAGE = VIBUF *************** *** 1929,1935 **** aucmd_restbuf(&aco); /* Careful: autocommands may have made "vimbuf" invalid! */ ! update_curbuf(VALID); } } } --- 1929,1935 ---- aucmd_restbuf(&aco); /* Careful: autocommands may have made "vimbuf" invalid! */ ! update_curbuf(UPD_VALID); } } } *************** *** 1970,1976 **** aucmd_restbuf(&aco); /* Careful: autocommands may have made "vimbuf" invalid! */ ! update_curbuf(VALID); } } } --- 1970,1976 ---- aucmd_restbuf(&aco); /* Careful: autocommands may have made "vimbuf" invalid! */ ! update_curbuf(UPD_VALID); } } } *** ../vim-9.0.0205/src/if_py_both.h 2022-05-22 12:15:45.000000000 +0100 --- src/if_py_both.h 2022-08-14 14:08:18.643598725 +0100 *************** *** 697,703 **** VimTryStart(); do_cmdline_cmd(cmd); ! update_screen(VALID); Python_Release_Vim(); Py_END_ALLOW_THREADS --- 697,703 ---- VimTryStart(); do_cmdline_cmd(cmd); ! update_screen(UPD_VALID); Python_Release_Vim(); Py_END_ALLOW_THREADS *************** *** 4067,4073 **** // When column is out of range silently correct it. check_cursor_col_win(self->win); ! update_screen(VALID); return 0; } else if (strcmp(name, "height") == 0) --- 4067,4073 ---- // When column is out of range silently correct it. check_cursor_col_win(self->win); ! update_screen(UPD_VALID); return 0; } else if (strcmp(name, "height") == 0) *************** *** 4745,4751 **** vim_free(str); restore_win_for_buf(&switchwin, &save_curbuf); ! update_screen(VALID); if (VimTryEnd()) return FAIL; --- 4745,4751 ---- vim_free(str); restore_win_for_buf(&switchwin, &save_curbuf); ! update_screen(UPD_VALID); if (VimTryEnd()) return FAIL; *************** *** 4816,4822 **** PyMem_Free(array); restore_win_for_buf(&switchwin, &save_curbuf); ! update_screen(VALID); if (VimTryEnd()) return FAIL; --- 4816,4822 ---- PyMem_Free(array); restore_win_for_buf(&switchwin, &save_curbuf); ! update_screen(UPD_VALID); if (VimTryEnd()) return FAIL; *************** *** 5825,5831 **** if (status) return; check_cursor(); ! update_curbuf(NOT_VALID); } static void --- 5825,5831 ---- if (status) return; check_cursor(); ! update_curbuf(UPD_NOT_VALID); } static void *** ../vim-9.0.0205/src/if_ruby.c 2022-01-24 11:12:27.000000000 +0000 --- src/if_ruby.c 2022-08-14 14:05:32.243609283 +0100 *************** *** 988,994 **** } } check_cursor(); ! update_curbuf(NOT_VALID); } } --- 988,994 ---- } } check_cursor(); ! update_curbuf(UPD_NOT_VALID); } } *************** *** 1195,1201 **** vim_set_option(VALUE self UNUSED, VALUE str) { do_set((char_u *)StringValuePtr(str), 0); ! update_screen(NOT_VALID); return Qnil; } --- 1195,1201 ---- vim_set_option(VALUE self UNUSED, VALUE str) { do_set((char_u *)StringValuePtr(str), 0); ! update_screen(UPD_NOT_VALID); return Qnil; } *************** *** 1492,1498 **** aucmd_restbuf(&aco); // Careful: autocommands may have made "buf" invalid! ! update_curbuf(NOT_VALID); } else { --- 1492,1498 ---- aucmd_restbuf(&aco); // Careful: autocommands may have made "buf" invalid! ! update_curbuf(UPD_NOT_VALID); } else { *************** *** 1538,1544 **** aucmd_restbuf(&aco); // Careful: autocommands may have made "buf" invalid! ! update_curbuf(NOT_VALID); } else { --- 1538,1544 ---- aucmd_restbuf(&aco); // Careful: autocommands may have made "buf" invalid! ! update_curbuf(UPD_NOT_VALID); } else { *************** *** 1579,1585 **** aucmd_restbuf(&aco); // Careful: autocommands may have made "buf" invalid! ! update_curbuf(NOT_VALID); } else { --- 1579,1585 ---- aucmd_restbuf(&aco); // Careful: autocommands may have made "buf" invalid! ! update_curbuf(UPD_NOT_VALID); } else { *************** *** 1774,1780 **** win->w_cursor.col = NUM2UINT(col); win->w_set_curswant = TRUE; check_cursor(); // put cursor on an existing line ! update_screen(NOT_VALID); return Qnil; } --- 1774,1780 ---- win->w_cursor.col = NUM2UINT(col); win->w_set_curswant = TRUE; check_cursor(); // put cursor on an existing line ! update_screen(UPD_NOT_VALID); return Qnil; } *** ../vim-9.0.0205/src/if_tcl.c 2022-08-08 15:49:14.192115015 +0100 --- src/if_tcl.c 2022-08-14 14:05:36.991609238 +0100 *************** *** 931,943 **** } if (flags & FL_UPDATE_CURBUF) ! redraw_curbuf_later(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); return err; } --- 931,943 ---- } if (flags & FL_UPDATE_CURBUF) ! 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(UPD_NOT_VALID); return err; } *************** *** 1115,1121 **** curwin = savewin; curbuf = savebuf; if (flags & FL_UPDATE_SCREEN) ! update_screen(NOT_VALID); return err; } --- 1115,1121 ---- curwin = savewin; curbuf = savebuf; if (flags & FL_UPDATE_SCREEN) ! update_screen(UPD_NOT_VALID); return err; } *************** *** 1131,1137 **** int err; err = tcldoexcommand(interp, objc, objv, 1); ! update_screen(VALID); return err; } --- 1131,1137 ---- int err; err = tcldoexcommand(interp, objc, objv, 1); ! update_screen(UPD_VALID); return err; } *************** *** 1145,1151 **** int err; err = tclsetoption(interp, objc, objv, 1); ! update_screen(VALID); return err; } --- 1145,1151 ---- int err; err = tclsetoption(interp, objc, objv, 1); ! update_screen(UPD_VALID); return err; } *** ../vim-9.0.0205/src/indent.c 2022-07-25 18:13:33.050580738 +0100 --- src/indent.c 2022-08-14 14:05:40.839609190 +0100 *************** *** 1132,1138 **** oap->is_VIsual ? start_lnum + oap->line_count : last_changed + 1, 0L); else if (oap->is_VIsual) ! redraw_curbuf_later(INVERTED); if (oap->line_count > p_report) { --- 1132,1138 ---- oap->is_VIsual ? start_lnum + oap->line_count : last_changed + 1, 0L); else if (oap->is_VIsual) ! redraw_curbuf_later(UPD_INVERTED); if (oap->line_count > p_report) { *************** *** 1830,1839 **** && tabstop_eq(curbuf->b_p_vts_array, new_vts_array)) ; // not changed else ! redraw_curbuf_later(NOT_VALID); #else if (curbuf->b_p_ts != new_ts) ! redraw_curbuf_later(NOT_VALID); #endif if (first_line != 0) changed_lines(first_line, 0, last_line + 1, 0L); --- 1830,1839 ---- && tabstop_eq(curbuf->b_p_vts_array, new_vts_array)) ; // not changed else ! redraw_curbuf_later(UPD_NOT_VALID); #else if (curbuf->b_p_ts != new_ts) ! redraw_curbuf_later(UPD_NOT_VALID); #endif if (first_line != 0) changed_lines(first_line, 0, last_line + 1, 0L); *** ../vim-9.0.0205/src/main.c 2022-06-16 13:02:36.000000000 +0100 --- src/main.c 2022-08-14 14:09:46.211586846 +0100 *************** *** 686,692 **** && !gui.in_use #endif ) ! must_redraw = CLEAR; else { screenclear(); // clear screen --- 686,692 ---- && !gui.in_use #endif ) ! must_redraw = UPD_CLEAR; else { screenclear(); // clear screen *************** *** 788,794 **** #endif RedrawingDisabled = 0; ! redraw_all_later(NOT_VALID); no_wait_return = FALSE; // 'autochdir' has been postponed --- 788,794 ---- #endif RedrawingDisabled = 0; ! redraw_all_later(UPD_NOT_VALID); no_wait_return = FALSE; // 'autochdir' has been postponed *************** *** 1412,1418 **** validate_cursor(); if (VIsual_active) ! update_curbuf(INVERTED); // update inverted part else if (must_redraw) { mch_disable_flush(); // Stop issuing gui_mch_flush(). --- 1412,1418 ---- validate_cursor(); if (VIsual_active) ! update_curbuf(UPD_INVERTED); // update inverted part else if (must_redraw) { mch_disable_flush(); // Stop issuing gui_mch_flush(). *** ../vim-9.0.0205/src/match.c 2022-07-23 09:52:00.337814264 +0100 --- src/match.c 2022-08-14 14:03:00.915601045 +0100 *************** *** 39,45 **** matchitem_T *m; int hlg_id; regprog_T *regprog = NULL; ! int rtype = SOME_VALID; if (*grp == NUL || (pat != NULL && *pat == NUL)) return -1; --- 39,45 ---- matchitem_T *m; int hlg_id; regprog_T *regprog = NULL; ! int rtype = UPD_SOME_VALID; if (*grp == NUL || (pat != NULL && *pat == NUL)) return -1; *************** *** 192,198 **** } m->pos.toplnum = toplnum; m->pos.botlnum = botlnum; ! rtype = VALID; } } --- 192,198 ---- } m->pos.toplnum = toplnum; m->pos.botlnum = botlnum; ! rtype = UPD_VALID; } } *************** *** 228,234 **** { matchitem_T *cur = wp->w_match_head; matchitem_T *prev = cur; ! int rtype = SOME_VALID; if (id < 1) { --- 228,234 ---- { matchitem_T *cur = wp->w_match_head; matchitem_T *prev = cur; ! int rtype = UPD_SOME_VALID; if (id < 1) { *************** *** 269,275 **** wp->w_buffer->b_mod_bot = cur->pos.botlnum; wp->w_buffer->b_mod_xlines = 0; } ! rtype = VALID; } vim_free(cur); redraw_win_later(wp, rtype); --- 269,275 ---- wp->w_buffer->b_mod_bot = cur->pos.botlnum; wp->w_buffer->b_mod_xlines = 0; } ! rtype = UPD_VALID; } vim_free(cur); redraw_win_later(wp, rtype); *************** *** 292,298 **** vim_free(wp->w_match_head); wp->w_match_head = m; } ! redraw_win_later(wp, SOME_VALID); } /* --- 292,298 ---- vim_free(wp->w_match_head); wp->w_match_head = m; } ! redraw_win_later(wp, UPD_SOME_VALID); } /* *** ../vim-9.0.0205/src/memline.c 2022-08-09 21:37:51.355177041 +0100 --- src/memline.c 2022-08-14 14:05:51.167609004 +0100 *************** *** 1763,1769 **** set_option_value_give_err((char_u *)"key", 0L, buf->b_p_key, OPT_LOCAL); } #endif ! redraw_curbuf_later(NOT_VALID); theend: vim_free(fname_used); --- 1763,1769 ---- set_option_value_give_err((char_u *)"key", 0L, buf->b_p_key, OPT_LOCAL); } #endif ! redraw_curbuf_later(UPD_NOT_VALID); theend: vim_free(fname_used); *************** *** 3074,3081 **** */ 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, --- 3074,3079 ---- *************** *** 3433,3439 **** * 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. * * return FAIL for failure, OK otherwise */ --- 3431,3437 ---- * Do not use it after calling ml_replace(). * * Check: The caller of this function should probably also call ! * changed_lines(), unless update_screen(UPD_NOT_VALID) is used. * * return FAIL for failure, OK otherwise */ *************** *** 5145,5151 **** // pretend screen didn't scroll, need redraw anyway msg_scrolled = 0; ! redraw_all_later(NOT_VALID); } #endif --- 5143,5149 ---- // pretend screen didn't scroll, need redraw anyway msg_scrolled = 0; ! redraw_all_later(UPD_NOT_VALID); } #endif *** ../vim-9.0.0205/src/menu.c 2022-07-01 12:13:12.463831288 +0100 --- src/menu.c 2022-08-14 14:05:54.951608917 +0100 *************** *** 299,305 **** 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); if (enable != MAYBE) { --- 299,305 ---- root_menu_ptr = get_root_menu(menu_path); if (root_menu_ptr == &curwin->w_winbar) // Assume the window toolbar menu will change. ! redraw_later(UPD_NOT_VALID); if (enable != MAYBE) { *** ../vim-9.0.0205/src/message.c 2022-07-30 16:54:01.863698294 +0100 --- src/message.c 2022-08-14 14:09:49.527586326 +0100 *************** *** 1138,1144 **** FILE *save_scriptout; if (redraw == TRUE) ! must_redraw = CLEAR; // If using ":silent cmd", don't wait for a return. Also don't set // need_wait_return to do it later. --- 1138,1144 ---- FILE *save_scriptout; if (redraw == TRUE) ! 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,1368 **** && (redraw == TRUE || (msg_scrolled != 0 && redraw != -1))) { starttermcap(); // start termcap before redrawing ! redraw_later(VALID); } } --- 1362,1368 ---- && (redraw == TRUE || (msg_scrolled != 0 && redraw != -1))) { starttermcap(); // start termcap before redrawing ! redraw_later(UPD_VALID); } } *************** *** 2485,2492 **** } #endif ++msg_scrolled; ! if (must_redraw < VALID) ! must_redraw = VALID; } /* --- 2485,2492 ---- } #endif ++msg_scrolled; ! if (must_redraw < UPD_VALID) ! must_redraw = UPD_VALID; } /* *** ../vim-9.0.0205/src/misc1.c 2022-08-09 18:24:58.598059458 +0100 --- src/misc1.c 2022-08-14 14:09:52.807585805 +0100 *************** *** 585,592 **** if (wp->w_buffer == buf && wp->w_status_height) { wp->w_redr_status = TRUE; ! if (must_redraw < VALID) ! must_redraw = VALID; } } --- 585,592 ---- if (wp->w_buffer == buf && wp->w_status_height) { wp->w_redr_status = TRUE; ! if (must_redraw < UPD_VALID) ! must_redraw = UPD_VALID; } } *************** *** 1149,1155 **** # endif ) { ! redraw_later(CLEAR); update_screen(0); redrawcmd(); } --- 1149,1155 ---- # endif ) { ! redraw_later(UPD_CLEAR); update_screen(0); redrawcmd(); } *** ../vim-9.0.0205/src/misc2.c 2022-07-25 18:13:33.050580738 +0100 --- src/misc2.c 2022-08-14 14:05:58.423608829 +0100 *************** *** 719,725 **** if (retval) curwin->w_set_curswant = TRUE; ! redraw_later(NOT_VALID); return retval; } --- 719,725 ---- if (retval) curwin->w_set_curswant = TRUE; ! redraw_later(UPD_NOT_VALID); return retval; } *** ../vim-9.0.0205/src/mouse.c 2022-08-09 14:19:36.879541842 +0100 --- src/mouse.c 2022-08-14 14:06:01.131608754 +0100 *************** *** 624,630 **** if (jump_flags) { jump_flags = jump_to_mouse(jump_flags, NULL, which_button); ! update_curbuf(VIsual_active ? INVERTED : VALID); setcursor(); out_flush(); // Update before showing popup menu } --- 624,630 ---- if (jump_flags) { jump_flags = jump_to_mouse(jump_flags, NULL, which_button); ! update_curbuf(VIsual_active ? UPD_INVERTED : UPD_VALID); setcursor(); out_flush(); // Update before showing popup menu } *************** *** 1027,1033 **** curwin->w_set_curswant = TRUE; } if (is_click) ! redraw_curbuf_later(INVERTED); // update the inversion } else if (VIsual_active && !old_active) { --- 1027,1033 ---- curwin->w_set_curswant = TRUE; } if (is_click) ! redraw_curbuf_later(UPD_INVERTED); // update the inversion } else if (VIsual_active && !old_active) { *************** *** 1164,1170 **** // overlapped by the popup menu. if (pum_visible() && did_scroll) { ! redraw_all_later(NOT_VALID); ins_compl_show_pum(); } --- 1164,1170 ---- // overlapped by the popup menu. if (pum_visible() && did_scroll) { ! redraw_all_later(UPD_NOT_VALID); ins_compl_show_pum(); } *************** *** 1597,1603 **** if (flags & MOUSE_MAY_STOP_VIS) { end_visual_mode_keep_button(); ! redraw_curbuf_later(INVERTED); // delete the inversion } #if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD) // Continue a modeless selection in another window. --- 1597,1603 ---- if (flags & MOUSE_MAY_STOP_VIS) { end_visual_mode_keep_button(); ! redraw_curbuf_later(UPD_INVERTED); // delete the inversion } #if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD) // Continue a modeless selection in another window. *************** *** 1738,1744 **** && (flags & MOUSE_MAY_STOP_VIS)))) { end_visual_mode_keep_button(); ! redraw_curbuf_later(INVERTED); // delete the inversion } #ifdef FEAT_CMDWIN if (cmdwin_type != 0 && wp != curwin) --- 1738,1744 ---- && (flags & MOUSE_MAY_STOP_VIS)))) { end_visual_mode_keep_button(); ! redraw_curbuf_later(UPD_INVERTED); // delete the inversion } #ifdef FEAT_CMDWIN if (cmdwin_type != 0 && wp != curwin) *************** *** 1842,1848 **** if (flags & MOUSE_MAY_STOP_VIS) { end_visual_mode_keep_button(); ! redraw_curbuf_later(INVERTED); // delete the inversion } #if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD) --- 1842,1848 ---- if (flags & MOUSE_MAY_STOP_VIS) { end_visual_mode_keep_button(); ! redraw_curbuf_later(UPD_INVERTED); // delete the inversion } #if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD) *************** *** 1904,1910 **** #endif curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_BOTLINE_AP); ! redraw_later(VALID); row = 0; } else if (row >= curwin->w_height) --- 1904,1910 ---- #endif curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_BOTLINE_AP); ! redraw_later(UPD_VALID); row = 0; } else if (row >= curwin->w_height) *************** *** 1942,1948 **** #ifdef FEAT_DIFF check_topfill(curwin, FALSE); #endif ! redraw_later(VALID); curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_BOTLINE_AP); row = curwin->w_height - 1; --- 1942,1948 ---- #ifdef FEAT_DIFF check_topfill(curwin, FALSE); #endif ! redraw_later(UPD_VALID); curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_BOTLINE_AP); row = curwin->w_height - 1; *************** *** 1968,1974 **** // 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()) col_from_screen = ScreenCols[off]; #ifdef FEAT_FOLDING // Remember the character under the mouse, it might be a '-' or '+' in --- 1968,1974 ---- // 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 <= 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 *** ../vim-9.0.0205/src/mouse.c 2022-08-09 14:19:36.879541842 +0100 --- src/mouse.c 2022-08-14 14:06:01.131608754 +0100 *************** *** 624,630 **** if (jump_flags) { jump_flags = jump_to_mouse(jump_flags, NULL, which_button); ! update_curbuf(VIsual_active ? INVERTED : VALID); setcursor(); out_flush(); // Update before showing popup menu } --- 624,630 ---- if (jump_flags) { jump_flags = jump_to_mouse(jump_flags, NULL, which_button); ! update_curbuf(VIsual_active ? UPD_INVERTED : UPD_VALID); setcursor(); out_flush(); // Update before showing popup menu } *************** *** 1027,1033 **** curwin->w_set_curswant = TRUE; } if (is_click) ! redraw_curbuf_later(INVERTED); // update the inversion } else if (VIsual_active && !old_active) { --- 1027,1033 ---- curwin->w_set_curswant = TRUE; } if (is_click) ! redraw_curbuf_later(UPD_INVERTED); // update the inversion } else if (VIsual_active && !old_active) { *************** *** 1164,1170 **** // overlapped by the popup menu. if (pum_visible() && did_scroll) { ! redraw_all_later(NOT_VALID); ins_compl_show_pum(); } --- 1164,1170 ---- // overlapped by the popup menu. if (pum_visible() && did_scroll) { ! redraw_all_later(UPD_NOT_VALID); ins_compl_show_pum(); } *************** *** 1597,1603 **** if (flags & MOUSE_MAY_STOP_VIS) { end_visual_mode_keep_button(); ! redraw_curbuf_later(INVERTED); // delete the inversion } #if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD) // Continue a modeless selection in another window. --- 1597,1603 ---- if (flags & MOUSE_MAY_STOP_VIS) { end_visual_mode_keep_button(); ! redraw_curbuf_later(UPD_INVERTED); // delete the inversion } #if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD) // Continue a modeless selection in another window. *************** *** 1738,1744 **** && (flags & MOUSE_MAY_STOP_VIS)))) { end_visual_mode_keep_button(); ! redraw_curbuf_later(INVERTED); // delete the inversion } #ifdef FEAT_CMDWIN if (cmdwin_type != 0 && wp != curwin) --- 1738,1744 ---- && (flags & MOUSE_MAY_STOP_VIS)))) { end_visual_mode_keep_button(); ! redraw_curbuf_later(UPD_INVERTED); // delete the inversion } #ifdef FEAT_CMDWIN if (cmdwin_type != 0 && wp != curwin) *************** *** 1842,1848 **** if (flags & MOUSE_MAY_STOP_VIS) { end_visual_mode_keep_button(); ! redraw_curbuf_later(INVERTED); // delete the inversion } #if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD) --- 1842,1848 ---- if (flags & MOUSE_MAY_STOP_VIS) { end_visual_mode_keep_button(); ! redraw_curbuf_later(UPD_INVERTED); // delete the inversion } #if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD) *************** *** 1904,1910 **** #endif curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_BOTLINE_AP); ! redraw_later(VALID); row = 0; } else if (row >= curwin->w_height) --- 1904,1910 ---- #endif curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_BOTLINE_AP); ! redraw_later(UPD_VALID); row = 0; } else if (row >= curwin->w_height) *************** *** 1942,1948 **** #ifdef FEAT_DIFF check_topfill(curwin, FALSE); #endif ! redraw_later(VALID); curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_BOTLINE_AP); row = curwin->w_height - 1; --- 1942,1948 ---- #ifdef FEAT_DIFF check_topfill(curwin, FALSE); #endif ! redraw_later(UPD_VALID); curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_BOTLINE_AP); row = curwin->w_height - 1; *************** *** 1968,1974 **** // 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()) col_from_screen = ScreenCols[off]; #ifdef FEAT_FOLDING // Remember the character under the mouse, it might be a '-' or '+' in --- 1968,1974 ---- // 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 <= 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 *** ../vim-9.0.0205/src/move.c 2022-08-12 13:05:27.563326167 +0100 --- src/move.c 2022-08-14 14:06:07.127608568 +0100 *************** *** 131,137 **** && !pum_visible()) { // win_line() will redraw the number column and cursorline only. ! redraw_win_later(wp, VALID); } } --- 131,137 ---- && !pum_visible()) { // win_line() will redraw the number column and cursorline only. ! redraw_win_later(wp, UPD_VALID); } } *************** *** 145,156 **** { if ((wp->w_valid & VALID_VIRTCOL) == 0 && !pum_visible()) { ! // When 'cursorcolumn' is set need to redraw with SOME_VALID. if (wp->w_p_cuc) ! redraw_win_later(wp, SOME_VALID); ! // When 'cursorlineopt' contains "screenline" need to redraw with VALID. else if (wp->w_p_cul && (wp->w_p_culopt_flags & CULOPT_SCRLINE)) ! redraw_win_later(wp, VALID); } } #endif --- 145,157 ---- { if ((wp->w_valid & VALID_VIRTCOL) == 0 && !pum_visible()) { ! // When 'cursorcolumn' is set need to redraw with UPD_SOME_VALID. if (wp->w_p_cuc) ! 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, UPD_VALID); } } #endif *************** *** 218,224 **** if (BUFEMPTY()) // special case - file is empty { if (curwin->w_topline != 1) ! redraw_later(NOT_VALID); curwin->w_topline = 1; curwin->w_botline = 2; curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP; --- 219,225 ---- if (BUFEMPTY()) // special case - file is empty { if (curwin->w_topline != 1) ! redraw_later(UPD_NOT_VALID); curwin->w_topline = 1; curwin->w_botline = 2; curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP; *************** *** 401,410 **** if (curwin->w_skipcol != 0) { curwin->w_skipcol = 0; ! redraw_later(NOT_VALID); } else ! redraw_later(VALID); // May need to set w_skipcol when cursor in w_topline. if (curwin->w_cursor.lnum == curwin->w_topline) validate_cursor(); --- 402,411 ---- if (curwin->w_skipcol != 0) { curwin->w_skipcol = 0; ! redraw_later(UPD_NOT_VALID); } else ! 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,528 **** 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); } /* --- 523,529 ---- 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, UPD_NOT_VALID); } /* *************** *** 552,558 **** #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); } /* --- 553,559 ---- #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(UPD_VALID); } /* *************** *** 1089,1095 **** { curwin->w_leftcol = new_leftcol; // screen has to be redrawn with new curwin->w_leftcol ! redraw_later(NOT_VALID); } } curwin->w_wcol -= curwin->w_leftcol; --- 1090,1096 ---- { curwin->w_leftcol = new_leftcol; // screen has to be redrawn with new curwin->w_leftcol ! redraw_later(UPD_NOT_VALID); } } curwin->w_wcol -= curwin->w_leftcol; *************** *** 1202,1208 **** else curwin->w_skipcol = 0; if (prev_skipcol != curwin->w_skipcol) ! redraw_later(NOT_VALID); #ifdef FEAT_SYN_HL redraw_for_cursorcolumn(curwin); --- 1203,1209 ---- else curwin->w_skipcol = 0; if (prev_skipcol != curwin->w_skipcol) ! redraw_later(UPD_NOT_VALID); #ifdef FEAT_SYN_HL redraw_for_cursorcolumn(curwin); *************** *** 2672,2678 **** #endif } ! redraw_later(VALID); return retval; } --- 2673,2679 ---- #endif } ! redraw_later(UPD_VALID); return retval; } *************** *** 2924,2930 **** #endif cursor_correct(); beginline(BL_SOL | BL_FIX); ! redraw_later(VALID); } void --- 2925,2931 ---- #endif cursor_correct(); beginline(BL_SOL | BL_FIX); ! redraw_later(UPD_VALID); } void *************** *** 2978,2984 **** // Correct cursor for multi-byte character. if (has_mbyte) mb_adjust_cursor(); ! redraw_later(VALID); // Only scroll when 'scrollbind' hasn't done this. if (!curwin->w_p_scb) --- 2979,2985 ---- // Correct cursor for multi-byte character. if (has_mbyte) mb_adjust_cursor(); ! redraw_later(UPD_VALID); // Only scroll when 'scrollbind' hasn't done this. if (!curwin->w_p_scb) *** ../vim-9.0.0205/src/netbeans.c 2022-06-30 22:13:56.208846322 +0100 --- src/netbeans.c 2022-08-14 14:09:57.255585089 +0100 *************** *** 116,122 **** // remove all signs and update the screen after gutter removal coloncmd(":sign unplace *"); changed_window_setting(); ! update_screen(CLEAR); setcursor(); cursor_on(); out_flush_cursor(TRUE, FALSE); --- 116,122 ---- // remove all signs and update the screen after gutter removal coloncmd(":sign unplace *"); changed_window_setting(); ! update_screen(UPD_CLEAR); setcursor(); cursor_on(); out_flush_cursor(TRUE, FALSE); *************** *** 1835,1843 **** } // gui_update_cursor(TRUE, FALSE); ! // update_curbuf(NOT_VALID); update_topline(); // scroll to show the line ! update_screen(VALID); setcursor(); cursor_on(); out_flush_cursor(TRUE, FALSE); --- 1835,1843 ---- } // gui_update_cursor(TRUE, FALSE); ! // update_curbuf(UPD_NOT_VALID); update_topline(); // scroll to show the line ! update_screen(UPD_VALID); setcursor(); cursor_on(); out_flush_cursor(TRUE, FALSE); *************** *** 2027,2033 **** args = (char_u *)cp; coloncmd(":sign unplace %d buffer=%d", serNum, buf->bufp->b_fnum); ! redraw_buf_later(buf->bufp, NOT_VALID); #endif // ===================================================================== } --- 2027,2033 ---- args = (char_u *)cp; coloncmd(":sign unplace %d buffer=%d", serNum, buf->bufp->b_fnum); ! redraw_buf_later(buf->bufp, UPD_NOT_VALID); #endif // ===================================================================== } *************** *** 2113,2119 **** } } #endif ! redraw_buf_later(buf->bufp, NOT_VALID); } } // ===================================================================== --- 2113,2119 ---- } } #endif ! redraw_buf_later(buf->bufp, UPD_NOT_VALID); } } // ===================================================================== *************** *** 2223,2229 **** */ if (buf != NULL && buf->initDone && do_update) { ! update_screen(NOT_VALID); setcursor(); cursor_on(); out_flush_cursor(TRUE, FALSE); --- 2223,2229 ---- */ if (buf != NULL && buf->initDone && do_update) { ! update_screen(UPD_NOT_VALID); setcursor(); cursor_on(); out_flush_cursor(TRUE, FALSE); *************** *** 2528,2534 **** // update the screen after having added the gutter changed_window_setting(); ! update_screen(CLEAR); setcursor(); cursor_on(); out_flush_cursor(TRUE, FALSE); --- 2528,2534 ---- // update the screen after having added the gutter changed_window_setting(); ! update_screen(UPD_CLEAR); setcursor(); cursor_on(); out_flush_cursor(TRUE, FALSE); *** ../vim-9.0.0205/src/normal.c 2022-07-31 18:34:28.238324299 +0100 --- src/normal.c 2022-08-14 14:10:01.195584449 +0100 *************** *** 830,836 **** && !(mod_mask & MOD_MASK_SHIFT)) { end_visual_mode(); ! redraw_curbuf_later(INVERTED); } // Keys that work different when 'keymodel' contains "startsel" --- 830,836 ---- && !(mod_mask & MOD_MASK_SHIFT)) { end_visual_mode(); ! redraw_curbuf_later(UPD_INVERTED); } // Keys that work different when 'keymodel' contains "startsel" *************** *** 1172,1178 **** if (VIsual_active) { end_visual_mode(); ! redraw_curbuf_later(INVERTED); // delete the inversion later } VIsual_reselect = FALSE; } --- 1172,1178 ---- if (VIsual_active) { end_visual_mode(); ! redraw_curbuf_later(UPD_INVERTED); // delete the inversion later } VIsual_reselect = FALSE; } *************** *** 1186,1192 **** if (VIsual_active) { end_visual_mode(); ! redraw_curbuf_later(INVERTED); // delete the inversion later VIsual_reselect = FALSE; } } --- 1186,1192 ---- if (VIsual_active) { end_visual_mode(); ! redraw_curbuf_later(UPD_INVERTED); // delete the inversion later VIsual_reselect = FALSE; } } *************** *** 1945,1951 **** scrolldown(-y, FALSE); } ! redraw_later(VALID); cursor_correct(); curwin->w_redr_status = TRUE; } --- 1945,1951 ---- scrolldown(-y, FALSE); } ! redraw_later(UPD_VALID); cursor_correct(); curwin->w_redr_status = TRUE; } *************** *** 2515,2521 **** } if (curwin->w_cursor.lnum != prev_lnum) coladvance(curwin->w_curswant); ! redraw_later(VALID); } /* --- 2515,2521 ---- } if (curwin->w_cursor.lnum != prev_lnum) coladvance(curwin->w_curswant); ! redraw_later(UPD_VALID); } /* *************** *** 2709,2715 **** // FALLTHROUGH case 't': scroll_cursor_top(0, TRUE); ! redraw_later(VALID); set_fraction(curwin); break; --- 2709,2715 ---- // FALLTHROUGH case 't': scroll_cursor_top(0, TRUE); ! redraw_later(UPD_VALID); set_fraction(curwin); break; *************** *** 2718,2724 **** // FALLTHROUGH case 'z': scroll_cursor_halfway(TRUE); ! redraw_later(VALID); set_fraction(curwin); break; --- 2718,2724 ---- // FALLTHROUGH case 'z': scroll_cursor_halfway(TRUE); ! redraw_later(UPD_VALID); set_fraction(curwin); break; *************** *** 2741,2747 **** // FALLTHROUGH case 'b': scroll_cursor_bot(0, TRUE); ! redraw_later(VALID); set_fraction(curwin); break; --- 2741,2747 ---- // FALLTHROUGH case 'b': scroll_cursor_bot(0, TRUE); ! redraw_later(UPD_VALID); set_fraction(curwin); break; *************** *** 2794,2800 **** if (curwin->w_leftcol != col) { curwin->w_leftcol = col; ! redraw_later(NOT_VALID); } } break; --- 2794,2800 ---- if (curwin->w_leftcol != col) { curwin->w_leftcol = col; ! redraw_later(UPD_NOT_VALID); } } break; *************** *** 2816,2822 **** if (curwin->w_leftcol != col) { curwin->w_leftcol = col; ! redraw_later(NOT_VALID); } } break; --- 2816,2822 ---- if (curwin->w_leftcol != col) { curwin->w_leftcol = col; ! redraw_later(UPD_NOT_VALID); } } break; *************** *** 3277,3283 **** } # endif #endif ! redraw_later(CLEAR); #if defined(MSWIN) && (!defined(FEAT_GUI_MSWIN) || defined(VIMDLL)) # ifdef VIMDLL if (!gui.in_use) --- 3277,3283 ---- } # endif #endif ! redraw_later(UPD_CLEAR); #if defined(MSWIN) && (!defined(FEAT_GUI_MSWIN) || defined(VIMDLL)) # ifdef VIMDLL if (!gui.in_use) *************** *** 4193,4199 **** #ifdef FEAT_SEARCH_EXTRA // Redraw the window to refresh the highlighted matches. if (i > 0 && p_hls && !no_hlsearch) ! redraw_later(SOME_VALID); #endif } --- 4193,4199 ---- #ifdef FEAT_SEARCH_EXTRA // Redraw the window to refresh the highlighted matches. if (i > 0 && p_hls && !no_hlsearch) ! redraw_later(UPD_SOME_VALID); #endif } *************** *** 4241,4247 **** #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); #endif // "/$" will put the cursor after the end of the line, may need to --- 4241,4247 ---- #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(UPD_SOME_VALID); #endif // "/$" will put the cursor after the end of the line, may need to *************** *** 5462,5468 **** showmode(); may_trigger_modechanged(); } ! redraw_curbuf_later(INVERTED); // update the inversion } else // start Visual mode { --- 5462,5468 ---- showmode(); may_trigger_modechanged(); } ! redraw_curbuf_later(UPD_INVERTED); // update the inversion } else // start Visual mode { *************** *** 5515,5521 **** } else curwin->w_set_curswant = TRUE; ! redraw_curbuf_later(INVERTED); // show the inversion } else { --- 5515,5521 ---- } else curwin->w_set_curswant = TRUE; ! redraw_curbuf_later(UPD_INVERTED); // show the inversion } else { *************** *** 5605,5611 **** // 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) { curwin->w_old_cursor_lnum = curwin->w_cursor.lnum; curwin->w_old_visual_lnum = curwin->w_cursor.lnum; --- 5605,5611 ---- // Only need to redraw this line, unless still need to redraw an old // Visual area (when 'lazyredraw' is set). ! 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,5722 **** // end are still the same, and the selection needs to be owned clip_star.vmode = NUL; #endif ! redraw_curbuf_later(INVERTED); showmode(); } --- 5716,5722 ---- // end are still the same, and the selection needs to be owned clip_star.vmode = NUL; #endif ! redraw_curbuf_later(UPD_INVERTED); showmode(); } *************** *** 6753,6759 **** if (VIsual_active) { end_visual_mode(); // stop Visual ! redraw_curbuf_later(INVERTED); } // CTRL-\ CTRL-G restarts Insert mode when 'insertmode' is set. if (cap->nchar == Ctrl_G && p_im) --- 6753,6759 ---- if (VIsual_active) { end_visual_mode(); // stop Visual ! redraw_curbuf_later(UPD_INVERTED); } // CTRL-\ CTRL-G restarts Insert mode when 'insertmode' is set. if (cap->nchar == Ctrl_G && p_im) *************** *** 6825,6831 **** end_visual_mode(); // stop Visual check_cursor_col(); // make sure cursor is not beyond EOL curwin->w_set_curswant = TRUE; ! redraw_curbuf_later(INVERTED); } else if (no_reason) vim_beep(BO_ESC); --- 6825,6831 ---- end_visual_mode(); // stop Visual check_cursor_col(); // make sure cursor is not beyond EOL curwin->w_set_curswant = TRUE; ! redraw_curbuf_later(UPD_INVERTED); } else if (no_reason) vim_beep(BO_ESC); *** ../vim-9.0.0205/src/ops.c 2022-08-06 17:10:16.137025282 +0100 --- src/ops.c 2022-08-14 14:00:34.595571232 +0100 *************** *** 1358,1364 **** if (!did_change && oap->is_VIsual) // No change: need to remove the Visual selection ! redraw_curbuf_later(INVERTED); if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0) { --- 1358,1364 ---- if (!did_change && oap->is_VIsual) // No change: need to remove the Visual selection ! redraw_curbuf_later(UPD_INVERTED); if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0) { *************** *** 1493,1499 **** // vis block is still marked. Get rid of it now. curwin->w_cursor.lnum = oap->start.lnum; ! update_screen(INVERTED); if (oap->block_mode) { --- 1493,1499 ---- // vis block is still marked. Get rid of it now. curwin->w_cursor.lnum = oap->start.lnum; ! update_screen(UPD_INVERTED); if (oap->block_mode) { *************** *** 2485,2491 **** if (!change_cnt && oap->is_VIsual) // No change: need to remove the Visual selection ! redraw_curbuf_later(INVERTED); // Set '[ mark if something changed. Keep the last end // position from do_addsub(). --- 2485,2491 ---- if (!change_cnt && oap->is_VIsual) // No change: need to remove the Visual selection ! redraw_curbuf_later(UPD_INVERTED); // Set '[ mark if something changed. Keep the last end // position from do_addsub(). *************** *** 3908,3914 **** // make sure redrawing is correct curwin->w_p_lbr = lbr_saved; #endif ! redraw_curbuf_later(INVERTED); } } } --- 3908,3914 ---- // make sure redrawing is correct curwin->w_p_lbr = lbr_saved; #endif ! redraw_curbuf_later(UPD_INVERTED); } } } *************** *** 3948,3954 **** #ifdef FEAT_LINEBREAK curwin->w_p_lbr = lbr_saved; #endif ! redraw_curbuf_later(INVERTED); } // If the end of an operator is in column one while oap->motion_type --- 3948,3954 ---- #ifdef FEAT_LINEBREAK curwin->w_p_lbr = lbr_saved; #endif ! redraw_curbuf_later(UPD_INVERTED); } // If the end of an operator is in column one while oap->motion_type *** ../vim-9.0.0205/src/option.c 2022-07-30 16:54:01.867698285 +0100 --- src/option.c 2022-08-14 14:10:08.507582623 +0100 *************** *** 1278,1284 **** set_options_default(OPT_FREE | opt_flags); didset_options(); didset_options2(); ! redraw_all_later(CLEAR); } else { --- 1278,1284 ---- set_options_default(OPT_FREE | opt_flags); didset_options(); didset_options2(); ! redraw_all_later(UPD_CLEAR); } else { *************** *** 2147,2153 **** } if (full_screen) ttest(FALSE); ! redraw_all_later(CLEAR); } } --- 2147,2153 ---- } if (full_screen) ttest(FALSE); ! redraw_all_later(UPD_CLEAR); } } *************** *** 2923,2929 **** // when 'ignorecase' is set or reset and 'hlsearch' is set, redraw else if ((int *)varp == &p_ic && p_hls) { ! redraw_all_later(SOME_VALID); } #ifdef FEAT_SEARCH_EXTRA --- 2923,2929 ---- // when 'ignorecase' is set or reset and 'hlsearch' is set, redraw else if ((int *)varp == &p_ic && p_hls) { ! redraw_all_later(UPD_SOME_VALID); } #ifdef FEAT_SEARCH_EXTRA *************** *** 3206,3212 **** // '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); } #endif --- 3206,3212 ---- // '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(UPD_CLEAR); } #endif *************** *** 3849,3861 **** if ((flags & P_RBUF) || (flags & P_RWIN) || all) changed_window_setting(); if (flags & P_RBUF) ! redraw_curbuf_later(NOT_VALID); if (flags & P_RWINONLY) ! redraw_later(NOT_VALID); if (doclear) ! redraw_all_later(CLEAR); else if (all) ! redraw_all_later(NOT_VALID); } /* --- 3849,3861 ---- if ((flags & P_RBUF) || (flags & P_RWIN) || all) changed_window_setting(); if (flags & P_RBUF) ! redraw_curbuf_later(UPD_NOT_VALID); if (flags & P_RWINONLY) ! redraw_later(UPD_NOT_VALID); if (doclear) ! redraw_all_later(UPD_CLEAR); else if (all) ! redraw_all_later(UPD_NOT_VALID); } /* *************** *** 4348,4354 **** add_termcode(key_name, string, FALSE); if (full_screen) ttest(FALSE); ! redraw_all_later(CLEAR); return NULL; } --- 4348,4354 ---- add_termcode(key_name, string, FALSE); if (full_screen) ttest(FALSE); ! redraw_all_later(UPD_CLEAR); return NULL; } *************** *** 5213,5224 **** 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); 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); break; case PV_VE: clear_string_option(&((win_T *)from)->w_p_ve); --- 5213,5224 ---- 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(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(UPD_NOT_VALID); break; case PV_VE: clear_string_option(&((win_T *)from)->w_p_ve); *** ../vim-9.0.0205/src/optionstr.c 2022-08-09 12:53:09.911689930 +0100 --- src/optionstr.c 2022-08-14 14:10:12.315533624 +0100 *************** *** 758,764 **** errmsg = e_invalid_argument; // list setting requires a redraw if (curwin->w_briopt_list) ! redraw_all_later(NOT_VALID); } #endif --- 758,764 ---- errmsg = e_invalid_argument; // list setting requires a redraw if (curwin->w_briopt_list) ! redraw_all_later(UPD_NOT_VALID); } #endif *************** *** 1121,1127 **** // 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); } } --- 1121,1127 ---- // 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(UPD_NOT_VALID); } } *************** *** 1316,1322 **** (void)set_chars_option(wp, local_ptr, TRUE); } ! redraw_all_later(NOT_VALID); } } // local 'listchars' --- 1316,1322 ---- (void)set_chars_option(wp, local_ptr, TRUE); } ! redraw_all_later(UPD_NOT_VALID); } } // local 'listchars' *************** *** 1441,1447 **** if (varp == &T_ME) { out_str(T_ME); ! redraw_later(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 --- 1441,1447 ---- if (varp == &T_ME) { out_str(T_ME); ! 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,1779 **** if (curwin->w_status_height) { curwin->w_redr_status = TRUE; ! redraw_later(VALID); } curbuf->b_help = (curbuf->b_p_bt[0] == 'h'); redraw_titles(); --- 1773,1779 ---- if (curwin->w_status_height) { curwin->w_redr_status = TRUE; ! redraw_later(UPD_VALID); } curbuf->b_help = (curbuf->b_p_bt[0] == 'h'); redraw_titles(); *************** *** 2581,2587 **** // redraw if ((varp == &p_flp || varp == &(curbuf->b_p_flp)) && curwin->w_briopt_list) ! redraw_all_later(NOT_VALID); #endif if (curwin->w_curswant != MAXCOL --- 2581,2587 ---- // redraw if ((varp == &p_flp || varp == &(curbuf->b_p_flp)) && curwin->w_briopt_list) ! redraw_all_later(UPD_NOT_VALID); #endif if (curwin->w_curswant != MAXCOL *** ../vim-9.0.0205/src/os_unix.c 2022-07-28 12:54:04.966094313 +0100 --- src/os_unix.c 2022-08-14 14:10:15.223491835 +0100 *************** *** 1228,1234 **** // 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); cursor_on_force(); out_flush(); } --- 1228,1234 ---- // 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(UPD_CLEAR); cursor_on_force(); out_flush(); } *** ../vim-9.0.0205/src/os_win32.c 2022-06-20 13:11:00.000000000 +0100 --- src/os_win32.c 2022-08-14 14:10:19.531430286 +0100 *************** *** 1692,1698 **** { // The screen is now messed up, must redraw the command // line and later all the windows. ! redraw_all_later(CLEAR); compute_cmdrow(); redrawcmd(); } --- 1692,1698 ---- { // The screen is now messed up, must redraw the command // line and later all the windows. ! redraw_all_later(UPD_CLEAR); compute_cmdrow(); redrawcmd(); } *************** *** 6483,6489 **** // sequence may be inserted asynchronously. if (len < 0) { ! redraw_all_later(CLEAR); return; } --- 6483,6489 ---- // sequence may be inserted asynchronously. if (len < 0) { ! redraw_all_later(UPD_CLEAR); return; } *** ../vim-9.0.0205/src/popupmenu.c 2022-07-26 12:24:38.242801624 +0100 --- src/popupmenu.c 2022-08-14 14:06:30.891607595 +0100 *************** *** 943,949 **** { pum_position_info_popup(curwin); if (win_valid(curwin_save)) ! redraw_win_later(curwin_save, SOME_VALID); } # endif if ((curwin != curwin_save && win_valid(curwin_save)) --- 943,949 ---- { pum_position_info_popup(curwin); if (win_valid(curwin_save)) ! redraw_win_later(curwin_save, UPD_SOME_VALID); } # endif if ((curwin != curwin_save && win_valid(curwin_save)) *************** *** 963,969 **** // Return cursor to where we were validate_cursor(); ! redraw_later(SOME_VALID); // When the preview window was resized we need to // update the view on the buffer. Only go back to --- 963,969 ---- // Return cursor to where we were validate_cursor(); ! 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,1054 **** pum_undisplay(void) { pum_array = NULL; ! redraw_all_later(NOT_VALID); redraw_tabline = TRUE; status_redraw_all(); #if defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX) --- 1048,1054 ---- pum_undisplay(void) { pum_array = NULL; ! redraw_all_later(UPD_NOT_VALID); redraw_tabline = TRUE; status_redraw_all(); #if defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX) *** ../vim-9.0.0205/src/popupwin.c 2022-08-08 15:49:14.192115015 +0100 --- src/popupwin.c 2022-08-14 14:10:24.751356267 +0100 *************** *** 406,412 **** } } popup_set_firstline(wp); ! redraw_win_later(wp, NOT_VALID); } } } --- 406,412 ---- } } popup_set_firstline(wp); ! redraw_win_later(wp, UPD_NOT_VALID); } } } *************** *** 674,680 **** 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); } else sign_undefine_by_name(sign_name, FALSE); --- 674,680 ---- sign_place(&sign_id, (char_u *)"PopUpMenu", sign_name, wp->w_buffer, wp->w_cursor.lnum, SIGN_DEF_PRIO); ! redraw_win_later(wp, UPD_NOT_VALID); } else sign_undefine_by_name(sign_name, FALSE); *************** *** 1223,1229 **** { wp->w_popup_flags |= POPF_HIDDEN; if (win_valid(wp->w_popup_prop_win)) ! redraw_win_later(wp->w_popup_prop_win, SOME_VALID); } return; } --- 1223,1229 ---- { wp->w_popup_flags |= POPF_HIDDEN; if (win_valid(wp->w_popup_prop_win)) ! redraw_win_later(wp->w_popup_prop_win, UPD_SOME_VALID); } return; } *************** *** 1636,1642 **** || org_width != wp->w_width || org_height != wp->w_height) { ! redraw_win_later(wp, NOT_VALID); if (wp->w_popup_flags & POPF_ON_CMDLINE) clear_cmdline = TRUE; popup_mask_refresh = TRUE; --- 1636,1642 ---- || org_width != wp->w_width || org_height != wp->w_height) { ! redraw_win_later(wp, UPD_NOT_VALID); if (wp->w_popup_flags & POPF_ON_CMDLINE) clear_cmdline = TRUE; popup_mask_refresh = TRUE; *************** *** 2211,2217 **** wp->w_vsep_width = 0; ! redraw_all_later(NOT_VALID); popup_mask_refresh = TRUE; #ifdef FEAT_TERMINAL --- 2211,2217 ---- wp->w_vsep_width = 0; ! redraw_all_later(UPD_NOT_VALID); popup_mask_refresh = TRUE; #ifdef FEAT_TERMINAL *************** *** 2640,2646 **** { wp->w_popup_flags |= POPF_HIDDEN; // Do not decrement b_nwindows, we still reference the buffer. ! redraw_all_later(NOT_VALID); popup_mask_refresh = TRUE; } } --- 2640,2646 ---- { wp->w_popup_flags |= POPF_HIDDEN; // Do not decrement b_nwindows, we still reference the buffer. ! redraw_all_later(UPD_NOT_VALID); popup_mask_refresh = TRUE; } } *************** *** 2672,2678 **** if ((wp->w_popup_flags & POPF_HIDDEN) != 0) { wp->w_popup_flags &= ~POPF_HIDDEN; ! redraw_all_later(NOT_VALID); popup_mask_refresh = TRUE; } } --- 2672,2678 ---- if ((wp->w_popup_flags & POPF_HIDDEN) != 0) { wp->w_popup_flags &= ~POPF_HIDDEN; ! redraw_all_later(UPD_NOT_VALID); popup_mask_refresh = TRUE; } } *************** *** 2725,2731 **** else { popup_set_buffer_text(wp->w_buffer, argvars[1]); ! redraw_win_later(wp, NOT_VALID); popup_adjust_position(wp); } } --- 2725,2731 ---- else { popup_set_buffer_text(wp->w_buffer, argvars[1]); ! redraw_win_later(wp, UPD_NOT_VALID); popup_adjust_position(wp); } } *************** *** 2740,2746 **** clear_cmdline = TRUE; win_free_popup(wp); ! redraw_all_later(NOT_VALID); popup_mask_refresh = TRUE; } --- 2740,2746 ---- clear_cmdline = TRUE; win_free_popup(wp); ! redraw_all_later(UPD_NOT_VALID); popup_mask_refresh = TRUE; } *************** *** 2919,2925 **** apply_options(wp, dict, FALSE); if (old_firstline != wp->w_firstline) ! redraw_win_later(wp, NOT_VALID); popup_adjust_position(wp); } --- 2919,2925 ---- apply_options(wp, dict, FALSE); if (old_firstline != wp->w_firstline) ! redraw_win_later(wp, UPD_NOT_VALID); popup_adjust_position(wp); } *************** *** 3675,3683 **** 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) { popup_mask_refresh = TRUE; redraw_all_popups = TRUE; --- 3675,3683 ---- int redrawing_all_win; // Need to recompute when switching tabs. ! // 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,3715 **** // compare with "popup_mask" to see what changed. redrawing_all_win = TRUE; FOR_ALL_WINDOWS(wp) ! if (wp->w_redr_type < SOME_VALID) redrawing_all_win = FALSE; if (redrawing_all_win) mask = popup_mask; --- 3709,3715 ---- // compare with "popup_mask" to see what changed. redrawing_all_win = TRUE; FOR_ALL_WINDOWS(wp) ! if (wp->w_redr_type < UPD_SOME_VALID) redrawing_all_win = FALSE; if (redrawing_all_win) mask = popup_mask; *************** *** 3796,3802 **** #if defined(FEAT_TERMINAL) // A terminal window needs to be redrawn. if (bt_terminal(wp->w_buffer)) ! redraw_win_later(wp, NOT_VALID); else #endif { --- 3796,3802 ---- #if defined(FEAT_TERMINAL) // A terminal window needs to be redrawn. if (bt_terminal(wp->w_buffer)) ! redraw_win_later(wp, UPD_NOT_VALID); else #endif { *************** *** 4454,4460 **** 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); } } --- 4454,4460 ---- if (wp->w_popup_title != NULL) vim_snprintf((char *)wp->w_popup_title, len, " %s ", wp->w_buffer->b_fname); ! redraw_win_later(wp, UPD_VALID); } } *** ../vim-9.0.0205/src/quickfix.c 2022-08-01 14:00:27.365518220 +0100 --- src/quickfix.c 2022-08-14 14:06:49.515606568 +0100 *************** *** 4352,4358 **** curwin->w_cursor.coladd = 0; curwin->w_curswant = 0; update_topline(); // scroll to show the line ! redraw_later(VALID); curwin->w_redr_status = TRUE; // update ruler curwin = old_curwin; curbuf = curwin->w_buffer; --- 4352,4358 ---- curwin->w_cursor.coladd = 0; curwin->w_curswant = 0; update_topline(); // scroll to show the line ! redraw_later(UPD_VALID); curwin->w_redr_status = TRUE; // update ruler curwin = old_curwin; curbuf = curwin->w_buffer; *************** *** 4573,4579 **** // 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); } } --- 4573,4579 ---- // 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, UPD_NOT_VALID); } } *************** *** 4827,4833 **** --curbuf_lock; // make sure it will be redrawn ! redraw_curbuf_later(NOT_VALID); } // Restore KeyTyped, setting 'filetype' may reset it. --- 4827,4833 ---- --curbuf_lock; // make sure it will be redrawn ! redraw_curbuf_later(UPD_NOT_VALID); } // Restore KeyTyped, setting 'filetype' may reset it. *************** *** 6468,6474 **** #ifdef FEAT_FOLDING foldUpdateAll(curwin); #else ! redraw_later(NOT_VALID); #endif } --- 6468,6474 ---- #ifdef FEAT_FOLDING foldUpdateAll(curwin); #else ! redraw_later(UPD_NOT_VALID); #endif } *** ../vim-9.0.0205/src/register.c 2022-08-07 18:09:05.769933098 +0100 --- src/register.c 2022-08-14 14:10:31.315264064 +0100 *************** *** 391,397 **** { // Enable macro indicator temporarily set_option_value((char_u *)"ch", 1L, NULL, 0); ! update_screen(VALID); changed_cmdheight = TRUE; } --- 391,397 ---- { // Enable macro indicator temporarily set_option_value((char_u *)"ch", 1L, NULL, 0); ! update_screen(UPD_VALID); changed_cmdheight = TRUE; } *************** *** 427,433 **** { // Restore cmdheight set_option_value((char_u *)"ch", 0L, NULL, 0); ! redraw_all_later(CLEAR); } } return retval; --- 427,433 ---- { // Restore cmdheight set_option_value((char_u *)"ch", 0L, NULL, 0); ! redraw_all_later(UPD_CLEAR); } } return retval; *** ../vim-9.0.0205/src/screen.c 2022-08-09 12:53:09.911689930 +0100 --- src/screen.c 2022-08-14 14:10:36.995185048 +0100 *************** *** 2906,2912 **** screen_Rows = Rows; screen_Columns = Columns; ! must_redraw = CLEAR; // need to clear the screen later if (doclear) screenclear2(); #ifdef FEAT_GUI --- 2906,2912 ---- screen_Rows = Rows; screen_Columns = Columns; ! must_redraw = UPD_CLEAR; // need to clear the screen later if (doclear) screenclear2(); #ifdef FEAT_GUI *************** *** 3028,3035 **** win_rest_invalid(firstwin); redraw_cmdline = TRUE; redraw_tabline = TRUE; ! if (must_redraw == CLEAR) // no need to clear again ! must_redraw = NOT_VALID; compute_cmdrow(); msg_row = cmdline_row; // put cursor on last line for messages msg_col = 0; --- 3028,3035 ---- win_rest_invalid(firstwin); redraw_cmdline = TRUE; redraw_tabline = TRUE; ! 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,3658 **** { while (wp != NULL) { ! redraw_win_later(wp, NOT_VALID); wp->w_redr_status = TRUE; wp = wp->w_next; } --- 3652,3658 ---- { while (wp != NULL) { ! redraw_win_later(wp, UPD_NOT_VALID); wp->w_redr_status = TRUE; wp = wp->w_next; } *** ../vim-9.0.0205/src/search.c 2022-07-23 09:52:00.341814264 +0100 --- src/search.c 2022-08-14 14:03:23.935603619 +0100 *************** *** 253,259 **** #ifdef FEAT_SEARCH_EXTRA // If 'hlsearch' set and search pat changed: need redraw. if (p_hls) ! redraw_all_later(SOME_VALID); set_no_hlsearch(FALSE); #endif } --- 253,259 ---- #ifdef FEAT_SEARCH_EXTRA // If 'hlsearch' set and search pat changed: need redraw. if (p_hls) ! redraw_all_later(UPD_SOME_VALID); set_no_hlsearch(FALSE); #endif } *************** *** 577,583 **** # 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); # endif } #endif --- 577,583 ---- # ifdef FEAT_SEARCH_EXTRA // If 'hlsearch' set and search pat changed: need redraw. if (p_hls && idx == last_idx && !no_hlsearch) ! redraw_all_later(UPD_SOME_VALID); # endif } #endif *************** *** 1284,1290 **** */ if (no_hlsearch && !(options & SEARCH_KEEP)) { ! redraw_all_later(SOME_VALID); set_no_hlsearch(FALSE); } #endif --- 1284,1290 ---- */ if (no_hlsearch && !(options & SEARCH_KEEP)) { ! redraw_all_later(UPD_SOME_VALID); set_no_hlsearch(FALSE); } #endif *************** *** 2800,2806 **** 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 save_dollar_vcol = dollar_vcol; #ifdef CURSOR_SHAPE --- 2800,2806 ---- if (dollar_vcol >= 0 && dollar_vcol == curwin->w_virtcol) dollar_vcol = -1; ++curwin->w_virtcol; // do display ')' just before "$" ! update_screen(UPD_VALID); // show the new char first save_dollar_vcol = dollar_vcol; #ifdef CURSOR_SHAPE *************** *** 3056,3062 **** // end are still the same, and the selection needs to be owned clip_star.vmode = NUL; #endif ! redraw_curbuf_later(INVERTED); showmode(); return OK; --- 3056,3062 ---- // end are still the same, and the selection needs to be owned clip_star.vmode = NUL; #endif ! redraw_curbuf_later(UPD_INVERTED); showmode(); return OK; *************** *** 3877,3883 **** { // Return cursor to where we were validate_cursor(); ! redraw_later(VALID); win_enter(curwin_save, TRUE); } # ifdef FEAT_PROP_POPUP --- 3877,3883 ---- { // Return cursor to where we were validate_cursor(); ! redraw_later(UPD_VALID); win_enter(curwin_save, TRUE); } # ifdef FEAT_PROP_POPUP *** ../vim-9.0.0205/src/sign.c 2022-07-23 09:52:00.341814264 +0100 --- src/sign.c 2022-08-14 14:06:59.847605905 +0100 *************** *** 248,254 **** // column for signs. if (buf->b_signlist == NULL) { ! redraw_buf_later(buf, NOT_VALID); changed_line_abv_curs(); } --- 248,254 ---- // column for signs. if (buf->b_signlist == NULL) { ! redraw_buf_later(buf, UPD_NOT_VALID); changed_line_abv_curs(); } *************** *** 616,622 **** // sign columns no longer shows. And the 'signcolumn' may be hidden. if (buf->b_signlist == NULL) { ! redraw_buf_later(buf, NOT_VALID); changed_line_abv_curs(); } --- 616,622 ---- // sign columns no longer shows. And the 'signcolumn' may be hidden. if (buf->b_signlist == NULL) { ! redraw_buf_later(buf, UPD_NOT_VALID); changed_line_abv_curs(); } *************** *** 757,763 **** // 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); changed_line_abv_curs(); } --- 757,763 ---- // sign column. Not when curwin is NULL (this means we're exiting). if (buf->b_signlist != NULL && curwin != NULL) { ! redraw_buf_later(buf, UPD_NOT_VALID); changed_line_abv_curs(); } *************** *** 1073,1079 **** // non-empty sign list. FOR_ALL_WINDOWS(wp) if (wp->w_buffer->b_signlist != NULL) ! redraw_buf_later(wp->w_buffer, NOT_VALID); } // set values for a defined sign. --- 1073,1079 ---- // non-empty sign list. FOR_ALL_WINDOWS(wp) if (wp->w_buffer->b_signlist != NULL) ! redraw_buf_later(wp->w_buffer, UPD_NOT_VALID); } // set values for a defined sign. *************** *** 1243,1249 **** if (sign_id == 0) { // Delete all the signs in the specified buffer ! redraw_buf_later(buf, NOT_VALID); buf_delete_signs(buf, sign_group); } else --- 1243,1249 ---- if (sign_id == 0) { // Delete all the signs in the specified buffer ! redraw_buf_later(buf, UPD_NOT_VALID); buf_delete_signs(buf, sign_group); } else *** ../vim-9.0.0205/src/spell.c 2022-08-04 13:01:44.769330917 +0100 --- src/spell.c 2022-08-14 14:07:03.651605642 +0100 *************** *** 2284,2290 **** } } } ! redraw_win_later(wp, NOT_VALID); theend: vim_free(spl_copy); --- 2284,2290 ---- } } } ! redraw_win_later(wp, UPD_NOT_VALID); theend: vim_free(spl_copy); *************** *** 3854,3860 **** if (curbuf->b_ml.ml_line_count > 1) ml_delete(curbuf->b_ml.ml_line_count); ! redraw_later(NOT_VALID); } /* --- 3854,3860 ---- if (curbuf->b_ml.ml_line_count > 1) ml_delete(curbuf->b_ml.ml_line_count); ! redraw_later(UPD_NOT_VALID); } /* *** ../vim-9.0.0205/src/spellfile.c 2022-07-14 17:25:08.637262152 +0100 --- src/spellfile.c 2022-08-14 14:03:27.479603970 +0100 *************** *** 1759,1765 **** if (spell_load_file(fname, NULL, slang, FALSE) == NULL) // reloading failed, clear the language slang_clear(slang); ! redraw_all_later(SOME_VALID); didit = TRUE; } } --- 1759,1765 ---- if (spell_load_file(fname, NULL, slang, FALSE) == NULL) // reloading failed, clear the language slang_clear(slang); ! redraw_all_later(UPD_SOME_VALID); didit = TRUE; } } *************** *** 6367,6373 **** if (buf != NULL) buf_reload(buf, buf->b_orig_mode, FALSE); ! redraw_all_later(SOME_VALID); } vim_free(fnamebuf); } --- 6367,6373 ---- if (buf != NULL) buf_reload(buf, buf->b_orig_mode, FALSE); ! redraw_all_later(UPD_SOME_VALID); } vim_free(fnamebuf); } *** ../vim-9.0.0205/src/structs.h 2022-08-14 13:28:36.223224725 +0100 --- src/structs.h 2022-08-14 14:01:56.567590962 +0100 *************** *** 3698,3704 **** 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 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 --- 3698,3704 ---- 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 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 *** ../vim-9.0.0205/src/syntax.c 2022-07-31 18:34:28.238324299 +0100 --- src/syntax.c 2022-08-14 14:07:07.647605358 +0100 *************** *** 3416,3422 **** } // assume spell checking changed, force a redraw ! redraw_win_later(curwin, NOT_VALID); } /* --- 3416,3422 ---- } // assume spell checking changed, force a redraw ! redraw_win_later(curwin, UPD_NOT_VALID); } /* *************** *** 3467,3473 **** curbuf->b_p_isk = save_isk; } } ! redraw_win_later(curwin, NOT_VALID); } /* --- 3467,3473 ---- curbuf->b_p_isk = save_isk; } } ! redraw_win_later(curwin, UPD_NOT_VALID); } /* *************** *** 3697,3703 **** arg = skipwhite(arg_end); } } ! redraw_curbuf_later(SOME_VALID); syn_stack_free_all(curwin->w_s); // Need to recompute all syntax. } --- 3697,3703 ---- arg = skipwhite(arg_end); } } ! redraw_curbuf_later(UPD_SOME_VALID); syn_stack_free_all(curwin->w_s); // Need to recompute all syntax. } *************** *** 4890,4896 **** else semsg(_(e_invalid_argument_str), arg); ! redraw_curbuf_later(SOME_VALID); syn_stack_free_all(curwin->w_s); // Need to recompute all syntax. } --- 4890,4896 ---- else semsg(_(e_invalid_argument_str), arg); ! redraw_curbuf_later(UPD_SOME_VALID); syn_stack_free_all(curwin->w_s); // Need to recompute all syntax. } *************** *** 4981,4987 **** ++curwin->w_s->b_syn_folditems; #endif ! redraw_curbuf_later(SOME_VALID); syn_stack_free_all(curwin->w_s); // Need to recompute all syntax. return; // don't free the progs and patterns now } --- 4981,4987 ---- ++curwin->w_s->b_syn_folditems; #endif ! 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,5239 **** } } ! redraw_curbuf_later(SOME_VALID); syn_stack_free_all(curwin->w_s); // Need to recompute all syntax. success = TRUE; // don't free the progs and patterns now } --- 5233,5239 ---- } } ! 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,5591 **** if (got_clstr) { ! redraw_curbuf_later(SOME_VALID); syn_stack_free_all(curwin->w_s); // Need to recompute all. } } --- 5585,5591 ---- if (got_clstr) { ! redraw_curbuf_later(UPD_SOME_VALID); syn_stack_free_all(curwin->w_s); // Need to recompute all. } } *************** *** 5862,5868 **** else if (!finished) { set_nextcmd(eap, arg_start); ! redraw_curbuf_later(SOME_VALID); syn_stack_free_all(curwin->w_s); // Need to recompute all syntax. } } --- 5862,5868 ---- else if (!finished) { set_nextcmd(eap, arg_start); ! redraw_curbuf_later(UPD_SOME_VALID); syn_stack_free_all(curwin->w_s); // Need to recompute all syntax. } } *** ../vim-9.0.0205/src/tag.c 2022-07-23 09:52:00.341814264 +0100 --- src/tag.c 2022-08-14 13:58:37.299527037 +0100 *************** *** 4024,4030 **** { // Return cursor to where we were validate_cursor(); ! redraw_later(VALID); win_enter(curwin_save, TRUE); } #endif --- 4024,4030 ---- { // Return cursor to where we were validate_cursor(); ! redraw_later(UPD_VALID); win_enter(curwin_save, TRUE); } #endif *** ../vim-9.0.0205/src/term.c 2022-07-01 16:35:38.406031649 +0100 --- src/term.c 2022-08-14 14:11:09.910740874 +0100 *************** *** 1628,1639 **** init_highlight(TRUE, FALSE); # ifdef DEBUG_TERMRESPONSE { ! int r = redraw_asap(CLEAR); log_tr("Received t_Co, redraw_asap(): %d", r); } # else ! redraw_asap(CLEAR); # endif } } --- 1628,1639 ---- init_highlight(TRUE, FALSE); # ifdef DEBUG_TERMRESPONSE { ! int r = redraw_asap(UPD_CLEAR); log_tr("Received t_Co, redraw_asap(): %d", r); } # else ! redraw_asap(UPD_CLEAR); # endif } } *************** *** 3551,3557 **** do_check_scrollbind(TRUE); if (State & MODE_CMDLINE) { ! update_screen(NOT_VALID); redrawcmdline(); } else --- 3551,3557 ---- do_check_scrollbind(TRUE); if (State & MODE_CMDLINE) { ! update_screen(UPD_NOT_VALID); redrawcmdline(); } else *************** *** 3559,3568 **** update_topline(); if (pum_visible()) { ! redraw_later(NOT_VALID); ins_compl_show_pum(); } ! update_screen(NOT_VALID); if (redrawing()) setcursor(); } --- 3559,3568 ---- update_topline(); if (pum_visible()) { ! redraw_later(UPD_NOT_VALID); ins_compl_show_pum(); } ! update_screen(UPD_NOT_VALID); if (redrawing()) setcursor(); } *************** *** 3920,3927 **** now = start; profile_end(&now); fprintf(fd_tr, "%s: %s ", profile_msg(&now), ! must_redraw == NOT_VALID ? "NV" ! : must_redraw == CLEAR ? "CL" : " "); va_start(ap, fmt); vfprintf(fd_tr, fmt, ap); va_end(ap); --- 3920,3927 ---- now = start; profile_end(&now); fprintf(fd_tr, "%s: %s ", profile_msg(&now), ! must_redraw == UPD_NOT_VALID ? "NV" ! : must_redraw == UPD_CLEAR ? "CL" : " "); va_start(ap, fmt); vfprintf(fd_tr, fmt, ap); va_end(ap); *************** *** 4624,4635 **** set_option_value_give_err((char_u *)"ambw", 0L, (char_u *)aw, 0); # ifdef DEBUG_TERMRESPONSE { ! int r = redraw_asap(CLEAR); log_tr("set 'ambiwidth', redraw_asap(): %d", r); } # else ! redraw_asap(CLEAR); # endif # ifdef FEAT_EVAL set_vim_var_string(VV_TERMU7RESP, tp, csi_len); --- 4624,4635 ---- set_option_value_give_err((char_u *)"ambw", 0L, (char_u *)aw, 0); # ifdef DEBUG_TERMRESPONSE { ! int r = redraw_asap(UPD_CLEAR); log_tr("set 'ambiwidth', redraw_asap(): %d", r); } # else ! redraw_asap(UPD_CLEAR); # endif # ifdef FEAT_EVAL set_vim_var_string(VV_TERMU7RESP, tp, csi_len); *************** *** 5167,5173 **** 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); } } # ifdef FEAT_TERMINAL --- 5167,5173 ---- set_option_value_give_err((char_u *)"bg", 0L, (char_u *)new_bg_val, 0); reset_option_was_set((char_u *)"bg"); ! redraw_asap(UPD_CLEAR); } } # ifdef FEAT_TERMINAL *** ../vim-9.0.0205/src/terminal.c 2022-07-23 09:52:00.341814264 +0100 --- src/terminal.c 2022-08-14 14:07:29.019603669 +0100 *************** *** 1286,1292 **** ch_log(term->tl_job->jv_channel, "updating screen"); if (buffer == curbuf && (State & MODE_CMDLINE) == 0) { ! update_screen(VALID_NO_UPDATE); // update_screen() can be slow, check the terminal wasn't closed // already if (buffer == curbuf && curbuf->b_term != NULL) --- 1286,1292 ---- ch_log(term->tl_job->jv_channel, "updating screen"); if (buffer == curbuf && (State & MODE_CMDLINE) == 0) { ! 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,2023 **** if (wp->w_topline < min_topline) wp->w_topline = min_topline; } ! redraw_win_later(wp, NOT_VALID); } } } --- 2017,2023 ---- if (wp->w_topline < min_topline) wp->w_topline = min_topline; } ! redraw_win_later(wp, UPD_NOT_VALID); } } } *************** *** 2136,2145 **** if (term->tl_channel_closed) cleanup_vterm(term); ! redraw_buf_and_status_later(curbuf, NOT_VALID); #ifdef FEAT_PROP_POPUP if (WIN_IS_POPUP(curwin)) ! redraw_later(NOT_VALID); #endif } --- 2136,2145 ---- if (term->tl_channel_closed) cleanup_vterm(term); ! redraw_buf_and_status_later(curbuf, UPD_NOT_VALID); #ifdef FEAT_PROP_POPUP if (WIN_IS_POPUP(curwin)) ! redraw_later(UPD_NOT_VALID); #endif } *************** *** 3015,3021 **** 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); return 1; } --- 3015,3021 ---- 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, UPD_SOME_VALID); return 1; } *************** *** 3068,3074 **** // Note sure if the scrolling will work correctly, let's do a complete // redraw later. ! redraw_buf_later(term->tl_buffer, NOT_VALID); return 1; } --- 3068,3074 ---- // Note sure if the scrolling will work correctly, let's do a complete // redraw later. ! redraw_buf_later(term->tl_buffer, UPD_NOT_VALID); return 1; } *************** *** 3222,3228 **** win_setwidth_win(cols, wp); } } ! redraw_buf_later(term->tl_buffer, NOT_VALID); } return 1; } --- 3222,3228 ---- win_setwidth_win(cols, wp); } } ! redraw_buf_later(term->tl_buffer, UPD_NOT_VALID); } return 1; } *************** *** 3511,3517 **** ch_log(NULL, "terminal job finished"); } ! redraw_buf_and_status_later(term->tl_buffer, NOT_VALID); return FALSE; } --- 3511,3517 ---- ch_log(NULL, "terminal job finished"); } ! redraw_buf_and_status_later(term->tl_buffer, UPD_NOT_VALID); return FALSE; } *************** *** 3816,3824 **** 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) { term->tl_dirty_row_start = 0; term->tl_dirty_row_end = MAX_ROW; --- 3816,3824 ---- screen = vterm_obtain_screen(vterm); state = vterm_obtain_state(vterm); ! // 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,3961 **** if (term_is_finished(curbuf) && term->tl_scrollback.ga_len > 0) { free_scrollback(term); ! redraw_buf_later(term->tl_buffer, NOT_VALID); // The buffer is now like a normal buffer, it cannot be easily // abandoned when changed. --- 3955,3961 ---- if (term_is_finished(curbuf) && term->tl_scrollback.ga_len > 0) { free_scrollback(term); ! 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,5544 **** while (!(curbuf->b_ml.ml_flags & ML_EMPTY)) ml_delete((linenr_T)1); free_scrollback(curbuf->b_term); ! redraw_later(NOT_VALID); } } else --- 5538,5544 ---- while (!(curbuf->b_ml.ml_flags & ML_EMPTY)) ml_delete((linenr_T)1); free_scrollback(curbuf->b_term); ! redraw_later(UPD_NOT_VALID); } } else *************** *** 5831,5837 **** term->tl_top_diff_rows = bot_rows; term->tl_bot_diff_rows = top_rows; ! update_screen(NOT_VALID); return OK; } --- 5831,5837 ---- term->tl_top_diff_rows = bot_rows; term->tl_bot_diff_rows = top_rows; ! update_screen(UPD_NOT_VALID); return OK; } *** ../vim-9.0.0205/src/terminal.c 2022-07-23 09:52:00.341814264 +0100 --- src/terminal.c 2022-08-14 14:07:29.019603669 +0100 *************** *** 1286,1292 **** ch_log(term->tl_job->jv_channel, "updating screen"); if (buffer == curbuf && (State & MODE_CMDLINE) == 0) { ! update_screen(VALID_NO_UPDATE); // update_screen() can be slow, check the terminal wasn't closed // already if (buffer == curbuf && curbuf->b_term != NULL) --- 1286,1292 ---- ch_log(term->tl_job->jv_channel, "updating screen"); if (buffer == curbuf && (State & MODE_CMDLINE) == 0) { ! 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,2023 **** if (wp->w_topline < min_topline) wp->w_topline = min_topline; } ! redraw_win_later(wp, NOT_VALID); } } } --- 2017,2023 ---- if (wp->w_topline < min_topline) wp->w_topline = min_topline; } ! redraw_win_later(wp, UPD_NOT_VALID); } } } *************** *** 2136,2145 **** if (term->tl_channel_closed) cleanup_vterm(term); ! redraw_buf_and_status_later(curbuf, NOT_VALID); #ifdef FEAT_PROP_POPUP if (WIN_IS_POPUP(curwin)) ! redraw_later(NOT_VALID); #endif } --- 2136,2145 ---- if (term->tl_channel_closed) cleanup_vterm(term); ! redraw_buf_and_status_later(curbuf, UPD_NOT_VALID); #ifdef FEAT_PROP_POPUP if (WIN_IS_POPUP(curwin)) ! redraw_later(UPD_NOT_VALID); #endif } *************** *** 3015,3021 **** 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); return 1; } --- 3015,3021 ---- 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, UPD_SOME_VALID); return 1; } *************** *** 3068,3074 **** // Note sure if the scrolling will work correctly, let's do a complete // redraw later. ! redraw_buf_later(term->tl_buffer, NOT_VALID); return 1; } --- 3068,3074 ---- // Note sure if the scrolling will work correctly, let's do a complete // redraw later. ! redraw_buf_later(term->tl_buffer, UPD_NOT_VALID); return 1; } *************** *** 3222,3228 **** win_setwidth_win(cols, wp); } } ! redraw_buf_later(term->tl_buffer, NOT_VALID); } return 1; } --- 3222,3228 ---- win_setwidth_win(cols, wp); } } ! redraw_buf_later(term->tl_buffer, UPD_NOT_VALID); } return 1; } *************** *** 3511,3517 **** ch_log(NULL, "terminal job finished"); } ! redraw_buf_and_status_later(term->tl_buffer, NOT_VALID); return FALSE; } --- 3511,3517 ---- ch_log(NULL, "terminal job finished"); } ! redraw_buf_and_status_later(term->tl_buffer, UPD_NOT_VALID); return FALSE; } *************** *** 3816,3824 **** 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) { term->tl_dirty_row_start = 0; term->tl_dirty_row_end = MAX_ROW; --- 3816,3824 ---- screen = vterm_obtain_screen(vterm); state = vterm_obtain_state(vterm); ! // 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,3961 **** if (term_is_finished(curbuf) && term->tl_scrollback.ga_len > 0) { free_scrollback(term); ! redraw_buf_later(term->tl_buffer, NOT_VALID); // The buffer is now like a normal buffer, it cannot be easily // abandoned when changed. --- 3955,3961 ---- if (term_is_finished(curbuf) && term->tl_scrollback.ga_len > 0) { free_scrollback(term); ! 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,5544 **** while (!(curbuf->b_ml.ml_flags & ML_EMPTY)) ml_delete((linenr_T)1); free_scrollback(curbuf->b_term); ! redraw_later(NOT_VALID); } } else --- 5538,5544 ---- while (!(curbuf->b_ml.ml_flags & ML_EMPTY)) ml_delete((linenr_T)1); free_scrollback(curbuf->b_term); ! redraw_later(UPD_NOT_VALID); } } else *************** *** 5831,5837 **** term->tl_top_diff_rows = bot_rows; term->tl_bot_diff_rows = top_rows; ! update_screen(NOT_VALID); return OK; } --- 5831,5837 ---- term->tl_top_diff_rows = bot_rows; term->tl_bot_diff_rows = top_rows; ! update_screen(UPD_NOT_VALID); return OK; } *** ../vim-9.0.0205/src/textformat.c 2022-08-08 15:49:14.192115015 +0100 --- src/textformat.c 2022-08-14 14:00:42.567573521 +0100 *************** *** 461,467 **** if (!format_only && haveto_redraw) { update_topline(); ! redraw_curbuf_later(VALID); } } --- 461,467 ---- if (!format_only && haveto_redraw) { update_topline(); ! redraw_curbuf_later(UPD_VALID); } } *************** *** 840,846 **** if (oap->is_VIsual) // When there is no change: need to remove the Visual selection ! redraw_curbuf_later(INVERTED); if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0) // Set '[ mark at the start of the formatted area --- 840,846 ---- if (oap->is_VIsual) // When there is no change: need to remove the Visual selection ! redraw_curbuf_later(UPD_INVERTED); if ((cmdmod.cmod_flags & CMOD_LOCKMARKS) == 0) // Set '[ mark at the start of the formatted area *************** *** 903,909 **** { if (oap->is_VIsual) // When there is no change: need to remove the Visual selection ! redraw_curbuf_later(INVERTED); if (fex_format(oap->start.lnum, oap->line_count, NUL) != 0) // As documented: when 'formatexpr' returns non-zero fall back to --- 903,909 ---- { if (oap->is_VIsual) // When there is no change: need to remove the Visual selection ! 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 *** ../vim-9.0.0205/src/textobject.c 2022-06-18 11:08:46.000000000 +0100 --- src/textobject.c 2022-08-14 14:00:50.083575604 +0100 *************** *** 740,746 **** { // should do something when inclusive == FALSE ! VIsual = start_pos; ! redraw_curbuf_later(INVERTED); // update the inversion } else { --- 740,746 ---- { // should do something when inclusive == FALSE ! VIsual = start_pos; ! redraw_curbuf_later(UPD_INVERTED); // update the inversion } else { *************** *** 1010,1016 **** VIsual = start_pos; VIsual_mode = 'v'; redraw_cmdline = TRUE; // show mode later ! redraw_curbuf_later(INVERTED); // update the inversion } else { --- 1010,1016 ---- VIsual = start_pos; VIsual_mode = 'v'; redraw_cmdline = TRUE; // show mode later ! redraw_curbuf_later(UPD_INVERTED); // update the inversion } else { *************** *** 1167,1173 **** inc(&curwin->w_cursor); // include the line break VIsual = start_pos; VIsual_mode = 'v'; ! redraw_curbuf_later(INVERTED); // update the inversion showmode(); } else --- 1167,1173 ---- inc(&curwin->w_cursor); // include the line break VIsual = start_pos; VIsual_mode = 'v'; ! redraw_curbuf_later(UPD_INVERTED); // update the inversion showmode(); } else *************** *** 1447,1453 **** inc_cursor(); VIsual = start_pos; VIsual_mode = 'v'; ! redraw_curbuf_later(INVERTED); // update the inversion showmode(); } else --- 1447,1453 ---- inc_cursor(); VIsual = start_pos; VIsual_mode = 'v'; ! redraw_curbuf_later(UPD_INVERTED); // update the inversion showmode(); } else *************** *** 1630,1636 **** VIsual.col = 0; } VIsual_mode = 'V'; ! redraw_curbuf_later(INVERTED); // update the inversion showmode(); } else --- 1630,1636 ---- VIsual.col = 0; } VIsual_mode = 'V'; ! redraw_curbuf_later(UPD_INVERTED); // update the inversion showmode(); } else *************** *** 1933,1939 **** || line[VIsual.col - 1] != quotechar))))) { VIsual = curwin->w_cursor; ! redraw_curbuf_later(INVERTED); } } else --- 1933,1939 ---- || line[VIsual.col - 1] != quotechar))))) { VIsual = curwin->w_cursor; ! redraw_curbuf_later(UPD_INVERTED); } } else *** ../vim-9.0.0205/src/textprop.c 2022-08-14 13:28:36.223224725 +0100 --- src/textprop.c 2022-08-14 14:07:33.027603321 +0100 *************** *** 395,401 **** return; } ! redraw_buf_later(buf, VALID); } /* --- 395,401 ---- return; } ! redraw_buf_later(buf, UPD_VALID); } /* *************** *** 550,556 **** start_lnum, end_lnum, start_col, end_col); text = NULL; ! redraw_buf_later(buf, VALID); theend: vim_free(text); --- 550,556 ---- start_lnum, end_lnum, start_col, end_col); text = NULL; ! redraw_buf_later(buf, UPD_VALID); theend: vim_free(text); *************** *** 909,915 **** } } if (did_clear) ! redraw_buf_later(buf, NOT_VALID); } /* --- 909,915 ---- } } if (did_clear) ! redraw_buf_later(buf, UPD_NOT_VALID); } /* *************** *** 1525,1531 **** { changed_line_display_buf(buf); changed_lines_buf(buf, first_changed, last_changed + 1, 0); ! redraw_buf_later(buf, VALID); } if (did_remove_text) --- 1525,1531 ---- { changed_line_display_buf(buf); changed_lines_buf(buf, first_changed, last_changed + 1, 0); ! redraw_buf_later(buf, UPD_VALID); } if (did_remove_text) *** ../vim-9.0.0205/src/undo.c 2022-05-29 22:20:40.000000000 +0100 --- src/undo.c 2022-08-14 14:07:36.311603029 +0100 *************** *** 3038,3044 **** FOR_ALL_WINDOWS(wp) { if (wp->w_buffer == curbuf && wp->w_p_cole > 0) ! redraw_win_later(wp, NOT_VALID); } } #endif --- 3038,3044 ---- FOR_ALL_WINDOWS(wp) { if (wp->w_buffer == curbuf && wp->w_p_cole > 0) ! redraw_win_later(wp, UPD_NOT_VALID); } } #endif *** ../vim-9.0.0205/src/vim.h 2022-08-08 15:49:14.192115015 +0100 --- src/vim.h 2022-08-14 14:11:57.542137275 +0100 *************** *** 579,597 **** #endif /* ! * 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 // possible ! #define 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 // flags for screen_line() #define SLF_RIGHTLEFT 1 --- 579,597 ---- #endif /* ! * Flags for update_screen(). ! * The higher the value, the higher the priority. */ ! #define UPD_VALID_NO_UPDATE 5 // no new changes, keep the command line if // possible ! #define UPD_VALID 10 // buffer not changed, or changes marked // with b_mod_* ! #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 *** ../vim-9.0.0205/src/window.c 2022-08-11 14:13:14.862778345 +0100 --- src/window.c 2022-08-14 14:07:52.691601485 +0100 *************** *** 1313,1320 **** // 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); status_redraw_all(); if (need_status) --- 1313,1320 ---- // Both windows need redrawing. Update all status lines, in case they // show something related to the window count or position. ! redraw_win_later(wp, UPD_NOT_VALID); ! redraw_win_later(oldwin, UPD_NOT_VALID); status_redraw_all(); if (need_status) *************** *** 1718,1724 **** wp->w_cursor = curwin->w_cursor; win_enter(wp, TRUE); ! redraw_all_later(NOT_VALID); } /* --- 1718,1724 ---- wp->w_cursor = curwin->w_cursor; win_enter(wp, TRUE); ! redraw_all_later(UPD_NOT_VALID); } /* *************** *** 1801,1807 **** (void)win_comp_pos(); } ! redraw_all_later(NOT_VALID); } /* --- 1801,1807 ---- (void)win_comp_pos(); } ! redraw_all_later(UPD_NOT_VALID); } /* *************** *** 1903,1909 **** frame_append(win2->w_frame, win1->w_frame); (void)win_comp_pos(); // recompute w_winrow for all windows ! redraw_later(NOT_VALID); } win_enter(win1, FALSE); } --- 1903,1909 ---- frame_append(win2->w_frame, win1->w_frame); (void)win_comp_pos(); // recompute w_winrow for all windows ! redraw_later(UPD_NOT_VALID); } win_enter(win1, FALSE); } *************** *** 1966,1972 **** 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); } } else if (topfr->fr_layout == FR_ROW) --- 1966,1972 ---- frame_new_height(topfr, height, FALSE, FALSE); topfr->fr_win->w_wincol = col; frame_new_width(topfr, width, FALSE, FALSE); ! redraw_all_later(UPD_NOT_VALID); } } else if (topfr->fr_layout == FR_ROW) *************** *** 2296,2302 **** static void win_init_empty(win_T *wp) { ! redraw_win_later(wp, NOT_VALID); wp->w_lines_valid = 0; wp->w_cursor.lnum = 1; wp->w_curswant = wp->w_cursor.col = 0; --- 2296,2302 ---- static void win_init_empty(win_T *wp) { ! 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,2792 **** gui_init_which_components(NULL); #endif ! redraw_all_later(NOT_VALID); return OK; } --- 2786,2792 ---- gui_init_which_components(NULL); #endif ! redraw_all_later(UPD_NOT_VALID); return OK; } *************** *** 4075,4081 **** entering_window(curwin); #endif ! redraw_all_later(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); --- 4075,4081 ---- entering_window(curwin); #endif ! 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,4379 **** apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf); } ! redraw_all_later(NOT_VALID); } /* --- 4373,4379 ---- apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf); } ! redraw_all_later(UPD_NOT_VALID); } /* *************** *** 4970,4976 **** #endif redraw_tabline = TRUE; if (restart_edit) ! redraw_later(VALID); // causes status line redraw // set window height to desired minimal value if (curwin->w_height < p_wh && !curwin->w_p_wfh --- 4970,4976 ---- #endif redraw_tabline = TRUE; if (restart_edit) ! 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,5595 **** // position changed, redraw wp->w_winrow = *row; wp->w_wincol = *col; ! redraw_win_later(wp, NOT_VALID); wp->w_redr_status = TRUE; } // WinBar will not show if the window height is zero --- 5589,5595 ---- // position changed, redraw wp->w_winrow = *row; wp->w_wincol = *col; ! redraw_win_later(wp, UPD_NOT_VALID); wp->w_redr_status = TRUE; } // WinBar will not show if the window height is zero *************** *** 5669,5675 **** msg_row = row; msg_col = 0; ! redraw_all_later(NOT_VALID); } /* --- 5669,5675 ---- msg_row = row; msg_col = 0; ! redraw_all_later(UPD_NOT_VALID); } /* *************** *** 5880,5886 **** // recompute the window positions (void)win_comp_pos(); ! redraw_all_later(NOT_VALID); } /* --- 5880,5886 ---- // recompute the window positions (void)win_comp_pos(); ! redraw_all_later(UPD_NOT_VALID); } /* *************** *** 6206,6212 **** 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); showmode(); } --- 6206,6212 ---- cmdline_row = row; p_ch = MAX(Rows - cmdline_row, p_ch_was_zero ? 0 : 1); curtab->tp_ch_used = p_ch; ! redraw_all_later(UPD_SOME_VALID); showmode(); } *************** *** 6312,6318 **** fr = fr->fr_next; } (void)win_comp_pos(); ! redraw_all_later(NOT_VALID); } #define FRACTION_MULT 16384L --- 6312,6318 ---- fr = fr->fr_next; } (void)win_comp_pos(); ! redraw_all_later(UPD_NOT_VALID); } #define FRACTION_MULT 16384L *************** *** 6491,6497 **** wp->w_prev_fraction_row = wp->w_wrow; win_comp_scroll(wp); ! redraw_win_later(wp, SOME_VALID); wp->w_redr_status = TRUE; invalidate_botline_win(wp); } --- 6491,6497 ---- wp->w_prev_fraction_row = wp->w_wrow; win_comp_scroll(wp); ! redraw_win_later(wp, UPD_SOME_VALID); wp->w_redr_status = TRUE; invalidate_botline_win(wp); } *************** *** 6511,6517 **** update_topline(); curs_columns(TRUE); // validate w_wrow } ! redraw_win_later(wp, NOT_VALID); wp->w_redr_status = TRUE; } --- 6511,6517 ---- update_topline(); curs_columns(TRUE); // validate w_wrow } ! redraw_win_later(wp, UPD_NOT_VALID); wp->w_redr_status = TRUE; } *************** *** 6692,6698 **** else win_new_height(wp, wp->w_height - 1); comp_col(); ! redraw_all_later(SOME_VALID); } } else if (fr->fr_layout == FR_ROW) --- 6692,6698 ---- else win_new_height(wp, wp->w_height - 1); comp_col(); ! redraw_all_later(UPD_SOME_VALID); } } else if (fr->fr_layout == FR_ROW) *************** *** 6984,6990 **** win_comp_pos(); if (wp != NULL && close_curwin) win_goto(wp); ! redraw_all_later(NOT_VALID); } clear_snapshot(curtab, idx); } --- 6984,6990 ---- win_comp_pos(); if (wp != NULL && close_curwin) win_goto(wp); ! redraw_all_later(UPD_NOT_VALID); } clear_snapshot(curtab, idx); } *** ../vim-9.0.0205/src/version.c 2022-08-14 13:28:36.223224725 +0100 --- src/version.c 2022-08-14 14:14:29.252480830 +0100 *************** *** 737,738 **** --- 737,740 ---- { /* Add new patch number below this line */ + /**/ + 206, /**/ -- FIRST GUARD: Ah! Now ... we're not allowed to ... SIR LAUNCELOT runs him through, grabs his spear and stabs the other guard who collapses in a heap. Hiccoughs quietly. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///