Mercurial > vim
comparison src/testdir/test_popupwin.vim @ 17241:3ada3d207b33 v8.1.1620
patch 8.1.1620: no test for popup window with border and mask
commit https://github.com/vim/vim/commit/ba45f1f4fbff1a78ed5786c2608b0f8a76ec53c8
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jul 3 22:50:41 2019 +0200
patch 8.1.1620: no test for popup window with border and mask
Problem: No test for popup window with border and mask.
Solution: Add this popup window, fix problems.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 03 Jul 2019 23:00:09 +0200 |
parents | 2a97167854fc |
children | 13a2d3364b3f |
comparison
equal
deleted
inserted
replaced
17240:c8a73240f8aa | 17241:3ada3d207b33 |
---|---|
425 func Test_popup_with_mask() | 425 func Test_popup_with_mask() |
426 if !CanRunVimInTerminal() | 426 if !CanRunVimInTerminal() |
427 throw 'Skipped: cannot make screendumps' | 427 throw 'Skipped: cannot make screendumps' |
428 endif | 428 endif |
429 let lines =<< trim END | 429 let lines =<< trim END |
430 call setline(1, repeat([join(range(1, 42), '')], 10)) | 430 call setline(1, repeat([join(range(1, 42), '')], 13)) |
431 hi PopupColor ctermbg=lightgrey | 431 hi PopupColor ctermbg=lightgrey |
432 let winid = popup_create([ | 432 let winid = popup_create([ |
433 \ 'some text', | 433 \ 'some text', |
434 \ 'another line', | 434 \ 'another line', |
435 \], { | 435 \], { |
436 \ 'line': 2, | 436 \ 'line': 1, |
437 \ 'col': 10, | 437 \ 'col': 10, |
438 \ 'wrap': 0, | 438 \ 'wrap': 0, |
439 \ 'fixed': 1, | 439 \ 'fixed': 1, |
440 \ 'zindex': 90, | 440 \ 'zindex': 90, |
441 \ 'padding': [], | 441 \ 'padding': [], |
446 \ 'yyyyyyyyy', | 446 \ 'yyyyyyyyy', |
447 \], { | 447 \], { |
448 \ 'line': 3, | 448 \ 'line': 3, |
449 \ 'col': 18, | 449 \ 'col': 18, |
450 \ 'zindex': 20}) | 450 \ 'zindex': 20}) |
451 let winidb = popup_create([ | |
452 \ 'just one line', | |
453 \], { | |
454 \ 'line': 7, | |
455 \ 'col': 10, | |
456 \ 'wrap': 0, | |
457 \ 'fixed': 1, | |
458 \ 'close': 'button', | |
459 \ 'zindex': 90, | |
460 \ 'padding': [], | |
461 \ 'border': [], | |
462 \ 'mask': [[1,2,1,1], [-5,-1,4,4], [7,9,2,3], [3,5,5,5],[-7,-4,5,5]]}) | |
451 END | 463 END |
452 call writefile(lines, 'XtestPopupMask') | 464 call writefile(lines, 'XtestPopupMask') |
453 let buf = RunVimInTerminal('-S XtestPopupMask', {'rows': 10}) | 465 let buf = RunVimInTerminal('-S XtestPopupMask', {'rows': 13}) |
454 call VerifyScreenDump(buf, 'Test_popupwin_mask_1', {}) | 466 call VerifyScreenDump(buf, 'Test_popupwin_mask_1', {}) |
455 | 467 |
456 call term_sendkeys(buf, ":call popup_move(winid, {'col': 11, 'line': 3})\<CR>") | 468 call term_sendkeys(buf, ":call popup_move(winid, {'col': 11, 'line': 2})\<CR>") |
469 call term_sendkeys(buf, ":call popup_move(winidb, {'col': 12})\<CR>") | |
457 call VerifyScreenDump(buf, 'Test_popupwin_mask_2', {}) | 470 call VerifyScreenDump(buf, 'Test_popupwin_mask_2', {}) |
458 | 471 |
459 call term_sendkeys(buf, ":call popup_move(winid, {'col': 65, 'line': 3})\<CR>") | 472 call term_sendkeys(buf, ":call popup_move(winid, {'col': 65, 'line': 2})\<CR>") |
473 call term_sendkeys(buf, ":call popup_move(winidb, {'col': 63})\<CR>") | |
460 call VerifyScreenDump(buf, 'Test_popupwin_mask_3', {}) | 474 call VerifyScreenDump(buf, 'Test_popupwin_mask_3', {}) |
461 | 475 |
462 call term_sendkeys(buf, ":call popup_move(winid, {'pos': 'topright', 'col': 12, 'line': 3})\<CR>") | 476 call term_sendkeys(buf, ":call popup_move(winid, {'pos': 'topright', 'col': 12, 'line': 2})\<CR>") |
477 call term_sendkeys(buf, ":call popup_move(winidb, {'pos': 'topright', 'col': 12})\<CR>") | |
463 call VerifyScreenDump(buf, 'Test_popupwin_mask_4', {}) | 478 call VerifyScreenDump(buf, 'Test_popupwin_mask_4', {}) |
464 | 479 |
465 " clean up | 480 " clean up |
466 call StopVimInTerminal(buf) | 481 call StopVimInTerminal(buf) |
467 call delete('XtestPopupMask') | 482 call delete('XtestPopupMask') |