Mercurial > vim
diff src/testdir/test_popupwin.vim @ 16800:12e3a3afdb6a v8.1.1402
patch 8.1.1402: "timer" option of popup windows not supported
commit https://github.com/vim/vim/commit/51fe3b14f63da2b985bcd7b4c50fbe34ae84ea48
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 26 20:10:06 2019 +0200
patch 8.1.1402: "timer" option of popup windows not supported
Problem: "timer" option of popup windows not supported.
Solution: Implement the "timer" option. (Yasuhiro Matsumoto, closes https://github.com/vim/vim/issues/4439)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 26 May 2019 20:15:05 +0200 |
parents | ddfa924df50d |
children | f5487021fdad |
line wrap: on
line diff
--- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -37,3 +37,37 @@ func Test_simple_popup() call StopVimInTerminal(buf) call delete('XtestPopup') endfunc + +func Test_popup_time() + topleft vnew + call setline(1, 'hello') + + call popup_create('world', { + \ 'line': 1, + \ 'col': 1, + \ 'time': 500, + \}) + redraw + let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '') + call assert_equal('world', line) + + sleep 700m + let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '') + call assert_equal('hello', line) + + call popup_create('on the command line', { + \ 'line': &lines, + \ 'col': 10, + \ 'time': 500, + \}) + redraw + let line = join(map(range(1, 30), 'screenstring(&lines, v:val)'), '') + call assert_match('.*on the command line.*', line) + + sleep 700m + redraw + let line = join(map(range(1, 30), 'screenstring(&lines, v:val)'), '') + call assert_notmatch('.*on the command line.*', line) + + bwipe! +endfunc