Sorry for the noise, I realized I need to add "noclear" to the vim9script command.
On Wednesday, March 5, 2025 at 11:52:28 AM UTC-7 Christian J. Robinson wrote: > Foo.vim: > > vim9script > > export class Foo > def new() > enddef > def Bar(s: string) > echo $"{s} works" > enddef > endclass > > vim9_regression.vim: > > vim9script > > if get(g:, 'did_foo', false) > finish > endif > > g:did_foo = true > > import autoload './Foo.vim' > > var foo = Foo.Foo.new() > > command -buffer -bar -nargs=1 Foo foo.Bar(<f-args>) > > > Source vim9_regression.vim, and run ":Foo bar" and you'll get the expected > "bar works" message, but source vim9_regression.vim again you'll get: > E121: Undefined variable: foo > > > -- > Christian J. Robinson <hep...@gmail.com> > -- -- 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 vim_dev+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/9d3701ff-4f75-4ca2-8c4b-62ab4ebb2a66n%40googlegroups.com.