diff --git a/src/popupwin.c b/src/popupwin.c index 96f669a50c..b74a9445bb 100644 --- a/src/popupwin.c +++ b/src/popupwin.c @@ -1647,6 +1647,8 @@ popup_adjust_position(win_T *wp) // make bottom aligned and recompute the height wp->w_height = w_height_before_limit; wp->w_winrow = wantline - 2 - wp->w_height - extra_height; + if (wp->w_popup_flags & POPF_INFO) + wp->w_winrow += extra_height + 2; if (wp->w_winrow < 0) { wp->w_height += wp->w_winrow; diff --git a/src/testdir/dumps/Test_popupwin_infopopup_align_item_01.dump b/src/testdir/dumps/Test_popupwin_infopopup_align_item_01.dump new file mode 100644 index 0000000000..558a571ed6 --- /dev/null +++ b/src/testdir/dumps/Test_popupwin_infopopup_align_item_01.dump @@ -0,0 +1,15 @@ +| +0#af5f00255#ffffff0@1|1| | +0#0000000&@70 +| +0#af5f00255&@1|2| | +0#0000000&@70 +| +0#af5f00255&@1|3| | +0#0000000&@70 +| +0#af5f00255&@1|4| | +0#0000000&@70 +| +0#af5f00255&@1|5| | +0#0000000&@70 +| +0#af5f00255&@1|6| | +0#0000000&@70 +| +0#af5f00255&@1|7| | +0#0000000&@70 +| +0#af5f00255&@1|8| | +0#0000000&@14|╔+0#0000001#e0e0e08|═@7|X| +0#0000000#ffffff0@45 +| +0#af5f00255&@1|9| | +0#0000000&@14|║+0#0000001#e0e0e08| |N|i|n|e| @2|║| +0#0000000#ffffff0@45 +| +0#af5f00255&|1|0| +0#0000001#ffd7ff255|c|p|_|m|a|t|c|h|_|a|r@1|a|y| |║+0&#e0e0e08| |T|e|n| @3|║| +0#0000000#ffffff0@45 +| +0#af5f00255&|1@1| +0#0000001#ffd7ff255|c|p|_|s|t|r| @8|║+0&#e0e0e08| |E|l|e|v|e|n| |║| +0#0000000#ffffff0@45 +| +0#af5f00255&|1|2| +0#0000001#e0e0e08|c|p|_|s|c|o|r|e| @6|║| |T|w|e|l|v|e| |║| +0#0000000#ffffff0@45 +| +0#af5f00255&|1|3| |c+0#0000000&|p|_|s|c|o|r|e> @6|╚+0#0000001#e0e0e08|═@7|⇲| +0#0000000#ffffff0@45 +|~+0#4040ff13&| @73 +|-+2#0000000&@1| |O|m|n|i| |c|o|m|p|l|e|t|i|o|n| |(|^|O|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |3| |o|f| |3| +0#0000000&@34 diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim index 4b616a8a40..a608fbaf59 100644 --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -3783,6 +3783,38 @@ func Test_popupmenu_info_align_menu() call StopVimInTerminal(buf) endfunc +func Test_popupmenu_info_align_item() + CheckScreendump + let lines =<< trim END + func Omni_test(findstart, base) + if a:findstart + return col(".") + endif + return [ + \ #{word: "cp_match_array", info: "One\nTwo\nThree\nFour"}, + \ #{word: "cp_str", info: "Five\nSix\nSeven\nEight"}, + \ #{word: "cp_score", info: "Nine\nTen\nEleven\nTwelve"}, + \ ] + endfunc + set completepopup=border:on,align:item + set cot=menu,menuone,popup, + set omnifunc=Omni_test + set number + END + call writefile(lines, 'XtestInfoPopupPos', 'D') + let buf = RunVimInTerminal('-S XtestInfoPopupPos', #{rows: 15}) + call TermWait(buf, 25) + + call term_sendkeys(buf, "A"..repeat("\", 12)) + call TermWait(buf, 25) + call term_sendkeys(buf, "\\\\") + call TermWait(buf, 25) + call VerifyScreenDump(buf, 'Test_popupwin_infopopup_align_item_01', {}) + + call term_sendkeys(buf, "\") + call StopVimInTerminal(buf) +endfunc + func Test_popupmenu_info_hidden() CheckScreendump CheckFeature quickfix diff --git a/src/version.c b/src/version.c index f6133c52d1..ba74665b5a 100644 --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1960, /**/ 1959, /**/