Skip to content

Commit 3ae50c7

Browse files
committed
patch 8.2.2132: padding not drawn properly for popup window with title
Problem: Padding not drawn properly for popup window with title. Solution: Draw the padding below the title. (closes #7460)
1 parent 709664c commit 3ae50c7

5 files changed

Lines changed: 39 additions & 8 deletions

File tree

src/popupwin.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3868,20 +3868,19 @@ update_popups(void (*win_update)(win_T *wp))
38683868
}
38693869
if (top_padding > 0)
38703870
{
3871-
// top padding; do not draw over the title
38723871
row = wp->w_winrow + wp->w_popup_border[0];
3873-
if (title_len > 0)
3872+
if (title_len > 0 && row == wp->w_winrow)
38743873
{
3875-
screen_fill(row, row + top_padding, padcol, title_wincol,
3874+
// top padding and no border; do not draw over the title
3875+
screen_fill(row, row + 1, padcol, title_wincol,
38763876
' ', ' ', popup_attr);
3877-
screen_fill(row, row + top_padding, title_wincol + title_len,
3877+
screen_fill(row, row + 1, title_wincol + title_len,
38783878
padendcol, ' ', ' ', popup_attr);
3879+
row += 1;
3880+
top_padding -= 1;
38793881
}
3880-
else
3881-
{
3882-
screen_fill(row, row + top_padding, padcol, padendcol,
3882+
screen_fill(row, row + top_padding, padcol, padendcol,
38833883
' ', ' ', popup_attr);
3884-
}
38853884
}
38863885

38873886
// Compute scrollbar thumb position and size.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
>1+0&#ffffff0| @73
2+
|2| @73
3+
|3| @27| +0#0000001#ffd7ff255|T|i|t|l|e| @9| +0#0000000#ffffff0@29
4+
|4| @27| +0#0000001#ffd7ff255@15| +0#0000000#ffffff0@29
5+
|5| @27| +0#0000001#ffd7ff255@1|a@2| @10| +0#0000000#ffffff0@29
6+
|6| @27| +0#0000001#ffd7ff255@1|b@2| @10| +0#0000000#ffffff0@29
7+
|7| @27| +0#0000001#ffd7ff255@15| +0#0000000#ffffff0@29
8+
|8| @27| +0#0000001#ffd7ff255@15| +0#0000000#ffffff0@29
9+
|9| @73
10+
|:| @55|1|,|1| @10|T|o|p|
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
>1+0&#ffffff0| @73
2+
|2| @26|╔+0#0000001#ffd7ff255|T|i|t|l|e|═@10|╗| +0#0000000#ffffff0@28
3+
|3| @26|║+0#0000001#ffd7ff255| @15|║| +0#0000000#ffffff0@28
4+
|4| @26|║+0#0000001#ffd7ff255| @15|║| +0#0000000#ffffff0@28
5+
|5| @26|║+0#0000001#ffd7ff255| @1|a@2| @10|║| +0#0000000#ffffff0@28
6+
|6| @26|║+0#0000001#ffd7ff255| @1|b@2| @10|║| +0#0000000#ffffff0@28
7+
|7| @26|║+0#0000001#ffd7ff255| @15|║| +0#0000000#ffffff0@28
8+
|8| @26|║+0#0000001#ffd7ff255| @15|║| +0#0000000#ffffff0@28
9+
|9| @26|╚+0#0000001#ffd7ff255|═@15|╝| +0#0000000#ffffff0@28
10+
|:| @55|1|,|1| @10|T|o|p|

src/testdir/test_popupwin.vim

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,6 +1766,16 @@ func Test_popup_title()
17661766
call term_sendkeys(buf, ":\<CR>")
17671767
call VerifyScreenDump(buf, 'Test_popupwin_longtitle_2', {})
17681768

1769+
call term_sendkeys(buf, ":call popup_clear()\<CR>")
1770+
call term_sendkeys(buf, ":call popup_create(['aaa', 'bbb'], #{title: 'Title', minwidth: 12, padding: [2, 2, 2, 2]})\<CR>")
1771+
call term_sendkeys(buf, ":\<CR>")
1772+
call VerifyScreenDump(buf, 'Test_popupwin_longtitle_3', {})
1773+
1774+
call term_sendkeys(buf, ":call popup_clear()\<CR>")
1775+
call term_sendkeys(buf, ":call popup_create(['aaa', 'bbb'], #{title: 'Title', minwidth: 12, border: [], padding: [2, 2, 2, 2]})\<CR>")
1776+
call term_sendkeys(buf, ":\<CR>")
1777+
call VerifyScreenDump(buf, 'Test_popupwin_longtitle_4', {})
1778+
17691779
" clean up
17701780
call StopVimInTerminal(buf)
17711781
call delete('XtestPopupTitle')

src/version.c

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

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2132,
753755
/**/
754756
2131,
755757
/**/

0 commit comments

Comments
 (0)