diff src/testdir/test_popupwin.vim @ 18339:a776385eac9f v8.1.2164

patch 8.1.2164: stuck when using "j" in a popupwin with popup_filter_menu Commit: https://github.com/vim/vim/commit/7b3d93966709998011e2eb3b84414ff454161b37 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Oct 16 22:17:07 2019 +0200 patch 8.1.2164: stuck when using "j" in a popupwin with popup_filter_menu 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)
author Bram Moolenaar <Bram@vim.org>
date Wed, 16 Oct 2019 22:30:04 +0200
parents 25535ef50842
children ba5d8c5d77d7
line wrap: on
line diff
--- 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