Mercurial > vim
comparison src/testdir/test_popupwin.vim @ 21713:b997e872ff95 v8.2.1406
patch 8.2.1406: popupwindow lacks scrollbar if no "maxheight" is used
Commit: https://github.com/vim/vim/commit/a1b9b0cc011ef15869ac25cb93e1b4baa0cb7f38
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 9 16:37:48 2020 +0200
patch 8.2.1406: popupwindow lacks scrollbar if no "maxheight" is used
Problem: Popupwindow lacks scrollbar if no "maxheight" is used.
Solution: Compute the max height depending on the position. (closes https://github.com/vim/vim/issues/6664)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 09 Aug 2020 16:45:04 +0200 |
parents | cbc570e66d11 |
children | f2ba8ebbab2b |
comparison
equal
deleted
inserted
replaced
21712:5294e38bd231 | 21713:b997e872ff95 |
---|---|
2142 call term_sendkeys(buf, "x") | 2142 call term_sendkeys(buf, "x") |
2143 call StopVimInTerminal(buf) | 2143 call StopVimInTerminal(buf) |
2144 call delete('XtestPopupScroll') | 2144 call delete('XtestPopupScroll') |
2145 endfunc | 2145 endfunc |
2146 | 2146 |
2147 func Test_popup_too_high_scrollbar() | |
2148 CheckScreendump | |
2149 | |
2150 let lines =<< trim END | |
2151 call setline(1, range(1, 20)->map({i, v -> repeat(v, 10)})) | |
2152 set scrolloff=0 | |
2153 func ShowPopup() | |
2154 let winid = popup_atcursor(['one', 'two', 'three', 'four', 'five', | |
2155 \ 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve'], #{ | |
2156 \ minwidth: 8, | |
2157 \ border: [], | |
2158 \ }) | |
2159 endfunc | |
2160 normal 3G$ | |
2161 call ShowPopup() | |
2162 END | |
2163 call writefile(lines, 'XtestPopupToohigh') | |
2164 let buf = RunVimInTerminal('-S XtestPopupToohigh', #{rows: 10}) | |
2165 call VerifyScreenDump(buf, 'Test_popupwin_toohigh_1', {}) | |
2166 | |
2167 call term_sendkeys(buf, ":call popup_clear()\<CR>") | |
2168 call term_sendkeys(buf, "8G$") | |
2169 call term_sendkeys(buf, ":call ShowPopup()\<CR>") | |
2170 call VerifyScreenDump(buf, 'Test_popupwin_toohigh_2', {}) | |
2171 | |
2172 " clean up | |
2173 call StopVimInTerminal(buf) | |
2174 call delete('XtestPopupToohigh') | |
2175 endfunc | |
2176 | |
2147 func Test_popup_fitting_scrollbar() | 2177 func Test_popup_fitting_scrollbar() |
2148 " this was causing a crash, divide by zero | 2178 " this was causing a crash, divide by zero |
2149 let winid = popup_create([ | 2179 let winid = popup_create([ |
2150 \ 'one', 'two', 'longer line that wraps', 'four', 'five'], #{ | 2180 \ 'one', 'two', 'longer line that wraps', 'four', 'five'], #{ |
2151 \ scrollbar: 1, | 2181 \ scrollbar: 1, |