From 1d3d84fe818efaf47d8f818fcc44368d144443a1 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 26 Dec 2019 13:21:35 -0500 Subject: vim-patch:8.1.0554: popup menu overlaps with preview window Problem: Popup menu overlaps with preview window. Solution: Adjust the height computation. (Hirohito Higashi, closes vim/vim#3414) https://github.com/vim/vim/commit/614ab8aa00346724bfc27980d25985d482269b75 Cherry-picked "row -> pum_win_row" rename changes from patch 8.1.0062. --- src/nvim/testdir/test_popup.vim | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_popup.vim b/src/nvim/testdir/test_popup.vim index 9db6112eeb..27c90f9114 100644 --- a/src/nvim/testdir/test_popup.vim +++ b/src/nvim/testdir/test_popup.vim @@ -733,6 +733,28 @@ func Test_popup_and_preview_autocommand() bw! endfunc +func Test_popup_and_previewwindow_dump() + if !CanRunVimInTerminal() + return + endif + call writefile([ + \ 'set previewheight=9', + \ 'silent! pedit', + \ 'call setline(1, map(repeat(["ab"], 10), "v:val. v:key"))', + \ 'exec "norm! G\\"', + \ ], 'Xscript') + let buf = RunVimInTerminal('-S Xscript', {}) + + " Test that popup and previewwindow do not overlap. + call term_sendkeys(buf, "o\\") + sleep 100m + call VerifyScreenDump(buf, 'Test_popup_and_previewwindow_01', {}) + + call term_sendkeys(buf, "\u") + call StopVimInTerminal(buf) + call delete('Xscript') +endfunc + func Test_popup_position() if !CanRunVimInTerminal() return -- cgit From e80f61020adfe6f2503c59cfea86f47fc6b0887d Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 28 Dec 2019 00:46:40 -0500 Subject: vim-patch:8.0.1540: popup menu positioning fails with longer string Problem: Popup menu positioning fails with longer string. Solution: Only align with right side of window when width is less than 'pumwidth' (closes vim/vim#2661) https://github.com/vim/vim/commit/2b10bcbfc1c025bf7e6358326ee70105e7d30e96 --- src/nvim/testdir/test_popup.vim | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_popup.vim b/src/nvim/testdir/test_popup.vim index 27c90f9114..e5696f4cbb 100644 --- a/src/nvim/testdir/test_popup.vim +++ b/src/nvim/testdir/test_popup.vim @@ -784,6 +784,15 @@ func Test_popup_position() call term_sendkeys(buf, "GA\") call VerifyScreenDump(buf, 'Test_popup_position_03', {'rows': 8}) + " completed text wider than the window and 'pumwidth' smaller than available + " space + call term_sendkeys(buf, "\u") + call term_sendkeys(buf, ":set pumwidth=20\") + call term_sendkeys(buf, "ggI123456789_\") + call term_sendkeys(buf, "jI123456789_\") + call term_sendkeys(buf, "GA\") + call VerifyScreenDump(buf, 'Test_popup_position_04', {'rows': 10}) + call term_sendkeys(buf, "\u") call StopVimInTerminal(buf) call delete('Xtest') -- cgit