> Vim9script introduces the fact of having to use a global to pass values
> between a P function, producing its values, used for example in an
> autocommand and a second C function consuming its data / values which
> would be called on a key mapping for example. The fact is that going
> through globals is not very elegant and forced to create a new global named
> different in each new case explained above. So I was looking for another
> way.
With Vim9 script the recommended way is to put the variable in one
script where it is exported, and then import it whereever you want to
use it. That way you have control over where the value is changed, make
it a constant, etc. See help for "vim9-scopes" and ":import".
--
Westheimer's Discovery:
A couple of months in the laboratory can
frequently save a couple of hours in the library.
/// 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 ///