Commit: runtime(doc): update enum helptext

1 view
Skip to first unread message

Christian Brabandt

unread,
Apr 14, 2025, 3:30:19 PM4/14/25
to vim...@googlegroups.com
runtime(doc): update enum helptext

Commit: https://github.com/vim/vim/commit/4ec93fec125b2743a7f63b4fd3087fa5895eab8b
Author: Yegappan Lakshmanan <yega...@yahoo.com>
Date: Mon Apr 14 21:14:33 2025 +0200

runtime(doc): update enum helptext

closes: https://github.com/vim/vim/issues/17112

Signed-off-by: Yegappan Lakshmanan <yega...@yahoo.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/doc/vim9class.txt b/runtime/doc/vim9class.txt
index 5d6f7fca1..519545677 100644
--- a/runtime/doc/vim9class.txt
+++ b/runtime/doc/vim9class.txt
@@ -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
@@ -1067,6 +1067,22 @@ The above enum definition is equivalent to the following class definition: >
public const ordinal: number
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
Reply all
Reply to author
Forward
0 new messages