summaryrefslogtreecommitdiffstats
path: root/patches/source/vim/patches/7.4.324
blob: 7418d06b7572dcf6f9b01d3fa8e2a099e1bc1422 (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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
To: vim_dev@googlegroups.com
Subject: Patch 7.4.324
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.324
Problem:    In Ex mode, cyrillic characters are not handled. (Stas Malavin)
Solution:   Support multi-byte characters in Ex mode. (Yukihiro Nakadaira)
Files:	    src/ex_getln.c


*** ../vim-7.4.323/src/ex_getln.c	2014-05-29 14:36:26.156862577 +0200
--- src/ex_getln.c	2014-06-12 19:33:10.440522741 +0200
***************
*** 2188,2193 ****
--- 2188,2194 ----
      int		vcol = 0;
      char_u	*p;
      int		prev_char;
+     int		len;
  
      /* Switch cursor on now.  This avoids that it happens after the "\n", which
       * confuses the system function that computes tabstops. */
***************
*** 2264,2270 ****
  	    {
  		if (line_ga.ga_len > 0)
  		{
! 		    --line_ga.ga_len;
  		    goto redraw;
  		}
  		continue;
--- 2265,2281 ----
  	    {
  		if (line_ga.ga_len > 0)
  		{
! #ifdef FEAT_MBYTE
! 		    if (has_mbyte)
! 		    {
! 			p = (char_u *)line_ga.ga_data;
! 			p[line_ga.ga_len] = NUL;
! 			len = (*mb_head_off)(p, p + line_ga.ga_len - 1) + 1;
! 			line_ga.ga_len -= len;
! 		    }
! 		    else
! #endif
! 			--line_ga.ga_len;
  		    goto redraw;
  		}
  		continue;
***************
*** 2280,2286 ****
  
  	    if (c1 == Ctrl_T)
  	    {
! 		long        sw = get_sw_value(curbuf);
  
  		p = (char_u *)line_ga.ga_data;
  		p[line_ga.ga_len] = NUL;
--- 2291,2297 ----
  
  	    if (c1 == Ctrl_T)
  	    {
! 		long	    sw = get_sw_value(curbuf);
  
  		p = (char_u *)line_ga.ga_data;
  		p[line_ga.ga_len] = NUL;
***************
*** 2300,2307 ****
  		/* redraw the line */
  		msg_col = startcol;
  		vcol = 0;
! 		for (p = (char_u *)line_ga.ga_data;
! 			  p < (char_u *)line_ga.ga_data + line_ga.ga_len; ++p)
  		{
  		    if (*p == TAB)
  		    {
--- 2311,2319 ----
  		/* redraw the line */
  		msg_col = startcol;
  		vcol = 0;
! 		p = (char_u *)line_ga.ga_data;
! 		p[line_ga.ga_len] = NUL;
! 		while (p < (char_u *)line_ga.ga_data + line_ga.ga_len)
  		{
  		    if (*p == TAB)
  		    {
***************
*** 2309,2319 ****
  			{
  			    msg_putchar(' ');
  			} while (++vcol % 8);
  		    }
  		    else
  		    {
! 			msg_outtrans_len(p, 1);
! 			vcol += char2cells(*p);
  		    }
  		}
  		msg_clr_eos();
--- 2321,2334 ----
  			{
  			    msg_putchar(' ');
  			} while (++vcol % 8);
+ 			++p;
  		    }
  		    else
  		    {
! 			len = MB_PTR2LEN(p);
! 			msg_outtrans_len(p, len);
! 			vcol += ptr2cells(p);
! 			p += len;
  		    }
  		}
  		msg_clr_eos();
***************
*** 2362,2368 ****
  
  	if (IS_SPECIAL(c1))
  	    c1 = '?';
! 	((char_u *)line_ga.ga_data)[line_ga.ga_len] = c1;
  	if (c1 == '\n')
  	    msg_putchar('\n');
  	else if (c1 == TAB)
--- 2377,2392 ----
  
  	if (IS_SPECIAL(c1))
  	    c1 = '?';
! #ifdef FEAT_MBYTE
! 	if (has_mbyte)
! 	    len = (*mb_char2bytes)(c1,
! 				  (char_u *)line_ga.ga_data + line_ga.ga_len);
! 	else
! #endif
! 	{
! 	    len = 1;
! 	    ((char_u *)line_ga.ga_data)[line_ga.ga_len] = c1;
! 	}
  	if (c1 == '\n')
  	    msg_putchar('\n');
  	else if (c1 == TAB)
***************
*** 2376,2385 ****
  	else
  	{
  	    msg_outtrans_len(
! 		     ((char_u *)line_ga.ga_data) + line_ga.ga_len, 1);
  	    vcol += char2cells(c1);
  	}
! 	++line_ga.ga_len;
  	escaped = FALSE;
  
  	windgoto(msg_row, msg_col);
--- 2400,2409 ----
  	else
  	{
  	    msg_outtrans_len(
! 		     ((char_u *)line_ga.ga_data) + line_ga.ga_len, len);
  	    vcol += char2cells(c1);
  	}
! 	line_ga.ga_len += len;
  	escaped = FALSE;
  
  	windgoto(msg_row, msg_col);
*** ../vim-7.4.323/src/version.c	2014-06-12 18:39:16.828400409 +0200
--- src/version.c	2014-06-12 19:37:40.296532950 +0200
***************
*** 736,737 ****
--- 736,739 ----
  {   /* Add new patch number below this line */
+ /**/
+     324,
  /**/

-- 
ZOOT:  I'm afraid our life must seem very dull and quiet compared to yours.
       We are but eightscore young blondes, all between sixteen and
       nineteen-and-a-half, cut off in this castle, with no one to protect us.
       Oooh.  It is a lonely life ... bathing ...  dressing ... undressing ...
       making exciting underwear....
                 "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    ///