]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.327 v7.4.327
authorBram Moolenaar <Bram@vim.org>
Tue, 17 Jun 2014 10:51:16 +0000 (12:51 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 17 Jun 2014 10:51:16 +0000 (12:51 +0200)
Problem:    When 'verbose' is set to display the return value of a function,
            may get E724 repeatedly.
Solution:   Do not give an error for verbose messages. Abort conversion to
            string after an error.

src/eval.c
src/version.c

index 728b7d1e2afc0a83e38c2250713ed2be156ce831..a350757dac8ea642c9172632a18fbafed2dc9d08 100644 (file)
@@ -134,6 +134,9 @@ static int current_copyID = 0;
 #define COPYID_INC 2
 #define COPYID_MASK (~0x1)
 
+/* Abort conversion to string after a recursion error. */
+static int  did_echo_string_emsg = FALSE;
+
 /*
  * Array to hold the hashtab with variables local to each sourced script.
  * Each item holds a variable (nameless) that points to the dict_T.
@@ -6686,6 +6689,8 @@ list_join_inner(gap, l, sep, echo_style, copyID, join_gap)
        }
 
        line_breakcheck();
+       if (did_echo_string_emsg)  /* recursion error, bail out */
+           break;
     }
 
     /* Allocate result buffer with its total size, avoid re-allocation and
@@ -7460,8 +7465,10 @@ dict2string(tv, copyID)
            if (s != NULL)
                ga_concat(&ga, s);
            vim_free(tofree);
-           if (s == NULL)
+           if (s == NULL || did_echo_string_emsg)
                break;
+           line_breakcheck();
+
        }
     }
     if (todo > 0)
@@ -7619,9 +7626,16 @@ echo_string(tv, tofree, numbuf, copyID)
 
     if (recurse >= DICT_MAXNEST)
     {
-       EMSG(_("E724: variable nested too deep for displaying"));
+       if (!did_echo_string_emsg)
+       {
+           /* Only give this message once for a recursive call to avoid
+            * flooding the user with errors.  And stop iterating over lists
+            * and dicts. */
+           did_echo_string_emsg = TRUE;
+           EMSG(_("E724: variable nested too deep for displaying"));
+       }
        *tofree = NULL;
-       return NULL;
+       return (char_u *)"{E724}";
     }
     ++recurse;
 
@@ -7689,7 +7703,8 @@ echo_string(tv, tofree, numbuf, copyID)
            *tofree = NULL;
     }
 
-    --recurse;
+    if (--recurse == 0)
+       did_echo_string_emsg = FALSE;
     return r;
 }
 
@@ -23303,7 +23318,10 @@ call_user_func(fp, argcount, argvars, rettv, firstline, lastline, selfdict)
                        msg_outnum((long)argvars[i].vval.v_number);
                    else
                    {
+                       /* Do not want errors such as E724 here. */
+                       ++emsg_off;
                        s = tv2string(&argvars[i], &tofree, numbuf2, 0);
+                       --emsg_off;
                        if (s != NULL)
                        {
                            if (vim_strsize(s) > MSG_BUF_CLEN)
@@ -23395,8 +23413,10 @@ call_user_func(fp, argcount, argvars, rettv, firstline, lastline, selfdict)
 
            /* The value may be very long.  Skip the middle part, so that we
             * have some idea how it starts and ends. smsg() would always
-            * truncate it at the end. */
+            * truncate it at the end. Don't want errors such as E724 here. */
+           ++emsg_off;
            s = tv2string(fc->rettv, &tofree, numbuf2, 0);
+           --emsg_off;
            if (s != NULL)
            {
                if (vim_strsize(s) > MSG_BUF_CLEN)
index 6cc3d072eec7a2aae9933db63407267d3c48fa77..9215ae475d92801ac3d022002cf90708427cf770 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    327,
 /**/
     326,
 /**/