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 a good way to make this work. Being able to access
"misc", which is script-local in one specific script, from any other
context, means script-local isn't really "local" any more.
I see. I guess it would probably require some trickery/hacks which will
make it less robust.
The best I can think of is to add a script-local function and use that:
vim9script
import autoload 'misc.vim'
def Eatchar(arg: string): string
return misc.Eatchar(arg)
enddef
iab <buffer> p! println!()<left><c-r>=<SID>Eatchar('\s')<cr>
This would defeat the purpose of putting function into autoloaded dir.
I think the misc#Eatchar() is better from user experience perspective.
--
--
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/e21317f6-3c85-46f4-bf12-b5d27c981560n%40googlegroups.com.