]> git.ipfire.org Git - ipfire-3.x.git/blob - vim/patches/vim-7.3.321.patch0
6303b013caa398986f6a08824718dc029772118b
[ipfire-3.x.git] / vim / patches / vim-7.3.321.patch0
1 To: vim_dev@googlegroups.com
2 Subject: Patch 7.3.321
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.321
11 Problem: Code not following Vim style.
12 Solution: Fix the style. (Elias Diem)
13 Files: src/os_qnx.c
14
15
16 *** ../vim-7.3.320/src/os_qnx.c 2011-06-19 01:14:22.000000000 +0200
17 --- src/os_qnx.c 2011-09-21 19:48:08.000000000 +0200
18 ***************
19 *** 24,33 ****
20 #if defined(FEAT_GUI_PHOTON)
21 PhChannelParms_t parms;
22
23 ! memset( &parms, 0, sizeof( parms ) );
24 parms.flags = Ph_DYNAMIC_BUFFER;
25
26 ! is_photon_available = (PhAttach( NULL, &parms ) != NULL) ? TRUE : FALSE;
27 #endif
28 }
29
30 --- 24,33 ----
31 #if defined(FEAT_GUI_PHOTON)
32 PhChannelParms_t parms;
33
34 ! memset(&parms, 0, sizeof(parms));
35 parms.flags = Ph_DYNAMIC_BUFFER;
36
37 ! is_photon_available = (PhAttach(NULL, &parms) != NULL) ? TRUE : FALSE;
38 #endif
39 }
40
41 ***************
42 *** 39,46 ****
43 /* Turn on the clipboard for a console vim when photon is running */
44 void qnx_clip_init()
45 {
46 ! if( is_photon_available == TRUE && !gui.in_use)
47 ! clip_init( TRUE );
48 }
49
50 /*****************************************************************************/
51 --- 39,46 ----
52 /* Turn on the clipboard for a console vim when photon is running */
53 void qnx_clip_init()
54 {
55 ! if (is_photon_available == TRUE && !gui.in_use)
56 ! clip_init(TRUE);
57 }
58
59 /*****************************************************************************/
60 ***************
61 *** 48,79 ****
62
63 /* No support for owning the clipboard */
64 int
65 ! clip_mch_own_selection( VimClipboard *cbd )
66 {
67 return FALSE;
68 }
69
70 void
71 ! clip_mch_lose_selection( VimClipboard *cbd )
72 {
73 }
74
75 void
76 ! clip_mch_request_selection( VimClipboard *cbd )
77 {
78 int type = MLINE, clip_length = 0, is_type_set = FALSE;
79 void *cbdata;
80 PhClipHeader *clip_header;
81 char_u *clip_text = NULL;
82
83 ! cbdata = PhClipboardPasteStart( PhInputGroup( NULL ));
84 ! if( cbdata != NULL )
85 {
86 /* Look for the vim specific clip first */
87 ! clip_header = PhClipboardPasteType( cbdata, CLIP_TYPE_VIM );
88 ! if( clip_header != NULL && clip_header->data != NULL )
89 {
90 ! switch( *(char *) clip_header->data )
91 {
92 default: /* fallthrough to line type */
93 case 'L': type = MLINE; break;
94 --- 48,79 ----
95
96 /* No support for owning the clipboard */
97 int
98 ! clip_mch_own_selection(VimClipboard *cbd)
99 {
100 return FALSE;
101 }
102
103 void
104 ! clip_mch_lose_selection(VimClipboard *cbd)
105 {
106 }
107
108 void
109 ! clip_mch_request_selection(VimClipboard *cbd)
110 {
111 int type = MLINE, clip_length = 0, is_type_set = FALSE;
112 void *cbdata;
113 PhClipHeader *clip_header;
114 char_u *clip_text = NULL;
115
116 ! cbdata = PhClipboardPasteStart(PhInputGroup(NULL));
117 ! if (cbdata != NULL)
118 {
119 /* Look for the vim specific clip first */
120 ! clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_VIM);
121 ! if (clip_header != NULL && clip_header->data != NULL)
122 {
123 ! switch(*(char *) clip_header->data)
124 {
125 default: /* fallthrough to line type */
126 case 'L': type = MLINE; break;
127 ***************
128 *** 86,112 ****
129 }
130
131 /* Try for just normal text */
132 ! clip_header = PhClipboardPasteType( cbdata, CLIP_TYPE_TEXT );
133 ! if( clip_header != NULL )
134 {
135 clip_text = clip_header->data;
136 clip_length = clip_header->length - 1;
137
138 ! if( clip_text != NULL && is_type_set == FALSE )
139 type = MAUTO;
140 }
141
142 ! if( (clip_text != NULL) && (clip_length > 0) )
143 {
144 ! clip_yank_selection( type, clip_text, clip_length, cbd );
145 }
146
147 ! PhClipboardPasteFinish( cbdata );
148 }
149 }
150
151 void
152 ! clip_mch_set_selection( VimClipboard *cbd )
153 {
154 int type;
155 long_u len;
156 --- 86,112 ----
157 }
158
159 /* Try for just normal text */
160 ! clip_header = PhClipboardPasteType(cbdata, CLIP_TYPE_TEXT);
161 ! if (clip_header != NULL)
162 {
163 clip_text = clip_header->data;
164 clip_length = clip_header->length - 1;
165
166 ! if (clip_text != NULL && is_type_set == FALSE)
167 type = MAUTO;
168 }
169
170 ! if ((clip_text != NULL) && (clip_length > 0))
171 {
172 ! clip_yank_selection(type, clip_text, clip_length, cbd);
173 }
174
175 ! PhClipboardPasteFinish(cbdata);
176 }
177 }
178
179 void
180 ! clip_mch_set_selection(VimClipboard *cbd)
181 {
182 int type;
183 long_u len;
184 ***************
185 *** 114,144 ****
186 PhClipHeader clip_header[2];
187
188 /* Prevent recursion from clip_get_selection() */
189 ! if( cbd->owned == TRUE )
190 return;
191
192 cbd->owned = TRUE;
193 ! clip_get_selection( cbd );
194 cbd->owned = FALSE;
195
196 ! type = clip_convert_selection( &str, &len, cbd );
197 ! if( type >= 0 )
198 {
199 ! text_clip = lalloc( len + 1, TRUE ); /* Normal text */
200
201 ! if( text_clip && vim_clip )
202 {
203 ! memset( clip_header, 0, sizeof( clip_header ) );
204
205 ! STRNCPY( clip_header[0].type, CLIP_TYPE_VIM, 8 );
206 ! clip_header[0].length = sizeof( vim_clip );
207 clip_header[0].data = vim_clip;
208
209 ! STRNCPY( clip_header[1].type, CLIP_TYPE_TEXT, 8 );
210 clip_header[1].length = len + 1;
211 clip_header[1].data = text_clip;
212
213 ! switch( type )
214 {
215 default: /* fallthrough to MLINE */
216 case MLINE: *vim_clip = 'L'; break;
217 --- 114,144 ----
218 PhClipHeader clip_header[2];
219
220 /* Prevent recursion from clip_get_selection() */
221 ! if (cbd->owned == TRUE)
222 return;
223
224 cbd->owned = TRUE;
225 ! clip_get_selection(cbd);
226 cbd->owned = FALSE;
227
228 ! type = clip_convert_selection(&str, &len, cbd);
229 ! if (type >= 0)
230 {
231 ! text_clip = lalloc(len + 1, TRUE); /* Normal text */
232
233 ! if (text_clip && vim_clip)
234 {
235 ! memset(clip_header, 0, sizeof(clip_header));
236
237 ! STRNCPY(clip_header[0].type, CLIP_TYPE_VIM, 8);
238 ! clip_header[0].length = sizeof(vim_clip);
239 clip_header[0].data = vim_clip;
240
241 ! STRNCPY(clip_header[1].type, CLIP_TYPE_TEXT, 8);
242 clip_header[1].length = len + 1;
243 clip_header[1].data = text_clip;
244
245 ! switch(type)
246 {
247 default: /* fallthrough to MLINE */
248 case MLINE: *vim_clip = 'L'; break;
249 ***************
250 *** 148,161 ****
251 #endif
252 }
253
254 ! vim_strncpy( text_clip, str, len );
255
256 vim_clip[ 1 ] = NUL;
257
258 ! PhClipboardCopy( PhInputGroup( NULL ), 2, clip_header);
259 }
260 ! vim_free( text_clip );
261 }
262 ! vim_free( str );
263 }
264 #endif
265 --- 148,161 ----
266 #endif
267 }
268
269 ! vim_strncpy(text_clip, str, len);
270
271 vim_clip[ 1 ] = NUL;
272
273 ! PhClipboardCopy(PhInputGroup(NULL), 2, clip_header);
274 }
275 ! vim_free(text_clip);
276 }
277 ! vim_free(str);
278 }
279 #endif
280 *** ../vim-7.3.320/src/version.c 2011-09-21 19:10:42.000000000 +0200
281 --- src/version.c 2011-09-21 19:47:50.000000000 +0200
282 ***************
283 *** 711,712 ****
284 --- 711,714 ----
285 { /* Add new patch number below this line */
286 + /**/
287 + 321,
288 /**/
289
290 --
291 Bypasses are devices that allow some people to dash from point A to
292 point B very fast while other people dash from point B to point A very
293 fast. People living at point C, being a point directly in between, are
294 often given to wonder what's so great about point A that so many people
295 from point B are so keen to get there and what's so great about point B
296 that so many people from point A are so keen to get there. They often
297 wish that people would just once and for all work out where the hell
298 they wanted to be.
299 -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
300
301 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
302 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
303 \\\ an exciting new programming language -- http://www.Zimbu.org ///
304 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///