mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
runtime(doc): update enum helptext
closes: #17112 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
836b87d699
commit
4ec93fec12
@@ -1,4 +1,4 @@
|
|||||||
*vim9class.txt* For Vim version 9.1. Last change: 2025 Apr 05
|
*vim9class.txt* For Vim version 9.1. Last change: 2025 Apr 13
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -1067,6 +1067,22 @@ The above enum definition is equivalent to the following class definition: >
|
|||||||
public const ordinal: number
|
public const ordinal: number
|
||||||
endclass
|
endclass
|
||||||
<
|
<
|
||||||
|
A enum can contain object variables and methods just like a regular
|
||||||
|
class: >
|
||||||
|
|
||||||
|
enum Color
|
||||||
|
Cyan([0, 255, 255]),
|
||||||
|
Magenta([255, 0, 255]),
|
||||||
|
Gray([128, 128, 128])
|
||||||
|
|
||||||
|
var rgb_values: list<number>
|
||||||
|
|
||||||
|
def Get_RGB(): list<number>
|
||||||
|
return this.rgb_values
|
||||||
|
enddef
|
||||||
|
endenum
|
||||||
|
echo Color.Magenta.Get_RGB()
|
||||||
|
<
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
9. Rationale
|
9. Rationale
|
||||||
|
Reference in New Issue
Block a user