comparison src/testdir/test_popupwin.vim @ 28279:8ef5c996df31 v8.2.4665

patch 8.2.4665: popup with "minwidth" and scrollbar not updated properly Commit: https://github.com/vim/vim/commit/eabddc425ea23fb91b3b0058ff01e9e4ede53351 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 2 15:32:16 2022 +0100 patch 8.2.4665: popup with "minwidth" and scrollbar not updated properly Problem: Popup with "minwidth" and scrollbar not updated properly. Solution: Adjust the computation if the window width. (closes https://github.com/vim/vim/issues/10061)
author Bram Moolenaar <Bram@vim.org>
date Sat, 02 Apr 2022 16:45:03 +0200
parents a14c4d3e3260
children 427600f3b1c5
comparison
equal deleted inserted replaced
28278:c943820b9c01 28279:8ef5c996df31
608 " dragging without border 608 " dragging without border
609 call term_sendkeys(buf, ":call DragAllStart()\<CR>") 609 call term_sendkeys(buf, ":call DragAllStart()\<CR>")
610 call VerifyScreenDump(buf, 'Test_popupwin_drag_05', {}) 610 call VerifyScreenDump(buf, 'Test_popupwin_drag_05', {})
611 call term_sendkeys(buf, ":call DragAllDrag()\<CR>") 611 call term_sendkeys(buf, ":call DragAllDrag()\<CR>")
612 call VerifyScreenDump(buf, 'Test_popupwin_drag_06', {}) 612 call VerifyScreenDump(buf, 'Test_popupwin_drag_06', {})
613
614 " clean up
615 call StopVimInTerminal(buf)
616 call delete('XtestPopupDrag')
617 endfunc
618
619 func Test_popup_drag_minwidth()
620 CheckScreendump
621
622 " create a popup that does not fit
623 let lines =<< trim END
624 call range(40)
625 \ ->map({_,i -> string(i)})
626 \ ->popup_create({
627 \ 'drag': 1,
628 \ 'wrap': 0,
629 \ 'border': [],
630 \ 'scrollbar': 1,
631 \ 'minwidth': 100,
632 \ 'filter': {w, k -> k ==# 'q' ? len([popup_close(w)]) : 0},
633 \ })
634 func DragitDown()
635 map <silent> <F3> :call test_setmouse(1, 10)<CR>
636 map <silent> <F4> :call test_setmouse(5, 40)<CR>
637 call feedkeys("\<F3>\<LeftMouse>\<F4>\<LeftDrag>\<LeftRelease>", "xt")
638 endfunc
639 func DragitUp()
640 map <silent> <F3> :call test_setmouse(5, 40)<CR>
641 map <silent> <F4> :call test_setmouse(4, 40)<CR>
642 map <silent> <F5> :call test_setmouse(3, 40)<CR>
643 call feedkeys("\<F3>\<LeftMouse>\<F4>\<LeftDrag>\<F5>\<LeftDrag>\<LeftRelease>", "xt")
644 endfunc
645 END
646 call writefile(lines, 'XtestPopupDrag')
647 let buf = RunVimInTerminal('-S XtestPopupDrag', #{rows: 10})
648 call VerifyScreenDump(buf, 'Test_popupwin_drag_minwidth_1', {})
649
650 call term_sendkeys(buf, ":call DragitDown()\<CR>")
651 call VerifyScreenDump(buf, 'Test_popupwin_drag_minwidth_2', {})
652
653 call term_sendkeys(buf, ":call DragitUp()\<CR>")
654 call VerifyScreenDump(buf, 'Test_popupwin_drag_minwidth_3', {})
655
656 call term_sendkeys(buf, 'q')
613 657
614 " clean up 658 " clean up
615 call StopVimInTerminal(buf) 659 call StopVimInTerminal(buf)
616 call delete('XtestPopupDrag') 660 call delete('XtestPopupDrag')
617 endfunc 661 endfunc