diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-14 14:17:45 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-14 14:17:45 +0100 |
commit | a4d158b3c839e96ed98ff87c7b7124ff4518c4ff (patch) | |
tree | 42d3a6b65d4ae53a6e078c8f24a5ee9960e3ad24 /src | |
parent | 28c9f895716cfa8f1220bc41b72a534c0e10cabe (diff) |
patch 9.0.0206: redraw flags are not named specificallyv9.0.0206
Problem: Redraw flags are not named specifically.
Solution: Prefix "UPD_" to the flags, for UPDate_screen().
Diffstat (limited to 'src')
64 files changed, 382 insertions, 378 deletions
diff --git a/src/buffer.c b/src/buffer.c index 669cfa9a97..1aaddd477b 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1924,7 +1924,7 @@ enter_buffer(buf_T *buf) curbuf->b_last_used = vim_time(); #endif - redraw_later(NOT_VALID); + redraw_later(UPD_NOT_VALID); } #if defined(FEAT_AUTOCHDIR) || defined(PROTO) diff --git a/src/change.c b/src/change.c index 42d4550172..9e1c1c9188 100644 --- a/src/change.c +++ b/src/change.c @@ -559,8 +559,8 @@ changed_common( linenr_T last = lnume + xtra - 1; // last line after the change #endif // Mark this window to be redrawn later. - if (wp->w_redr_type < VALID) - wp->w_redr_type = VALID; + if (wp->w_redr_type < UPD_VALID) + wp->w_redr_type = UPD_VALID; // Check if a change in the buffer has invalidated the cached // values for the cursor. @@ -648,18 +648,18 @@ changed_common( if (wp->w_p_rnu && xtra != 0) { wp->w_last_cursor_lnum_rnu = 0; - redraw_win_later(wp, VALID); + redraw_win_later(wp, UPD_VALID); } #ifdef FEAT_SYN_HL // Cursor line highlighting probably need to be updated with - // "VALID" if it's below the change. + // "UPD_VALID" if it's below the change. // If the cursor line is inside the change we need to redraw more. if (wp->w_p_cul) { if (xtra == 0) - redraw_win_later(wp, VALID); + redraw_win_later(wp, UPD_VALID); else if (lnum <= wp->w_last_cursorline) - redraw_win_later(wp, SOME_VALID); + redraw_win_later(wp, UPD_SOME_VALID); } #endif } @@ -671,8 +671,8 @@ changed_common( // Call update_screen() later, which checks out what needs to be redrawn, // since it notices b_mod_set and then uses b_mod_*. - if (must_redraw < VALID) - must_redraw = VALID; + if (must_redraw < UPD_VALID) + must_redraw = UPD_VALID; // when the cursor line is changed always trigger CursorMoved if (lnum <= curwin->w_cursor.lnum @@ -724,7 +724,7 @@ changed_bytes(linenr_T lnum, colnr_T col) FOR_ALL_WINDOWS(wp) if (wp->w_p_diff && wp != curwin) { - redraw_win_later(wp, VALID); + redraw_win_later(wp, UPD_VALID); wlnum = diff_lnum_win(lnum, wp); if (wlnum > 0) changedOneline(wp->w_buffer, wlnum); @@ -869,7 +869,7 @@ changed_lines( FOR_ALL_WINDOWS(wp) if (wp->w_p_diff && wp != curwin) { - redraw_win_later(wp, VALID); + redraw_win_later(wp, UPD_VALID); wlnum = diff_lnum_win(lnum, wp); if (wlnum > 0) changed_lines_buf(wp->w_buffer, wlnum, diff --git a/src/channel.c b/src/channel.c index 8a64d1756a..0bfeeac476 100644 --- a/src/channel.c +++ b/src/channel.c @@ -2930,7 +2930,7 @@ append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, ch_part_T part) } } } - redraw_buf_and_status_later(buffer, VALID); + redraw_buf_and_status_later(buffer, UPD_VALID); channel_need_redraw = TRUE; } diff --git a/src/clipboard.c b/src/clipboard.c index e7854d0454..e140113ff7 100644 --- a/src/clipboard.c +++ b/src/clipboard.c @@ -147,7 +147,7 @@ clip_own_selection(Clipboard_T *cbd) && (cbd == &clip_star ? clip_isautosel_star() : clip_isautosel_plus()) && HL_ATTR(HLF_V) != HL_ATTR(HLF_VNC)) - redraw_curbuf_later(INVERTED_ALL); + redraw_curbuf_later(UPD_INVERTED_ALL); } } #else @@ -202,7 +202,7 @@ clip_lose_selection(Clipboard_T *cbd) && HL_ATTR(HLF_V) != HL_ATTR(HLF_VNC) && !exiting) { - update_curbuf(INVERTED_ALL); + update_curbuf(UPD_INVERTED_ALL); setcursor(); cursor_on(); out_flush_cursor(TRUE, FALSE); diff --git a/src/cmdexpand.c b/src/cmdexpand.c index 793a104d06..ff6aa0d033 100644 --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -3654,7 +3654,7 @@ wildmenu_cleanup(cmdline_info_T *cclp) p_ls = save_p_ls; p_wmh = save_p_wmh; last_status(FALSE); - update_screen(VALID); // redraw the screen NOW + update_screen(UPD_VALID); // redraw the screen NOW redrawcmd(); save_p_ls = -1; } diff --git a/src/debugger.c b/src/debugger.c index 38d1fb6022..e2f73cca03 100644 --- a/src/debugger.c +++ b/src/debugger.c @@ -285,7 +285,7 @@ do_debug(char_u *cmd) --RedrawingDisabled; --no_wait_return; - redraw_all_later(NOT_VALID); + redraw_all_later(UPD_NOT_VALID); need_wait_return = FALSE; msg_scroll = save_msg_scroll; lines_left = Rows - 1; diff --git a/src/diff.c b/src/diff.c index 43feb2a8b3..80f1eb3368 100644 --- a/src/diff.c +++ b/src/diff.c @@ -123,7 +123,7 @@ diff_buf_delete(buf_T *buf) // don't redraw right away, more might change or buffer state // is invalid right now need_diff_redraw = TRUE; - redraw_later(VALID); + redraw_later(UPD_VALID); } } } @@ -683,7 +683,7 @@ diff_redraw( if (!wp->w_p_diff || !buf_valid(wp->w_buffer)) continue; - redraw_win_later(wp, SOME_VALID); + redraw_win_later(wp, UPD_SOME_VALID); if (wp != curwin) wp_other = wp; #ifdef FEAT_FOLDING @@ -1336,7 +1336,7 @@ ex_diffpatch(exarg_T *eap) #endif // patch probably has written over the screen - redraw_later(CLEAR); + redraw_later(UPD_CLEAR); // Delete any .orig or .rej file created. STRCPY(buf, tmp_new); @@ -1544,7 +1544,7 @@ diff_win_options( if (addbuf) diff_buf_add(wp->w_buffer); - redraw_win_later(wp, NOT_VALID); + redraw_win_later(wp, UPD_NOT_VALID); } /* diff --git a/src/digraph.c b/src/digraph.c index f37292fcd1..de4ff83efb 100644 --- a/src/digraph.c +++ b/src/digraph.c @@ -2025,8 +2025,10 @@ listdigraphs(int use_headers) ui_breakcheck(); ++dp; } - must_redraw = CLEAR; // clear screen, because some digraphs may be - // wrong, in which case we messed up ScreenLines + + // clear screen, because some digraphs may be wrong, in which case we + // messed up ScreenLines + must_redraw = UPD_CLEAR; } static void diff --git a/src/drawscreen.c b/src/drawscreen.c index a5822b25d8..9e8d9eede1 100644 --- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -28,7 +28,7 @@ * * Commands that scroll a window change w_topline and must call * check_cursor() to move the cursor into the visible part of the window, and - * call redraw_later(VALID) to have the window displayed by update_screen() + * call redraw_later(UPD_VALID) to have the window displayed by update_screen() * later. * * Commands that change text in the buffer must call changed_bytes() or @@ -40,23 +40,23 @@ * * Commands that change how a window is displayed (e.g., setting 'list') or * invalidate the contents of a window in another way (e.g., change fold - * settings), must call redraw_later(NOT_VALID) to have the whole window + * settings), must call redraw_later(UPD_NOT_VALID) to have the whole window * redisplayed by update_screen() later. * * Commands that change how a buffer is displayed (e.g., setting 'tabstop') - * must call redraw_curbuf_later(NOT_VALID) to have all the windows for the + * must call redraw_curbuf_later(UPD_NOT_VALID) to have all the windows for the * buffer redisplayed by update_screen() later. * * Commands that change highlighting and possibly cause a scroll too must call - * redraw_later(SOME_VALID) to update the whole window but still use scrolling - * to avoid redrawing everything. But the length of displayed lines must not - * change, use NOT_VALID then. + * redraw_later(UPD_SOME_VALID) to update the whole window but still use + * scrolling to avoid redrawing everything. But the length of displayed lines + * must not change, use UPD_NOT_VALID then. * - * Commands that move the window position must call redraw_later(NOT_VALID). + * Commands that move the window position must call redraw_later(UPD_NOT_VALID). * TODO: should minimize redrawing by scrolling when possible. * * Commands that change everything (e.g., resizing the screen) must call - * redraw_all_later(NOT_VALID) or redraw_all_later(CLEAR). + * redraw_all_later(UPD_NOT_VALID) or redraw_all_later(UPD_CLEAR). * * Things that are handled indirectly: * - When messages scroll the screen up, msg_scrolled will be set and @@ -99,7 +99,7 @@ update_screen(int type_arg) if (!screen_valid(TRUE)) return FAIL; - if (type == VALID_NO_UPDATE) + if (type == UPD_VALID_NO_UPDATE) { no_update = TRUE; type = 0; @@ -134,12 +134,12 @@ update_screen(int type_arg) } // May need to update w_lines[]. - if (curwin->w_lines_valid == 0 && type < NOT_VALID + if (curwin->w_lines_valid == 0 && type < UPD_NOT_VALID #ifdef FEAT_TERMINAL && !term_do_update_window(curwin) #endif ) - type = NOT_VALID; + type = UPD_NOT_VALID; // Postpone the redrawing when it's not needed and when being called // recursively. @@ -147,7 +147,7 @@ update_screen(int type_arg) { redraw_later(type); // remember type for next time must_redraw = type; - if (type > INVERTED_ALL) + if (type > UPD_INVERTED_ALL) curwin->w_lines_valid = 0; // don't use w_lines[].wl_size now return FAIL; } @@ -171,28 +171,28 @@ update_screen(int type_arg) { clear_cmdline = TRUE; if (msg_scrolled > Rows - 5) // clearing is faster - type = CLEAR; - else if (type != CLEAR) + type = UPD_CLEAR; + else if (type != UPD_CLEAR) { check_for_delay(FALSE); if (screen_ins_lines(0, 0, msg_scrolled, (int)Rows, 0, NULL) == FAIL) - type = CLEAR; + type = UPD_CLEAR; FOR_ALL_WINDOWS(wp) { if (wp->w_winrow < msg_scrolled) { if (W_WINROW(wp) + wp->w_height > msg_scrolled - && wp->w_redr_type < REDRAW_TOP + && wp->w_redr_type < UPD_REDRAW_TOP && wp->w_lines_valid > 0 && wp->w_topline == wp->w_lines[0].wl_lnum) { wp->w_upd_rows = msg_scrolled - W_WINROW(wp); - wp->w_redr_type = REDRAW_TOP; + wp->w_redr_type = UPD_REDRAW_TOP; } else { - wp->w_redr_type = NOT_VALID; + wp->w_redr_type = UPD_NOT_VALID; if (W_WINROW(wp) + wp->w_height + wp->w_status_height <= msg_scrolled) wp->w_redr_status = TRUE; @@ -214,10 +214,10 @@ update_screen(int type_arg) if (need_highlight_changed) highlight_changed(); - if (type == CLEAR) // first clear screen + if (type == UPD_CLEAR) // first clear screen { screenclear(); // will reset clear_cmdline - type = NOT_VALID; + type = UPD_NOT_VALID; // must_redraw may be set indirectly, avoid another redraw later must_redraw = 0; } @@ -228,24 +228,24 @@ update_screen(int type_arg) #ifdef FEAT_LINEBREAK // Force redraw when width of 'number' or 'relativenumber' column // changes. - if (curwin->w_redr_type < NOT_VALID + if (curwin->w_redr_type < UPD_NOT_VALID && curwin->w_nrwidth != ((curwin->w_p_nu || curwin->w_p_rnu) ? number_width(curwin) : 0)) - curwin->w_redr_type = NOT_VALID; + curwin->w_redr_type = UPD_NOT_VALID; #endif // Only start redrawing if there is really something to do. - if (type == INVERTED) + if (type == UPD_INVERTED) update_curswant(); if (curwin->w_redr_type < type - && !((type == VALID + && !((type == UPD_VALID && curwin->w_lines[0].wl_valid #ifdef FEAT_DIFF && curwin->w_topfill == curwin->w_old_topfill && curwin->w_botfill == curwin->w_old_botfill #endif && curwin->w_topline == curwin->w_lines[0].wl_lnum) - || (type == INVERTED + || (type == UPD_INVERTED && VIsual_active && curwin->w_old_cursor_lnum == curwin->w_cursor.lnum && curwin->w_old_visual_mode == VIsual_mode @@ -255,7 +255,7 @@ update_screen(int type_arg) curwin->w_redr_type = type; // Redraw the tab pages line if needed. - if (redraw_tabline || type >= NOT_VALID) + if (redraw_tabline || type >= UPD_NOT_VALID) draw_tabline(); #ifdef FEAT_SYN_HL @@ -1408,12 +1408,13 @@ fold_line( * * How the window is redrawn depends on wp->w_redr_type. Each type also * implies the one below it. - * NOT_VALID redraw the whole window - * SOME_VALID redraw the whole window but do scroll when possible - * REDRAW_TOP redraw the top w_upd_rows window lines, otherwise like VALID - * INVERTED redraw the changed part of the Visual area - * INVERTED_ALL redraw the whole Visual area - * VALID 1. scroll up/down to adjust for a changed w_topline + * UPD_NOT_VALID redraw the whole window + * UPD_SOME_VALID redraw the whole window but do scroll when possible + * UPD_REDRAW_TOP redraw the top w_upd_rows window lines, otherwise like + * UPD_VALID + * UPD_INVERTED redraw the changed part of the Visual area + * UPD_INVERTED_ALL redraw the whole Visual area + * UPD_VALID 1. scroll up/down to adjust for a changed w_topline * 2. update lines at the top when scrolled down * 3. redraw changed text: * - if wp->w_buffer->b_mod_set set, update lines between @@ -1500,7 +1501,7 @@ win_update(win_T *wp) type = wp->w_redr_type; - if (type == NOT_VALID) + if (type == UPD_NOT_VALID) { wp->w_redr_status = TRUE; wp->w_lines_valid = 0; @@ -1552,7 +1553,7 @@ win_update(win_T *wp) i = (wp->w_p_nu || wp->w_p_rnu) ? number_width(wp) : 0; if (wp->w_nrwidth != i) { - type = NOT_VALID; + type = UPD_NOT_VALID; wp->w_nrwidth = i; } else @@ -1563,7 +1564,7 @@ win_update(win_T *wp) // When there are both inserted/deleted lines and specific lines to be // redrawn, w_redraw_top and w_redraw_bot may be invalid, just redraw // everything (only happens when redrawing is off for while). - type = NOT_VALID; + type = UPD_NOT_VALID; } else { @@ -1705,7 +1706,7 @@ win_update(win_T *wp) // When only displaying the lines at the top, set top_end. Used when // window has scrolled down for msg_scrolled. - if (type == REDRAW_TOP) + if (type == UPD_REDRAW_TOP) { j = 0; for (i = 0; i < wp->w_lines_valid; ++i) @@ -1719,10 +1720,10 @@ win_update(win_T *wp) } if (top_end == 0) // not found (cannot happen?): redraw everything - type = NOT_VALID; + type = UPD_NOT_VALID; else - // top area defined, the rest is VALID - type = VALID; + // top area defined, the rest is UPD_VALID + type = UPD_VALID; } // Trick: we want to avoid clearing the screen twice. screenclear() will @@ -1738,8 +1739,8 @@ win_update(win_T *wp) // 2: wp->w_topline is below wp->w_lines[0].wl_lnum: may scroll up // 3: wp->w_topline is wp->w_lines[0].wl_lnum: find first entry in // w_lines[] that needs updating. - if ((type == VALID || type == SOME_VALID - || type == INVERTED || type == INVERTED_ALL) + if ((type == UPD_VALID || type == UPD_SOME_VALID + || type == UPD_INVERTED || type == UPD_INVERTED_ALL) #ifdef FEAT_DIFF && !wp->w_botfill && !wp->w_old_botfill #endif @@ -1942,35 +1943,35 @@ win_update(win_T *wp) // When win_del_lines() or win_ins_lines() caused the screen to be // cleared (only happens for the first window) or when screenclear() // was called directly above, "must_redraw" will have been set to - // NOT_VALID, need to reset it here to avoid redrawing twice. + // UPD_NOT_VALID, need to reset it here to avoid redrawing twice. if (screen_cleared == TRUE) must_redraw = 0; } else { - // Not VALID or INVERTED: redraw all lines. + // Not UPD_VALID or UPD_INVERTED: redraw all lines. mid_start = 0; mid_end = wp->w_height; } - if (type == SOME_VALID) + if (type == UPD_SOME_VALID) { - // SOME_VALID: redraw all lines. + // UPD_SOME_VALID: redraw all lines. mid_start = 0; mid_end = wp->w_height; - type = NOT_VALID; + type = UPD_NOT_VALID; } // check if we are updating or removing the inverted part if ((VIsual_active && buf == curwin->w_buffer) - || (wp->w_old_cursor_lnum != 0 && type != NOT_VALID)) + || (wp->w_old_cursor_lnum != 0 && type != UPD_NOT_VALID)) { linenr_T from, to; if (VIsual_active) { if (VIsual_mode != wp->w_old_visual_mode - || type == INVERTED_ALL) + || type == UPD_INVERTED_ALL) { // If the type of Visual selection changed, redraw the whole // selection. Also when the ownership of the X selection is @@ -3114,7 +3115,7 @@ redraw_after_callback(int call_update_screen, int do_message) validate_cursor(); // keep the command line if possible - update_screen(VALID_NO_UPDATE); + update_screen(UPD_VALID_NO_UPDATE); setcursor(); if (msg_scrolled == 0) @@ -3140,7 +3141,7 @@ redraw_after_callback(int call_update_screen, int do_message) /* * Redraw the current window later, with update_screen(type). * Set must_redraw only if not already set to a higher value. - * E.g. if must_redraw is CLEAR, type NOT_VALID will do nothing. + * E.g. if must_redraw is UPD_CLEAR, type UPD_NOT_VALID will do nothing. */ void redraw_later(int type) @@ -3156,7 +3157,7 @@ redraw_win_later( if (!exiting && wp->w_redr_type < type) { wp->w_redr_type = type; - if (type >= NOT_VALID) + if (type >= UPD_NOT_VALID) wp->w_lines_valid = 0; if (must_redraw < type) // must_redraw is the maximum of all windows must_redraw = type; @@ -3170,7 +3171,7 @@ redraw_win_later( void redraw_later_clear(void) { - redraw_all_later(CLEAR); + redraw_all_later(UPD_CLEAR); reset_screen_attr(); } @@ -3263,7 +3264,7 @@ status_redraw_all(void) if (wp->w_status_height) { wp->w_redr_status = TRUE; - redraw_later(VALID); + redraw_later(UPD_VALID); } } @@ -3279,7 +3280,7 @@ status_redraw_curbuf(void) if (wp->w_status_height != 0 && wp->w_buffer == curbuf) { wp->w_redr_status = TRUE; - redraw_later(VALID); + redraw_later(UPD_VALID); } } @@ -3339,5 +3340,5 @@ redrawWinline( wp->w_redraw_top = lnum; if (wp->w_redraw_bot == 0 || wp->w_redraw_bot < lnum) wp->w_redraw_bot = lnum; - redraw_win_later(wp, VALID); + redraw_win_later(wp, UPD_VALID); } diff --git a/src/edit.c b/src/edit.c index c3aa888780..0b0d174f36 100644 --- a/src/edit.c +++ b/src/edit.c @@ -4701,7 +4701,7 @@ ins_up( || old_topfill != curwin->w_topfill #endif ) - redraw_later(VALID); + redraw_later(UPD_VALID); start_arrow(&tpos); can_cindent = TRUE; } @@ -4758,7 +4758,7 @@ ins_down( || old_topfill != curwin->w_topfill #endif ) - redraw_later(VALID); + redraw_later(UPD_VALID); start_arrow(&tpos); can_cindent = TRUE; } @@ -5283,7 +5283,7 @@ ins_ctrl_ey(int tc) scrolldown_clamp(); else scrollup_clamp(); - redraw_later(VALID); + redraw_later(UPD_VALID); } else { diff --git a/src/evalvars.c b/src/evalvars.c index 16dfd0d126..0b51ce1da0 100644 --- a/src/evalvars.c +++ b/src/evalvars.c @@ -3827,7 +3827,7 @@ set_var_const( else if (STRCMP(varname, "hlsearch") == 0) { no_hlsearch = !di->di_tv.vval.v_number; - r |