Patch 8.2.2132

8 views
Skip to first unread message

Bram Moolenaar

unread,
Dec 12, 2020, 12:19:45 PM12/12/20
to vim...@googlegroups.com

Patch 8.2.2132
Problem: Padding not drawn properly for popup window with title.
Solution: Draw the padding below the title. (closes #7460)
Files: src/popupwin.c, src/testdir/test_popupwin.vim,
src/testdir/dumps/Test_popupwin_longtitle_3.dump,
src/testdir/dumps/Test_popupwin_longtitle_4.dump


*** ../vim-8.2.2131/src/popupwin.c 2020-11-28 20:22:03.092081260 +0100
--- src/popupwin.c 2020-12-12 18:11:21.792934728 +0100
***************
*** 3868,3887 ****
}
if (top_padding > 0)
{
- // top padding; do not draw over the title
row = wp->w_winrow + wp->w_popup_border[0];
! if (title_len > 0)
{
! screen_fill(row, row + top_padding, padcol, title_wincol,
' ', ' ', popup_attr);
! screen_fill(row, row + top_padding, title_wincol + title_len,
padendcol, ' ', ' ', popup_attr);
}
! else
! {
! screen_fill(row, row + top_padding, padcol, padendcol,
' ', ' ', popup_attr);
- }
}

// Compute scrollbar thumb position and size.
--- 3868,3886 ----
}
if (top_padding > 0)
{
row = wp->w_winrow + wp->w_popup_border[0];
! if (title_len > 0 && row == wp->w_winrow)
{
! // top padding and no border; do not draw over the title
! screen_fill(row, row + 1, padcol, title_wincol,
' ', ' ', popup_attr);
! screen_fill(row, row + 1, title_wincol + title_len,
padendcol, ' ', ' ', popup_attr);
+ row += 1;
+ top_padding -= 1;
}
! screen_fill(row, row + top_padding, padcol, padendcol,
' ', ' ', popup_attr);
}

// Compute scrollbar thumb position and size.
*** ../vim-8.2.2131/src/testdir/test_popupwin.vim 2020-12-09 18:13:40.713680179 +0100
--- src/testdir/test_popupwin.vim 2020-12-12 18:15:28.524214709 +0100
***************
*** 1766,1771 ****
--- 1766,1781 ----
call term_sendkeys(buf, ":\<CR>")
call VerifyScreenDump(buf, 'Test_popupwin_longtitle_2', {})

+ call term_sendkeys(buf, ":call popup_clear()\<CR>")
+ call term_sendkeys(buf, ":call popup_create(['aaa', 'bbb'], #{title: 'Title', minwidth: 12, padding: [2, 2, 2, 2]})\<CR>")
+ call term_sendkeys(buf, ":\<CR>")
+ call VerifyScreenDump(buf, 'Test_popupwin_longtitle_3', {})
+
+ call term_sendkeys(buf, ":call popup_clear()\<CR>")
+ call term_sendkeys(buf, ":call popup_create(['aaa', 'bbb'], #{title: 'Title', minwidth: 12, border: [], padding: [2, 2, 2, 2]})\<CR>")
+ call term_sendkeys(buf, ":\<CR>")
+ call VerifyScreenDump(buf, 'Test_popupwin_longtitle_4', {})
+
" clean up
call StopVimInTerminal(buf)
call delete('XtestPopupTitle')
*** ../vim-8.2.2131/src/testdir/dumps/Test_popupwin_longtitle_3.dump 2020-12-12 18:17:38.563827713 +0100
--- src/testdir/dumps/Test_popupwin_longtitle_3.dump 2020-12-12 18:15:40.528179194 +0100
***************
*** 0 ****
--- 1,10 ----
+ >1+0&#ffffff0| @73
+ |2| @73
+ |3| @27| +0#0000001#ffd7ff255|T|i|t|l|e| @9| +0#0000000#ffffff0@29
+ |4| @27| +0#0000001#ffd7ff255@15| +0#0000000#ffffff0@29
+ |5| @27| +0#0000001#ffd7ff255@1|a@2| @10| +0#0000000#ffffff0@29
+ |6| @27| +0#0000001#ffd7ff255@1|b@2| @10| +0#0000000#ffffff0@29
+ |7| @27| +0#0000001#ffd7ff255@15| +0#0000000#ffffff0@29
+ |8| @27| +0#0000001#ffd7ff255@15| +0#0000000#ffffff0@29
+ |9| @73
+ |:| @55|1|,|1| @10|T|o|p|
*** ../vim-8.2.2131/src/testdir/dumps/Test_popupwin_longtitle_4.dump 2020-12-12 18:17:38.567827702 +0100
--- src/testdir/dumps/Test_popupwin_longtitle_4.dump 2020-12-12 18:15:41.580176077 +0100
***************
*** 0 ****
--- 1,10 ----
+ >1+0&#ffffff0| @73
+ |2| @26|╔+0#0000001#ffd7ff255|T|i|t|l|e|═@10|╗| +0#0000000#ffffff0@28
+ |3| @26|║+0#0000001#ffd7ff255| @15|║| +0#0000000#ffffff0@28
+ |4| @26|║+0#0000001#ffd7ff255| @15|║| +0#0000000#ffffff0@28
+ |5| @26|║+0#0000001#ffd7ff255| @1|a@2| @10|║| +0#0000000#ffffff0@28
+ |6| @26|║+0#0000001#ffd7ff255| @1|b@2| @10|║| +0#0000000#ffffff0@28
+ |7| @26|║+0#0000001#ffd7ff255| @15|║| +0#0000000#ffffff0@28
+ |8| @26|║+0#0000001#ffd7ff255| @15|║| +0#0000000#ffffff0@28
+ |9| @26|╚+0#0000001#ffd7ff255|═@15|╝| +0#0000000#ffffff0@28
+ |:| @55|1|,|1| @10|T|o|p|
*** ../vim-8.2.2131/src/version.c 2020-12-12 14:33:37.096920916 +0100
--- src/version.c 2020-12-12 18:06:02.629824129 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2132,
/**/

--
Every time I lose weight, it finds me again!

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages