Patch 9.0.0317 (after 9.0.0316)
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.
Files:      src/drawscreen.c, src/screen.c, src/proto/screen.pro,
            src/popupwin.c, src/proto/popupwin.pro,
            src/testdir/dumps/Test_popupwin_win_execute.dump


*** ../vim-9.0.0316/src/drawscreen.c    2022-08-29 12:40:56.873873382 +0100
--- src/drawscreen.c    2022-08-29 13:14:46.139458916 +0100
***************
*** 173,185 ****
--- 173,191 ----
        if (type != UPD_CLEAR)
        {
            if (msg_scrolled > Rows - 5)            // redrawing is faster
+           {
                type = UPD_NOT_VALID;
+               redraw_as_cleared();
+           }
            else
            {
                check_for_delay(FALSE);
                if (screen_ins_lines(0, 0, msg_scrolled, (int)Rows, 0, NULL)
                                                                       == FAIL)
+               {
                    type = UPD_NOT_VALID;
+                   redraw_as_cleared();
+               }
                FOR_ALL_WINDOWS(wp)
                {
                    if (wp->w_winrow < msg_scrolled)
*** ../vim-9.0.0316/src/screen.c        2022-08-27 21:29:28.257402847 +0100
--- src/screen.c        2022-08-29 13:34:51.723619119 +0100
***************
*** 49,55 ****
  static int    screen_attr = 0;
  
  static void screen_char_2(unsigned off, int row, int col);
! static void screenclear2(void);
  static void lineclear(unsigned off, int width, int attr);
  static void lineinvalid(unsigned off, int width);
  static int win_do_lines(win_T *wp, int row, int line_count, int mayclear, int 
del, int clear_attr);
--- 49,55 ----
  static int    screen_attr = 0;
  
  static void screen_char_2(unsigned off, int row, int col);
! static void screenclear2(int doclear);
  static void lineclear(unsigned off, int width, int attr);
  static void lineinvalid(unsigned off, int width);
  static int win_do_lines(win_T *wp, int row, int line_count, int mayclear, int 
del, int clear_attr);
***************
*** 2906,2912 ****
  
      set_must_redraw(UPD_CLEAR);       // need to clear the screen later
      if (doclear)
!       screenclear2();
  #ifdef FEAT_GUI
      else if (gui.in_use
            && !gui.starting
--- 2906,2912 ----
  
      set_must_redraw(UPD_CLEAR);       // need to clear the screen later
      if (doclear)
!       screenclear2(TRUE);
  #ifdef FEAT_GUI
      else if (gui.in_use
            && !gui.starting
***************
*** 2969,2984 ****
  #endif
  }
  
      void
  screenclear(void)
  {
      check_for_delay(FALSE);
      screenalloc(FALSE);           // allocate screen buffers if size changed
!     screenclear2();       // clear the screen
  }
  
      static void
! screenclear2(void)
  {
      int           i;
  
--- 2969,2998 ----
  #endif
  }
  
+ /*
+  * Clear the screen.
+  * May delay if there is something the user should read.
+  * Allocated the screen for resizing if needed.
+  */
      void
  screenclear(void)
  {
      check_for_delay(FALSE);
      screenalloc(FALSE);           // allocate screen buffers if size changed
!     screenclear2(TRUE);           // clear the screen
! }
! 
! /*
!  * Do not clear the screen but mark everything for redraw.
!  */
!     void
! redraw_as_cleared(void)
! {
!     screenclear2(FALSE);
  }
  
      static void
! screenclear2(int doclear)
  {
      int           i;
  
***************
*** 3007,3013 ****
        LineWraps[i] = FALSE;
      }
  
!     if (can_clear(T_CL))
      {
        out_str(T_CL);          // clear the display
        clear_cmdline = FALSE;
--- 3021,3027 ----
        LineWraps[i] = FALSE;
      }
  
!     if (doclear && can_clear(T_CL))
      {
        out_str(T_CL);          // clear the display
        clear_cmdline = FALSE;
***************
*** 3023,3029 ****
  
      screen_cleared = TRUE;    // can use contents of ScreenLines now
  
!     win_rest_invalid(firstwin);
      redraw_cmdline = TRUE;
      redraw_tabline = TRUE;
      if (must_redraw == UPD_CLEAR)     // no need to clear again
--- 3037,3046 ----
  
      screen_cleared = TRUE;    // can use contents of ScreenLines now
  
!     win_rest_invalid(firstwin);       // redraw all regular windows
! #ifdef FEAT_PROP_POPUP
!     popup_redraw_all();               // redraw all popup windows
! #endif
      redraw_cmdline = TRUE;
      redraw_tabline = TRUE;
      if (must_redraw == UPD_CLEAR)     // no need to clear again
*** ../vim-9.0.0316/src/proto/screen.pro        2022-08-09 12:53:09.911689930 
+0100
--- src/proto/screen.pro        2022-08-29 13:18:15.130256236 +0100
***************
*** 31,36 ****
--- 31,37 ----
  void screenalloc(int doclear);
  void free_screenlines(void);
  void screenclear(void);
+ void redraw_as_cleared(void);
  void line_was_clobbered(int screen_lnum);
  int can_clear(char_u *p);
  void screen_start(void);
*** ../vim-9.0.0316/src/popupwin.c      2022-08-28 14:39:34.355253105 +0100
--- src/popupwin.c      2022-08-29 13:36:54.243444996 +0100
***************
*** 1938,1943 ****
--- 1938,1957 ----
  #endif
  
  /*
+  * Mark all popup windows in the current tab and global for redrawing.
+  */
+     void
+ popup_redraw_all(void)
+ {
+     win_T     *wp;
+ 
+     FOR_ALL_POPUPWINS(wp)
+       wp->w_redr_type = UPD_NOT_VALID;
+     FOR_ALL_POPUPWINS_IN_TAB(curtab, wp)
+       wp->w_redr_type = UPD_NOT_VALID;
+ }
+ 
+ /*
   * Set the color for a notification window.
   */
      static void
*** ../vim-9.0.0316/src/proto/popupwin.pro      2022-08-28 13:02:23.955786926 
+0100
--- src/proto/popupwin.pro      2022-08-29 13:36:45.195457379 +0100
***************
*** 15,20 ****
--- 15,21 ----
  int parse_completepopup(win_T *wp);
  void popup_set_wantpos_cursor(win_T *wp, int width, dict_T *d);
  void popup_set_wantpos_rowcol(win_T *wp, int row, int col);
+ void popup_redraw_all(void);
  void f_popup_clear(typval_T *argvars, typval_T *rettv);
  void f_popup_create(typval_T *argvars, typval_T *rettv);
  void f_popup_atcursor(typval_T *argvars, typval_T *rettv);
*** ../vim-9.0.0316/src/testdir/dumps/Test_popupwin_win_execute.dump    
2020-09-23 16:14:25.000000000 +0100
--- src/testdir/dumps/Test_popupwin_win_execute.dump    2022-08-29 
13:37:07.943426392 +0100
***************
*** 2,8 ****
  |~+0#4040ff13&| @73
  |~| @73
  |~| @73
! |~| @31| +0#0000000&@8| +0#4040ff13&@32
  |~| @73
  |~| @73
  |~| @73
--- 2,8 ----
  |~+0#4040ff13&| @73
  |~| @73
  |~| @73
! |~| @31|s+0#0000001#ffd7ff255|o|m|e| |t|e|x|t| +0#4040ff13#ffffff0@32
  |~| @73
  |~| @73
  |~| @73
*** ../vim-9.0.0316/src/version.c       2022-08-29 12:40:56.877873407 +0100
--- src/version.c       2022-08-29 13:16:06.834945060 +0100
***************
*** 709,710 ****
--- 709,712 ----
  {   /* Add new patch number below this line */
+ /**/
+     317,
  /**/

-- 
Mushrooms always grow in damp places and so they look like umbrellas.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220829124500.8A7A71C07CD%40moolenaar.net.

Raspunde prin e-mail lui