forked from aniani/vim
runtime(vim): Distinguish Vim9 constructor definitions from the :new ex command (#14050)
With the arrival of Vim9 classes, the syntax must allow for
_new_ constructors; multiple constructor definitions are
supported for a class, provided distinct suffix-names are
used. Currently, the defined constructors match either
vimCommand or vimFunctionError (for any newBar).
For example:
------------------------------------------------------------
vim9script
class Foo
def new()
enddef
def newBar()
enddef
endclass
------------------------------------------------------------
Since every constructor is required to bear a lower-cased
_new_ prefix name, it should suffice to distinguish them
from functions, and so there are no new highlight or syntax
groups introduced.
Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
" Language: Vim script
|
||||
" Maintainer: Hirohito Higashi (h_east)
|
||||
" URL: https://github.com/vim-jp/syntax-vim-ex
|
||||
" Last Change: Feb 11, 2024
|
||||
" Version: 2.0.0
|
||||
" Last Change: Feb 18, 2024
|
||||
" Version: 2.0.1
|
||||
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
@@ -281,6 +281,7 @@ function! s:get_vim_command_type(cmd_name)
|
||||
\ 'behave', 'augroup', 'normal', 'syntax',
|
||||
\ 'append', 'insert',
|
||||
\ 'Next', 'Print', 'X',
|
||||
\ 'new',
|
||||
\ ]
|
||||
" Required for original behavior
|
||||
" \ 'global', 'vglobal'
|
||||
|
||||
Reference in New Issue
Block a user