Mercurial > vim
diff src/testdir/test_popupwin.vim @ 17119:b439e096a011 v8.1.1559
patch 8.1.1559: popup window title property not implemented yet
commit https://github.com/vim/vim/commit/eb2310d47d83764a61d63cd5c2788870d7f6eddf
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 16 20:09:10 2019 +0200
patch 8.1.1559: popup window title property not implemented yet
Problem: Popup window title property not implemented yet.
Solution: Implement the title property.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 16 Jun 2019 20:15:05 +0200 |
parents | 7ef5283ace3c |
children | 808ea76535a9 |
line wrap: on
line diff
--- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -940,7 +940,7 @@ func Test_popup_menu_screenshot() let lines =<< trim END call setline(1, range(1, 20)) hi PopupSelected ctermbg=lightblue - call popup_menu(['one', 'two', 'another'], {'callback': 'MenuDone'}) + call popup_menu(['one', 'two', 'another'], {'callback': 'MenuDone', 'title': ' make a choice from the list '}) func MenuDone(id, res) echomsg "selected " .. a:res endfunc @@ -960,6 +960,26 @@ func Test_popup_menu_screenshot() call delete('XtestPopupMenu') endfunc +func Test_popup_title() + if !CanRunVimInTerminal() + throw 'Skipped: cannot make screendumps' + endif + + " Create a popup without title or border, a line of padding will be added to + " put the title on. + let lines =<< trim END + call setline(1, range(1, 20)) + call popup_create(['one', 'two', 'another'], {'title': 'Title String'}) + END + call writefile(lines, 'XtestPopupTitle') + let buf = RunVimInTerminal('-S XtestPopupTitle', {'rows': 10}) + call VerifyScreenDump(buf, 'Test_popupwin_title', {}) + + " clean up + call StopVimInTerminal(buf) + call delete('XtestPopupTitle') +endfunc + func Test_popup_close_callback() func PopupDone(id, result) let g:result = a:result