comparison src/testdir/test_popupwin.vim @ 18558:e5ef5d820b5b v8.1.2273

patch 8.1.2273: wrong default when "pos" is changed with popup_atcursor() Commit: https://github.com/vim/vim/commit/4dd8fe0b4f49ec267640fb457672452825b11df0 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 9 15:33:31 2019 +0100 patch 8.1.2273: wrong default when "pos" is changed with popup_atcursor() Problem: Wrong default when "pos" is changed with popup_atcursor(). Solution: Adjust the default line and col when "pos" is not the default value. (#5151)
author Bram Moolenaar <Bram@vim.org>
date Sat, 09 Nov 2019 15:45:04 +0100
parents a6dbbedddce1
children 78e43be18f6b
comparison
equal deleted inserted replaced
18557:6b3126903e2e 18558:e5ef5d820b5b
1290 let pos = popup_getpos(winid) 1290 let pos = popup_getpos(winid)
1291 call assert_equal(2, pos.line) 1291 call assert_equal(2, pos.line)
1292 call popup_close(winid) 1292 call popup_close(winid)
1293 1293
1294 bwipe! 1294 bwipe!
1295 endfunc
1296
1297 func Test_popup_atcursor_pos()
1298 CheckScreendump
1299
1300 let lines =<< trim END
1301 call setline(1, repeat([repeat('-', 60)], 15))
1302 set so=0
1303
1304 normal 9G3|r#
1305 let winid1 = popup_atcursor(['first', 'second'], #{
1306 \ moved: [0, 0, 0],
1307 \ })
1308 normal 9G21|r&
1309 let winid1 = popup_atcursor(['FIrsT', 'SEcoND'], #{
1310 \ pos: 'botright',
1311 \ moved: [0, 0, 0],
1312 \ })
1313 normal 3G27|r%
1314 let winid1 = popup_atcursor(['fiRSt', 'seCOnd'], #{
1315 \ pos: 'topleft',
1316 \ moved: [0, 0, 0],
1317 \ })
1318 normal 3G45|r@
1319 let winid1 = popup_atcursor(['First', 'SeconD'], #{
1320 \ pos: 'topright',
1321 \ moved: [0, 0, 0],
1322 \ })
1323 END
1324 call writefile(lines, 'XtestPopupAtcursorPos')
1325 let buf = RunVimInTerminal('-S XtestPopupAtcursorPos', #{rows: 12})
1326 call VerifyScreenDump(buf, 'Test_popupwin_atcursor_pos', {})
1327
1328 " clean up
1329 call StopVimInTerminal(buf)
1330 call delete('XtestPopupAtcursorPos')
1295 endfunc 1331 endfunc
1296 1332
1297 func Test_popup_beval() 1333 func Test_popup_beval()
1298 CheckScreendump 1334 CheckScreendump
1299 CheckFeature balloon_eval_term 1335 CheckFeature balloon_eval_term