You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error detected while compiling function <SNR>17_Setup:
line 1:
E1048: Item not found in script: Foo
Type <leader>F. This echos:
autoloading foo.vim
Foo
Quit and restart vim
Type <leader>F. This echos:
autoloading foo.vim
Foo
Type <leader>S. This works this time and echos:
Foo
Notes:
Appending defcompile to the end of plugin/foo.vim produces the error on startup and then <leader>S consistently fails even if typed after <leader>F (which still works).
Replacing the call foo.Foo() in Setup() with foo#Foo() works and the autoloading foo.vim is echoed only when <leader>S is typed for the first time (if done before <leader>F of course) but in that case the import is not needed (except for the <leader>F mapping).
Expected behaviour
No error should be printed and Foo should be echoed independently of the order of invocation of the mappings.
Or the documentation should be updated to clarify how autoloaded imports should be used.
Steps to reproduce
~/.vim/autoload/foo.vim
:~/.vim/plugin/foo.vim
:<leader>S
. This produces the errors:<leader>F
. This echos:<leader>F
. This echos:<leader>S
. This works this time and echos:Notes:
defcompile
to the end ofplugin/foo.vim
produces the error on startup and then<leader>S
consistently fails even if typed after<leader>F
(which still works).foo.Foo()
inSetup()
withfoo#Foo()
works and theautoloading foo.vim
is echoed only when<leader>S
is typed for the first time (if done before<leader>F
of course) but in that case the import is not needed (except for the<leader>F
mapping).Expected behaviour
No error should be printed and
Foo
should be echoed independently of the order of invocation of the mappings.Or the documentation should be updated to clarify how autoloaded imports should be used.
Version of Vim
9.1.412
Environment
OS: Ubuntu 22.04
terminal: tmux 3.5 in GNOME Terminal 3.44.0
$TERM: tmux-256color
shell: bash 5.1.16(1)-release
Logs and stack traces
No response
The text was updated successfully, but these errors were encountered: