Mercurial > vim
diff src/testdir/test_vim9_expr.vim @ 21753:9ef7ae8ab51c v8.2.1426
patch 8.2.1426: Vim9: cannot call autoload function in :def function
Commit: https://github.com/vim/vim/commit/a177344dc0c337e5b272c1c59d13964a8318bcfa
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Aug 12 15:21:22 2020 +0200
patch 8.2.1426: Vim9: cannot call autoload function in :def function
Problem: Vim9: cannot call autoload function in :def function.
Solution: Load the autoload script. (closes https://github.com/vim/vim/issues/6690)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 12 Aug 2020 15:30:04 +0200 |
parents | caf0286cf02b |
children | 25b659fa5ca5 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -1752,6 +1752,21 @@ def Test_expr7_call() "vim9script", "let x = substitute ('x', 'x', 'x', 'x')" ], 'E121:') + + let auto_lines =<< trim END + def g:some#func(): string + return 'found' + enddef + END + mkdir('Xruntime/autoload', 'p') + writefile(auto_lines, 'Xruntime/autoload/some.vim') + let save_rtp = &rtp + &rtp = getcwd() .. '/Xruntime,' .. &rtp + assert_equal('found', g:some#func()) + assert_equal('found', some#func()) + + &rtp = save_rtp + delete('Xruntime', 'rf') enddef