diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-08-18 15:25:17 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-08-18 15:25:17 +0200 |
commit | 576a4a6ff14da876d7c4418e5f27e926fcfa8d2a (patch) | |
tree | 6c34c1eaed6f1b46c573bb0fe3ce8d375e678e29 /src/testdir | |
parent | 93cf85f9ef02931de3f8c8e536a137da0b48b7dc (diff) |
patch 8.1.1880: cannot show extra info for completion in a popup windowv8.1.1880
Problem: Cannot show extra info for completion in a popup window.
Solution: Add the "popup" entry in 'completeopt'.
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/dumps/Test_popupwin_infopopup_1.dump | 14 | ||||
-rw-r--r-- | src/testdir/dumps/Test_popupwin_infopopup_2.dump | 14 | ||||
-rw-r--r-- | src/testdir/dumps/Test_popupwin_infopopup_3.dump | 14 | ||||
-rw-r--r-- | src/testdir/dumps/Test_popupwin_infopopup_4.dump | 14 | ||||
-rw-r--r-- | src/testdir/test_popupwin.vim | 72 |
5 files changed, 128 insertions, 0 deletions
diff --git a/src/testdir/dumps/Test_popupwin_infopopup_1.dump b/src/testdir/dumps/Test_popupwin_infopopup_1.dump new file mode 100644 index 0000000000..ba5925affa --- /dev/null +++ b/src/testdir/dumps/Test_popupwin_infopopup_1.dump @@ -0,0 +1,14 @@ +|t+0&#ffffff0|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|a|w|o|r|d> @15|╔+0#0000001#ffd7ff255|═@15|X| +0#0000000#ffffff0@9 +|~+0#4040ff13&| @23| +0#0000001#e0e0e08|w|r|d| @4|W| |e|x|t|r|a| |t|e|x|t| |║+0&#ffd7ff255| |w|o|r|d|s| |a|r|e| |c|o@1|l| |║| +0#4040ff13#ffffff0@9 +|~| @23| +0#0000001#ffd7ff255|a|n|o|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| |╚|═@15|⇲| +0#4040ff13#ffffff0@9 +|~| @23| +0#0000001#ffd7ff255|n|o|a|w|r|d| @1|W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27 +|~| @23| +0#0000001#ffd7ff255|t|h|a|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|-+2#0000000&@1| |U|s|e|r| |d|e|f|i|n|e|d| |c|o|m|p|l|e|t|i|o|n| |(|^|U|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |4| +0#0000000&@26 diff --git a/src/testdir/dumps/Test_popupwin_infopopup_2.dump b/src/testdir/dumps/Test_popupwin_infopopup_2.dump new file mode 100644 index 0000000000..059055e5ae --- /dev/null +++ b/src/testdir/dumps/Test_popupwin_infopopup_2.dump @@ -0,0 +1,14 @@ +|t+0&#ffffff0|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|a|n|o|t|h|e|r|w|o|r|d> @37 +|~+0#4040ff13&| @23| +0#0000001#ffd7ff255|w|r|d| @4|W| |e|x|t|r|a| |t|e|x|t| |╔|═@25|X +|~+0#4040ff13#ffffff0| @23| +0#0000001#e0e0e08|a|n|o|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| |║+0&#ffd7ff255| |o|t|h|e|r| |w|o|r|d|s| |a|r|e| @9|║ +|~+0#4040ff13#ffffff0| @23| +0#0000001#ffd7ff255|n|o|a|w|r|d| @1|W| |e|x|t|r|a| |t|e|x|t| |║| |c|o@1|l|e|r| |t|h|a|n| |t|h|i|s| |a|n|d| |s|o|m| |║ +|~+0#4040ff13#ffffff0| @23| +0#0000001#ffd7ff255|t|h|a|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| |║| |e| |m|o|r|e| |t|e|x|t| @13|║ +|~+0#4040ff13#ffffff0| @45|║+0#0000001#ffd7ff255| |t|o| |m|a|k|e| |w|r|a|p| @12|║ +|~+0#4040ff13#ffffff0| @45|╚+0#0000001#ffd7ff255|═@25|⇲ +|~+0#4040ff13#ffffff0| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|-+2#0000000&@1| |U|s|e|r| |d|e|f|i|n|e|d| |c|o|m|p|l|e|t|i|o|n| |(|^|U|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |2| |o|f| |4| +0#0000000&@26 diff --git a/src/testdir/dumps/Test_popupwin_infopopup_3.dump b/src/testdir/dumps/Test_popupwin_infopopup_3.dump new file mode 100644 index 0000000000..3295cb2479 --- /dev/null +++ b/src/testdir/dumps/Test_popupwin_infopopup_3.dump @@ -0,0 +1,14 @@ +|t+0&#ffffff0|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|n|o|i|n|f|o> @42 +|~+0#4040ff13&| @23| +0#0000001#ffd7ff255|w|r|d| @4|W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27 +|~| @23| +0#0000001#ffd7ff255|a|n|o|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| |╔|═@14|X| +0#4040ff13#ffffff0@10 +|~| @23| +0#0000001#e0e0e08|n|o|a|w|r|d| @1|W| |e|x|t|r|a| |t|e|x|t| |║+0&#ffd7ff255| |n|o| |w|o|r|d|s| |h|e|r|e| |║| +0#4040ff13#ffffff0@10 +|~| @23| +0#0000001#ffd7ff255|t|h|a|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| |╚|═@14|⇲| +0#4040ff13#ffffff0@10 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|-+2#0000000&@1| |U|s|e|r| |d|e|f|i|n|e|d| |c|o|m|p|l|e|t|i|o|n| |(|^|U|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |3| |o|f| |4| +0#0000000&@26 diff --git a/src/testdir/dumps/Test_popupwin_infopopup_4.dump b/src/testdir/dumps/Test_popupwin_infopopup_4.dump new file mode 100644 index 0000000000..3a15a9f7c2 --- /dev/null +++ b/src/testdir/dumps/Test_popupwin_infopopup_4.dump @@ -0,0 +1,14 @@ +|t+0&#ffffff0|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| |t|e|x|t| > @39 +|~+0#4040ff13&| @23| +0#0000001#ffd7ff255|w|r|d| @4|W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27 +|~| @23| +0#0000001#ffd7ff255|a|n|o|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27 +|~| @23| +0#0000001#ffd7ff255|n|o|a|w|r|d| @1|W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27 +|~| @23| +0#0000001#ffd7ff255|t|h|a|t|w|r|d| |W| |e|x|t|r|a| |t|e|x|t| | +0#4040ff13#ffffff0@27 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|-+2#0000000&@1| |U|s|e|r| |d|e|f|i|n|e|d| |c|o|m|p|l|e|t|i|o|n| |(|^|U|^|N|^|P|)| |B+0#e000002&|a|c|k| |a|t| |o|r|i|g|i|n|a|l| +0#0000000&@22 diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim index fbd32be20f..5de7255af0 100644 --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -2193,4 +2193,76 @@ func Test_previewpopup() call delete('Xheader.h') endfunc +func Test_popupmenu_info() + let lines =<< trim END + set completeopt+=preview,popup + set completefunc=CompleteFuncDict + + func CompleteFuncDict(findstart, base) + if a:findstart + if col('.') > 10 + return col('.') - 10 + endif + return 0 + endif + + return { + \ 'words': [ + \ { + \ 'word': 'aword', + \ 'abbr': 'wrd', + \ 'menu': 'extra text', + \ 'info': 'words are cool', + \ 'kind': 'W', + \ 'user_data': 'test' + \ }, + \ { + \ 'word': 'anotherword', + \ 'abbr': 'anotwrd', + \ 'menu': 'extra text', + \ 'info': "other words are\ncooler than this and some more text\nto make wrap", + \ 'kind': 'W', + \ 'user_data': 'notest' + \ }, + \ { + \ 'word': 'noinfo', + \ 'abbr': 'noawrd', + \ 'menu': 'extra text', + \ 'info': 'no words here', + \ 'kind': 'W', + \ 'user_data': 'notest' + \ }, + \ { + \ 'word': 'thatword', + \ 'abbr': 'thatwrd', + \ 'menu': 'extra text', + \ 'info': 'that word is cool', + \ 'kind': 'W', + \ 'user_data': 'notest' + \ }, + \ ] + \ } + endfunc + call setline(1, 'text text text text text text text ') + END + call writefile(lines, 'XtestInfoPopup') + let buf = RunVimInTerminal('-S XtestInfoPopup', #{rows: 14}) + call term_wait(buf, 50) + + call term_sendkeys(buf, "A\<C-X>\<C-U>") + call VerifyScreenDump(buf, 'Test_popupwin_infopopup_1', {}) + + call term_sendkeys(buf, "\<C-N>") + call VerifyScreenDump(buf, 'Test_popupwin_infopopup_2', {}) + + call term_sendkeys(buf, "\<C-N>") + call VerifyScreenDump(buf, 'Test_popupwin_infopopup_3', {}) + + call term_sendkeys(buf, "\<C-N>\<C-N>") + call VerifyScreenDump(buf, 'Test_popupwin_infopopup_4', {}) + + call StopVimInTerminal(buf) + call delete('XtestInfoPopup') +endfunc + " vim: shiftwidth=2 sts=2 |