Logo
Explore Help
Sign In
CC-tea/org-vim
1
0
Fork 0
You've already forked org-vim
mirror of https://github.com/vim/vim.git synced 2026-04-14 16:00:42 +02:00
Code Issues Packages Projects Releases Wiki Activity
Files
8e25d91cb7bb4dc171cb4e95b1bb79a39400a13a
org-vim/runtime/syntax/testdir/input/vim_new.vim

18 lines
205 B
VimL
Raw Normal View History

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>
2024-02-18 21:02:14 +03:00
vim9script
# Vim :new command and class constructors.
class Test
def new()
enddef
def newOther()
enddef
def newyetanother()
enddef
endclass
Test.new()
Test.newOther()
Test.newyetanother()
new
quit
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.5 Page: 1259ms Template: 82ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API