summaryrefslogtreecommitdiffstats
path: root/src/evalfunc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r--src/evalfunc.c35
1 files changed, 29 insertions, 6 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 14650ca..2064982 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -3920,7 +3920,7 @@ f_deepcopy(typval_T *argvars, typval_T *rettv)
static void
f_did_filetype(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
- rettv->vval.v_number = did_filetype;
+ rettv->vval.v_number = curbuf->b_did_filetype;
}
/*
@@ -6129,6 +6129,13 @@ f_has(typval_T *argvars, typval_T *rettv)
0
#endif
},
+ {"dialog_con_gui",
+#if defined(FEAT_CON_DIALOG) && defined(FEAT_GUI_DIALOG)
+ 1
+#else
+ 0
+#endif
+ },
{"dialog_gui",
#ifdef FEAT_GUI_DIALOG
1
@@ -11486,15 +11493,31 @@ f_type(typval_T *argvars, typval_T *rettv)
case VAR_CHANNEL: n = VAR_TYPE_CHANNEL; break;
case VAR_BLOB: n = VAR_TYPE_BLOB; break;
case VAR_INSTR: n = VAR_TYPE_INSTR; break;
- case VAR_CLASS: n = VAR_TYPE_CLASS; break;
- case VAR_OBJECT: n = VAR_TYPE_OBJECT; break;
case VAR_TYPEALIAS: n = VAR_TYPE_TYPEALIAS; break;
+ case VAR_CLASS:
+ {
+ class_T *cl = argvars[0].vval.v_class;
+ if (IS_ENUM(cl))
+ n = VAR_TYPE_ENUM;
+ else
+ n = VAR_TYPE_CLASS;
+ break;
+ }
+ case VAR_OBJECT:
+ {
+ class_T *cl = argvars[0].vval.v_object->obj_class;
+ if (IS_ENUM(cl))
+ n = VAR_TYPE_ENUMVALUE;
+ else
+ n = VAR_TYPE_OBJECT;
+ break;
+ }
case VAR_UNKNOWN:
case VAR_ANY:
case VAR_VOID:
- internal_error_no_abort("f_type(UNKNOWN)");
- n = -1;
- break;
+ internal_error_no_abort("f_type(UNKNOWN)");
+ n = -1;
+ break;
}
rettv->vval.v_number = n;
}