New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vim9: cannot refer to exported autoload function via dot notation without sourcing its script too early #9578
Comments
Sorry, it might not be easy to understand the purpose of the 3 shell commands. They test these assignments:
Summary of the results:
Notice that the 2 tables are inconsistent. The right cell gives identical results on the first line, but not on the 2nd and 3rd lines. |
If you use the completion it is normal the autoload script is actually loaded. But when setting 'thesaurusfunc' to an autoloaded function it should not be loaded yet. it appears that it does happen with just this:
It should be possible to avoid that. |
Actually, using the assignment style won't work, because the expression will be evaluated, causing the autoload script to be loaded. Using a string should work though. |
Steps to reproduce
Run this shell command:
It takes 5 seconds for Vim to start, then the completion menu is opened.
Run this other shell command:
Vim starts immediately, but
E117
is given:Run this last shell command:
Vim starts after 5 seconds, and
E117
is given:Expected behavior
In at least one of these shell commands, Vim starts immediately, then sleeps for 5 seconds, then opens the completion menu. Otherwise, it means we have no way to refer to an exported autoload function via the Vim9 dot notation without sourcing its script too early, which defeats the whole purpose of writing it inside an autoload script in the first place.
Version of Vim
8.2 Included patches: 1-4162
Environment
Operating system: Ubuntu 20.04.3 LTS
Terminal: xterm
Value of $TERM: xterm-256color
Shell: zsh 5.8
Additional context
If we refer to the autoload function via the legacy name
completion#ThesaurusFunc()
, then we can get the desired result simply by quoting the name:Test:
The text was updated successfully, but these errors were encountered: