comparison src/testdir/test_popupwin.vim @ 16898:16fd1bb2e675 v8.1.1450

patch 8.1.1450: popup window positioning wrong when using padding or borders commit https://github.com/vim/vim/commit/399d898ac1e6e587088b5bdd6e36eca4998bc1eb Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 2 15:34:29 2019 +0200 patch 8.1.1450: popup window positioning wrong when using padding or borders Problem: Popup window positioning wrong when using padding or borders. Solution: Fix computing the position.
author Bram Moolenaar <Bram@vim.org>
date Sun, 02 Jun 2019 15:45:05 +0200
parents 52fc577a087d
children 23645f9a5ce2
comparison
equal deleted inserted replaced
16897:84c04459c23d 16898:16fd1bb2e675
171 call VerifyScreenDump(buf, 'Test_popupwin_11', {}) 171 call VerifyScreenDump(buf, 'Test_popupwin_11', {})
172 172
173 " clean up 173 " clean up
174 call StopVimInTerminal(buf) 174 call StopVimInTerminal(buf)
175 call delete('XtestPopup') 175 call delete('XtestPopup')
176 endfunc
177
178 func Test_popup_all_corners()
179 if !CanRunVimInTerminal()
180 return
181 endif
182 let lines =<< trim END
183 call setline(1, repeat([repeat('-', 60)], 15))
184 set so=0
185 normal 2G3|r#
186 let winid1 = popup_create(['first', 'second'], {
187 \ 'line': 'cursor+1',
188 \ 'col': 'cursor',
189 \ 'pos': 'topleft',
190 \ 'border': [],
191 \ 'padding': [],
192 \ })
193 normal 25|r@
194 let winid1 = popup_create(['First', 'SeconD'], {
195 \ 'line': 'cursor+1',
196 \ 'col': 'cursor',
197 \ 'pos': 'topright',
198 \ 'border': [],
199 \ 'padding': [],
200 \ })
201 normal 9G29|r%
202 let winid1 = popup_create(['fiRSt', 'seCOnd'], {
203 \ 'line': 'cursor-1',
204 \ 'col': 'cursor',
205 \ 'pos': 'botleft',
206 \ 'border': [],
207 \ 'padding': [],
208 \ })
209 normal 51|r&
210 let winid1 = popup_create(['FIrsT', 'SEcoND'], {
211 \ 'line': 'cursor-1',
212 \ 'col': 'cursor',
213 \ 'pos': 'botright',
214 \ 'border': [],
215 \ 'padding': [],
216 \ })
217 END
218 call writefile(lines, 'XtestPopupCorners')
219 let buf = RunVimInTerminal('-S XtestPopupCorners', {'rows': 12})
220 call VerifyScreenDump(buf, 'Test_popupwin_corners', {})
221
222 " clean up
223 call StopVimInTerminal(buf)
224 call delete('XtestPopupCorners')
176 endfunc 225 endfunc
177 226
178 func Test_win_execute_closing_curwin() 227 func Test_win_execute_closing_curwin()
179 split 228 split
180 let winid = popup_create('some text', {}) 229 let winid = popup_create('some text', {})