0
0
mirror of https://github.com/vim/vim.git synced 2025-10-02 05:04:20 -04:00

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 #6690)
This commit is contained in:
Bram Moolenaar
2020-08-12 15:21:22 +02:00
parent 575f24b3f3
commit a177344dc0
5 changed files with 45 additions and 4 deletions

View File

@@ -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