comparison src/screen.c @ 29958:549994614a5a v9.0.0317

patch 9.0.0317: when updating the whole screen a popup may not be redrawn Commit: https://github.com/vim/vim/commit/b13d3405fffae1115acc1433479b616f30e292e5 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Aug 29 13:44:28 2022 +0100 patch 9.0.0317: when updating the whole screen a popup may not be redrawn Problem: When updating the whole screen a popup may not be redrawn. Solution: Mark the screen and windows for redraw also when not clearing. Also mark popup windows for redraw.
author Bram Moolenaar <Bram@vim.org>
date Mon, 29 Aug 2022 14:45:04 +0200
parents a6721cafbc74
children bb0e525e1393
comparison
equal deleted inserted replaced
29957:60901ab49eae 29958:549994614a5a
47 * The attributes that are actually active for writing to the screen. 47 * The attributes that are actually active for writing to the screen.
48 */ 48 */
49 static int screen_attr = 0; 49 static int screen_attr = 0;
50 50
51 static void screen_char_2(unsigned off, int row, int col); 51 static void screen_char_2(unsigned off, int row, int col);
52 static void screenclear2(void); 52 static void screenclear2(int doclear);
53 static void lineclear(unsigned off, int width, int attr); 53 static void lineclear(unsigned off, int width, int attr);
54 static void lineinvalid(unsigned off, int width); 54 static void lineinvalid(unsigned off, int width);
55 static int win_do_lines(win_T *wp, int row, int line_count, int mayclear, int del, int clear_attr); 55 static int win_do_lines(win_T *wp, int row, int line_count, int mayclear, int del, int clear_attr);
56 static void win_rest_invalid(win_T *wp); 56 static void win_rest_invalid(win_T *wp);
57 static void msg_pos_mode(void); 57 static void msg_pos_mode(void);
2904 screen_Rows = Rows; 2904 screen_Rows = Rows;
2905 screen_Columns = Columns; 2905 screen_Columns = Columns;
2906 2906
2907 set_must_redraw(UPD_CLEAR); // need to clear the screen later 2907 set_must_redraw(UPD_CLEAR); // need to clear the screen later
2908 if (doclear) 2908 if (doclear)
2909 screenclear2(); 2909 screenclear2(TRUE);
2910 #ifdef FEAT_GUI 2910 #ifdef FEAT_GUI
2911 else if (gui.in_use 2911 else if (gui.in_use
2912 && !gui.starting 2912 && !gui.starting
2913 && ScreenLines != NULL 2913 && ScreenLines != NULL
2914 && old_Rows != Rows) 2914 && old_Rows != Rows)
2967 VIM_CLEAR(popup_mask_next); 2967 VIM_CLEAR(popup_mask_next);
2968 VIM_CLEAR(popup_transparent); 2968 VIM_CLEAR(popup_transparent);
2969 #endif 2969 #endif
2970 } 2970 }
2971 2971
2972 /*
2973 * Clear the screen.
2974 * May delay if there is something the user should read.
2975 * Allocated the screen for resizing if needed.
2976 */
2972 void 2977 void
2973 screenclear(void) 2978 screenclear(void)
2974 { 2979 {
2975 check_for_delay(FALSE); 2980 check_for_delay(FALSE);
2976 screenalloc(FALSE); // allocate screen buffers if size changed 2981 screenalloc(FALSE); // allocate screen buffers if size changed
2977 screenclear2(); // clear the screen 2982 screenclear2(TRUE); // clear the screen
2983 }
2984
2985 /*
2986 * Do not clear the screen but mark everything for redraw.
2987 */
2988 void
2989 redraw_as_cleared(void)
2990 {
2991 screenclear2(FALSE);
2978 } 2992 }
2979 2993
2980 static void 2994 static void
2981 screenclear2(void) 2995 screenclear2(int doclear)
2982 { 2996 {
2983 int i; 2997 int i;
2984 2998
2985 if (starting == NO_SCREEN || ScreenLines == NULL 2999 if (starting == NO_SCREEN || ScreenLines == NULL
2986 #ifdef FEAT_GUI 3000 #ifdef FEAT_GUI
3005 { 3019 {
3006 lineclear(LineOffset[i], (int)Columns, 0); 3020 lineclear(LineOffset[i], (int)Columns, 0);
3007 LineWraps[i] = FALSE; 3021 LineWraps[i] = FALSE;
3008 } 3022 }
3009 3023
3010 if (can_clear(T_CL)) 3024 if (doclear && can_clear(T_CL))
3011 { 3025 {
3012 out_str(T_CL); // clear the display 3026 out_str(T_CL); // clear the display
3013 clear_cmdline = FALSE; 3027 clear_cmdline = FALSE;
3014 mode_displayed = FALSE; 3028 mode_displayed = FALSE;
3015 } 3029 }
3021 clear_cmdline = TRUE; 3035 clear_cmdline = TRUE;
3022 } 3036 }
3023 3037
3024 screen_cleared = TRUE; // can use contents of ScreenLines now 3038 screen_cleared = TRUE; // can use contents of ScreenLines now
3025 3039
3026 win_rest_invalid(firstwin); 3040 win_rest_invalid(firstwin); // redraw all regular windows
3041 #ifdef FEAT_PROP_POPUP
3042 popup_redraw_all(); // redraw all popup windows
3043 #endif
3027 redraw_cmdline = TRUE; 3044 redraw_cmdline = TRUE;
3028 redraw_tabline = TRUE; 3045 redraw_tabline = TRUE;
3029 if (must_redraw == UPD_CLEAR) // no need to clear again 3046 if (must_redraw == UPD_CLEAR) // no need to clear again
3030 must_redraw = UPD_NOT_VALID; 3047 must_redraw = UPD_NOT_VALID;
3031 compute_cmdrow(); 3048 compute_cmdrow();