Mercurial > vim
comparison src/testdir/test_popupwin.vim @ 18512:e855058e0c23 v8.1.2250
patch 8.1.2250: CTRL-U and CTRL-D don't work in popup window
Commit: https://github.com/vim/vim/commit/30efcf3d26bd14af71cd306c4c5f9e789a7130c9
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Nov 3 22:29:38 2019 +0100
patch 8.1.2250: CTRL-U and CTRL-D don't work in popup window
Problem: CTRL-U and CTRL-D don't work in popup window.
Solution: Initialize 'scroll'. Add "lastline" in popup_getpos().
(closes #5170)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 03 Nov 2019 22:30:03 +0100 |
parents | 04a40c1514c4 |
children | 244b336b94ce |
comparison
equal
deleted
inserted
replaced
18511:96e8a23cf3e8 | 18512:e855058e0c23 |
---|---|
140 \ width: 14, | 140 \ width: 14, |
141 \ core_width: 12, | 141 \ core_width: 12, |
142 \ height: 3, | 142 \ height: 3, |
143 \ core_height: 1, | 143 \ core_height: 1, |
144 \ firstline: 1, | 144 \ firstline: 1, |
145 \ lastline: 1, | |
145 \ scrollbar: 0, | 146 \ scrollbar: 0, |
146 \ visible: 1} | 147 \ visible: 1} |
147 let winid = popup_create('hello border', #{line: 2, col: 3, border: []})", | 148 let winid = popup_create('hello border', #{line: 2, col: 3, border: []})", |
148 call assert_equal(with_border_or_padding, winid->popup_getpos()) | 149 call assert_equal(with_border_or_padding, winid->popup_getpos()) |
149 let options = popup_getoptions(winid) | 150 let options = popup_getoptions(winid) |
184 \ core_width: 10, | 185 \ core_width: 10, |
185 \ height: 5, | 186 \ height: 5, |
186 \ scrollbar: 0, | 187 \ scrollbar: 0, |
187 \ core_height: 1, | 188 \ core_height: 1, |
188 \ firstline: 1, | 189 \ firstline: 1, |
190 \ lastline: 1, | |
189 \ visible: 1}, popup_getpos(winid)) | 191 \ visible: 1}, popup_getpos(winid)) |
190 | 192 |
191 call popup_clear() | 193 call popup_clear() |
192 endfunc | 194 endfunc |
193 | 195 |
382 | 384 |
383 " Making some property change has no side effect | 385 " Making some property change has no side effect |
384 call popup_setoptions(winid, #{line: 3}) | 386 call popup_setoptions(winid, #{line: 3}) |
385 call assert_equal(0, popup_getoptions(winid).firstline) | 387 call assert_equal(0, popup_getoptions(winid).firstline) |
386 call assert_equal(10, popup_getpos(winid).firstline) | 388 call assert_equal(10, popup_getpos(winid).firstline) |
389 | |
390 " CTRL-D scrolls down half a page | |
391 let winid = popup_create(['xxx']->repeat(50), #{ | |
392 \ maxheight: 8, | |
393 \ }) | |
394 redraw | |
395 call assert_equal(1, popup_getpos(winid).firstline) | |
396 call win_execute(winid, "normal! \<C-D>") | |
397 call assert_equal(5, popup_getpos(winid).firstline) | |
398 call win_execute(winid, "normal! \<C-D>") | |
399 call assert_equal(9, popup_getpos(winid).firstline) | |
400 call win_execute(winid, "normal! \<C-U>") | |
401 call assert_equal(5, popup_getpos(winid).firstline) | |
402 | |
403 call win_execute(winid, "normal! \<C-F>") | |
404 call assert_equal(11, popup_getpos(winid).firstline) | |
405 call win_execute(winid, "normal! \<C-B>") | |
406 call assert_equal(5, popup_getpos(winid).firstline) | |
387 | 407 |
388 call popup_close(winid) | 408 call popup_close(winid) |
389 endfunc | 409 endfunc |
390 | 410 |
391 func Test_popup_noscrolloff() | 411 func Test_popup_noscrolloff() |
1793 \ minwidth: 30, | 1813 \ minwidth: 30, |
1794 \ maxwidth: 30, | 1814 \ maxwidth: 30, |
1795 \ minheight: 4, | 1815 \ minheight: 4, |
1796 \ maxheight: 4, | 1816 \ maxheight: 4, |
1797 \ firstline: 1, | 1817 \ firstline: 1, |
1818 \ lastline: 4, | |
1798 \ wrap: v:true, | 1819 \ wrap: v:true, |
1799 \ scrollbar: v:true, | 1820 \ scrollbar: v:true, |
1800 \ mapping: v:false, | 1821 \ mapping: v:false, |
1801 \ filter: funcref('Popup_filter') | 1822 \ filter: funcref('Popup_filter') |
1802 \ }) | 1823 \ }) |