summaryrefslogtreecommitdiff
path: root/src/testdir/test_popupwin.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-30 19:25:06 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-30 19:25:06 +0200
commitcc31ad9f9b601d53926b96586bd6b40602d57951 (patch)
tree2cc83563ea3db6176c37a922068c262777d8217f /src/testdir/test_popupwin.vim
parent54fabd4b5e373c7f1d794d24d27a30a8bac84da1 (diff)
downloadvim-git-cc31ad9f9b601d53926b96586bd6b40602d57951.tar.gz
patch 8.1.1428: popup_atcursor() not implemented yetv8.1.1428
Problem: Popup_atcursor() not implemented yet. Solution: Implement it. (Yasuhiro Matsumoto, closes #4456)
Diffstat (limited to 'src/testdir/test_popupwin.vim')
-rw-r--r--src/testdir/test_popupwin.vim49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index d92d8b12a..ee188e39c 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -335,3 +335,52 @@ func Test_popup_option_values()
call popup_close(winid)
bwipe
endfunc
+
+func Test_popup_atcursor()
+ topleft vnew
+ call setline(1, [
+ \ 'xxxxxxxxxxxxxxxxx',
+ \ 'xxxxxxxxxxxxxxxxx',
+ \ 'xxxxxxxxxxxxxxxxx',
+ \])
+
+ call cursor(2, 2)
+ redraw
+ let winid = popup_atcursor('vim', {})
+ redraw
+ let line = join(map(range(1, 17), 'screenstring(1, v:val)'), '')
+ call assert_equal('xvimxxxxxxxxxxxxx', line)
+ call popup_close(winid)
+
+ call cursor(3, 4)
+ redraw
+ let winid = popup_atcursor('vim', {})
+ redraw
+ let line = join(map(range(1, 17), 'screenstring(2, v:val)'), '')
+ call assert_equal('xxxvimxxxxxxxxxxx', line)
+ call popup_close(winid)
+
+ call cursor(1, 1)
+ redraw
+ let winid = popup_create('vim', {
+ \ 'line': 'cursor+2',
+ \ 'col': 'cursor+1',
+ \})
+ redraw
+ let line = join(map(range(1, 17), 'screenstring(3, v:val)'), '')
+ call assert_equal('xvimxxxxxxxxxxxxx', line)
+ call popup_close(winid)
+
+ call cursor(3, 3)
+ redraw
+ let winid = popup_create('vim', {
+ \ 'line': 'cursor-2',
+ \ 'col': 'cursor-1',
+ \})
+ redraw
+ let line = join(map(range(1, 17), 'screenstring(1, v:val)'), '')
+ call assert_equal('xvimxxxxxxxxxxxxx', line)
+ call popup_close(winid)
+
+ bwipe!
+endfunc