Related:
When I ran "$ make check_doc" with the improved generator script, I found that the following Vim9-specific Ex-commands can be shortened:
Currently the behavior seems inconsistent.
abstract can be shortened.vim9script abs class ClassA abstract def FuncA() endclass
No error
abstract cannot be shortened.vim9script abstract class ClassA abs def FuncA() endclass
E1065: Command cannot be shortened: abs def FuncA()
interface can be shortened.vim9script inte I def F() endinterface
No error.
endinterface cannot be shortened.vim9script interface I def F() endin
E1065: Command cannot be shortened: endin
So, Based on Vim9 policy(:h vim9-no-shorten), it has been changed so that it cannot be shortened.
@yegappan, @dkearns Could you review this?
https://github.com/vim/vim/pull/16356
(6 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@h-east pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Fix issue that related #16362
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Thanks.
It looks good to me in principle but I'm not entirely clear on Bram's intention here. I sent him an update to the matchit pattern for enums and interfaces with support for the shortened names and it was included without comment at the time (early '23).
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Thanks,
I sent him an update to the matchit pattern for enums and interfaces with support for the shortened names
Then let's just revert this as well please? Let's try to be consistent and only allow the long names for vim9 script. It also helps readability.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I include it and update the screendump tests. But please check it, now it does no longer highlight properly? Or is this expected?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I added abstract to the exclude_list just like class and enum.
This way, abstract will not be added to the "syn keyword vimCommand" in the auto-generated part of vim.vim.
https://github.com/vim/vim/blob/aa979c763da2fa7ede2416a1ab8de7a46d88cd04/runtime/syntax/generator/gen_syntax_vim.vim#L251-L259
I believe this is the correct solution.
However, I think the following changes are necessary.
What do you think?
(I have confirmed that this change produces the same results as before for syntax tests)
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 6a8e7adea..cb7f1dff9 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -241,7 +241,7 @@ syn case match " All vimCommands are contained by vimIsCommand. {{{2 syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimCall,vimCatch,vimConst,vimDef,vimDefFold,vimDelcommand,@vimEcho,vimEnddef,vimEndfunction,vimExecute,vimIsCommand,vimExtCmd,vimFor,vimFunction,vimFuncFold,vimGlobal,vimHighlight,vimLet,vimLoadkeymap,vimMap,vimMark,vimMatch,vimNotFunc,vimNormal,vimSet,vimSleep,vimSyntax,vimThrow,vimUnlet,vimUnmap,vimUserCmd,vimMenu,vimMenutranslate,@vim9CmdList -syn cluster vim9CmdList contains=vim9Class,vim9Const,vim9Enum,vim9Export,vim9Final,vim9For,vim9Interface,vim9Type,vim9Var +syn cluster vim9CmdList contains=vim9Abstract,vim9Class,vim9Const,vim9Enum,vim9Export,vim9Final,vim9For,vim9Interface,vim9Type,vim9Var syn match vimCmdSep "[:|]\+" skipwhite nextgroup=@vimCmdList,vimSubst1 syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" contains=vimCommand syn match vimBang contained "!"
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@chrisbra
I have made a PR for the fix. #16376
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
thanks
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()