comparison src/testdir/test_popupwin.vim @ 16809:5ff14f96f1c9 v8.1.1406

patch 8.1.1406: popup_hide() and popup_show() not implemented yet commit https://github.com/vim/vim/commit/2cd0dce898995a2b05f7285a70efec3f67f579f5 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 26 22:17:52 2019 +0200 patch 8.1.1406: popup_hide() and popup_show() not implemented yet Problem: popup_hide() and popup_show() not implemented yet. Solution: Implement the functions.
author Bram Moolenaar <Bram@vim.org>
date Sun, 26 May 2019 22:30:05 +0200
parents 306766ed0f70
children 0457d49eb2d9
comparison
equal deleted inserted replaced
16808:c002c4899529 16809:5ff14f96f1c9
74 let line = join(map(range(1, 30), 'screenstring(&lines, v:val)'), '') 74 let line = join(map(range(1, 30), 'screenstring(&lines, v:val)'), '')
75 call assert_notmatch('.*on the command line.*', line) 75 call assert_notmatch('.*on the command line.*', line)
76 76
77 bwipe! 77 bwipe!
78 endfunc 78 endfunc
79
80 func Test_popup_hide()
81 topleft vnew
82 call setline(1, 'hello')
83
84 let winid = popup_create('world', {
85 \ 'line': 1,
86 \ 'col': 1,
87 \})
88 redraw
89 let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '')
90 call assert_equal('world', line)
91
92 call popup_hide(winid)
93 redraw
94 let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '')
95 call assert_equal('hello', line)
96
97 call popup_show(winid)
98 redraw
99 let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '')
100 call assert_equal('world', line)
101
102
103 call popup_close(winid)
104 redraw
105 let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '')
106 call assert_equal('hello', line)
107
108 " error is given for existing non-popup window
109 call assert_fails('call popup_hide(win_getid())', 'E993:')
110
111 " no error non-existing window
112 call popup_hide(1234234)
113 call popup_show(41234234)
114
115 bwipe!
116 endfunc