| " Tests for popup windows |
| |
| if !has('textprop') |
| finish |
| endif |
| |
| source screendump.vim |
| |
| func Test_simple_popup() |
| if !CanRunVimInTerminal() |
| return |
| endif |
| call writefile([ |
| \ "call setline(1, range(1, 100))", |
| \ "let winid = popup_create('hello there', {'line': 3, 'col': 11})", |
| \ "hi PopupColor ctermbg=lightblue", |
| \ "call setwinvar(winid, '&wincolor', 'PopupColor')", |
| \ "let winid2 = popup_create(['another one', 'another two', 'another three'], {'line': 3, 'col': 25})", |
| \], 'XtestPopup') |
| let buf = RunVimInTerminal('-S XtestPopup', {'rows': 10}) |
| call VerifyScreenDump(buf, 'Test_popupwin_01', {}) |
| |
| " Add a tabpage |
| call term_sendkeys(buf, ":tabnew\<CR>") |
| call term_sendkeys(buf, ":call popup_create('other tab', {'line': 4, 'col': 9})\<CR>") |
| call VerifyScreenDump(buf, 'Test_popupwin_02', {}) |
| |
| " switch back to first tabpage |
| call term_sendkeys(buf, "gt") |
| call VerifyScreenDump(buf, 'Test_popupwin_03', {}) |
| |
| " close that tabpage |
| call term_sendkeys(buf, ":quit!\<CR>") |
| call VerifyScreenDump(buf, 'Test_popupwin_04', {}) |
| |
| " clean up |
| call StopVimInTerminal(buf) |
| call delete('XtestPopup') |
| endfunc |