Wednesday, January 11, 2023

Re: vim9 autoload script modified : How to reload it On-The-Fly



Ok Bram that what I do each time I modify an autoload vim9script (so I do the best I can :)
effectively, sourcing does not work sorry lifepillar: it echoes to me a message E1091 Function HighCaller (below) is not compiled.

And the calling tree is as this :
nnoremap foo <ScriptCmd> Helper. HighCaller  ()<CR> ->  autoload/vim9fooscript.vim :: exported def HighCaller() ->  autoload/vim9fooscript.vim :: def SubCalled

So it seems to be  needed to add a mapping to launch gvim -c with the command test I need.
Thank you
Nicolas


Le mercredi 11 janvier 2023 à 21:09:00 UTC+1, Bram Moolenaar a écrit :

> Currently modifying an *autoload*/*vim9fooscript*.vim which can be started
> by typing a nnoremap as this :
>
>
> - *_vimrc* :
>
> import autoload './vimfiles/some/thing/*autoload*/*vim9fooscript* .vim'
> as thatHelp
> *nnoremap* inout <ScriptCmd> thatHelp.E10_InOut()<CR>
>
>
>
> - vimfiles/some/thing/*autoload*/*vim9fooscript*.vim
>
> def Foo which is currently modifying
>
>
> How to force "recompile" the new modified content of def Foo without touch
> the nnoremap ?

There is no reliable way to reload an autoload script and have all the
changes take effect. It's best to exit Vim and restart. Trying to make
this work without a Vim restart is not only complicated, it is also
going to be unreliable.

--
An alien life briefly visits earth. Just before departing it leaves a
message in the dust on the back of a white van. The world is shocked
and wants to know what it means. After months of studies the worlds
best linguistic scientists are able to decipher the message: "Wash me!".

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/3d4ed282-6c4c-4f67-a411-bb130e83353dn%40googlegroups.com.

No comments:

Post a Comment