comparison src/testdir/test_vim9_script.vim @ 27002:cf5b5e95f62b v8.2.4030

patch 8.2.4030: a script local funcref is not found from a mapping Commit: https://github.com/vim/vim/commit/71f21938bc9f4f6c0e52c178f51cb19be9804690 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jan 7 18:20:55 2022 +0000 patch 8.2.4030: a script local funcref is not found from a mapping Problem: A script local funcref is not found from a mapping. Solution: When looking for a function, also find a script-local funcref. (closes #9485)
author Bram Moolenaar <Bram@vim.org>
date Fri, 07 Jan 2022 19:30:03 +0100
parents 83dcff9f3a9a
children b861ae62860d
comparison
equal deleted inserted replaced
27001:d3404d1f5478 27002:cf5b5e95f62b
1660 delete('Xexport_ft.vim') 1660 delete('Xexport_ft.vim')
1661 delete('ftplugin', 'rf') 1661 delete('ftplugin', 'rf')
1662 &rtp = save_rtp 1662 &rtp = save_rtp
1663 enddef 1663 enddef
1664 1664
1665 " FIXME 1665 def Test_use_import_in_mapping()
1666 "def Test_use_import_in_mapping() 1666 var lines =<< trim END
1667 " var lines =<< trim END 1667 vim9script
1668 " vim9script 1668 export def Funcx()
1669 " export def Funcx() 1669 g:result = 42
1670 " g:result = 42 1670 enddef
1671 " enddef 1671 END
1672 " END 1672 writefile(lines, 'XsomeExport.vim')
1673 " writefile(lines, 'XsomeExport.vim') 1673 lines =<< trim END
1674 " lines =<< trim END 1674 vim9script
1675 " vim9script 1675 import './XsomeExport.vim' as some
1676 " import './XsomeExport.vim' as some 1676 var Funcy = some.Funcx
1677 " var Funcy = some.Funcx 1677 nnoremap <F3> :call <sid>Funcy()<cr>
1678 " nnoremap <F3> :call <sid>Funcy()<cr> 1678 END
1679 " END 1679 writefile(lines, 'Xmapscript.vim')
1680 " writefile(lines, 'Xmapscript.vim') 1680
1681 " 1681 source Xmapscript.vim
1682 " source Xmapscript.vim 1682 feedkeys("\<F3>", "xt")
1683 " feedkeys("\<F3>", "xt") 1683 assert_equal(42, g:result)
1684 " assert_equal(42, g:result) 1684
1685 " 1685 unlet g:result
1686 " unlet g:result 1686 delete('XsomeExport.vim')
1687 " delete('XsomeExport.vim') 1687 delete('Xmapscript.vim')
1688 " delete('Xmapscript.vim') 1688 nunmap <F3>
1689 " nunmap <F3> 1689 enddef
1690 "enddef
1691 1690
1692 def Test_vim9script_mix() 1691 def Test_vim9script_mix()
1693 var lines =<< trim END 1692 var lines =<< trim END
1694 if has(g:feature) 1693 if has(g:feature)
1695 " legacy script 1694 " legacy script