comparison src/testdir/test_popupwin.vim @ 17604:506dd2efcbb2 v8.1.1799

patch 8.1.1799: cannot avoid mapping for a popup window commit https://github.com/vim/vim/commit/749fa0af85232be1d44b77a09161f71cdbace62c Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 3 16:18:07 2019 +0200 patch 8.1.1799: cannot avoid mapping for a popup window Problem: Cannot avoid mapping for a popup window. Solution: Add the "mapping" property, default TRUE.
author Bram Moolenaar <Bram@vim.org>
date Sat, 03 Aug 2019 16:30:06 +0200
parents d5e5d0fc3fa8
children 2ae30dac20d6
comparison
equal deleted inserted replaced
17603:3784be49d075 17604:506dd2efcbb2
655 call assert_fails('call popup_create([#{text: "text", props: ["none"]}], {})', 'E715:') 655 call assert_fails('call popup_create([#{text: "text", props: ["none"]}], {})', 'E715:')
656 call popup_clear() 656 call popup_clear()
657 call assert_fails('call popup_create("text", #{mask: ["asdf"]})', 'E475:') 657 call assert_fails('call popup_create("text", #{mask: ["asdf"]})', 'E475:')
658 call popup_clear() 658 call popup_clear()
659 call assert_fails('call popup_create("text", #{mask: test_null_list()})', 'E475:') 659 call assert_fails('call popup_create("text", #{mask: test_null_list()})', 'E475:')
660 call assert_fails('call popup_create("text", #{mapping: []})', 'E745:')
660 call popup_clear() 661 call popup_clear()
661 endfunc 662 endfunc
662 663
663 func Test_win_execute_closing_curwin() 664 func Test_win_execute_closing_curwin()
664 split 665 split
1201 func Test_popup_menu() 1202 func Test_popup_menu()
1202 func QuitCallback(id, res) 1203 func QuitCallback(id, res)
1203 let s:cb_winid = a:id 1204 let s:cb_winid = a:id
1204 let s:cb_res = a:res 1205 let s:cb_res = a:res
1205 endfunc 1206 endfunc
1207 " mapping won't be used in popup
1208 map j k
1206 1209
1207 let winid = ShowMenu(" ", 1) 1210 let winid = ShowMenu(" ", 1)
1208 let winid = ShowMenu("j \<CR>", 2) 1211 let winid = ShowMenu("j \<CR>", 2)
1209 let winid = ShowMenu("JjK \<CR>", 2) 1212 let winid = ShowMenu("JjK \<CR>", 2)
1210 let winid = ShowMenu("jjjjjj ", 3) 1213 let winid = ShowMenu("jjjjjj ", 3)
1213 let winid = ShowMenu("X", -1) 1216 let winid = ShowMenu("X", -1)
1214 let winid = ShowMenu("\<Esc>", -1) 1217 let winid = ShowMenu("\<Esc>", -1)
1215 let winid = ShowMenu("\<C-C>", -1) 1218 let winid = ShowMenu("\<C-C>", -1)
1216 1219
1217 delfunc QuitCallback 1220 delfunc QuitCallback
1221 unmap j
1218 endfunc 1222 endfunc
1219 1223
1220 func Test_popup_menu_screenshot() 1224 func Test_popup_menu_screenshot()
1221 if !CanRunVimInTerminal() 1225 if !CanRunVimInTerminal()
1222 throw 'Skipped: cannot make screendumps' 1226 throw 'Skipped: cannot make screendumps'
2192 call VerifyScreenDump(buf, 'Test_popupwin_previewpopup_3', {}) 2196 call VerifyScreenDump(buf, 'Test_popupwin_previewpopup_3', {})
2193 2197
2194 call term_sendkeys(buf, "/another\<CR>\<C-W>}") 2198 call term_sendkeys(buf, "/another\<CR>\<C-W>}")
2195 call VerifyScreenDump(buf, 'Test_popupwin_previewpopup_4', {}) 2199 call VerifyScreenDump(buf, 'Test_popupwin_previewpopup_4', {})
2196 2200
2201 call term_sendkeys(buf, ":cd ..\<CR>:\<CR>")
2202 call VerifyScreenDump(buf, 'Test_popupwin_previewpopup_5', {})
2203
2197 call StopVimInTerminal(buf) 2204 call StopVimInTerminal(buf)
2198 call delete('Xtags') 2205 call delete('Xtags')
2199 call delete('Xtagfile') 2206 call delete('Xtagfile')
2200 call delete('XtestPreviewPopup') 2207 call delete('XtestPreviewPopup')
2201 endfunc 2208 endfunc