Mercurial > vim
diff src/testdir/test_popupwin.vim @ 17180:8581779aa16f v8.1.1589
patch 8.1.1589: popup window does not indicate scroll position
commit https://github.com/vim/vim/commit/75fb0854e93913c4d2cfcd6ef634173c4d13a093
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jun 25 05:15:58 2019 +0200
patch 8.1.1589: popup window does not indicate scroll position
Problem: Popup window does not indicate scroll position.
Solution: Add a scrollbar.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 25 Jun 2019 05:30:06 +0200 |
parents | 6990c1160ea5 |
children | a47ea7d2fe6d |
line wrap: on
line diff
--- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -1407,10 +1407,40 @@ func Test_notifications() call term_sendkeys(buf, ":call popup_notification('another important notification', {})\<CR>") call VerifyScreenDump(buf, 'Test_popupwin_notify_02', {}) + " clean up + call StopVimInTerminal(buf) + call delete('XtestNotifications') +endfunc + +func Test_popup_scrollbar() + if !CanRunVimInTerminal() + throw 'Skipped: cannot make screendumps' + endif + + let lines =<< trim END + call setline(1, range(1, 20)) + let winid = popup_create(['one', 'two', 'three', 'four', 'five', + \ 'six', 'seven', 'eight', 'nine'], { + \ 'minwidth': 8, + \ 'maxheight': 4, + \ }) + END + call writefile(lines, 'XtestPopupScroll') + let buf = RunVimInTerminal('-S XtestPopupScroll', {'rows': 10}) + call VerifyScreenDump(buf, 'Test_popupwin_scroll_1', {}) + + call term_sendkeys(buf, ":call popup_setoptions(winid, {'firstline': 2})\<CR>") + call VerifyScreenDump(buf, 'Test_popupwin_scroll_2', {}) + + call term_sendkeys(buf, ":call popup_setoptions(winid, {'firstline': 6})\<CR>") + call VerifyScreenDump(buf, 'Test_popupwin_scroll_3', {}) + + call term_sendkeys(buf, ":call popup_setoptions(winid, {'firstline': 9})\<CR>") + call VerifyScreenDump(buf, 'Test_popupwin_scroll_4', {}) " clean up call StopVimInTerminal(buf) - call delete('XtestNotifications') + call delete('XtestPopupScroll') endfunc func Test_popup_settext()