comparison src/testdir/test_popupwin.vim @ 17121:808ea76535a9 v8.1.1560

patch 8.1.1560: popup window hidden option not implemented yet commit https://github.com/vim/vim/commit/6313c4f41d0e1d91b4217557685c014ea919915f Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 16 20:39:13 2019 +0200 patch 8.1.1560: popup window hidden option not implemented yet Problem: Popup window hidden option not implemented yet. Solution: Implement the hidden option.
author Bram Moolenaar <Bram@vim.org>
date Sun, 16 Jun 2019 20:45:04 +0200
parents b439e096a011
children efc6f5e3b543
comparison
equal deleted inserted replaced
17120:d6f065ba684d 17121:808ea76535a9
1308 " clean up 1308 " clean up
1309 call StopVimInTerminal(buf) 1309 call StopVimInTerminal(buf)
1310 call delete('XtestNotifications') 1310 call delete('XtestNotifications')
1311 endfunc 1311 endfunc
1312 1312
1313 function Test_popup_settext() 1313 func Test_popup_settext()
1314 if !CanRunVimInTerminal() 1314 if !CanRunVimInTerminal()
1315 throw 'Skipped: cannot make screendumps' 1315 throw 'Skipped: cannot make screendumps'
1316 endif 1316 endif
1317 1317
1318 let lines =<< trim END 1318 let lines =<< trim END
1350 call VerifyScreenDump(buf, 'Test_popup_settext_06', {}) 1350 call VerifyScreenDump(buf, 'Test_popup_settext_06', {})
1351 1351
1352 " clean up 1352 " clean up
1353 call StopVimInTerminal(buf) 1353 call StopVimInTerminal(buf)
1354 call delete('XtestPopupSetText') 1354 call delete('XtestPopupSetText')
1355 endfunction 1355 endfunc
1356
1357 func Test_popup_hidden()
1358 new
1359
1360 let winid = popup_atcursor('text', {'hidden': 1})
1361 redraw
1362 call assert_equal(0, popup_getpos(winid).visible)
1363 call popup_close(winid)
1364
1365 let winid = popup_create('text', {'hidden': 1})
1366 redraw
1367 call assert_equal(0, popup_getpos(winid).visible)
1368 call popup_close(winid)
1369
1370 func QuitCallback(id, res)
1371 let s:cb_winid = a:id
1372 let s:cb_res = a:res
1373 endfunc
1374 let winid = popup_dialog('make a choice', {'hidden': 1,
1375 \ 'filter': 'popup_filter_yesno',
1376 \ 'callback': 'QuitCallback',
1377 \ })
1378 redraw
1379 call assert_equal(0, popup_getpos(winid).visible)
1380 exe "normal anot used by filter\<Esc>"
1381 call assert_equal('not used by filter', getline(1))
1382
1383 call popup_show(winid)
1384 call feedkeys('y', "xt")
1385 call assert_equal(1, s:cb_res)
1386
1387 bwipe!
1388 delfunc QuitCallback
1389 endfunc