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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
|
To: vim_dev@googlegroups.com
Subject: Patch 7.3.221
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.3.221
Problem: Text from the clipboard is sometimes handled as linewise, but not
consistently.
Solution: Assume the text is linewise when it ends in a CR or NL.
Files: src/gui_gtk_x11.c, src/gui_mac.c, src/ops.c, src/os_msdos.c,
src/os_mswin.c, src/os_qnx.c, src/ui.c
*** ../mercurial/vim73/src/gui_gtk_x11.c 2011-02-25 17:10:22.000000000 +0100
--- src/gui_gtk_x11.c 2011-06-19 00:58:31.000000000 +0200
***************
*** 1173,1179 ****
char_u *tmpbuf = NULL;
guchar *tmpbuf_utf8 = NULL;
int len;
! int motion_type;
if (data->selection == clip_plus.gtk_sel_atom)
cbd = &clip_plus;
--- 1173,1179 ----
char_u *tmpbuf = NULL;
guchar *tmpbuf_utf8 = NULL;
int len;
! int motion_type = MAUTO;
if (data->selection == clip_plus.gtk_sel_atom)
cbd = &clip_plus;
***************
*** 1182,1188 ****
text = (char_u *)data->data;
len = data->length;
- motion_type = MCHAR;
if (text == NULL || len <= 0)
{
--- 1182,1187 ----
*** ../mercurial/vim73/src/gui_mac.c 2011-06-12 20:33:30.000000000 +0200
--- src/gui_mac.c 2011-06-19 00:59:07.000000000 +0200
***************
*** 4671,4677 ****
if (flavor)
type = **textOfClip;
else
! type = (strchr(*textOfClip, '\r') != NULL) ? MLINE : MCHAR;
tempclip = lalloc(scrapSize + 1, TRUE);
mch_memmove(tempclip, *textOfClip + flavor, scrapSize);
--- 4671,4677 ----
if (flavor)
type = **textOfClip;
else
! type = MAUTO;
tempclip = lalloc(scrapSize + 1, TRUE);
mch_memmove(tempclip, *textOfClip + flavor, scrapSize);
*** ../mercurial/vim73/src/ops.c 2011-04-01 16:28:33.000000000 +0200
--- src/ops.c 2011-06-19 00:59:39.000000000 +0200
***************
*** 5733,5739 ****
}
}
! /* Convert from the GUI selection string into the '*'/'+' register */
void
clip_yank_selection(type, str, len, cbd)
int type;
--- 5733,5741 ----
}
}
! /*
! * Convert from the GUI selection string into the '*'/'+' register.
! */
void
clip_yank_selection(type, str, len, cbd)
int type;
***************
*** 6090,6098 ****
if (yank_type == MBLOCK)
yank_type = MAUTO;
#endif
- if (yank_type == MAUTO)
- yank_type = ((len > 0 && (str[len - 1] == '\n' || str[len - 1] == '\r'))
- ? MLINE : MCHAR);
str_to_reg(y_current, yank_type, str, len, block_len);
# ifdef FEAT_CLIPBOARD
--- 6092,6097 ----
***************
*** 6113,6125 ****
* is appended.
*/
static void
! str_to_reg(y_ptr, type, str, len, blocklen)
struct yankreg *y_ptr; /* pointer to yank register */
! int type; /* MCHAR, MLINE or MBLOCK */
char_u *str; /* string to put in register */
long len; /* length of string */
long blocklen; /* width of Visual block */
{
int lnum;
long start;
long i;
--- 6112,6125 ----
* is appended.
*/
static void
! str_to_reg(y_ptr, yank_type, str, len, blocklen)
struct yankreg *y_ptr; /* pointer to yank register */
! int yank_type; /* MCHAR, MLINE, MBLOCK, MAUTO */
char_u *str; /* string to put in register */
long len; /* length of string */
long blocklen; /* width of Visual block */
{
+ int type; /* MCHAR, MLINE or MBLOCK */
int lnum;
long start;
long i;
***************
*** 6136,6141 ****
--- 6136,6147 ----
if (y_ptr->y_array == NULL) /* NULL means empty register */
y_ptr->y_size = 0;
+ if (yank_type == MAUTO)
+ type = ((len > 0 && (str[len - 1] == NL || str[len - 1] == CAR))
+ ? MLINE : MCHAR);
+ else
+ type = yank_type;
+
/*
* Count the number of lines within the string
*/
*** ../mercurial/vim73/src/os_msdos.c 2010-12-17 18:06:00.000000000 +0100
--- src/os_msdos.c 2011-06-19 01:00:56.000000000 +0200
***************
*** 2232,2238 ****
void
clip_mch_request_selection(VimClipboard *cbd)
{
! int type = MCHAR;
char_u *pAllocated = NULL;
char_u *pClipText = NULL;
int clip_data_format = 0;
--- 2232,2238 ----
void
clip_mch_request_selection(VimClipboard *cbd)
{
! int type = MAUTO;
char_u *pAllocated = NULL;
char_u *pClipText = NULL;
int clip_data_format = 0;
***************
*** 2280,2293 ****
{
clip_data_format = CF_TEXT;
pClipText = pAllocated;
- type = (vim_strchr((char*)pClipText, '\r') != NULL) ? MLINE : MCHAR;
}
else if ((pAllocated = Win16GetClipboardData(CF_OEMTEXT)) != NULL)
{
clip_data_format = CF_OEMTEXT;
pClipText = pAllocated;
- type = (vim_strchr((char*)pClipText, '\r') != NULL) ? MLINE : MCHAR;
}
/* Did we get anything? */
--- 2280,2291 ----
*** ../mercurial/vim73/src/os_mswin.c 2011-01-17 20:08:04.000000000 +0100
--- src/os_mswin.c 2011-06-19 01:01:51.000000000 +0200
***************
*** 1410,1418 ****
{
char_u *temp_clipboard;
! /* If the type is not known guess it. */
if (metadata.type == -1)
! metadata.type = (vim_strchr(str, '\n') == NULL) ? MCHAR : MLINE;
/* Translate <CR><NL> into <NL>. */
temp_clipboard = crnl_to_nl(str, &str_size);
--- 1410,1418 ----
{
char_u *temp_clipboard;
! /* If the type is not known detect it. */
if (metadata.type == -1)
! metadata.type = MAUTO;
/* Translate <CR><NL> into <NL>. */
temp_clipboard = crnl_to_nl(str, &str_size);
*** ../mercurial/vim73/src/os_qnx.c 2010-05-15 21:22:11.000000000 +0200
--- src/os_qnx.c 2011-06-19 01:02:26.000000000 +0200
***************
*** 93,99 ****
clip_length = clip_header->length - 1;
if( clip_text != NULL && is_type_set == FALSE )
! type = (strchr( clip_text, '\r' ) != NULL) ? MLINE : MCHAR;
}
if( (clip_text != NULL) && (clip_length > 0) )
--- 93,99 ----
clip_length = clip_header->length - 1;
if( clip_text != NULL && is_type_set == FALSE )
! type = MAUTO;
}
if( (clip_text != NULL) && (clip_length > 0) )
*** ../mercurial/vim73/src/ui.c 2010-09-21 22:09:28.000000000 +0200
--- src/ui.c 2011-06-19 01:03:31.000000000 +0200
***************
*** 1609,1615 ****
#if defined(FEAT_HANGULIN) || defined(PROTO)
void
! push_raw_key (s, len)
char_u *s;
int len;
{
--- 1609,1615 ----
#if defined(FEAT_HANGULIN) || defined(PROTO)
void
! push_raw_key(s, len)
char_u *s;
int len;
{
***************
*** 2016,2022 ****
long_u *length;
int *format;
{
! int motion_type;
long_u len;
char_u *p;
char **text_list = NULL;
--- 2016,2022 ----
long_u *length;
int *format;
{
! int motion_type = MAUTO;
long_u len;
char_u *p;
char **text_list = NULL;
***************
*** 2036,2042 ****
*(int *)success = FALSE;
return;
}
- motion_type = MCHAR;
p = (char_u *)value;
len = *length;
if (*type == vim_atom)
--- 2036,2041 ----
*** ../vim-7.3.220/src/version.c 2011-06-19 00:27:46.000000000 +0200
--- src/version.c 2011-06-19 01:03:59.000000000 +0200
***************
*** 711,712 ****
--- 711,714 ----
{ /* Add new patch number below this line */
+ /**/
+ 221,
/**/
--
hundred-and-one symptoms of being an internet addict:
190. You quickly hand over your wallet, leather jacket, and car keys
during a mugging, then proceed to beat the crap out of your
assailant when he asks for your laptop.
/// 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 ///
|