]> git.pld-linux.org Git - packages/vim.git/blob - 7.3.221
- new
[packages/vim.git] / 7.3.221
1 To: vim_dev@googlegroups.com
2 Subject: Patch 7.3.221
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.3.221
11 Problem:    Text from the clipboard is sometimes handled as linewise, but not
12             consistently.
13 Solution:   Assume the text is linewise when it ends in a CR or NL.
14 Files:      src/gui_gtk_x11.c, src/gui_mac.c, src/ops.c, src/os_msdos.c,
15             src/os_mswin.c, src/os_qnx.c, src/ui.c
16
17
18 *** ../mercurial/vim73/src/gui_gtk_x11.c        2011-02-25 17:10:22.000000000 +0100
19 --- src/gui_gtk_x11.c   2011-06-19 00:58:31.000000000 +0200
20 ***************
21 *** 1173,1179 ****
22       char_u        *tmpbuf = NULL;
23       guchar        *tmpbuf_utf8 = NULL;
24       int                   len;
25 !     int                   motion_type;
26   
27       if (data->selection == clip_plus.gtk_sel_atom)
28         cbd = &clip_plus;
29 --- 1173,1179 ----
30       char_u        *tmpbuf = NULL;
31       guchar        *tmpbuf_utf8 = NULL;
32       int                   len;
33 !     int                   motion_type = MAUTO;
34   
35       if (data->selection == clip_plus.gtk_sel_atom)
36         cbd = &clip_plus;
37 ***************
38 *** 1182,1188 ****
39   
40       text = (char_u *)data->data;
41       len  = data->length;
42 -     motion_type = MCHAR;
43   
44       if (text == NULL || len <= 0)
45       {
46 --- 1182,1187 ----
47 *** ../mercurial/vim73/src/gui_mac.c    2011-06-12 20:33:30.000000000 +0200
48 --- src/gui_mac.c       2011-06-19 00:59:07.000000000 +0200
49 ***************
50 *** 4671,4677 ****
51       if (flavor)
52         type = **textOfClip;
53       else
54 !       type = (strchr(*textOfClip, '\r') != NULL) ? MLINE : MCHAR;
55   
56       tempclip = lalloc(scrapSize + 1, TRUE);
57       mch_memmove(tempclip, *textOfClip + flavor, scrapSize);
58 --- 4671,4677 ----
59       if (flavor)
60         type = **textOfClip;
61       else
62 !       type = MAUTO;
63   
64       tempclip = lalloc(scrapSize + 1, TRUE);
65       mch_memmove(tempclip, *textOfClip + flavor, scrapSize);
66 *** ../mercurial/vim73/src/ops.c        2011-04-01 16:28:33.000000000 +0200
67 --- src/ops.c   2011-06-19 00:59:39.000000000 +0200
68 ***************
69 *** 5733,5739 ****
70       }
71   }
72   
73 ! /* Convert from the GUI selection string into the '*'/'+' register */
74       void
75   clip_yank_selection(type, str, len, cbd)
76       int               type;
77 --- 5733,5741 ----
78       }
79   }
80   
81 ! /*
82 !  * Convert from the GUI selection string into the '*'/'+' register.
83 !  */
84       void
85   clip_yank_selection(type, str, len, cbd)
86       int               type;
87 ***************
88 *** 6090,6098 ****
89       if (yank_type == MBLOCK)
90         yank_type = MAUTO;
91   #endif
92 -     if (yank_type == MAUTO)
93 -       yank_type = ((len > 0 && (str[len - 1] == '\n' || str[len - 1] == '\r'))
94 -                                                            ? MLINE : MCHAR);
95       str_to_reg(y_current, yank_type, str, len, block_len);
96   
97   # ifdef FEAT_CLIPBOARD
98 --- 6092,6097 ----
99 ***************
100 *** 6113,6125 ****
101    * is appended.
102    */
103       static void
104 ! str_to_reg(y_ptr, type, str, len, blocklen)
105       struct yankreg    *y_ptr;         /* pointer to yank register */
106 !     int                       type;           /* MCHAR, MLINE or MBLOCK */
107       char_u            *str;           /* string to put in register */
108       long              len;            /* length of string */
109       long              blocklen;       /* width of Visual block */
110   {
111       int               lnum;
112       long      start;
113       long      i;
114 --- 6112,6125 ----
115    * is appended.
116    */
117       static void
118 ! str_to_reg(y_ptr, yank_type, str, len, blocklen)
119       struct yankreg    *y_ptr;         /* pointer to yank register */
120 !     int                       yank_type;      /* MCHAR, MLINE, MBLOCK, MAUTO */
121       char_u            *str;           /* string to put in register */
122       long              len;            /* length of string */
123       long              blocklen;       /* width of Visual block */
124   {
125 +     int               type;                   /* MCHAR, MLINE or MBLOCK */
126       int               lnum;
127       long      start;
128       long      i;
129 ***************
130 *** 6136,6141 ****
131 --- 6136,6147 ----
132       if (y_ptr->y_array == NULL)               /* NULL means empty register */
133         y_ptr->y_size = 0;
134   
135 +     if (yank_type == MAUTO)
136 +       type = ((len > 0 && (str[len - 1] == NL || str[len - 1] == CAR))
137 +                                                            ? MLINE : MCHAR);
138 +     else
139 +       type = yank_type;
140
141       /*
142        * Count the number of lines within the string
143        */
144 *** ../mercurial/vim73/src/os_msdos.c   2010-12-17 18:06:00.000000000 +0100
145 --- src/os_msdos.c      2011-06-19 01:00:56.000000000 +0200
146 ***************
147 *** 2232,2238 ****
148       void
149   clip_mch_request_selection(VimClipboard *cbd)
150   {
151 !     int               type = MCHAR;
152       char_u    *pAllocated = NULL;
153       char_u    *pClipText = NULL;
154       int               clip_data_format = 0;
155 --- 2232,2238 ----
156       void
157   clip_mch_request_selection(VimClipboard *cbd)
158   {
159 !     int               type = MAUTO;
160       char_u    *pAllocated = NULL;
161       char_u    *pClipText = NULL;
162       int               clip_data_format = 0;
163 ***************
164 *** 2280,2293 ****
165         {
166             clip_data_format = CF_TEXT;
167             pClipText = pAllocated;
168 -           type = (vim_strchr((char*)pClipText, '\r') != NULL) ? MLINE : MCHAR;
169         }
170   
171         else if ((pAllocated = Win16GetClipboardData(CF_OEMTEXT)) != NULL)
172         {
173             clip_data_format = CF_OEMTEXT;
174             pClipText = pAllocated;
175 -           type = (vim_strchr((char*)pClipText, '\r') != NULL) ? MLINE : MCHAR;
176         }
177   
178         /* Did we get anything? */
179 --- 2280,2291 ----
180 *** ../mercurial/vim73/src/os_mswin.c   2011-01-17 20:08:04.000000000 +0100
181 --- src/os_mswin.c      2011-06-19 01:01:51.000000000 +0200
182 ***************
183 *** 1410,1418 ****
184       {
185         char_u *temp_clipboard;
186   
187 !       /* If the type is not known guess it. */
188         if (metadata.type == -1)
189 !           metadata.type = (vim_strchr(str, '\n') == NULL) ? MCHAR : MLINE;
190   
191         /* Translate <CR><NL> into <NL>. */
192         temp_clipboard = crnl_to_nl(str, &str_size);
193 --- 1410,1418 ----
194       {
195         char_u *temp_clipboard;
196   
197 !       /* If the type is not known detect it. */
198         if (metadata.type == -1)
199 !           metadata.type = MAUTO;
200   
201         /* Translate <CR><NL> into <NL>. */
202         temp_clipboard = crnl_to_nl(str, &str_size);
203 *** ../mercurial/vim73/src/os_qnx.c     2010-05-15 21:22:11.000000000 +0200
204 --- src/os_qnx.c        2011-06-19 01:02:26.000000000 +0200
205 ***************
206 *** 93,99 ****
207             clip_length  = clip_header->length - 1;
208   
209             if( clip_text != NULL && is_type_set == FALSE )
210 !               type = (strchr( clip_text, '\r' ) != NULL) ? MLINE : MCHAR;
211         }
212   
213         if( (clip_text != NULL) && (clip_length > 0) )
214 --- 93,99 ----
215             clip_length  = clip_header->length - 1;
216   
217             if( clip_text != NULL && is_type_set == FALSE )
218 !               type = MAUTO;
219         }
220   
221         if( (clip_text != NULL) && (clip_length > 0) )
222 *** ../mercurial/vim73/src/ui.c 2010-09-21 22:09:28.000000000 +0200
223 --- src/ui.c    2011-06-19 01:03:31.000000000 +0200
224 ***************
225 *** 1609,1615 ****
226   
227   #if defined(FEAT_HANGULIN) || defined(PROTO)
228       void
229 ! push_raw_key (s, len)
230       char_u  *s;
231       int           len;
232   {
233 --- 1609,1615 ----
234   
235   #if defined(FEAT_HANGULIN) || defined(PROTO)
236       void
237 ! push_raw_key(s, len)
238       char_u  *s;
239       int           len;
240   {
241 ***************
242 *** 2016,2022 ****
243       long_u    *length;
244       int               *format;
245   {
246 !     int               motion_type;
247       long_u    len;
248       char_u    *p;
249       char      **text_list = NULL;
250 --- 2016,2022 ----
251       long_u    *length;
252       int               *format;
253   {
254 !     int               motion_type = MAUTO;
255       long_u    len;
256       char_u    *p;
257       char      **text_list = NULL;
258 ***************
259 *** 2036,2042 ****
260         *(int *)success = FALSE;
261         return;
262       }
263 -     motion_type = MCHAR;
264       p = (char_u *)value;
265       len = *length;
266       if (*type == vim_atom)
267 --- 2036,2041 ----
268 *** ../vim-7.3.220/src/version.c        2011-06-19 00:27:46.000000000 +0200
269 --- src/version.c       2011-06-19 01:03:59.000000000 +0200
270 ***************
271 *** 711,712 ****
272 --- 711,714 ----
273   {   /* Add new patch number below this line */
274 + /**/
275 +     221,
276   /**/
277
278 -- 
279 hundred-and-one symptoms of being an internet addict:
280 190. You quickly hand over your wallet, leather jacket, and car keys
281      during a mugging, then proceed to beat the crap out of your
282      assailant when he asks for your laptop.
283
284  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
285 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
286 \\\  an exciting new programming language -- http://www.Zimbu.org        ///
287  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.09238 seconds and 3 git commands to generate.