From: Yegappan Lakshmanan Date: Mon, 14 Apr 2025 19:14:33 +0000 (+0200) Subject: runtime(doc): update enum helptext X-Git-Tag: v9.1.1300~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ec93fec125b2743a7f63b4fd3087fa5895eab8b;p=thirdparty%2Fvim.git runtime(doc): update enum helptext closes: #17112 Signed-off-by: Yegappan Lakshmanan Signed-off-by: Christian Brabandt --- diff --git a/runtime/doc/vim9class.txt b/runtime/doc/vim9class.txt index 5d6f7fca18..519545677c 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 + + def Get_RGB(): list + return this.rgb_values + enddef + endenum + echo Color.Magenta.Get_RGB() +< ============================================================================== 9. Rationale