From: Yasuhiro Matsumoto Date: Sun, 1 Mar 2026 17:25:08 +0000 (+0000) Subject: patch 9.2.0087: popup: redrawing can be improved when moving popups X-Git-Tag: v9.2.0087^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7e99d102b888f91edb607fb5fb857ad244909e2;p=thirdparty%2Fvim.git 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 Signed-off-by: Christian Brabandt --- diff --git a/src/popupwin.c b/src/popupwin.c index 1d8356ccf8..399ab67ac3 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 e4cec84002..9400e18268 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, /**/