home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.4 / 7.4.327 < prev    next >
Encoding:
Internet Message Format  |  2014-06-16  |  4.2 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.4.327
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.4.327
  11. Problem:    When 'verbose' is set to display the return value of a function,
  12.         may get E724 repeatedly.
  13. Solution:   Do not give an error for verbose messages. Abort conversion to
  14.         string after an error.
  15. Files:        src/eval.c
  16.  
  17.  
  18. *** ../vim-7.4.326/src/eval.c    2014-06-12 18:39:16.828400409 +0200
  19. --- src/eval.c    2014-06-17 12:48:12.083946675 +0200
  20. ***************
  21. *** 134,139 ****
  22. --- 134,142 ----
  23.   #define COPYID_INC 2
  24.   #define COPYID_MASK (~0x1)
  25.   
  26. + /* Abort conversion to string after a recursion error. */
  27. + static int  did_echo_string_emsg = FALSE;
  28.   /*
  29.    * Array to hold the hashtab with variables local to each sourced script.
  30.    * Each item holds a variable (nameless) that points to the dict_T.
  31. ***************
  32. *** 6686,6691 ****
  33. --- 6689,6696 ----
  34.       }
  35.   
  36.       line_breakcheck();
  37. +     if (did_echo_string_emsg)  /* recursion error, bail out */
  38. +         break;
  39.       }
  40.   
  41.       /* Allocate result buffer with its total size, avoid re-allocation and
  42. ***************
  43. *** 7460,7467 ****
  44.           if (s != NULL)
  45.           ga_concat(&ga, s);
  46.           vim_free(tofree);
  47. !         if (s == NULL)
  48.           break;
  49.       }
  50.       }
  51.       if (todo > 0)
  52. --- 7465,7474 ----
  53.           if (s != NULL)
  54.           ga_concat(&ga, s);
  55.           vim_free(tofree);
  56. !         if (s == NULL || did_echo_string_emsg)
  57.           break;
  58. +         line_breakcheck();
  59.       }
  60.       }
  61.       if (todo > 0)
  62. ***************
  63. *** 7619,7627 ****
  64.   
  65.       if (recurse >= DICT_MAXNEST)
  66.       {
  67. !     EMSG(_("E724: variable nested too deep for displaying"));
  68.       *tofree = NULL;
  69. !     return NULL;
  70.       }
  71.       ++recurse;
  72.   
  73. --- 7626,7641 ----
  74.   
  75.       if (recurse >= DICT_MAXNEST)
  76.       {
  77. !     if (!did_echo_string_emsg)
  78. !     {
  79. !         /* Only give this message once for a recursive call to avoid
  80. !          * flooding the user with errors.  And stop iterating over lists
  81. !          * and dicts. */
  82. !         did_echo_string_emsg = TRUE;
  83. !         EMSG(_("E724: variable nested too deep for displaying"));
  84. !     }
  85.       *tofree = NULL;
  86. !     return (char_u *)"{E724}";
  87.       }
  88.       ++recurse;
  89.   
  90. ***************
  91. *** 7689,7695 ****
  92.           *tofree = NULL;
  93.       }
  94.   
  95. !     --recurse;
  96.       return r;
  97.   }
  98.   
  99. --- 7703,7710 ----
  100.           *tofree = NULL;
  101.       }
  102.   
  103. !     if (--recurse == 0)
  104. !     did_echo_string_emsg = FALSE;
  105.       return r;
  106.   }
  107.   
  108. ***************
  109. *** 23303,23309 ****
  110. --- 23318,23327 ----
  111.               msg_outnum((long)argvars[i].vval.v_number);
  112.               else
  113.               {
  114. +             /* Do not want errors such as E724 here. */
  115. +             ++emsg_off;
  116.               s = tv2string(&argvars[i], &tofree, numbuf2, 0);
  117. +             --emsg_off;
  118.               if (s != NULL)
  119.               {
  120.                   if (vim_strsize(s) > MSG_BUF_CLEN)
  121. ***************
  122. *** 23395,23402 ****
  123.   
  124.           /* The value may be very long.  Skip the middle part, so that we
  125.            * have some idea how it starts and ends. smsg() would always
  126. !          * truncate it at the end. */
  127.           s = tv2string(fc->rettv, &tofree, numbuf2, 0);
  128.           if (s != NULL)
  129.           {
  130.           if (vim_strsize(s) > MSG_BUF_CLEN)
  131. --- 23413,23422 ----
  132.   
  133.           /* The value may be very long.  Skip the middle part, so that we
  134.            * have some idea how it starts and ends. smsg() would always
  135. !          * truncate it at the end. Don't want errors such as E724 here. */
  136. !         ++emsg_off;
  137.           s = tv2string(fc->rettv, &tofree, numbuf2, 0);
  138. +         --emsg_off;
  139.           if (s != NULL)
  140.           {
  141.           if (vim_strsize(s) > MSG_BUF_CLEN)
  142. *** ../vim-7.4.326/src/version.c    2014-06-14 12:53:27.394152699 +0200
  143. --- src/version.c    2014-06-17 12:41:45.019932032 +0200
  144. ***************
  145. *** 736,737 ****
  146. --- 736,739 ----
  147.   {   /* Add new patch number below this line */
  148. + /**/
  149. +     327,
  150.   /**/
  151.  
  152. -- 
  153. TALL KNIGHT: We shall say Ni! again to you if you do not appease us.
  154. ARTHUR:      All right!  What do you want?
  155. TALL KNIGHT: We want ... a shrubbery!
  156.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  157.  
  158.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  159. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  160. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  161.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  162.