summaryrefslogtreecommitdiff
path: root/src/testdir/test_popupwin.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-10-16 22:17:07 +0200
committerBram Moolenaar <Bram@vim.org>2019-10-16 22:17:07 +0200
commit7b3d93966709998011e2eb3b84414ff454161b37 (patch)
treef5f4d431fb4460b32784b72c90c21d94e1cfa230 /src/testdir/test_popupwin.vim
parentb2fe1d676f28af92989a842d4e8708dddf157b3d (diff)
downloadvim-git-7b3d93966709998011e2eb3b84414ff454161b37.tar.gz
patch 8.1.2164: stuck when using "j" in a popupwin with popup_filter_menuv8.1.2164
Problem: Stuck when using "j" in a popupwin with popup_filter_menu if a line wraps. Solution: Check the cursor line is visible. (closes #4577)
Diffstat (limited to 'src/testdir/test_popupwin.vim')
-rw-r--r--src/testdir/test_popupwin.vim32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 771db9a69..e84527bf7 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -509,6 +509,38 @@ func Test_popup_close_with_mouse()
call delete('XtestPopupClose')
endfunction
+func Test_popup_menu_wrap()
+ CheckScreendump
+
+ let lines =<< trim END
+ call setline(1, range(1, 20))
+ call popup_create([
+ \ 'one',
+ \ 'asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfas',
+ \ 'three',
+ \ 'four',
+ \ ], #{
+ \ pos: "botleft",
+ \ border: [],
+ \ padding: [0,1,0,1],
+ \ maxheight: 3,
+ \ cursorline: 1,
+ \ filter: 'popup_filter_menu',
+ \ })
+ END
+ call writefile(lines, 'XtestPopupWrap')
+ let buf = RunVimInTerminal('-S XtestPopupWrap', #{rows: 10})
+ call VerifyScreenDump(buf, 'Test_popupwin_wrap_1', {})
+
+ call term_sendkeys(buf, "jj")
+ call VerifyScreenDump(buf, 'Test_popupwin_wrap_2', {})
+
+ " clean up
+ call term_sendkeys(buf, "\<Esc>")
+ call StopVimInTerminal(buf)
+ call delete('XtestPopupWrap')
+endfunction
+
func Test_popup_with_mask()
CheckScreendump