Your "old way" example most likely works because "misc#" finds the
misc.vim script file in an autoload directory. The "import" line
doesn't matter (I haven't tried this though).
Indeed, import doesn't matter, it was just a leftover from previous try and
not needed here.
I can't think of
Maxim Kim wrote:
> Is there a way to use vim9 autoloaded function in expression register?
>
> The old way works:
>
> vim9script
> import autoload 'misc.vim'
> iab p! println!()=misc#Eatchar('\s')
>
> the dotted call doesn't:
>
> vim9script
> import autoload 'misc.vim'
> iab p! println!()=m
Is there a way to use vim9 autoloaded function in expression register?
The old way works:
vim9script
import autoload 'misc.vim'
iab p! println!()=misc#Eatchar('\s')
the dotted call doesn't:
vim9script
import autoload 'misc.vim'
iab p! println!()=misc.Eatchar('\s')
E121: Undefined variable: m