The section under :h vim9-scopes needs to be updated since it's no longer possible to write def scriptname#function(). Doing so gives the error:
E1263: cannot use name with # in Vim9 script, use export instead
What is the point of keeping the prefix s: for functions or variables? I personally don't see an advantage. Removing it (or forcing it) will make all plugins look more consistent. There is already an inconsistency in Vim's runtime. See for example s:LoadFTPlugin() and SetSyn(name: string).
And out of curiosity, why doesn't the file ftplugin.vim contain any vim9script declaration at the top of the file. The first few lines use the old legacy vimscript syntax, whereas the def function the new syntax. In my option, that's a little bit confusing. Why not just vim9script the entire script? Similar for menu.vim and synmenu.vim.
8.2.4333
Linux
No response
—
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
Fixed in 9da17d7.
—
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
Closed #9724.
—
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.![]()
On Friday, February 11, 2022 at 10:09:08 PM UTC+11 Bram Moolenaar wrote:
> This is what we would have then:
>
> - Vim9 script at script level: "s:" NOT allowed.
> - Vim9 script in :def function: "s:" NOT allowed.
> - Vim9 script in legacy function: "s:" required for script items.
> - legacy script at script level: "s:" required for script items.
> - legacy script in :def function: "s:" required for script items that are not defined yet, "s:" optional for existing script items.
> - legacy script in legacy function: "s:" required for script items
I am not familiar enough with the details to make a meaningful recommendation. However, the above list mentions "legacy" in the last four items and it would make sense for s: to be required/optional there. The first two items (Vim9 script at script level, Vim9 script in :def function) should not permit s:.
John