Mercurial > vim
comparison src/testdir/test_popupwin.vim @ 17580:d5e5d0fc3fa8 v8.1.1787
patch 8.1.1787: cannot resize a popup window
commit https://github.com/vim/vim/commit/9bcb70c18a740bf9d97a1420df5964618f218a89
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Aug 1 21:11:05 2019 +0200
patch 8.1.1787: cannot resize a popup window
Problem: Cannot resize a popup window.
Solution: Allow for resizing by dragging the lower right corncer.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 01 Aug 2019 21:15:07 +0200 |
parents | 8cca2654d459 |
children | 506dd2efcbb2 |
comparison
equal
deleted
inserted
replaced
17579:8c91fe192c56 | 17580:d5e5d0fc3fa8 |
---|---|
352 " create a popup that covers the command line | 352 " create a popup that covers the command line |
353 let lines =<< trim END | 353 let lines =<< trim END |
354 call setline(1, range(1, 20)) | 354 call setline(1, range(1, 20)) |
355 let winid = popup_create(['1111', '222222', '33333'], #{ | 355 let winid = popup_create(['1111', '222222', '33333'], #{ |
356 \ drag: 1, | 356 \ drag: 1, |
357 \ resize: 1, | |
357 \ border: [], | 358 \ border: [], |
358 \ line: &lines - 4, | 359 \ line: &lines - 4, |
359 \ }) | 360 \ }) |
360 func Dragit() | 361 func Dragit() |
361 call feedkeys("\<F3>\<LeftMouse>\<F4>\<LeftDrag>\<LeftRelease>", "xt") | 362 call feedkeys("\<F3>\<LeftMouse>\<F4>\<LeftDrag>\<LeftRelease>", "xt") |
362 endfunc | 363 endfunc |
363 map <silent> <F3> :call test_setmouse(&lines - 4, &columns / 2)<CR> | 364 map <silent> <F3> :call test_setmouse(&lines - 4, &columns / 2)<CR> |
364 map <silent> <F4> :call test_setmouse(&lines - 8, &columns / 2)<CR> | 365 map <silent> <F4> :call test_setmouse(&lines - 8, &columns / 2)<CR> |
366 func Resize() | |
367 call feedkeys("\<F5>\<LeftMouse>\<F6>\<LeftDrag>\<LeftRelease>", "xt") | |
368 endfunc | |
369 map <silent> <F5> :call test_setmouse(6, 41)<CR> | |
370 map <silent> <F6> :call test_setmouse(7, 45)<CR> | |
365 END | 371 END |
366 call writefile(lines, 'XtestPopupDrag') | 372 call writefile(lines, 'XtestPopupDrag') |
367 let buf = RunVimInTerminal('-S XtestPopupDrag', #{rows: 10}) | 373 let buf = RunVimInTerminal('-S XtestPopupDrag', #{rows: 10}) |
368 call VerifyScreenDump(buf, 'Test_popupwin_drag_01', {}) | 374 call VerifyScreenDump(buf, 'Test_popupwin_drag_01', {}) |
369 | 375 |
370 call term_sendkeys(buf, ":call Dragit()\<CR>") | 376 call term_sendkeys(buf, ":call Dragit()\<CR>") |
371 call VerifyScreenDump(buf, 'Test_popupwin_drag_02', {}) | 377 call VerifyScreenDump(buf, 'Test_popupwin_drag_02', {}) |
378 | |
379 call term_sendkeys(buf, ":call Resize()\<CR>") | |
380 call VerifyScreenDump(buf, 'Test_popupwin_drag_03', {}) | |
372 | 381 |
373 " clean up | 382 " clean up |
374 call StopVimInTerminal(buf) | 383 call StopVimInTerminal(buf) |
375 call delete('XtestPopupDrag') | 384 call delete('XtestPopupDrag') |
376 endfunc | 385 endfunc |