Mercurial > vim
comparison src/window.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 | c43738957bee |
children | 6c7eddcce52c |
comparison
equal
deleted
inserted
replaced
29731:df7f360215b7 | 29732:89e1d67814a9 |
---|---|
1311 if (flags & (WSP_TOP | WSP_BOT)) | 1311 if (flags & (WSP_TOP | WSP_BOT)) |
1312 (void)win_comp_pos(); | 1312 (void)win_comp_pos(); |
1313 | 1313 |
1314 // Both windows need redrawing. Update all status lines, in case they | 1314 // Both windows need redrawing. Update all status lines, in case they |
1315 // show something related to the window count or position. | 1315 // show something related to the window count or position. |
1316 redraw_win_later(wp, NOT_VALID); | 1316 redraw_win_later(wp, UPD_NOT_VALID); |
1317 redraw_win_later(oldwin, NOT_VALID); | 1317 redraw_win_later(oldwin, UPD_NOT_VALID); |
1318 status_redraw_all(); | 1318 status_redraw_all(); |
1319 | 1319 |
1320 if (need_status) | 1320 if (need_status) |
1321 { | 1321 { |
1322 msg_row = Rows - 1; | 1322 msg_row = Rows - 1; |
1716 reset_VIsual_and_resel(); | 1716 reset_VIsual_and_resel(); |
1717 else if (VIsual_active) | 1717 else if (VIsual_active) |
1718 wp->w_cursor = curwin->w_cursor; | 1718 wp->w_cursor = curwin->w_cursor; |
1719 | 1719 |
1720 win_enter(wp, TRUE); | 1720 win_enter(wp, TRUE); |
1721 redraw_all_later(NOT_VALID); | 1721 redraw_all_later(UPD_NOT_VALID); |
1722 } | 1722 } |
1723 | 1723 |
1724 /* | 1724 /* |
1725 * rotate windows: if upwards TRUE the second window becomes the first one | 1725 * rotate windows: if upwards TRUE the second window becomes the first one |
1726 * if upwards FALSE the first window becomes the second one | 1726 * if upwards FALSE the first window becomes the second one |
1799 | 1799 |
1800 // recompute w_winrow and w_wincol for all windows | 1800 // recompute w_winrow and w_wincol for all windows |
1801 (void)win_comp_pos(); | 1801 (void)win_comp_pos(); |
1802 } | 1802 } |
1803 | 1803 |
1804 redraw_all_later(NOT_VALID); | 1804 redraw_all_later(UPD_NOT_VALID); |
1805 } | 1805 } |
1806 | 1806 |
1807 /* | 1807 /* |
1808 * Move the current window to the very top/bottom/left/right of the screen. | 1808 * Move the current window to the very top/bottom/left/right of the screen. |
1809 */ | 1809 */ |
1901 frame_remove(win1->w_frame); | 1901 frame_remove(win1->w_frame); |
1902 win_append(win2, win1); | 1902 win_append(win2, win1); |
1903 frame_append(win2->w_frame, win1->w_frame); | 1903 frame_append(win2->w_frame, win1->w_frame); |
1904 | 1904 |
1905 (void)win_comp_pos(); // recompute w_winrow for all windows | 1905 (void)win_comp_pos(); // recompute w_winrow for all windows |
1906 redraw_later(NOT_VALID); | 1906 redraw_later(UPD_NOT_VALID); |
1907 } | 1907 } |
1908 win_enter(win1, FALSE); | 1908 win_enter(win1, FALSE); |
1909 } | 1909 } |
1910 | 1910 |
1911 /* | 1911 /* |
1964 { | 1964 { |
1965 topfr->fr_win->w_winrow = row; | 1965 topfr->fr_win->w_winrow = row; |
1966 frame_new_height(topfr, height, FALSE, FALSE); | 1966 frame_new_height(topfr, height, FALSE, FALSE); |
1967 topfr->fr_win->w_wincol = col; | 1967 topfr->fr_win->w_wincol = col; |
1968 frame_new_width(topfr, width, FALSE, FALSE); | 1968 frame_new_width(topfr, width, FALSE, FALSE); |
1969 redraw_all_later(NOT_VALID); | 1969 redraw_all_later(UPD_NOT_VALID); |
1970 } | 1970 } |
1971 } | 1971 } |
1972 else if (topfr->fr_layout == FR_ROW) | 1972 else if (topfr->fr_layout == FR_ROW) |
1973 { | 1973 { |
1974 topfr->fr_width = width; | 1974 topfr->fr_width = width; |
2294 #endif | 2294 #endif |
2295 | 2295 |
2296 static void | 2296 static void |
2297 win_init_empty(win_T *wp) | 2297 win_init_empty(win_T *wp) |
2298 { | 2298 { |
2299 redraw_win_later(wp, NOT_VALID); | 2299 redraw_win_later(wp, UPD_NOT_VALID); |
2300 wp->w_lines_valid = 0; | 2300 wp->w_lines_valid = 0; |
2301 wp->w_cursor.lnum = 1; | 2301 wp->w_cursor.lnum = 1; |
2302 wp->w_curswant = wp->w_cursor.col = 0; | 2302 wp->w_curswant = wp->w_cursor.col = 0; |
2303 wp->w_cursor.coladd = 0; | 2303 wp->w_cursor.coladd = 0; |
2304 wp->w_pcmark.lnum = 1; // pcmark not cleared but set to line 1 | 2304 wp->w_pcmark.lnum = 1; // pcmark not cleared but set to line 1 |
2784 // When 'guioptions' includes 'L' or 'R' may have to remove scrollbars. | 2784 // When 'guioptions' includes 'L' or 'R' may have to remove scrollbars. |
2785 if (gui.in_use && !win_hasvertsplit()) | 2785 if (gui.in_use && !win_hasvertsplit()) |
2786 gui_init_which_components(NULL); | 2786 gui_init_which_components(NULL); |
2787 #endif | 2787 #endif |
2788 | 2788 |
2789 redraw_all_later(NOT_VALID); | 2789 redraw_all_later(UPD_NOT_VALID); |
2790 return OK; | 2790 return OK; |
2791 } | 2791 } |
2792 | 2792 |
2793 static void | 2793 static void |
2794 trigger_winclosed(win_T *win) | 2794 trigger_winclosed(win_T *win) |
4073 #endif | 4073 #endif |
4074 #ifdef FEAT_JOB_CHANNEL | 4074 #ifdef FEAT_JOB_CHANNEL |
4075 entering_window(curwin); | 4075 entering_window(curwin); |
4076 #endif | 4076 #endif |
4077 | 4077 |
4078 redraw_all_later(NOT_VALID); | 4078 redraw_all_later(UPD_NOT_VALID); |
4079 apply_autocmds(EVENT_WINNEW, NULL, NULL, FALSE, curbuf); | 4079 apply_autocmds(EVENT_WINNEW, NULL, NULL, FALSE, curbuf); |
4080 apply_autocmds(EVENT_WINENTER, NULL, NULL, FALSE, curbuf); | 4080 apply_autocmds(EVENT_WINENTER, NULL, NULL, FALSE, curbuf); |
4081 apply_autocmds(EVENT_TABNEW, NULL, NULL, FALSE, curbuf); | 4081 apply_autocmds(EVENT_TABNEW, NULL, NULL, FALSE, curbuf); |
4082 apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf); | 4082 apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf); |
4083 return OK; | 4083 return OK; |
4371 apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf); | 4371 apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf); |
4372 if (old_curbuf != curbuf) | 4372 if (old_curbuf != curbuf) |
4373 apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf); | 4373 apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf); |
4374 } | 4374 } |
4375 | 4375 |
4376 redraw_all_later(NOT_VALID); | 4376 redraw_all_later(UPD_NOT_VALID); |
4377 } | 4377 } |
4378 | 4378 |
4379 /* | 4379 /* |
4380 * Go to tab page "n". For ":tab N" and "Ngt". | 4380 * Go to tab page "n". For ":tab N" and "Ngt". |
4381 * When "n" is 9999 go to the last tab page. | 4381 * When "n" is 9999 go to the last tab page. |
4968 // terminal is likely in another mode | 4968 // terminal is likely in another mode |
4969 redraw_mode = TRUE; | 4969 redraw_mode = TRUE; |
4970 #endif | 4970 #endif |
4971 redraw_tabline = TRUE; | 4971 redraw_tabline = TRUE; |
4972 if (restart_edit) | 4972 if (restart_edit) |
4973 redraw_later(VALID); // causes status line redraw | 4973 redraw_later(UPD_VALID); // causes status line redraw |
4974 | 4974 |
4975 // set window height to desired minimal value | 4975 // set window height to desired minimal value |
4976 if (curwin->w_height < p_wh && !curwin->w_p_wfh | 4976 if (curwin->w_height < p_wh && !curwin->w_p_wfh |
4977 #ifdef FEAT_PROP_POPUP | 4977 #ifdef FEAT_PROP_POPUP |
4978 && !popup_is_popup(curwin) | 4978 && !popup_is_popup(curwin) |
5587 if (wp->w_winrow != *row || wp->w_wincol != *col) | 5587 if (wp->w_winrow != *row || wp->w_wincol != *col) |
5588 { | 5588 { |
5589 // position changed, redraw | 5589 // position changed, redraw |
5590 wp->w_winrow = *row; | 5590 wp->w_winrow = *row; |
5591 wp->w_wincol = *col; | 5591 wp->w_wincol = *col; |
5592 redraw_win_later(wp, NOT_VALID); | 5592 redraw_win_later(wp, UPD_NOT_VALID); |
5593 wp->w_redr_status = TRUE; | 5593 wp->w_redr_status = TRUE; |
5594 } | 5594 } |
5595 // WinBar will not show if the window height is zero | 5595 // WinBar will not show if the window height is zero |
5596 h = VISIBLE_HEIGHT(wp) + wp->w_status_height; | 5596 h = VISIBLE_HEIGHT(wp) + wp->w_status_height; |
5597 *row += h > topfrp->fr_height ? topfrp->fr_height : h; | 5597 *row += h > topfrp->fr_height ? topfrp->fr_height : h; |
5667 screen_fill(row, cmdline_row, 0, (int)Columns, ' ', ' ', 0); | 5667 screen_fill(row, cmdline_row, 0, (int)Columns, ' ', ' ', 0); |
5668 cmdline_row = row; | 5668 cmdline_row = row; |
5669 msg_row = row; | 5669 msg_row = row; |
5670 msg_col = 0; | 5670 msg_col = 0; |
5671 | 5671 |
5672 redraw_all_later(NOT_VALID); | 5672 redraw_all_later(UPD_NOT_VALID); |
5673 } | 5673 } |
5674 | 5674 |
5675 /* | 5675 /* |
5676 * Set the height of a frame to "height" and take care that all frames and | 5676 * Set the height of a frame to "height" and take care that all frames and |
5677 * windows inside it are resized. Also resize frames on the left and right if | 5677 * windows inside it are resized. Also resize frames on the left and right if |
5878 frame_setwidth(wp->w_frame, width + wp->w_vsep_width); | 5878 frame_setwidth(wp->w_frame, width + wp->w_vsep_width); |
5879 | 5879 |
5880 // recompute the window positions | 5880 // recompute the window positions |
5881 (void)win_comp_pos(); | 5881 (void)win_comp_pos(); |
5882 | 5882 |
5883 redraw_all_later(NOT_VALID); | 5883 redraw_all_later(UPD_NOT_VALID); |
5884 } | 5884 } |
5885 | 5885 |
5886 /* | 5886 /* |
5887 * Set the width of a frame to "width" and take care that all frames and | 5887 * Set the width of a frame to "width" and take care that all frames and |
5888 * windows inside it are resized. Also resize frames above and below if the | 5888 * windows inside it are resized. Also resize frames above and below if the |
6204 row = win_comp_pos(); | 6204 row = win_comp_pos(); |
6205 screen_fill(row, cmdline_row, 0, (int)Columns, ' ', ' ', 0); | 6205 screen_fill(row, cmdline_row, 0, (int)Columns, ' ', ' ', 0); |
6206 cmdline_row = row; | 6206 cmdline_row = row; |
6207 p_ch = MAX(Rows - cmdline_row, p_ch_was_zero ? 0 : 1); | 6207 p_ch = MAX(Rows - cmdline_row, p_ch_was_zero ? 0 : 1); |
6208 curtab->tp_ch_used = p_ch; | 6208 curtab->tp_ch_used = p_ch; |
6209 redraw_all_later(SOME_VALID); | 6209 redraw_all_later(UPD_SOME_VALID); |
6210 showmode(); | 6210 showmode(); |
6211 } | 6211 } |
6212 | 6212 |
6213 /* | 6213 /* |
6214 * Separator line of dragwin is dragged "offset" lines right (negative is left). | 6214 * Separator line of dragwin is dragged "offset" lines right (negative is left). |
6310 fr = fr->fr_prev; | 6310 fr = fr->fr_prev; |
6311 else | 6311 else |
6312 fr = fr->fr_next; | 6312 fr = fr->fr_next; |
6313 } | 6313 } |
6314 (void)win_comp_pos(); | 6314 (void)win_comp_pos(); |
6315 redraw_all_later(NOT_VALID); | 6315 redraw_all_later(UPD_NOT_VALID); |
6316 } | 6316 } |
6317 | 6317 |
6318 #define FRACTION_MULT 16384L | 6318 #define FRACTION_MULT 16384L |
6319 | 6319 |
6320 /* | 6320 /* |
6489 } | 6489 } |
6490 if (prev_height > 0) | 6490 if (prev_height > 0) |
6491 wp->w_prev_fraction_row = wp->w_wrow; | 6491 wp->w_prev_fraction_row = wp->w_wrow; |
6492 | 6492 |
6493 win_comp_scroll(wp); | 6493 win_comp_scroll(wp); |
6494 redraw_win_later(wp, SOME_VALID); | 6494 redraw_win_later(wp, UPD_SOME_VALID); |
6495 wp->w_redr_status = TRUE; | 6495 wp->w_redr_status = TRUE; |
6496 invalidate_botline_win(wp); | 6496 invalidate_botline_win(wp); |
6497 } | 6497 } |
6498 | 6498 |
6499 /* | 6499 /* |
6509 if (wp == curwin) | 6509 if (wp == curwin) |
6510 { | 6510 { |
6511 update_topline(); | 6511 update_topline(); |
6512 curs_columns(TRUE); // validate w_wrow | 6512 curs_columns(TRUE); // validate w_wrow |
6513 } | 6513 } |
6514 redraw_win_later(wp, NOT_VALID); | 6514 redraw_win_later(wp, UPD_NOT_VALID); |
6515 wp->w_redr_status = TRUE; | 6515 wp->w_redr_status = TRUE; |
6516 } | 6516 } |
6517 | 6517 |
6518 void | 6518 void |
6519 win_comp_scroll(win_T *wp) | 6519 win_comp_scroll(win_T *wp) |
6690 (void)win_comp_pos(); | 6690 (void)win_comp_pos(); |
6691 } | 6691 } |
6692 else | 6692 else |
6693 win_new_height(wp, wp->w_height - 1); | 6693 win_new_height(wp, wp->w_height - 1); |
6694 comp_col(); | 6694 comp_col(); |
6695 redraw_all_later(SOME_VALID); | 6695 redraw_all_later(UPD_SOME_VALID); |
6696 } | 6696 } |
6697 } | 6697 } |
6698 else if (fr->fr_layout == FR_ROW) | 6698 else if (fr->fr_layout == FR_ROW) |
6699 { | 6699 { |
6700 // vertically split windows, set status line for each one | 6700 // vertically split windows, set status line for each one |
6982 { | 6982 { |
6983 wp = restore_snapshot_rec(curtab->tp_snapshot[idx], topframe); | 6983 wp = restore_snapshot_rec(curtab->tp_snapshot[idx], topframe); |
6984 win_comp_pos(); | 6984 win_comp_pos(); |
6985 if (wp != NULL && close_curwin) | 6985 if (wp != NULL && close_curwin) |
6986 win_goto(wp); | 6986 win_goto(wp); |
6987 redraw_all_later(NOT_VALID); | 6987 redraw_all_later(UPD_NOT_VALID); |
6988 } | 6988 } |
6989 clear_snapshot(curtab, idx); | 6989 clear_snapshot(curtab, idx); |
6990 } | 6990 } |
6991 | 6991 |
6992 /* | 6992 /* |