Yegappan wrote:

> On Tue, Feb 1, 2022 at 8:05 AM Bram Moolenaar <vim-dev-git...@256bit.org>
> wrote:
> 
> > > v8.2.4264 revoked the '#' style function name in vim9, but:
> > > 1, that made some complex to call such vim9 func in legacy vim script
> > > e.g vimrc.
> >
> > I don't see how. You can still call the autoload function using the #
> > form.
> 
> The recent changes to disallow the use of '#' in a function name and the
> changes to the import mechanism resulted in quite a bit of changes to the
> LSP Vim9 plugin.
> 
> You can see the impact in the following commits:
> 
> https://github.com/yegappan/lsp/commit/aeede042a93441f038f6b36448aaf383969bc86b
> https://github.com/yegappan/lsp/commit/d7105d210391ad8fe3733d81f048df7a970b2488
> 
> In particular look at the changes to the plugin/lsp.vim. As all the users
> may not have the latest Vim, the plugin needs to support an older
> version of Vim and the latest version. This is difficult.

The autoload mechanism in Vim9 was introduced only recently.  But I
suppose you were relying on the legacy mechanism.

The change indeed had bigger impact than I anticipated.  But I do think
that it is better in the long run.

So far you could have an autoload function call anywhere, just use
"scriptname#Funcname()".  Although this is convenient, it also hides a
dependency on another script, which must be present for this to work.
Now you need an "import autoload 'scriptname.vim'" and then you can use
"scriptname.Funcname()".  Now the import, thus the dependency, is
explicit.  The cost is an extra line.

There is one loophole though: When using a legacy function it can use
the "scritpname#Funcname()" form, also in a Vim9 script.  Perhaps you
can use that as a temporary workaround?

In a cleanly written Vim9 script you would not define a legacy function.

-- 
If your company is not involved in something called "ISO 9000" you probably
have no idea what it is.  If your company _is_ involved in ISO 9000 then you
definitely have no idea what it is.
                                (Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- b...@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_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 on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220202132036.641A91C044D%40moolenaar.net.

Raspunde prin e-mail lui