Skip to content

Commit 575961c

Browse files
mattnchrisbra
authored andcommitted
patch 9.2.0260: statusline not redrawn after closing a popup window
Problem: When a popup window overlapping a status line is closed or hidden, the status line is not redrawn, leaving ghost artifacts from the popup. Solution: popup_free() and popup_hide() call redraw_all_later(UPD_NOT_VALID) which marks window contents for redraw but does not set w_redr_status. The diff-based path in may_update_popup_mask() that normally sets w_redr_status is skipped when redrawing_all_win is TRUE. Add status_redraw_all calls to ensure status lines are properly redrawn (Yasuhiro Matsumoto). closes: #19830 Signed-off-by: Yasuhiro Matsumoto <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent f6e1dd1 commit 575961c

5 files changed

Lines changed: 56 additions & 0 deletions

File tree

src/popupwin.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3033,6 +3033,7 @@ popup_hide(win_T *wp)
30333033
if (wp->w_winrow + popup_height(wp) >= cmdline_row)
30343034
clear_cmdline = TRUE;
30353035
redraw_all_later(UPD_NOT_VALID);
3036+
status_redraw_all();
30363037
popup_mask_refresh = TRUE;
30373038
}
30383039

@@ -3196,6 +3197,7 @@ popup_free(win_T *wp)
31963197
#endif
31973198

31983199
redraw_all_later(UPD_NOT_VALID);
3200+
status_redraw_all();
31993201
popup_mask_refresh = TRUE;
32003202
}
32013203

src/testdir/dumps/Test_popupwin_close_status_1.dump

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/testdir/dumps/Test_popupwin_close_status_2.dump

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/testdir/test_popupwin.vim

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5080,4 +5080,26 @@ func Test_popup_close_b_nwindows()
50805080
call assert_equal(0, bufexists('Xfoo'))
50815081
endfunc
50825082

5083+
func Test_popupwin_close_status_redraw()
5084+
CheckScreendump
5085+
5086+
let lines =<< trim END
5087+
split
5088+
call setline(1, range(1, 20))
5089+
let winid = popup_create('popup over statusline', #{
5090+
\ line: &lines / 2,
5091+
\ col: 5,
5092+
\ })
5093+
END
5094+
call writefile(lines, 'XtestPopupCloseStatus', 'D')
5095+
let buf = RunVimInTerminal('-S XtestPopupCloseStatus', #{rows: 15})
5096+
call VerifyScreenDump(buf, 'Test_popupwin_close_status_1', {})
5097+
5098+
" close the popup and check the status line is redrawn
5099+
call term_sendkeys(buf, ":call popup_close(winid)\<CR>")
5100+
call VerifyScreenDump(buf, 'Test_popupwin_close_status_2', {})
5101+
5102+
call StopVimInTerminal(buf)
5103+
endfunc
5104+
50835105
" vim: shiftwidth=2 sts=2

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ static char *(features[]) =
734734

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
260,
737739
/**/
738740
259,
739741
/**/

0 commit comments

Comments
 (0)