patch 8.2.5040: scrollbar thumb in scrolled popup not visible
Problem: Scrollbar thumb in scrolled popup not visible.
Solution: Show at least one thumb character. (fixes 10492)
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index a78816b..d3a57b0 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -2314,8 +2314,8 @@
endif
endfunc
- def CreatePopup(text: list<string>)
- popup_create(text, {
+ def CreatePopup(text: list<string>): number
+ return popup_create(text, {
\ minwidth: 30,
\ maxwidth: 30,
\ minheight: 4,
@@ -2342,6 +2342,11 @@
END
call CreatePopup(text)
endfunc
+ func ScrollBottom()
+ call popup_clear()
+ let id = CreatePopup(range(20)->map({k, v -> string(v)}))
+ call popup_setoptions(id, #{firstline: 20})
+ endfunc
map <silent> <F3> :call test_setmouse(5, 36)<CR>
map <silent> <F4> :call test_setmouse(4, 42)<CR>
map <silent> <F5> :call test_setmouse(7, 42)<CR>
@@ -2397,6 +2402,10 @@
call term_sendkeys(buf, "j")
call VerifyScreenDump(buf, 'Test_popupwin_scroll_12', {})
+ " check thumb when scrolled all the way down
+ call term_sendkeys(buf, ":call ScrollBottom()\<CR>")
+ call VerifyScreenDump(buf, 'Test_popupwin_scroll_13', {})
+
" clean up
call term_sendkeys(buf, "x")
call StopVimInTerminal(buf)