comparison src/testdir/test_mapping.vim @ 27156:67194006cad8 v8.2.4107

patch 8.2.4107: script context not restored after using <ScriptCmd> Commit: https://github.com/vim/vim/commit/a9725221ac4650b7e9219bf6e3682826fe2e0096 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 16 13:30:33 2022 +0000 patch 8.2.4107: script context not restored after using <ScriptCmd> Problem: Script context not restored after using <ScriptCmd>. Solution: Also restore context when not in a script. (closes https://github.com/vim/vim/issues/9536) Add the 'c' flag to feedkeys() to be able to test this.
author Bram Moolenaar <Bram@vim.org>
date Sun, 16 Jan 2022 14:45:03 +0100
parents 8bb07c88ac27
children 1af5263a4509
comparison
equal deleted inserted replaced
27155:1ebb45dd9232 27156:67194006cad8
2 2
3 source shared.vim 3 source shared.vim
4 source check.vim 4 source check.vim
5 source screendump.vim 5 source screendump.vim
6 source term_util.vim 6 source term_util.vim
7 source vim9.vim
7 8
8 func Test_abbreviation() 9 func Test_abbreviation()
9 " abbreviation with 0x80 should work 10 " abbreviation with 0x80 should work
10 inoreab чкпр vim 11 inoreab чкпр vim
11 call feedkeys("Goчкпр \<Esc>", "xt") 12 call feedkeys("Goчкпр \<Esc>", "xt")
1395 call delete('Xcmdtext') 1396 call delete('Xcmdtext')
1396 delfunc SelectDash 1397 delfunc SelectDash
1397 ounmap i- 1398 ounmap i-
1398 endfunc 1399 endfunc
1399 1400
1401 func Test_map_script_cmd_restore()
1402 let lines =<< trim END
1403 vim9script
1404 nnoremap <F3> <ScriptCmd>eval 1 + 2<CR>
1405 END
1406 call CheckScriptSuccess(lines)
1407 call feedkeys("\<F3>:let g:result = 3+4\<CR>", 'xtc')
1408 call assert_equal(7, g:result)
1409
1410 nunmap <F3>
1411 unlet g:result
1412 endfunc
1413
1400 " Test for using <script> with a map to remap characters in rhs 1414 " Test for using <script> with a map to remap characters in rhs
1401 func Test_script_local_remap() 1415 func Test_script_local_remap()
1402 new 1416 new
1403 inoremap <buffer> <SID>xyz mno 1417 inoremap <buffer> <SID>xyz mno
1404 inoremap <buffer> <script> abc st<SID>xyzre 1418 inoremap <buffer> <script> abc st<SID>xyzre