comparison src/testdir/test_popupwin.vim @ 29036:71b766ba26a6 v8.2.5040

patch 8.2.5040: scrollbar thumb in scrolled popup not visible Commit: https://github.com/vim/vim/commit/fc376e0b1a36a2ef153e28752c61342554386886 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 29 18:18:18 2022 +0100 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)
author Bram Moolenaar <Bram@vim.org>
date Sun, 29 May 2022 19:30:02 +0200
parents f3c014fe5c16
children ad99b7b9df13
comparison
equal deleted inserted replaced
29035:02242c8534a6 29036:71b766ba26a6
2312 call popup_close(a:winid) 2312 call popup_close(a:winid)
2313 return v:true 2313 return v:true
2314 endif 2314 endif
2315 endfunc 2315 endfunc
2316 2316
2317 def CreatePopup(text: list<string>) 2317 def CreatePopup(text: list<string>): number
2318 popup_create(text, { 2318 return popup_create(text, {
2319 \ minwidth: 30, 2319 \ minwidth: 30,
2320 \ maxwidth: 30, 2320 \ maxwidth: 30,
2321 \ minheight: 4, 2321 \ minheight: 4,
2322 \ maxheight: 4, 2322 \ maxheight: 4,
2323 \ firstline: 1, 2323 \ firstline: 1,
2340 long line long line long line long line long line long line 2340 long line long line long line long line long line long line
2341 long line long line long line long line long line long line 2341 long line long line long line long line long line long line
2342 END 2342 END
2343 call CreatePopup(text) 2343 call CreatePopup(text)
2344 endfunc 2344 endfunc
2345 func ScrollBottom()
2346 call popup_clear()
2347 let id = CreatePopup(range(20)->map({k, v -> string(v)}))
2348 call popup_setoptions(id, #{firstline: 20})
2349 endfunc
2345 map <silent> <F3> :call test_setmouse(5, 36)<CR> 2350 map <silent> <F3> :call test_setmouse(5, 36)<CR>
2346 map <silent> <F4> :call test_setmouse(4, 42)<CR> 2351 map <silent> <F4> :call test_setmouse(4, 42)<CR>
2347 map <silent> <F5> :call test_setmouse(7, 42)<CR> 2352 map <silent> <F5> :call test_setmouse(7, 42)<CR>
2348 END 2353 END
2349 call writefile(lines, 'XtestPopupScroll') 2354 call writefile(lines, 'XtestPopupScroll')
2394 call VerifyScreenDump(buf, 'Test_popupwin_scroll_11', {}) 2399 call VerifyScreenDump(buf, 'Test_popupwin_scroll_11', {})
2395 2400
2396 " check size with wrapping lines 2401 " check size with wrapping lines
2397 call term_sendkeys(buf, "j") 2402 call term_sendkeys(buf, "j")
2398 call VerifyScreenDump(buf, 'Test_popupwin_scroll_12', {}) 2403 call VerifyScreenDump(buf, 'Test_popupwin_scroll_12', {})
2404
2405 " check thumb when scrolled all the way down
2406 call term_sendkeys(buf, ":call ScrollBottom()\<CR>")
2407 call VerifyScreenDump(buf, 'Test_popupwin_scroll_13', {})
2399 2408
2400 " clean up 2409 " clean up
2401 call term_sendkeys(buf, "x") 2410 call term_sendkeys(buf, "x")
2402 call StopVimInTerminal(buf) 2411 call StopVimInTerminal(buf)
2403 call delete('XtestPopupScroll') 2412 call delete('XtestPopupScroll')