diff src/evalfunc.c @ 16664:ca1814eeecf5 v8.1.1334

patch 8.1.1334: when buffer is hidden "F" in 'shortmess' is not used commit https://github.com/vim/vim/commit/eda652215abf696f86b872888945a2d2dd8c7192 Author: Bram Moolenaar <Bram@vim.org> Date: Thu May 16 20:29:44 2019 +0200 patch 8.1.1334: when buffer is hidden "F" in 'shortmess' is not used Problem: When buffer is hidden "F" in 'shortmess' is not used. Solution: Check the "F" flag in 'shortmess' when the buffer is already loaded. (Jason Franklin) Add test_getvalue() to be able to test this.
author Bram Moolenaar <Bram@vim.org>
date Thu, 16 May 2019 20:30:07 +0200
parents 04c2614af21c
children 46322a4e6028
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -442,6 +442,7 @@ static void f_tempname(typval_T *argvars
 static void f_test_alloc_fail(typval_T *argvars, typval_T *rettv);
 static void f_test_autochdir(typval_T *argvars, typval_T *rettv);
 static void f_test_feedinput(typval_T *argvars, typval_T *rettv);
+static void f_test_getvalue(typval_T *argvars, typval_T *rettv);
 static void f_test_option_not_set(typval_T *argvars, typval_T *rettv);
 static void f_test_override(typval_T *argvars, typval_T *rettv);
 static void f_test_refcount(typval_T *argvars, typval_T *rettv);
@@ -991,6 +992,7 @@ static struct fst
     {"test_autochdir",	0, 0, f_test_autochdir},
     {"test_feedinput",	1, 1, f_test_feedinput},
     {"test_garbagecollect_now",	0, 0, f_test_garbagecollect_now},
+    {"test_getvalue",	1, 1, f_test_getvalue},
     {"test_ignore_error",	1, 1, f_test_ignore_error},
     {"test_null_blob",	0, 0, f_test_null_blob},
 #ifdef FEAT_JOB_CHANNEL
@@ -14413,6 +14415,25 @@ f_test_feedinput(typval_T *argvars, typv
 }
 
 /*
+ * "test_getvalue({name})" function
+ */
+    static void
+f_test_getvalue(typval_T *argvars, typval_T *rettv)
+{
+    if (argvars[0].v_type != VAR_STRING)
+	emsg(_(e_invarg));
+    else
+    {
+	char_u *name = tv_get_string(&argvars[0]);
+
+	if (STRCMP(name, (char_u *)"need_fileinfo") == 0)
+	    rettv->vval.v_number = need_fileinfo;
+	else
+	    semsg(_(e_invarg2), name);
+    }
+}
+
+/*
  * "test_option_not_set({name})" function
  */
     static void