patch 8.1.1589: popup window does not indicate scroll position
Problem: Popup window does not indicate scroll position.
Solution: Add a scrollbar.
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index b4bfcef..1e8f522 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -1407,12 +1407,42 @@
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('XtestPopupScroll')
+endfunc
+
func Test_popup_settext()
if !CanRunVimInTerminal()
throw 'Skipped: cannot make screendumps'