// Check across the full width of the popup to find all underlying
// windows (e.g., when the popup spans a vertical split).
for (col = wp->w_wincol;
- col < wp->w_wincol + width && col < screen_Columns; ++col)
+ col < wp->w_wincol + width && col < screen_Columns; ++col)
{
int line_cp = r;
int col_cp = col;
{
linenr_T lnum;
- (void)mouse_comp_pos(twp, &line_cp, &col_cp, &lnum, NULL);
- // Called from inside update_screen(); raising must_redraw
- // would loop the outer redraw indefinitely.
- redraw_win_range_now(twp, lnum, lnum);
+#ifdef FEAT_TERMINAL
+ // A terminal only repaints vterm-damaged rows; force a
+ // full repaint so the opacity blend sees the true
+ // background, not stale blended cells.
+ if (term_do_update_window(twp))
+ twp->w_redr_type = UPD_NOT_VALID;
+ else
+#endif
+ {
+ (void)mouse_comp_pos(twp, &line_cp, &col_cp, &lnum,
+ NULL);
+ // Called from inside update_screen(); raising
+ // must_redraw would loop the outer redraw indefinitely.
+ redraw_win_range_now(twp, lnum, lnum);
+ }
}
else if (line_cp == twp->w_height)
// Status bar line: mark for redraw to prevent
call StopVimInTerminal(buf)
endfunc
+func Test_popup_opacity_terminal_move_no_leftover()
+ CheckScreendump
+ CheckFeature terminal
+ CheckUnix
+
+ " A semi-transparent popup over a terminal used to leave the old popup
+ " cells behind when it moved.
+ let lines =<< trim END
+ set shell=/bin/sh noruler
+ unlet $PROMPT_COMMAND
+ let $PS1 = 'vim> '
+ terminal ++curwin
+ call popup_create('ABC',
+ \ #{line: 5, col: 10, highlight: 'None', opacity: 30})
+ func MoveIt()
+ let id = popup_list()[0]
+ call popup_settext(id, 'XYZ')
+ call popup_setoptions(id, #{col: popup_getpos(id).col + 3})
+ endfunc
+ END
+ call writefile(lines, 'XtestPopupOpacityTermMove', 'D')
+ let buf = RunVimInTerminal('-S XtestPopupOpacityTermMove',
+ \ #{rows: 12, wait_for_ruler: 0})
+ call WaitForAssert({-> assert_match('ABC', term_getline(buf, 5))})
+ call VerifyScreenDump(buf, 'Test_popupwin_opacity_term_move_1', {})
+
+ " Move the popup and change its text: the old "ABC" cells must be cleared.
+ call term_sendkeys(buf, "\<C-W>:call MoveIt()\<CR>")
+ call WaitForAssert({-> assert_match('XYZ', term_getline(buf, 5))})
+ call VerifyScreenDump(buf, 'Test_popupwin_opacity_term_move_2', {})
+
+ " clean up
+ call term_sendkeys(buf, "\<C-W>:qa!\<CR>")
+ call WaitForAssert({-> assert_equal("finished", term_getstatus(buf))})
+ exe buf .. 'bwipe!'
+endfunc
+
func Test_popup_opacity_terminal_no_freeze()
CheckFeature terminal
CheckUnix