summaryrefslogtreecommitdiff
path: root/src/testdir/test_popupwin.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir/test_popupwin.vim')
-rw-r--r--src/testdir/test_popupwin.vim39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 0e2eec0aa..29b7b7df9 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -3362,6 +3362,45 @@ func Test_previewpopup()
call StopVimInTerminal(buf)
endfunc
+func Test_previewpopup_pum()
+ CheckScreendump
+ CheckFeature quickfix
+
+ let lines =<< trim END
+ let a = 3
+ let b = 1
+ echo a
+ echo b
+ call system('echo hello')
+ " the end
+ END
+ call writefile(lines, 'XpreviewText.vim', 'D')
+
+ let lines =<< trim END
+ call setline(1, ['one', 'two', 'three', 'other', 'once', 'only', 'off'])
+ set previewpopup=height:6,width:40
+ pedit XpreviewText.vim
+ END
+ call writefile(lines, 'XtestPreviewPum', 'D')
+ let buf = RunVimInTerminal('-S XtestPreviewPum', #{rows: 12})
+
+ call term_sendkeys(buf, "A o\<C-N>")
+ call VerifyScreenDump(buf, 'Test_pum_preview_1', {})
+
+ call term_sendkeys(buf, "\<C-N>")
+ call VerifyScreenDump(buf, 'Test_pum_preview_2', {})
+
+ call term_sendkeys(buf, "\<C-N>")
+ call VerifyScreenDump(buf, 'Test_pum_preview_3', {})
+
+ call term_sendkeys(buf, "\<C-N>")
+ call VerifyScreenDump(buf, 'Test_pum_preview_4', {})
+
+ call term_sendkeys(buf, "\<Esc>")
+ call StopVimInTerminal(buf)
+endfunc
+
+
func Get_popupmenu_lines()
let lines =<< trim END
set completeopt+=preview,popup