Tony wrote:
> IIUC, the following is now a valid construct in newly-written or
> updated non-"vim9script" script? (Let's say, a .vimrc which must also
> support an older Vim version from my Linux distro)
>
> if exists('vim9script') == 2
That should be:
if exists(':vim9script') == 2
> import MyFunc as myfunc from '~/.vim/myvim9.vim'
Import only works in a Vim9 script file. Not that it is impossible in
legacy Vim script, but I think it's a good idea not to mix a new command
in an old script file. e.g., do you need to use "s:myfunc" here?
> else
> function s:myfunc()
> ...
> endfunction
> endif
> command MyCommand -nargs=0 -bar call s:myfunc()
--
While it's true that many normal people whould prefer not to _date_ an
engineer, most normal people harbor an intense desire to _mate_ with them,
thus producing engineerlike children who will have high-paying jobs long
before losing their virginity.
(Scott Adams - The Dilbert principle)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ 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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202001261757.00QHvNk7019758%40masaka.moolenaar.net.