patch 9.2.0087: popup: redrawing can be improved when moving popups

Commit: 
https://github.com/vim/vim/commit/f7e99d102b888f91edb607fb5fb857ad244909e2
Author: Yasuhiro Matsumoto <[email protected]>
Date:   Sun Mar 1 17:25:08 2026 +0000

    patch 9.2.0087: popup: redrawing can be improved when moving popups
    
    Problem:  popup: redrawing can be improved when moving popups
    Solution: When a pop-up window moves, only the target window should be
              redrawn (Yasuhiro Matsumoto).
    
    closes: #19536
    
    Signed-off-by: Yasuhiro Matsumoto <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/popupwin.c b/src/popupwin.c
index 1d8356ccf..399ab67ac 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -3299,10 +3299,51 @@ f_popup_move(typval_T *argvars, typval_T *rettv UNUSED)
        clear_cmdline = TRUE;
     popup_adjust_position(wp);
 
-    // Redraw the old position to clear ghost images
+    // Redraw the popup at the new position; for opaque popups, the
+    // diff-based popup mask update in may_update_popup_mask() will handle
+    // redrawing the affected lines in regular windows to clear the old
+    // position.  Transparent popups don't participate in popup_mask, so
+    // we need to manually mark the old area's lines for redraw.
     if (old_winrow != wp->w_winrow || old_wincol != wp->w_wincol
            || old_height != wp->w_height || old_width != wp->w_width)
-       redraw_all_later(UPD_NOT_VALID);
+    {
+       redraw_win_later(wp, UPD_NOT_VALID);
+
+       if ((wp->w_popup_flags & POPF_OPACITY) && wp->w_popup_blend > 0)
+       {
+           int     total_h = old_height + popup_top_extra(wp)
+                       + wp->w_popup_border[2] + wp->w_popup_padding[2];
+           int     row;
+
+           for (row = old_winrow;
+                      row < old_winrow + total_h && row < screen_Rows; ++row)
+           {
+               if (row >= cmdline_row)
+                   clear_cmdline = TRUE;
+               else
+               {
+                   int         line_cp = row;
+                   int         col_cp = old_wincol;
+                   win_T       *twp;
+
+                   twp = mouse_find_win(&line_cp, &col_cp, IGNORE_POPUP);
+                   if (twp != NULL)
+                   {
+                       if (line_cp >= twp->w_height)
+                           twp->w_redr_status = TRUE;
+                       else
+                       {
+                           linenr_T    lnum;
+
+                           (void)mouse_comp_pos(twp, &line_cp, &col_cp,
+                                                              &lnum, NULL);
+                           redrawWinline(twp, lnum);
+                       }
+                   }
+               }
+           }
+       }
+    }
 }
 
 /*
diff --git a/src/version.c b/src/version.c
index e4cec8400..9400e1826 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    87,
 /**/
     86,
 /**/

-- 
-- 
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 visit 
https://groups.google.com/d/msgid/vim_dev/E1vwkcI-001hmZ-IX%40256bit.org.

Raspunde prin e-mail lui