Mercurial > vim
diff src/testdir/test_popupwin.vim @ 17348:d82b0cfb1e82 v8.1.1673
patch 8.1.1673: cannot easily find the popup window at a certain position
commit https://github.com/vim/vim/commit/b4f0628fc5892e1bb9f0f780af782ff47ef277ed
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jul 12 21:07:54 2019 +0200
patch 8.1.1673: cannot easily find the popup window at a certain position
Problem: Cannot easily find the popup window at a certain position.
Solution: Add popup_locate().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 12 Jul 2019 21:15:04 +0200 |
parents | b0de2e92ed46 |
children | 102ed3a26a5d |
line wrap: on
line diff
--- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -713,7 +713,7 @@ func Test_popup_time() topleft vnew call setline(1, 'hello') - call popup_create('world', { + let winid = popup_create('world', { \ 'line': 1, \ 'col': 1, \ 'minwidth': 20, @@ -723,6 +723,11 @@ func Test_popup_time() let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '') call assert_equal('world', line) + call assert_equal(winid, popup_locate(1, 1)) + call assert_equal(winid, popup_locate(1, 20)) + call assert_equal(0, popup_locate(1, 21)) + call assert_equal(0, popup_locate(2, 1)) + sleep 700m redraw let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '')