Problem: Return value of type() for class and object unclear.
Solution: Add v:t_object and v:t_class.
Job: 8 |v:t_job|
Channel: 9 |v:t_channel|
Blob: 10 |v:t_blob|
+ Class 12 |v:t_class|
+ Object 13 |v:t_object|
For backward compatibility, this method can be used: >
:if type(myvar) == type(0)
:if type(myvar) == type("")
v:t_string Value of |String| type. Read-only. See: |type()|
*v:t_blob* *t_blob-variable*
v:t_blob Value of |Blob| type. Read-only. See: |type()|
+ *v:t_class* *t_class-variable*
+v:t_class Value of |class| type. Read-only. See: |type()|
+ *v:t_object* *t_object-variable*
+v:t_object Value of |object| type. Read-only. See: |type()|
*v:termresponse* *termresponse-variable*
v:termresponse The escape sequence returned by the terminal for the |t_RV|
{VV_NAME("t_job", VAR_NUMBER), NULL, VV_RO},
{VV_NAME("t_channel", VAR_NUMBER), NULL, VV_RO},
{VV_NAME("t_blob", VAR_NUMBER), NULL, VV_RO},
+ {VV_NAME("t_class", VAR_NUMBER), NULL, VV_RO},
+ {VV_NAME("t_object", VAR_NUMBER), NULL, VV_RO},
{VV_NAME("termrfgresp", VAR_STRING), NULL, VV_RO},
{VV_NAME("termrbgresp", VAR_STRING), NULL, VV_RO},
{VV_NAME("termu7resp", VAR_STRING), NULL, VV_RO},
set_vim_var_nr(VV_TYPE_JOB, VAR_TYPE_JOB);
set_vim_var_nr(VV_TYPE_CHANNEL, VAR_TYPE_CHANNEL);
set_vim_var_nr(VV_TYPE_BLOB, VAR_TYPE_BLOB);
+ set_vim_var_nr(VV_TYPE_CLASS, VAR_TYPE_CLASS);
+ set_vim_var_nr(VV_TYPE_OBJECT, VAR_TYPE_OBJECT);
set_vim_var_nr(VV_ECHOSPACE, sc_col - 1);
# call an object method
assert_equal('(2, 12)', pos.ToString())
+
+ assert_equal(v:t_class, type(TextPosition))
+ assert_equal(v:t_object, type(pos))
+ assert_equal('class<TextPosition>', typename(TextPosition))
+ assert_equal('object<TextPosition>', typename(pos))
END
v9.CheckScriptSuccess(lines)
enddef
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1188,
/**/
1187,
/**/
#define VV_TYPE_JOB 85
#define VV_TYPE_CHANNEL 86
#define VV_TYPE_BLOB 87
-#define VV_TERMRFGRESP 88
-#define VV_TERMRBGRESP 89
-#define VV_TERMU7RESP 90
-#define VV_TERMSTYLERESP 91
-#define VV_TERMBLINKRESP 92
-#define VV_EVENT 93
-#define VV_VERSIONLONG 94
-#define VV_ECHOSPACE 95
-#define VV_ARGV 96
-#define VV_COLLATE 97
-#define VV_EXITING 98
-#define VV_COLORNAMES 99
-#define VV_SIZEOFINT 100
-#define VV_SIZEOFLONG 101
-#define VV_SIZEOFPOINTER 102
-#define VV_MAXCOL 103
-#define VV_LEN 104 // number of v: vars
+#define VV_TYPE_CLASS 88
+#define VV_TYPE_OBJECT 89
+#define VV_TERMRFGRESP 90
+#define VV_TERMRBGRESP 91
+#define VV_TERMU7RESP 92
+#define VV_TERMSTYLERESP 93
+#define VV_TERMBLINKRESP 94
+#define VV_EVENT 95
+#define VV_VERSIONLONG 96
+#define VV_ECHOSPACE 97
+#define VV_ARGV 98
+#define VV_COLLATE 99
+#define VV_EXITING 100
+#define VV_COLORNAMES 101
+#define VV_SIZEOFINT 102
+#define VV_SIZEOFLONG 103
+#define VV_SIZEOFPOINTER 104
+#define VV_MAXCOL 105
+#define VV_LEN 106 // number of v: vars
// used for v_number in VAR_BOOL and VAR_SPECIAL
#define VVAL_FALSE 0L // VAR_BOOL