comparison src/move.c @ 29732:89e1d67814a9 v9.0.0206

patch 9.0.0206: redraw flags are not named specifically Commit: https://github.com/vim/vim/commit/a4d158b3c839e96ed98ff87c7b7124ff4518c4ff Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 14 14:17:45 2022 +0100 patch 9.0.0206: redraw flags are not named specifically Problem: Redraw flags are not named specifically. Solution: Prefix "UPD_" to the flags, for UPDate_screen().
author Bram Moolenaar <Bram@vim.org>
date Sun, 14 Aug 2022 15:30:05 +0200
parents d97b2ce26258
children ed6f3d2593df
comparison
equal deleted inserted replaced
29731:df7f360215b7 29732:89e1d67814a9
129 ) 129 )
130 && (wp->w_valid & VALID_CROW) == 0 130 && (wp->w_valid & VALID_CROW) == 0
131 && !pum_visible()) 131 && !pum_visible())
132 { 132 {
133 // win_line() will redraw the number column and cursorline only. 133 // win_line() will redraw the number column and cursorline only.
134 redraw_win_later(wp, VALID); 134 redraw_win_later(wp, UPD_VALID);
135 } 135 }
136 } 136 }
137 137
138 #ifdef FEAT_SYN_HL 138 #ifdef FEAT_SYN_HL
139 /* 139 /*
143 static void 143 static void
144 redraw_for_cursorcolumn(win_T *wp) 144 redraw_for_cursorcolumn(win_T *wp)
145 { 145 {
146 if ((wp->w_valid & VALID_VIRTCOL) == 0 && !pum_visible()) 146 if ((wp->w_valid & VALID_VIRTCOL) == 0 && !pum_visible())
147 { 147 {
148 // When 'cursorcolumn' is set need to redraw with SOME_VALID. 148 // When 'cursorcolumn' is set need to redraw with UPD_SOME_VALID.
149 if (wp->w_p_cuc) 149 if (wp->w_p_cuc)
150 redraw_win_later(wp, SOME_VALID); 150 redraw_win_later(wp, UPD_SOME_VALID);
151 // When 'cursorlineopt' contains "screenline" need to redraw with VALID. 151 // When 'cursorlineopt' contains "screenline" need to redraw with
152 // UPD_VALID.
152 else if (wp->w_p_cul && (wp->w_p_culopt_flags & CULOPT_SCRLINE)) 153 else if (wp->w_p_cul && (wp->w_p_culopt_flags & CULOPT_SCRLINE))
153 redraw_win_later(wp, VALID); 154 redraw_win_later(wp, UPD_VALID);
154 } 155 }
155 } 156 }
156 #endif 157 #endif
157 158
158 /* 159 /*
216 * If the buffer is empty, always set topline to 1. 217 * If the buffer is empty, always set topline to 1.
217 */ 218 */
218 if (BUFEMPTY()) // special case - file is empty 219 if (BUFEMPTY()) // special case - file is empty
219 { 220 {
220 if (curwin->w_topline != 1) 221 if (curwin->w_topline != 1)
221 redraw_later(NOT_VALID); 222 redraw_later(UPD_NOT_VALID);
222 curwin->w_topline = 1; 223 curwin->w_topline = 1;
223 curwin->w_botline = 2; 224 curwin->w_botline = 2;
224 curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP; 225 curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP;
225 curwin->w_scbind_pos = 1; 226 curwin->w_scbind_pos = 1;
226 } 227 }
399 { 400 {
400 dollar_vcol = -1; 401 dollar_vcol = -1;
401 if (curwin->w_skipcol != 0) 402 if (curwin->w_skipcol != 0)
402 { 403 {
403 curwin->w_skipcol = 0; 404 curwin->w_skipcol = 0;
404 redraw_later(NOT_VALID); 405 redraw_later(UPD_NOT_VALID);
405 } 406 }
406 else 407 else
407 redraw_later(VALID); 408 redraw_later(UPD_VALID);
408 // May need to set w_skipcol when cursor in w_topline. 409 // May need to set w_skipcol when cursor in w_topline.
409 if (curwin->w_cursor.lnum == curwin->w_topline) 410 if (curwin->w_cursor.lnum == curwin->w_topline)
410 validate_cursor(); 411 validate_cursor();
411 } 412 }
412 413
520 changed_window_setting_win(win_T *wp) 521 changed_window_setting_win(win_T *wp)
521 { 522 {
522 wp->w_lines_valid = 0; 523 wp->w_lines_valid = 0;
523 changed_line_abv_curs_win(wp); 524 changed_line_abv_curs_win(wp);
524 wp->w_valid &= ~(VALID_BOTLINE|VALID_BOTLINE_AP|VALID_TOPLINE); 525 wp->w_valid &= ~(VALID_BOTLINE|VALID_BOTLINE_AP|VALID_TOPLINE);
525 redraw_win_later(wp, NOT_VALID); 526 redraw_win_later(wp, UPD_NOT_VALID);
526 } 527 }
527 528
528 /* 529 /*
529 * Set wp->w_topline to a certain number. 530 * Set wp->w_topline to a certain number.
530 */ 531 */
550 // Keep the filler lines when the topline didn't change. 551 // Keep the filler lines when the topline didn't change.
551 wp->w_topfill = 0; 552 wp->w_topfill = 0;
552 #endif 553 #endif
553 wp->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_TOPLINE); 554 wp->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_TOPLINE);
554 // Don't set VALID_TOPLINE here, 'scrolloff' needs to be checked. 555 // Don't set VALID_TOPLINE here, 'scrolloff' needs to be checked.
555 redraw_later(VALID); 556 redraw_later(UPD_VALID);
556 } 557 }
557 558
558 /* 559 /*
559 * Call this function when the length of the cursor line (in screen 560 * Call this function when the length of the cursor line (in screen
560 * characters) has changed, and the change is before the cursor. 561 * characters) has changed, and the change is before the cursor.
1087 new_leftcol = 0; 1088 new_leftcol = 0;
1088 if (new_leftcol != (int)curwin->w_leftcol) 1089 if (new_leftcol != (int)curwin->w_leftcol)
1089 { 1090 {
1090 curwin->w_leftcol = new_leftcol; 1091 curwin->w_leftcol = new_leftcol;
1091 // screen has to be redrawn with new curwin->w_leftcol 1092 // screen has to be redrawn with new curwin->w_leftcol
1092 redraw_later(NOT_VALID); 1093 redraw_later(UPD_NOT_VALID);
1093 } 1094 }
1094 } 1095 }
1095 curwin->w_wcol -= curwin->w_leftcol; 1096 curwin->w_wcol -= curwin->w_leftcol;
1096 } 1097 }
1097 else if (curwin->w_wcol > (int)curwin->w_leftcol) 1098 else if (curwin->w_wcol > (int)curwin->w_leftcol)
1200 win_del_lines(curwin, 0, -extra, FALSE, FALSE, 0); 1201 win_del_lines(curwin, 0, -extra, FALSE, FALSE, 0);
1201 } 1202 }
1202 else 1203 else
1203 curwin->w_skipcol = 0; 1204 curwin->w_skipcol = 0;
1204 if (prev_skipcol != curwin->w_skipcol) 1205 if (prev_skipcol != curwin->w_skipcol)
1205 redraw_later(NOT_VALID); 1206 redraw_later(UPD_NOT_VALID);
1206 1207
1207 #ifdef FEAT_SYN_HL 1208 #ifdef FEAT_SYN_HL
1208 redraw_for_cursorcolumn(curwin); 1209 redraw_for_cursorcolumn(curwin);
1209 #endif 1210 #endif
1210 #if defined(FEAT_PROP_POPUP) && defined(FEAT_TERMINAL) 1211 #if defined(FEAT_PROP_POPUP) && defined(FEAT_TERMINAL)
2670 else if (curwin->w_botline > curbuf->b_ml.ml_line_count) 2671 else if (curwin->w_botline > curbuf->b_ml.ml_line_count)
2671 (void)hasFolding(curwin->w_topline, &curwin->w_topline, NULL); 2672 (void)hasFolding(curwin->w_topline, &curwin->w_topline, NULL);
2672 #endif 2673 #endif
2673 } 2674 }
2674 2675
2675 redraw_later(VALID); 2676 redraw_later(UPD_VALID);
2676 return retval; 2677 return retval;
2677 } 2678 }
2678 2679
2679 /* 2680 /*
2680 * Decide how much overlap to use for page-up or page-down scrolling. 2681 * Decide how much overlap to use for page-up or page-down scrolling.
2922 #ifdef FEAT_DIFF 2923 #ifdef FEAT_DIFF
2923 check_topfill(curwin, !flag); 2924 check_topfill(curwin, !flag);
2924 #endif 2925 #endif
2925 cursor_correct(); 2926 cursor_correct();
2926 beginline(BL_SOL | BL_FIX); 2927 beginline(BL_SOL | BL_FIX);
2927 redraw_later(VALID); 2928 redraw_later(UPD_VALID);
2928 } 2929 }
2929 2930
2930 void 2931 void
2931 do_check_cursorbind(void) 2932 do_check_cursorbind(void)
2932 { 2933 {
2976 2977
2977 restart_edit = restart_edit_save; 2978 restart_edit = restart_edit_save;
2978 // Correct cursor for multi-byte character. 2979 // Correct cursor for multi-byte character.
2979 if (has_mbyte) 2980 if (has_mbyte)
2980 mb_adjust_cursor(); 2981 mb_adjust_cursor();
2981 redraw_later(VALID); 2982 redraw_later(UPD_VALID);
2982 2983
2983 // Only scroll when 'scrollbind' hasn't done this. 2984 // Only scroll when 'scrollbind' hasn't done this.
2984 if (!curwin->w_p_scb) 2985 if (!curwin->w_p_scb)
2985 update_topline(); 2986 update_topline();
2986 curwin->w_redr_status = TRUE; 2987 curwin->w_redr_status = TRUE;