Mercurial > vim
comparison src/drawscreen.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 | 5b3a88601317 |
children | 68ef14b21d01 |
comparison
equal
deleted
inserted
replaced
29731:df7f360215b7 | 29732:89e1d67814a9 |
---|---|
26 * action to update the display. The main loop will check if w_topline is | 26 * action to update the display. The main loop will check if w_topline is |
27 * valid and update it (scroll the window) when needed. | 27 * valid and update it (scroll the window) when needed. |
28 * | 28 * |
29 * Commands that scroll a window change w_topline and must call | 29 * Commands that scroll a window change w_topline and must call |
30 * check_cursor() to move the cursor into the visible part of the window, and | 30 * check_cursor() to move the cursor into the visible part of the window, and |
31 * call redraw_later(VALID) to have the window displayed by update_screen() | 31 * call redraw_later(UPD_VALID) to have the window displayed by update_screen() |
32 * later. | 32 * later. |
33 * | 33 * |
34 * Commands that change text in the buffer must call changed_bytes() or | 34 * Commands that change text in the buffer must call changed_bytes() or |
35 * changed_lines() to mark the area that changed and will require updating | 35 * changed_lines() to mark the area that changed and will require updating |
36 * later. The main loop will call update_screen(), which will update each | 36 * later. The main loop will call update_screen(), which will update each |
38 * can remain displayed as it is. Text after the change may need updating for | 38 * can remain displayed as it is. Text after the change may need updating for |
39 * scrolling, folding and syntax highlighting. | 39 * scrolling, folding and syntax highlighting. |
40 * | 40 * |
41 * Commands that change how a window is displayed (e.g., setting 'list') or | 41 * Commands that change how a window is displayed (e.g., setting 'list') or |
42 * invalidate the contents of a window in another way (e.g., change fold | 42 * invalidate the contents of a window in another way (e.g., change fold |
43 * settings), must call redraw_later(NOT_VALID) to have the whole window | 43 * settings), must call redraw_later(UPD_NOT_VALID) to have the whole window |
44 * redisplayed by update_screen() later. | 44 * redisplayed by update_screen() later. |
45 * | 45 * |
46 * Commands that change how a buffer is displayed (e.g., setting 'tabstop') | 46 * Commands that change how a buffer is displayed (e.g., setting 'tabstop') |
47 * must call redraw_curbuf_later(NOT_VALID) to have all the windows for the | 47 * must call redraw_curbuf_later(UPD_NOT_VALID) to have all the windows for the |
48 * buffer redisplayed by update_screen() later. | 48 * buffer redisplayed by update_screen() later. |
49 * | 49 * |
50 * Commands that change highlighting and possibly cause a scroll too must call | 50 * Commands that change highlighting and possibly cause a scroll too must call |
51 * redraw_later(SOME_VALID) to update the whole window but still use scrolling | 51 * redraw_later(UPD_SOME_VALID) to update the whole window but still use |
52 * to avoid redrawing everything. But the length of displayed lines must not | 52 * scrolling to avoid redrawing everything. But the length of displayed lines |
53 * change, use NOT_VALID then. | 53 * must not change, use UPD_NOT_VALID then. |
54 * | 54 * |
55 * Commands that move the window position must call redraw_later(NOT_VALID). | 55 * Commands that move the window position must call redraw_later(UPD_NOT_VALID). |
56 * TODO: should minimize redrawing by scrolling when possible. | 56 * TODO: should minimize redrawing by scrolling when possible. |
57 * | 57 * |
58 * Commands that change everything (e.g., resizing the screen) must call | 58 * Commands that change everything (e.g., resizing the screen) must call |
59 * redraw_all_later(NOT_VALID) or redraw_all_later(CLEAR). | 59 * redraw_all_later(UPD_NOT_VALID) or redraw_all_later(UPD_CLEAR). |
60 * | 60 * |
61 * Things that are handled indirectly: | 61 * Things that are handled indirectly: |
62 * - When messages scroll the screen up, msg_scrolled will be set and | 62 * - When messages scroll the screen up, msg_scrolled will be set and |
63 * update_screen() called to redraw. | 63 * update_screen() called to redraw. |
64 */ | 64 */ |
97 | 97 |
98 // Don't do anything if the screen structures are (not yet) valid. | 98 // Don't do anything if the screen structures are (not yet) valid. |
99 if (!screen_valid(TRUE)) | 99 if (!screen_valid(TRUE)) |
100 return FAIL; | 100 return FAIL; |
101 | 101 |
102 if (type == VALID_NO_UPDATE) | 102 if (type == UPD_VALID_NO_UPDATE) |
103 { | 103 { |
104 no_update = TRUE; | 104 no_update = TRUE; |
105 type = 0; | 105 type = 0; |
106 } | 106 } |
107 | 107 |
132 // scroll, the screen will be redrawn later or in win_update(). | 132 // scroll, the screen will be redrawn later or in win_update(). |
133 must_redraw = 0; | 133 must_redraw = 0; |
134 } | 134 } |
135 | 135 |
136 // May need to update w_lines[]. | 136 // May need to update w_lines[]. |
137 if (curwin->w_lines_valid == 0 && type < NOT_VALID | 137 if (curwin->w_lines_valid == 0 && type < UPD_NOT_VALID |
138 #ifdef FEAT_TERMINAL | 138 #ifdef FEAT_TERMINAL |
139 && !term_do_update_window(curwin) | 139 && !term_do_update_window(curwin) |
140 #endif | 140 #endif |
141 ) | 141 ) |
142 type = NOT_VALID; | 142 type = UPD_NOT_VALID; |
143 | 143 |
144 // Postpone the redrawing when it's not needed and when being called | 144 // Postpone the redrawing when it's not needed and when being called |
145 // recursively. | 145 // recursively. |
146 if (!redrawing() || updating_screen) | 146 if (!redrawing() || updating_screen) |
147 { | 147 { |
148 redraw_later(type); // remember type for next time | 148 redraw_later(type); // remember type for next time |
149 must_redraw = type; | 149 must_redraw = type; |
150 if (type > INVERTED_ALL) | 150 if (type > UPD_INVERTED_ALL) |
151 curwin->w_lines_valid = 0; // don't use w_lines[].wl_size now | 151 curwin->w_lines_valid = 0; // don't use w_lines[].wl_size now |
152 return FAIL; | 152 return FAIL; |
153 } | 153 } |
154 updating_screen = TRUE; | 154 updating_screen = TRUE; |
155 | 155 |
169 // if the screen was scrolled up when displaying a message, scroll it down | 169 // if the screen was scrolled up when displaying a message, scroll it down |
170 if (msg_scrolled) | 170 if (msg_scrolled) |
171 { | 171 { |
172 clear_cmdline = TRUE; | 172 clear_cmdline = TRUE; |
173 if (msg_scrolled > Rows - 5) // clearing is faster | 173 if (msg_scrolled > Rows - 5) // clearing is faster |
174 type = CLEAR; | 174 type = UPD_CLEAR; |
175 else if (type != CLEAR) | 175 else if (type != UPD_CLEAR) |
176 { | 176 { |
177 check_for_delay(FALSE); | 177 check_for_delay(FALSE); |
178 if (screen_ins_lines(0, 0, msg_scrolled, (int)Rows, 0, NULL) | 178 if (screen_ins_lines(0, 0, msg_scrolled, (int)Rows, 0, NULL) |
179 == FAIL) | 179 == FAIL) |
180 type = CLEAR; | 180 type = UPD_CLEAR; |
181 FOR_ALL_WINDOWS(wp) | 181 FOR_ALL_WINDOWS(wp) |
182 { | 182 { |
183 if (wp->w_winrow < msg_scrolled) | 183 if (wp->w_winrow < msg_scrolled) |
184 { | 184 { |
185 if (W_WINROW(wp) + wp->w_height > msg_scrolled | 185 if (W_WINROW(wp) + wp->w_height > msg_scrolled |
186 && wp->w_redr_type < REDRAW_TOP | 186 && wp->w_redr_type < UPD_REDRAW_TOP |
187 && wp->w_lines_valid > 0 | 187 && wp->w_lines_valid > 0 |
188 && wp->w_topline == wp->w_lines[0].wl_lnum) | 188 && wp->w_topline == wp->w_lines[0].wl_lnum) |
189 { | 189 { |
190 wp->w_upd_rows = msg_scrolled - W_WINROW(wp); | 190 wp->w_upd_rows = msg_scrolled - W_WINROW(wp); |
191 wp->w_redr_type = REDRAW_TOP; | 191 wp->w_redr_type = UPD_REDRAW_TOP; |
192 } | 192 } |
193 else | 193 else |
194 { | 194 { |
195 wp->w_redr_type = NOT_VALID; | 195 wp->w_redr_type = UPD_NOT_VALID; |
196 if (W_WINROW(wp) + wp->w_height + wp->w_status_height | 196 if (W_WINROW(wp) + wp->w_height + wp->w_status_height |
197 <= msg_scrolled) | 197 <= msg_scrolled) |
198 wp->w_redr_status = TRUE; | 198 wp->w_redr_status = TRUE; |
199 } | 199 } |
200 } | 200 } |
212 | 212 |
213 // Check for changed highlighting | 213 // Check for changed highlighting |
214 if (need_highlight_changed) | 214 if (need_highlight_changed) |
215 highlight_changed(); | 215 highlight_changed(); |
216 | 216 |
217 if (type == CLEAR) // first clear screen | 217 if (type == UPD_CLEAR) // first clear screen |
218 { | 218 { |
219 screenclear(); // will reset clear_cmdline | 219 screenclear(); // will reset clear_cmdline |
220 type = NOT_VALID; | 220 type = UPD_NOT_VALID; |
221 // must_redraw may be set indirectly, avoid another redraw later | 221 // must_redraw may be set indirectly, avoid another redraw later |
222 must_redraw = 0; | 222 must_redraw = 0; |
223 } | 223 } |
224 | 224 |
225 if (clear_cmdline) // going to clear cmdline (done below) | 225 if (clear_cmdline) // going to clear cmdline (done below) |
226 check_for_delay(FALSE); | 226 check_for_delay(FALSE); |
227 | 227 |
228 #ifdef FEAT_LINEBREAK | 228 #ifdef FEAT_LINEBREAK |
229 // Force redraw when width of 'number' or 'relativenumber' column | 229 // Force redraw when width of 'number' or 'relativenumber' column |
230 // changes. | 230 // changes. |
231 if (curwin->w_redr_type < NOT_VALID | 231 if (curwin->w_redr_type < UPD_NOT_VALID |
232 && curwin->w_nrwidth != ((curwin->w_p_nu || curwin->w_p_rnu) | 232 && curwin->w_nrwidth != ((curwin->w_p_nu || curwin->w_p_rnu) |
233 ? number_width(curwin) : 0)) | 233 ? number_width(curwin) : 0)) |
234 curwin->w_redr_type = NOT_VALID; | 234 curwin->w_redr_type = UPD_NOT_VALID; |
235 #endif | 235 #endif |
236 | 236 |
237 // Only start redrawing if there is really something to do. | 237 // Only start redrawing if there is really something to do. |
238 if (type == INVERTED) | 238 if (type == UPD_INVERTED) |
239 update_curswant(); | 239 update_curswant(); |
240 if (curwin->w_redr_type < type | 240 if (curwin->w_redr_type < type |
241 && !((type == VALID | 241 && !((type == UPD_VALID |
242 && curwin->w_lines[0].wl_valid | 242 && curwin->w_lines[0].wl_valid |
243 #ifdef FEAT_DIFF | 243 #ifdef FEAT_DIFF |
244 && curwin->w_topfill == curwin->w_old_topfill | 244 && curwin->w_topfill == curwin->w_old_topfill |
245 && curwin->w_botfill == curwin->w_old_botfill | 245 && curwin->w_botfill == curwin->w_old_botfill |
246 #endif | 246 #endif |
247 && curwin->w_topline == curwin->w_lines[0].wl_lnum) | 247 && curwin->w_topline == curwin->w_lines[0].wl_lnum) |
248 || (type == INVERTED | 248 || (type == UPD_INVERTED |
249 && VIsual_active | 249 && VIsual_active |
250 && curwin->w_old_cursor_lnum == curwin->w_cursor.lnum | 250 && curwin->w_old_cursor_lnum == curwin->w_cursor.lnum |
251 && curwin->w_old_visual_mode == VIsual_mode | 251 && curwin->w_old_visual_mode == VIsual_mode |
252 && (curwin->w_valid & VALID_VIRTCOL) | 252 && (curwin->w_valid & VALID_VIRTCOL) |
253 && curwin->w_old_curswant == curwin->w_curswant) | 253 && curwin->w_old_curswant == curwin->w_curswant) |
254 )) | 254 )) |
255 curwin->w_redr_type = type; | 255 curwin->w_redr_type = type; |
256 | 256 |
257 // Redraw the tab pages line if needed. | 257 // Redraw the tab pages line if needed. |
258 if (redraw_tabline || type >= NOT_VALID) | 258 if (redraw_tabline || type >= UPD_NOT_VALID) |
259 draw_tabline(); | 259 draw_tabline(); |
260 | 260 |
261 #ifdef FEAT_SYN_HL | 261 #ifdef FEAT_SYN_HL |
262 // Correct stored syntax highlighting info for changes in each displayed | 262 // Correct stored syntax highlighting info for changes in each displayed |
263 // buffer. Each buffer must only be done once. | 263 // buffer. Each buffer must only be done once. |
1406 * This may cause the windows below it also to be redrawn (when clearing the | 1406 * This may cause the windows below it also to be redrawn (when clearing the |
1407 * screen or scrolling lines). | 1407 * screen or scrolling lines). |
1408 * | 1408 * |
1409 * How the window is redrawn depends on wp->w_redr_type. Each type also | 1409 * How the window is redrawn depends on wp->w_redr_type. Each type also |
1410 * implies the one below it. | 1410 * implies the one below it. |
1411 * NOT_VALID redraw the whole window | 1411 * UPD_NOT_VALID redraw the whole window |
1412 * SOME_VALID redraw the whole window but do scroll when possible | 1412 * UPD_SOME_VALID redraw the whole window but do scroll when possible |
1413 * REDRAW_TOP redraw the top w_upd_rows window lines, otherwise like VALID | 1413 * UPD_REDRAW_TOP redraw the top w_upd_rows window lines, otherwise like |
1414 * INVERTED redraw the changed part of the Visual area | 1414 * UPD_VALID |
1415 * INVERTED_ALL redraw the whole Visual area | 1415 * UPD_INVERTED redraw the changed part of the Visual area |
1416 * VALID 1. scroll up/down to adjust for a changed w_topline | 1416 * UPD_INVERTED_ALL redraw the whole Visual area |
1417 * UPD_VALID 1. scroll up/down to adjust for a changed w_topline | |
1417 * 2. update lines at the top when scrolled down | 1418 * 2. update lines at the top when scrolled down |
1418 * 3. redraw changed text: | 1419 * 3. redraw changed text: |
1419 * - if wp->w_buffer->b_mod_set set, update lines between | 1420 * - if wp->w_buffer->b_mod_set set, update lines between |
1420 * b_mod_top and b_mod_bot. | 1421 * b_mod_top and b_mod_bot. |
1421 * - if wp->w_redraw_top non-zero, redraw lines between | 1422 * - if wp->w_redraw_top non-zero, redraw lines between |
1498 } | 1499 } |
1499 #endif | 1500 #endif |
1500 | 1501 |
1501 type = wp->w_redr_type; | 1502 type = wp->w_redr_type; |
1502 | 1503 |
1503 if (type == NOT_VALID) | 1504 if (type == UPD_NOT_VALID) |
1504 { | 1505 { |
1505 wp->w_redr_status = TRUE; | 1506 wp->w_redr_status = TRUE; |
1506 wp->w_lines_valid = 0; | 1507 wp->w_lines_valid = 0; |
1507 } | 1508 } |
1508 | 1509 |
1550 // Force redraw when width of 'number' or 'relativenumber' column | 1551 // Force redraw when width of 'number' or 'relativenumber' column |
1551 // changes. | 1552 // changes. |
1552 i = (wp->w_p_nu || wp->w_p_rnu) ? number_width(wp) : 0; | 1553 i = (wp->w_p_nu || wp->w_p_rnu) ? number_width(wp) : 0; |
1553 if (wp->w_nrwidth != i) | 1554 if (wp->w_nrwidth != i) |
1554 { | 1555 { |
1555 type = NOT_VALID; | 1556 type = UPD_NOT_VALID; |
1556 wp->w_nrwidth = i; | 1557 wp->w_nrwidth = i; |
1557 } | 1558 } |
1558 else | 1559 else |
1559 #endif | 1560 #endif |
1560 | 1561 |
1561 if (buf->b_mod_set && buf->b_mod_xlines != 0 && wp->w_redraw_top != 0) | 1562 if (buf->b_mod_set && buf->b_mod_xlines != 0 && wp->w_redraw_top != 0) |
1562 { | 1563 { |
1563 // When there are both inserted/deleted lines and specific lines to be | 1564 // When there are both inserted/deleted lines and specific lines to be |
1564 // redrawn, w_redraw_top and w_redraw_bot may be invalid, just redraw | 1565 // redrawn, w_redraw_top and w_redraw_bot may be invalid, just redraw |
1565 // everything (only happens when redrawing is off for while). | 1566 // everything (only happens when redrawing is off for while). |
1566 type = NOT_VALID; | 1567 type = UPD_NOT_VALID; |
1567 } | 1568 } |
1568 else | 1569 else |
1569 { | 1570 { |
1570 // Set mod_top to the first line that needs displaying because of | 1571 // Set mod_top to the first line that needs displaying because of |
1571 // changes. Set mod_bot to the first line after the changes. | 1572 // changes. Set mod_bot to the first line after the changes. |
1703 #endif | 1704 #endif |
1704 | 1705 |
1705 | 1706 |
1706 // When only displaying the lines at the top, set top_end. Used when | 1707 // When only displaying the lines at the top, set top_end. Used when |
1707 // window has scrolled down for msg_scrolled. | 1708 // window has scrolled down for msg_scrolled. |
1708 if (type == REDRAW_TOP) | 1709 if (type == UPD_REDRAW_TOP) |
1709 { | 1710 { |
1710 j = 0; | 1711 j = 0; |
1711 for (i = 0; i < wp->w_lines_valid; ++i) | 1712 for (i = 0; i < wp->w_lines_valid; ++i) |
1712 { | 1713 { |
1713 j += wp->w_lines[i].wl_size; | 1714 j += wp->w_lines[i].wl_size; |
1717 break; | 1718 break; |
1718 } | 1719 } |
1719 } | 1720 } |
1720 if (top_end == 0) | 1721 if (top_end == 0) |
1721 // not found (cannot happen?): redraw everything | 1722 // not found (cannot happen?): redraw everything |
1722 type = NOT_VALID; | 1723 type = UPD_NOT_VALID; |
1723 else | 1724 else |
1724 // top area defined, the rest is VALID | 1725 // top area defined, the rest is UPD_VALID |
1725 type = VALID; | 1726 type = UPD_VALID; |
1726 } | 1727 } |
1727 | 1728 |
1728 // Trick: we want to avoid clearing the screen twice. screenclear() will | 1729 // Trick: we want to avoid clearing the screen twice. screenclear() will |
1729 // set "screen_cleared" to TRUE. The special value MAYBE (which is still | 1730 // set "screen_cleared" to TRUE. The special value MAYBE (which is still |
1730 // non-zero and thus not FALSE) will indicate that screenclear() was not | 1731 // non-zero and thus not FALSE) will indicate that screenclear() was not |
1736 // handle three cases: | 1737 // handle three cases: |
1737 // 1: we are off the top of the screen by a few lines: scroll down | 1738 // 1: we are off the top of the screen by a few lines: scroll down |
1738 // 2: wp->w_topline is below wp->w_lines[0].wl_lnum: may scroll up | 1739 // 2: wp->w_topline is below wp->w_lines[0].wl_lnum: may scroll up |
1739 // 3: wp->w_topline is wp->w_lines[0].wl_lnum: find first entry in | 1740 // 3: wp->w_topline is wp->w_lines[0].wl_lnum: find first entry in |
1740 // w_lines[] that needs updating. | 1741 // w_lines[] that needs updating. |
1741 if ((type == VALID || type == SOME_VALID | 1742 if ((type == UPD_VALID || type == UPD_SOME_VALID |
1742 || type == INVERTED || type == INVERTED_ALL) | 1743 || type == UPD_INVERTED || type == UPD_INVERTED_ALL) |
1743 #ifdef FEAT_DIFF | 1744 #ifdef FEAT_DIFF |
1744 && !wp->w_botfill && !wp->w_old_botfill | 1745 && !wp->w_botfill && !wp->w_old_botfill |
1745 #endif | 1746 #endif |
1746 ) | 1747 ) |
1747 { | 1748 { |
1940 } | 1941 } |
1941 | 1942 |
1942 // When win_del_lines() or win_ins_lines() caused the screen to be | 1943 // When win_del_lines() or win_ins_lines() caused the screen to be |
1943 // cleared (only happens for the first window) or when screenclear() | 1944 // cleared (only happens for the first window) or when screenclear() |
1944 // was called directly above, "must_redraw" will have been set to | 1945 // was called directly above, "must_redraw" will have been set to |
1945 // NOT_VALID, need to reset it here to avoid redrawing twice. | 1946 // UPD_NOT_VALID, need to reset it here to avoid redrawing twice. |
1946 if (screen_cleared == TRUE) | 1947 if (screen_cleared == TRUE) |
1947 must_redraw = 0; | 1948 must_redraw = 0; |
1948 } | 1949 } |
1949 else | 1950 else |
1950 { | 1951 { |
1951 // Not VALID or INVERTED: redraw all lines. | 1952 // Not UPD_VALID or UPD_INVERTED: redraw all lines. |
1952 mid_start = 0; | 1953 mid_start = 0; |
1953 mid_end = wp->w_height; | 1954 mid_end = wp->w_height; |
1954 } | 1955 } |
1955 | 1956 |
1956 if (type == SOME_VALID) | 1957 if (type == UPD_SOME_VALID) |
1957 { | 1958 { |
1958 // SOME_VALID: redraw all lines. | 1959 // UPD_SOME_VALID: redraw all lines. |
1959 mid_start = 0; | 1960 mid_start = 0; |
1960 mid_end = wp->w_height; | 1961 mid_end = wp->w_height; |
1961 type = NOT_VALID; | 1962 type = UPD_NOT_VALID; |
1962 } | 1963 } |
1963 | 1964 |
1964 // check if we are updating or removing the inverted part | 1965 // check if we are updating or removing the inverted part |
1965 if ((VIsual_active && buf == curwin->w_buffer) | 1966 if ((VIsual_active && buf == curwin->w_buffer) |
1966 || (wp->w_old_cursor_lnum != 0 && type != NOT_VALID)) | 1967 || (wp->w_old_cursor_lnum != 0 && type != UPD_NOT_VALID)) |
1967 { | 1968 { |
1968 linenr_T from, to; | 1969 linenr_T from, to; |
1969 | 1970 |
1970 if (VIsual_active) | 1971 if (VIsual_active) |
1971 { | 1972 { |
1972 if (VIsual_mode != wp->w_old_visual_mode | 1973 if (VIsual_mode != wp->w_old_visual_mode |
1973 || type == INVERTED_ALL) | 1974 || type == UPD_INVERTED_ALL) |
1974 { | 1975 { |
1975 // If the type of Visual selection changed, redraw the whole | 1976 // If the type of Visual selection changed, redraw the whole |
1976 // selection. Also when the ownership of the X selection is | 1977 // selection. Also when the ownership of the X selection is |
1977 // gained or lost. | 1978 // gained or lost. |
1978 if (curwin->w_cursor.lnum < VIsual.lnum) | 1979 if (curwin->w_cursor.lnum < VIsual.lnum) |
3112 { | 3113 { |
3113 update_topline(); | 3114 update_topline(); |
3114 validate_cursor(); | 3115 validate_cursor(); |
3115 | 3116 |
3116 // keep the command line if possible | 3117 // keep the command line if possible |
3117 update_screen(VALID_NO_UPDATE); | 3118 update_screen(UPD_VALID_NO_UPDATE); |
3118 setcursor(); | 3119 setcursor(); |
3119 | 3120 |
3120 if (msg_scrolled == 0) | 3121 if (msg_scrolled == 0) |
3121 { | 3122 { |
3122 // don't want a hit-enter prompt when something else is displayed | 3123 // don't want a hit-enter prompt when something else is displayed |
3138 } | 3139 } |
3139 | 3140 |
3140 /* | 3141 /* |
3141 * Redraw the current window later, with update_screen(type). | 3142 * Redraw the current window later, with update_screen(type). |
3142 * Set must_redraw only if not already set to a higher value. | 3143 * Set must_redraw only if not already set to a higher value. |
3143 * E.g. if must_redraw is CLEAR, type NOT_VALID will do nothing. | 3144 * E.g. if must_redraw is UPD_CLEAR, type UPD_NOT_VALID will do nothing. |
3144 */ | 3145 */ |
3145 void | 3146 void |
3146 redraw_later(int type) | 3147 redraw_later(int type) |
3147 { | 3148 { |
3148 redraw_win_later(curwin, type); | 3149 redraw_win_later(curwin, type); |
3154 int type) | 3155 int type) |
3155 { | 3156 { |
3156 if (!exiting && wp->w_redr_type < type) | 3157 if (!exiting && wp->w_redr_type < type) |
3157 { | 3158 { |
3158 wp->w_redr_type = type; | 3159 wp->w_redr_type = type; |
3159 if (type >= NOT_VALID) | 3160 if (type >= UPD_NOT_VALID) |
3160 wp->w_lines_valid = 0; | 3161 wp->w_lines_valid = 0; |
3161 if (must_redraw < type) // must_redraw is the maximum of all windows | 3162 if (must_redraw < type) // must_redraw is the maximum of all windows |
3162 must_redraw = type; | 3163 must_redraw = type; |
3163 } | 3164 } |
3164 } | 3165 } |
3168 * after executing a shell command that messes up the screen. | 3169 * after executing a shell command that messes up the screen. |
3169 */ | 3170 */ |
3170 void | 3171 void |
3171 redraw_later_clear(void) | 3172 redraw_later_clear(void) |
3172 { | 3173 { |
3173 redraw_all_later(CLEAR); | 3174 redraw_all_later(UPD_CLEAR); |
3174 reset_screen_attr(); | 3175 reset_screen_attr(); |
3175 } | 3176 } |
3176 | 3177 |
3177 /* | 3178 /* |
3178 * Mark all windows to be redrawn later. | 3179 * Mark all windows to be redrawn later. |
3261 | 3262 |
3262 FOR_ALL_WINDOWS(wp) | 3263 FOR_ALL_WINDOWS(wp) |
3263 if (wp->w_status_height) | 3264 if (wp->w_status_height) |
3264 { | 3265 { |
3265 wp->w_redr_status = TRUE; | 3266 wp->w_redr_status = TRUE; |
3266 redraw_later(VALID); | 3267 redraw_later(UPD_VALID); |
3267 } | 3268 } |
3268 } | 3269 } |
3269 | 3270 |
3270 /* | 3271 /* |
3271 * mark all status lines of the current buffer for redraw | 3272 * mark all status lines of the current buffer for redraw |
3277 | 3278 |
3278 FOR_ALL_WINDOWS(wp) | 3279 FOR_ALL_WINDOWS(wp) |
3279 if (wp->w_status_height != 0 && wp->w_buffer == curbuf) | 3280 if (wp->w_status_height != 0 && wp->w_buffer == curbuf) |
3280 { | 3281 { |
3281 wp->w_redr_status = TRUE; | 3282 wp->w_redr_status = TRUE; |
3282 redraw_later(VALID); | 3283 redraw_later(UPD_VALID); |
3283 } | 3284 } |
3284 } | 3285 } |
3285 | 3286 |
3286 /* | 3287 /* |
3287 * Redraw all status lines that need to be redrawn. | 3288 * Redraw all status lines that need to be redrawn. |
3337 { | 3338 { |
3338 if (wp->w_redraw_top == 0 || wp->w_redraw_top > lnum) | 3339 if (wp->w_redraw_top == 0 || wp->w_redraw_top > lnum) |
3339 wp->w_redraw_top = lnum; | 3340 wp->w_redraw_top = lnum; |
3340 if (wp->w_redraw_bot == 0 || wp->w_redraw_bot < lnum) | 3341 if (wp->w_redraw_bot == 0 || wp->w_redraw_bot < lnum) |
3341 wp->w_redraw_bot = lnum; | 3342 wp->w_redraw_bot = lnum; |
3342 redraw_win_later(wp, VALID); | 3343 redraw_win_later(wp, UPD_VALID); |
3343 } | 3344 } |