summaryrefslogtreecommitdiffstats
path: root/patches/source/vim/patches/7.4.327
blob: a797dd7ec2d295a7dd51e6dac835910155ec657b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
To: vim_dev@googlegroups.com
Subject: Patch 7.4.327
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.4.327
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.
Files:	    src/eval.c


*** ../vim-7.4.326/src/eval.c	2014-06-12 18:39:16.828400409 +0200
--- src/eval.c	2014-06-17 12:48:12.083946675 +0200
***************
*** 134,139 ****
--- 134,142 ----
  #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,6691 ****
--- 6689,6696 ----
  	}
  
  	line_breakcheck();
+ 	if (did_echo_string_emsg)  /* recursion error, bail out */
+ 	    break;
      }
  
      /* Allocate result buffer with its total size, avoid re-allocation and
***************
*** 7460,7467 ****
  	    if (s != NULL)
  		ga_concat(&ga, s);
  	    vim_free(tofree);
! 	    if (s == NULL)
  		break;
  	}
      }
      if (todo > 0)
--- 7465,7474 ----
  	    if (s != NULL)
  		ga_concat(&ga, s);
  	    vim_free(tofree);
! 	    if (s == NULL || did_echo_string_emsg)
  		break;
+ 	    line_breakcheck();
+ 
  	}
      }
      if (todo > 0)
***************
*** 7619,7627 ****
  
      if (recurse >= DICT_MAXNEST)
      {
! 	EMSG(_("E724: variable nested too deep for displaying"));
  	*tofree = NULL;
! 	return NULL;
      }
      ++recurse;
  
--- 7626,7641 ----
  
      if (recurse >= DICT_MAXNEST)
      {
! 	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 (char_u *)"{E724}";
      }
      ++recurse;
  
***************
*** 7689,7695 ****
  	    *tofree = NULL;
      }
  
!     --recurse;
      return r;
  }
  
--- 7703,7710 ----
  	    *tofree = NULL;
      }
  
!     if (--recurse == 0)
! 	did_echo_string_emsg = FALSE;
      return r;
  }
  
***************
*** 23303,23309 ****
--- 23318,23327 ----
  			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,23402 ****
  
  	    /* 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. */
  	    s = tv2string(fc->rettv, &tofree, numbuf2, 0);
  	    if (s != NULL)
  	    {
  		if (vim_strsize(s) > MSG_BUF_CLEN)
--- 23413,23422 ----
  
  	    /* 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. 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)
*** ../vim-7.4.326/src/version.c	2014-06-14 12:53:27.394152699 +0200
--- src/version.c	2014-06-17 12:41:45.019932032 +0200
***************
*** 736,737 ****
--- 736,739 ----
  {   /* Add new patch number below this line */
+ /**/
+     327,
  /**/

-- 
TALL KNIGHT: We shall say Ni! again to you if you do not appease us.
ARTHUR:      All right!  What do you want?
TALL KNIGHT: We want ... a shrubbery!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///