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.vim52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 6bfc6dd43..dc2274346 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -2982,6 +2982,58 @@ func Test_popupmenu_info_hidden()
call delete('XtestInfoPopupHidden')
endfunc
+func Test_popupmenu_info_too_wide()
+ CheckScreendump
+ CheckFeature quickfix
+
+ let lines =<< trim END
+ call setline(1, range(10))
+
+ set completeopt+=preview,popup
+ set completepopup=align:menu
+ set omnifunc=OmniFunc
+ hi InfoPopup ctermbg=lightgrey
+
+ func OmniFunc(findstart, base)
+ if a:findstart
+ return 0
+ endif
+
+ let menuText = 'some long text to make sure the menu takes up all of the width of the window'
+ return #{
+ \ words: [
+ \ #{
+ \ word: 'scrap',
+ \ menu: menuText,
+ \ info: "other words are\ncooler than this and some more text\nto make wrap",
+ \ },
+ \ #{
+ \ word: 'scappier',
+ \ menu: menuText,
+ \ info: 'words are cool',
+ \ },
+ \ #{
+ \ word: 'scrappier2',
+ \ menu: menuText,
+ \ info: 'words are cool',
+ \ },
+ \ ]
+ \ }
+ endfunc
+ END
+
+ call writefile(lines, 'XtestInfoPopupWide')
+ let buf = RunVimInTerminal('-S XtestInfoPopupWide', #{rows: 8})
+ call term_wait(buf, 50)
+
+ call term_sendkeys(buf, "Ascr\<C-X>\<C-O>")
+ call VerifyScreenDump(buf, 'Test_popupwin_infopopup_wide_1', {})
+
+ call term_sendkeys(buf, "\<Esc>")
+ call StopVimInTerminal(buf)
+ call delete('XtestInfoPopupWide')
+endfunc
+
func Test_popupwin_recycle_bnr()
let bufnr = popup_notification('nothing wrong', {})->winbufnr()
call popup_clear()