diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-12-01 11:59:00 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-12-01 11:59:00 +0100 |
commit | 614ab8aa00346724bfc27980d25985d482269b75 (patch) | |
tree | fe9a1080eaf1ba90dac24b15585e4ac14fab8aee | |
parent | 07dc18ffa4e7ed202f219fe2fd3d6f58246f71f9 (diff) | |
download | vim-git-614ab8aa00346724bfc27980d25985d482269b75.tar.gz |
patch 8.1.0554: popup menu overlaps with preview windowv8.1.0554
Problem: Popup menu overlaps with preview window.
Solution: Adjust the height computation. (Hirohito Higashi, closes #3414)
-rw-r--r-- | src/popupmnu.c | 17 | ||||
-rw-r--r-- | src/testdir/dumps/Test_popup_and_previewwindow_01.dump | 20 | ||||
-rw-r--r-- | src/testdir/test_popup.vim | 22 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 48 insertions, 13 deletions
diff --git a/src/popupmnu.c b/src/popupmnu.c index c481d4be7..f3a9f3991 100644 --- a/src/popupmnu.c +++ b/src/popupmnu.c @@ -196,20 +196,11 @@ pum_display( return; #if defined(FEAT_QUICKFIX) - // If there is a preview window at the above avoid drawing over it. - // Do keep at least 10 entries. - if (pvwin != NULL && pum_row < above_row && pum_height > 10) + // If there is a preview window above avoid drawing over it. + if (pvwin != NULL && pum_row < above_row && pum_height > above_row) { - if (pum_win_row - above_row < 10) - { - pum_row = pum_win_row - 10; - pum_height = 10; - } - else - { - pum_row = above_row; - pum_height = pum_win_row - above_row; - } + pum_row = above_row; + pum_height = pum_win_row - above_row; } #endif diff --git a/src/testdir/dumps/Test_popup_and_previewwindow_01.dump b/src/testdir/dumps/Test_popup_and_previewwindow_01.dump new file mode 100644 index 000000000..71ff3990f --- /dev/null +++ b/src/testdir/dumps/Test_popup_and_previewwindow_01.dump @@ -0,0 +1,20 @@ +|a+0&#ffffff0|b|0| @71 +|a|b|1| @71 +|a|b|2| @71 +|a|b|3| @71 +|a|b|4| @71 +|a|b|5| @71 +|a|b|6| @71 +|a|b|7| @71 +|a|b|8| @71 +|a+0#0000001#e0e0e08|b|0| @11| +0#0000000#0000001|e+1&#ffffff0|w|]|[|+|]| @34|1|,|1| @11|T|o|p +|a+0#0000001#ffd7ff255|b|1| @11| +0#0000000#0000001| +0&#ffffff0@58 +|a+0#0000001#ffd7ff255|b|2| @11| +0#0000000#0000001| +0&#ffffff0@58 +|a+0#0000001#ffd7ff255|b|3| @11| +0#0000000#0000001| +0&#ffffff0@58 +|a+0#0000001#ffd7ff255|b|4| @11| +0#0000000#a8a8a8255| +0&#ffffff0@58 +|a+0#0000001#ffd7ff255|b|5| @11| +0#0000000#a8a8a8255| +0&#ffffff0@58 +|a+0#0000001#ffd7ff255|b|6| @11| +0#0000000#a8a8a8255| +0&#ffffff0@58 +|a|b|0> @71 +|~+0#4040ff13&| @73 +|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|1|0|,|1| @10|B|o|t +|-+2&&@1| |K|e|y|w|o|r|d| |L|o|c|a|l| |c|o|m|p|l|e|t|i|o|n| |(|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |1|0| +0#0000000&@26 diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim index 9c25687ad..287d59d90 100644 --- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -701,6 +701,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\<C-E>\<C-E>"', + \ ], 'Xscript') + let buf = RunVimInTerminal('-S Xscript', {}) + + " Test that popup and previewwindow do not overlap. + call term_sendkeys(buf, "o\<C-X>\<C-N>") + sleep 100m + call VerifyScreenDump(buf, 'Test_popup_and_previewwindow_01', {}) + + call term_sendkeys(buf, "\<Esc>u") + call StopVimInTerminal(buf) + call delete('Xscript') +endfunc + func Test_balloon_split() if !exists('*balloon_split') return diff --git a/src/version.c b/src/version.c index 5f61775ac..6cce56670 100644 --- a/src/version.c +++ b/src/version.c @@ -793,6 +793,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 554, +/**/ 553, /**/ 552, |