comparison 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
comparison
equal deleted inserted replaced
17347:21b9633e27d1 17348:d82b0cfb1e82
711 throw 'Skipped: timer feature not supported' 711 throw 'Skipped: timer feature not supported'
712 endif 712 endif
713 topleft vnew 713 topleft vnew
714 call setline(1, 'hello') 714 call setline(1, 'hello')
715 715
716 call popup_create('world', { 716 let winid = popup_create('world', {
717 \ 'line': 1, 717 \ 'line': 1,
718 \ 'col': 1, 718 \ 'col': 1,
719 \ 'minwidth': 20, 719 \ 'minwidth': 20,
720 \ 'time': 500, 720 \ 'time': 500,
721 \}) 721 \})
722 redraw 722 redraw
723 let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '') 723 let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '')
724 call assert_equal('world', line) 724 call assert_equal('world', line)
725
726 call assert_equal(winid, popup_locate(1, 1))
727 call assert_equal(winid, popup_locate(1, 20))
728 call assert_equal(0, popup_locate(1, 21))
729 call assert_equal(0, popup_locate(2, 1))
725 730
726 sleep 700m 731 sleep 700m
727 redraw 732 redraw
728 let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '') 733 let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '')
729 call assert_equal('hello', line) 734 call assert_equal('hello', line)