source: patches/vim-7.0-fixes-4.patch@ cf4bffa

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since cf4bffa was 4f46927, checked in by Jim Gifford <clfs@…>, 19 years ago

Updated Vim 7.0 patch

  • Property mode set to 100644
File size: 25.0 KB
RevLine 
[4f46927]1Submitted By: Jim Gifford (jim at linuxfromscratch dot org)
2Date: 2006-06-21
[34f53b7]3Initial Package Version: 7.0
4Origin: Upstream
5Upstream Status: Applied
[4f46927]6Description: Contains Patch 001-004 and 006-022 from Upstream
[34f53b7]7 005 is for the extras and Windows 32 only
8
[4f46927]9diff -Naur vim70.orig/runtime/autoload/ccomplete.vim vim70/runtime/autoload/ccomplete.vim
10--- vim70.orig/runtime/autoload/ccomplete.vim 2006-05-03 07:35:56.000000000 -0700
11+++ vim70/runtime/autoload/ccomplete.vim 2006-06-21 23:50:50.000000000 -0700
[34f53b7]12@@ -1,7 +1,7 @@
13 " Vim completion script
14 " Language: C
15 " Maintainer: Bram Moolenaar <Bram@vim.org>
16-" Last Change: 2006 May 03
17+" Last Change: 2006 May 08
18
19
20 " This function is used for the 'omnifunc' option.
21@@ -458,7 +458,7 @@
22 " member.
23 function! s:StructMembers(typename, items, all)
24 " Todo: What about local structures?
25- let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
26+ let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
27 if fnames == ''
28 return []
29 endif
[4f46927]30diff -Naur vim70.orig/runtime/autoload/spellfile.vim vim70/runtime/autoload/spellfile.vim
31--- vim70.orig/runtime/autoload/spellfile.vim 2006-02-01 04:12:24.000000000 -0800
32+++ vim70/runtime/autoload/spellfile.vim 2006-06-21 23:50:50.000000000 -0700
[34f53b7]33@@ -1,9 +1,9 @@
34 " Vim script to download a missing spell file
35 " Maintainer: Bram Moolenaar <Bram@vim.org>
36-" Last Change: 2006 Feb 01
37+" Last Change: 2006 May 10
38
39 if !exists('g:spellfile_URL')
40- let g:spellfile_URL = 'ftp://ftp.vim.org/pub/vim/unstable/runtime/spell'
41+ let g:spellfile_URL = 'ftp://ftp.vim.org/pub/vim/runtime/spell'
42 endif
43 let s:spellfile_URL = '' " Start with nothing so that s:donedict is reset.
44
45@@ -61,13 +61,13 @@
46 new
47 setlocal bin
48 echo 'Downloading ' . fname . '...'
49- exe 'Nread ' g:spellfile_URL . '/' . fname
50+ call spellfile#Nread(fname)
51 if getline(2) !~ 'VIMspell'
52 " Didn't work, perhaps there is an ASCII one.
53 g/^/d
54 let fname = a:lang . '.ascii.spl'
55 echo 'Could not find it, trying ' . fname . '...'
56- exe 'Nread ' g:spellfile_URL . '/' . fname
57+ call spellfile#Nread(fname)
58 if getline(2) !~ 'VIMspell'
59 echo 'Sorry, downloading failed'
60 bwipe!
61@@ -95,7 +95,7 @@
62 g/^/d
63 let fname = substitute(fname, '\.spl$', '.sug', '')
64 echo 'Downloading ' . fname . '...'
65- exe 'Nread ' g:spellfile_URL . '/' . fname
66+ call spellfile#Nread(fname)
67 if getline(2) !~ 'VIMsug'
68 echo 'Sorry, downloading failed'
69 else
70@@ -109,3 +109,10 @@
71 bwipe
72 endif
73 endfunc
74+
75+" Read "fname" from the ftp server.
76+function! spellfile#Nread(fname)
77+ let machine = substitute(g:spellfile_URL, 'ftp://\([^/]*\).*', '\1', '')
78+ let dir = substitute(g:spellfile_URL, 'ftp://[^/]*/\(.*\)', '\1', '')
79+ exe 'Nread "' . machine . ' anonymous vim7user ' . dir . '/' . a:fname . '"'
80+endfunc
[4f46927]81diff -Naur vim70.orig/runtime/plugin/matchparen.vim vim70/runtime/plugin/matchparen.vim
82--- vim70.orig/runtime/plugin/matchparen.vim 2006-04-27 06:31:26.000000000 -0700
83+++ vim70/runtime/plugin/matchparen.vim 2006-06-21 23:50:50.000000000 -0700
[34f53b7]84@@ -1,6 +1,6 @@
85 " Vim plugin for showing matching parens
86 " Maintainer: Bram Moolenaar <Bram@vim.org>
87-" Last Change: 2006 Apr 27
88+" Last Change: 2006 May 11
89
90 " Exit quickly when:
91 " - this plugin was already loaded (or disabled)
92@@ -90,7 +90,7 @@
93 " Find the match. When it was just before the cursor move it there for a
94 " moment.
95 if before > 0
96- let save_cursor = getpos('.')
97+ let save_cursor = winsaveview()
98 call cursor(c_lnum, c_col - before)
99 endif
100
101@@ -102,7 +102,7 @@
102 let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
103
104 if before > 0
105- call setpos('.', save_cursor)
106+ call winrestview(save_cursor)
107 endif
108
109 " If a match is found setup match highlighting.
[4f46927]110diff -Naur vim70.orig/src/edit.c vim70/src/edit.c
111--- vim70.orig/src/edit.c 2006-05-07 04:48:51.000000000 -0700
112+++ vim70/src/edit.c 2006-06-21 23:50:50.000000000 -0700
[34f53b7]113@@ -751,7 +751,7 @@
114 continue;
115 }
116
117- /* Pressing CTRL-Y selects the current match. Shen
118+ /* Pressing CTRL-Y selects the current match. When
119 * compl_enter_selects is set the Enter key does the same. */
120 if (c == Ctrl_Y || (compl_enter_selects
121 && (c == CAR || c == K_KENTER || c == NL)))
122@@ -3046,7 +3046,6 @@
123 ins_compl_delete();
124 ins_bytes(compl_leader + curwin->w_cursor.col - compl_col);
125 compl_used_match = FALSE;
126- compl_enter_selects = FALSE;
127
128 if (compl_started)
129 ins_compl_set_original_text(compl_leader);
130@@ -3076,6 +3075,7 @@
131 compl_restarting = FALSE;
132 }
133
134+#if 0 /* disabled, made CTRL-L, BS and typing char jump to original text. */
135 if (!compl_used_match)
136 {
137 /* Go to the original text, since none of the matches is inserted. */
138@@ -3087,6 +3087,8 @@
139 compl_curr_match = compl_shown_match;
140 compl_shows_dir = compl_direction;
141 }
142+#endif
143+ compl_enter_selects = !compl_used_match;
144
145 /* Show the popup menu with a different set of matches. */
146 ins_compl_show_pum();
147@@ -3175,10 +3177,32 @@
148 char_u *p;
149 int len = curwin->w_cursor.col - compl_col;
150 int c;
151+ compl_T *cp;
152
153 p = compl_shown_match->cp_str;
154 if ((int)STRLEN(p) <= len) /* the match is too short */
155- return;
156+ {
157+ /* When still at the original match use the first entry that matches
158+ * the leader. */
159+ if (compl_shown_match->cp_flags & ORIGINAL_TEXT)
160+ {
161+ p = NULL;
162+ for (cp = compl_shown_match->cp_next; cp != NULL
163+ && cp != compl_first_match; cp = cp->cp_next)
164+ {
165+ if (ins_compl_equal(cp, compl_leader,
166+ (int)STRLEN(compl_leader)))
167+ {
168+ p = cp->cp_str;
169+ break;
170+ }
171+ }
172+ if (p == NULL || (int)STRLEN(p) <= len)
173+ return;
174+ }
175+ else
176+ return;
177+ }
178 p += len;
179 #ifdef FEAT_MBYTE
180 c = mb_ptr2char(p);
181@@ -4100,6 +4124,21 @@
182 && compl_shown_match->cp_next != NULL
183 && compl_shown_match->cp_next != compl_first_match)
184 compl_shown_match = compl_shown_match->cp_next;
185+
186+ /* If we didn't find it searching forward, and compl_shows_dir is
187+ * backward, find the last match. */
188+ if (compl_shows_dir == BACKWARD
189+ && !ins_compl_equal(compl_shown_match,
190+ compl_leader, (int)STRLEN(compl_leader))
191+ && (compl_shown_match->cp_next == NULL
192+ || compl_shown_match->cp_next == compl_first_match))
193+ {
194+ while (!ins_compl_equal(compl_shown_match,
195+ compl_leader, (int)STRLEN(compl_leader))
196+ && compl_shown_match->cp_prev != NULL
197+ && compl_shown_match->cp_prev != compl_first_match)
198+ compl_shown_match = compl_shown_match->cp_prev;
199+ }
200 }
201
202 if (allow_get_expansion && insert_match
[4f46927]203diff -Naur vim70.orig/src/eval.c vim70/src/eval.c
204--- vim70.orig/src/eval.c 2006-05-05 10:15:26.000000000 -0700
205+++ vim70/src/eval.c 2006-06-21 23:50:50.000000000 -0700
[34f53b7]206@@ -11372,7 +11372,7 @@
207 if (argvars[2].v_type != VAR_UNKNOWN)
208 {
209 char_u *xp_name;
210- int xp_namelen;
211+ int xp_namelen;
212 long argt;
213
214 rettv->vval.v_string = NULL;
215@@ -18963,7 +18963,8 @@
216 else if (lead > 0)
217 {
218 lead = 3;
219- if (eval_fname_sid(lv.ll_exp_name != NULL ? lv.ll_exp_name : *pp))
220+ if ((lv.ll_exp_name != NULL && eval_fname_sid(lv.ll_exp_name))
221+ || eval_fname_sid(*pp))
222 {
223 /* It's "s:" or "<SID>" */
224 if (current_SID <= 0)
[4f46927]225diff -Naur vim70.orig/src/ex_docmd.c vim70/src/ex_docmd.c
226--- vim70.orig/src/ex_docmd.c 2006-05-05 09:33:19.000000000 -0700
227+++ vim70/src/ex_docmd.c 2006-06-21 23:50:50.000000000 -0700
[34f53b7]228@@ -833,7 +833,7 @@
229 * If requested, store and reset the global values controlling the
230 * exception handling (used when debugging).
231 */
232- else if (flags & DOCMD_EXCRESET)
233+ if (flags & DOCMD_EXCRESET)
234 save_dbg_stuff(&debug_saved);
235
236 initial_trylevel = trylevel;
[4f46927]237diff -Naur vim70.orig/src/gui_at_fs.c vim70/src/gui_at_fs.c
238--- vim70.orig/src/gui_at_fs.c 2005-07-09 04:30:17.000000000 -0700
239+++ vim70/src/gui_at_fs.c 2006-06-21 23:50:50.000000000 -0700
[34f53b7]240@@ -1861,27 +1861,27 @@
241 XtPointer pnew;
242 {
243 SFDir *dir;
244- int nw;
245+ int nw = (int)(long)pnew;
246
247 dir = &(SFdirs[SFdirPtr + (int)(long)n]);
248
249 #ifdef FEAT_GUI_NEXTAW
250- if ((int)(long)pnew < 0)
251+ if (nw < 0)
252 {
253- if ((int)(long)pnew > -SFvScrollHeight)
254- (int)(long)pnew = -1;
255+ if (nw > -SFvScrollHeight)
256+ nw = -1;
257 else
258- (int)(long)pnew = -SFlistSize;
259+ nw = -SFlistSize;
260 }
261- else if ((int)(long)pnew > 0)
262+ else if (nw > 0)
263 {
264- if ((int)(long)pnew < SFvScrollHeight)
265- (int)(long)pnew = 1;
266+ if (nw < SFvScrollHeight)
267+ nw = 1;
268 else
269- (int)(long)pnew = SFlistSize;
270+ nw = SFlistSize;
271 }
272 #endif
273- nw = dir->vOrigin + (int)(long)pnew;
274+ nw += dir->vOrigin;
275
276 if (nw > dir->nEntries - SFlistSize)
277 nw = dir->nEntries - SFlistSize;
278@@ -1941,27 +1941,27 @@
279 XtPointer pnew;
280 {
281 SFDir *dir;
282- int nw;
283+ int nw = (int)(long)pnew;
284
285 dir = &(SFdirs[SFdirPtr + (int)(long)n]);
286
287 #ifdef FEAT_GUI_NEXTAW
288- if ((int)(long)pnew < 0)
289+ if (nw < 0)
290 {
291- if ((int)(long)pnew > -SFhScrollWidth)
292- (int)(long)pnew = -1;
293+ if (nw > -SFhScrollWidth)
294+ nw = -1;
295 else
296- (int)(long)pnew = -SFcharsPerEntry;
297+ nw = -SFcharsPerEntry;
298 }
299- else if ((int)(long)pnew > 0)
300+ else if (nw > 0)
301 {
302- if ((int)(long)pnew < SFhScrollWidth)
303- (int)(long)pnew = 1;
304+ if (nw < SFhScrollWidth)
305+ nw = 1;
306 else
307- (int)(long)pnew = SFcharsPerEntry;
308+ nw = SFcharsPerEntry;
309 }
310 #endif
311- nw = dir->hOrigin + (int)(long)pnew;
312+ nw += dir->hOrigin;
313
314 if (nw > dir->nChars - SFcharsPerEntry)
315 nw = dir->nChars - SFcharsPerEntry;
316@@ -2038,26 +2038,26 @@
317 XtPointer client_data;
318 XtPointer pnew;
319 {
320- int nw;
321+ int nw = (int)(long)pnew;
322 float f;
323
324 #ifdef FEAT_GUI_NEXTAW
325- if ((int)(long)pnew < 0)
326+ if (nw < 0)
327 {
328- if ((int)(long)pnew > -SFpathScrollWidth)
329- (int)(long)pnew = -1;
330+ if (nw > -SFpathScrollWidth)
331+ nw = -1;
332 else
333- (int)(long)pnew = -3;
334+ nw = -3;
335 }
336- else if ((int)(long)pnew > 0)
337+ else if (nw > 0)
338 {
339- if ((int)(long)pnew < SFpathScrollWidth)
340- (int)(long)pnew = 1;
341+ if (nw < SFpathScrollWidth)
342+ nw = 1;
343 else
344- (int)(long)pnew = 3;
345+ nw = 3;
346 }
347 #endif
348- nw = SFdirPtr + (int)(long)pnew;
349+ nw += SFdirPtr;
350
351 if (nw > SFdirEnd - 3)
352 nw = SFdirEnd - 3;
[4f46927]353diff -Naur vim70.orig/src/gui.c vim70/src/gui.c
354--- vim70.orig/src/gui.c 2006-05-03 04:00:59.000000000 -0700
355+++ vim70/src/gui.c 2006-06-21 23:52:38.000000000 -0700
356@@ -4515,7 +4515,7 @@
357 int y;
358 {
359 win_T *wp;
360- char_u st[6];
361+ char_u st[8];
362
363 /* Ignore this while still starting up. */
364 if (!gui.in_use || gui.starting)
[34f53b7]365@@ -4603,11 +4603,11 @@
366 /* Don't move the mouse when it's left or right of the Vim window */
367 if (x < 0 || x > Columns * gui.char_width)
368 return;
369+ if (y >= 0
370 # ifdef FEAT_WINDOWS
371- if (Y_2_ROW(y) >= tabline_height())
372-# else
373- if (y >= 0)
374+ && Y_2_ROW(y) >= tabline_height()
375 # endif
376+ )
377 wp = xy2win(x, y);
378 if (wp != curwin && wp != NULL) /* If in other than current window */
379 {
[4f46927]380diff -Naur vim70.orig/src/gui_xmebw.c vim70/src/gui_xmebw.c
381--- vim70.orig/src/gui_xmebw.c 2006-04-30 08:32:32.000000000 -0700
382+++ vim70/src/gui_xmebw.c 2006-06-21 23:50:50.000000000 -0700
[fefaf43]383@@ -47,13 +47,13 @@
384 #include "gui_xmebwp.h"
385
386 /* Provide some missing wrappers, which are missed from the LessTif
387- * implementation.
388+ * implementation. Also missing in Motif 1.2 and earlier.
389 *
390 * We neither use XmeGetPixmapData or _XmGetPixmapData, since with LessTif the
391 * pixmap will not appear in it's caches properly. We cache the interresting
392 * values in XmEnhancedButtonPart instead ourself.
393 */
394-#ifdef LESSTIF_VERSION
395+#if defined(LESSTIF_VERSION) || (XmVersion <= 1002)
396 # ifndef Lab_IsMenupane
397 # define Lab_IsMenupane(w) (Lab_MenuType(w) == (int)XmMENU_POPUP || \
398 Lab_MenuType(w) == (int)XmMENU_PULLDOWN)
[34f53b7]399@@ -480,7 +480,7 @@
400 || (eb->core.height <= 2 * eb->primitive.highlight_thickness))
401 return;
402
403-#ifndef LESSTIF_VERSION
404+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
405 {
406 XmDisplay dpy;
407
408@@ -641,7 +641,7 @@
409 GC tmp_gc = NULL;
410 Boolean replaceGC = False;
411 Boolean deadjusted = False;
412-#ifndef LESSTIF_VERSION
413+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
414 XmDisplay dpy = (XmDisplay)XmGetXmDisplay(XtDisplay(eb));
415 Boolean etched_in = dpy->display.enable_etched_in_menu;
416 #else
417@@ -726,7 +726,7 @@
418 if ((((ShellWidget) XtParent(XtParent(eb)))->shell.popped_up)
419 && _XmGetInDragMode((Widget) eb))
420 {
421-#ifndef LESSTIF_VERSION
422+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
423 XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid));
424 Boolean etched_in = dpy->display.enable_etched_in_menu;
425 #else
426@@ -810,7 +810,7 @@
427
428 if (Lab_IsMenupane(eb))
429 {
430-#ifndef LESSTIF_VERSION
431+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
432 XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid));
433 Boolean etched_in = dpy->display.enable_etched_in_menu;
434 #else
435@@ -1150,7 +1150,7 @@
436 Redisplay(Widget w, XEvent *event, Region region)
437 {
438 XmEnhancedButtonWidget eb = (XmEnhancedButtonWidget) w;
439-#ifndef LESSTIF_VERSION
440+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
441 XmDisplay dpy;
442 XtEnum default_button_emphasis;
443 #endif
444@@ -1162,7 +1162,7 @@
445 if (!XtIsRealized((Widget)eb))
446 return;
447
448-#ifndef LESSTIF_VERSION
449+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
450 dpy = (XmDisplay)XmGetXmDisplay(XtDisplay(eb));
451 default_button_emphasis = dpy->display.default_button_emphasis;
452 #endif
453@@ -1241,7 +1241,7 @@
454 {
455 int adjust = 0;
456
457-#ifndef LESSTIF_VERSION
458+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
459 /*
460 * NOTE: PushButton has two types of shadows: primitive-shadow and
461 * default-button-shadow. If pushbutton is in a menu only primitive
462@@ -1289,7 +1289,7 @@
463 adjust, adjust, rectwidth, rectheight, borderwidth);
464 }
465
466-#ifndef LESSTIF_VERSION
467+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
468 switch (default_button_emphasis)
469 {
470 case XmINTERNAL_HIGHLIGHT:
471@@ -1365,7 +1365,7 @@
472 default_button_shadow_thickness =
473 eb->pushbutton.default_button_shadow_thickness;
474
475-#ifndef LESSTIF_VERSION
476+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
477 /*
478 * Compute location of bounding box to contain the
479 * defaultButtonShadow.
[4f46927]480diff -Naur vim70.orig/src/if_ruby.c vim70/src/if_ruby.c
481--- vim70.orig/src/if_ruby.c 2006-04-30 08:37:52.000000000 -0700
482+++ vim70/src/if_ruby.c 2006-06-21 23:56:28.000000000 -0700
483@@ -643,11 +643,23 @@
484
485 static VALUE set_buffer_line(buf_T *buf, linenr_T n, VALUE str)
486 {
487- buf_T *savebuf = curbuf;
488- char *line = STR2CSTR(str);
489+ char *line = STR2CSTR(str);
490+#ifdef FEAT_AUTOCMD
491+ aco_save_T aco;
492+#else
493+ buf_T *save_curbuf = curbuf;
494+#endif
495
496- if (n > 0 && n <= buf->b_ml.ml_line_count && line != NULL) {
497+ if (n > 0 && n <= buf->b_ml.ml_line_count && line != NULL)
498+ {
499+#ifdef FEAT_AUTOCMD
500+ /* set curwin/curbuf for "buf" and save some things */
501+ aucmd_prepbuf(&aco, buf);
502+#else
503 curbuf = buf;
504+ curwin->w_buffer = buf;
505+#endif
506+
507 if (u_savesub(n) == OK) {
508 ml_replace(n, (char_u *)line, TRUE);
509 changed();
510@@ -655,10 +667,19 @@
511 syn_changed(n); /* recompute syntax hl. for this line */
512 #endif
513 }
514- curbuf = savebuf;
515+
516+#ifdef FEAT_AUTOCMD
517+ /* restore curwin/curbuf and a few other things */
518+ aucmd_restbuf(&aco);
519+ /* Careful: autocommands may have made "buf" invalid! */
520+#else
521+ curwin->w_buffer = save_curbuf;
522+ curbuf = save_curbuf;
523+#endif
524 update_curbuf(NOT_VALID);
525 }
526- else {
527+ else
528+ {
529 rb_raise(rb_eIndexError, "index %d out of buffer", n);
530 return Qnil; /* For stop warning */
531 }
532@@ -676,12 +697,24 @@
533
534 static VALUE buffer_delete(VALUE self, VALUE num)
535 {
536- buf_T *buf = get_buf(self);
537- buf_T *savebuf = curbuf;
538- long n = NUM2LONG(num);
539+ buf_T *buf = get_buf(self);
540+ long n = NUM2LONG(num);
541+#ifdef FEAT_AUTOCMD
542+ aco_save_T aco;
543+#else
544+ buf_T *save_curbuf = curbuf;
545+#endif
546
547- if (n > 0 && n <= buf->b_ml.ml_line_count) {
548+ if (n > 0 && n <= buf->b_ml.ml_line_count)
549+ {
550+#ifdef FEAT_AUTOCMD
551+ /* set curwin/curbuf for "buf" and save some things */
552+ aucmd_prepbuf(&aco, buf);
553+#else
554 curbuf = buf;
555+ curwin->w_buffer = buf;
556+#endif
557+
558 if (u_savedel(n, 1) == OK) {
559 ml_delete(n, 0);
560
561@@ -691,10 +724,19 @@
562
563 changed();
564 }
565- curbuf = savebuf;
566+
567+#ifdef FEAT_AUTOCMD
568+ /* restore curwin/curbuf and a few other things */
569+ aucmd_restbuf(&aco);
570+ /* Careful: autocommands may have made "buf" invalid! */
571+#else
572+ curwin->w_buffer = save_curbuf;
573+ curbuf = save_curbuf;
574+#endif
575 update_curbuf(NOT_VALID);
576 }
577- else {
578+ else
579+ {
580 rb_raise(rb_eIndexError, "index %d out of buffer", n);
581 }
582 return Qnil;
583@@ -702,13 +744,25 @@
584
585 static VALUE buffer_append(VALUE self, VALUE num, VALUE str)
586 {
587- buf_T *buf = get_buf(self);
588- buf_T *savebuf = curbuf;
589- char *line = STR2CSTR(str);
590- long n = NUM2LONG(num);
591+ buf_T *buf = get_buf(self);
592+ char *line = STR2CSTR(str);
593+ long n = NUM2LONG(num);
594+#ifdef FEAT_AUTOCMD
595+ aco_save_T aco;
596+#else
597+ buf_T *save_curbuf = curbuf;
598+#endif
599
600- if (n >= 0 && n <= buf->b_ml.ml_line_count && line != NULL) {
601+ if (n >= 0 && n <= buf->b_ml.ml_line_count && line != NULL)
602+ {
603+#ifdef FEAT_AUTOCMD
604+ /* set curwin/curbuf for "buf" and save some things */
605+ aucmd_prepbuf(&aco, buf);
606+#else
607 curbuf = buf;
608+ curwin->w_buffer = buf;
609+#endif
610+
611 if (u_inssub(n + 1) == OK) {
612 ml_append(n, (char_u *) line, (colnr_T) 0, FALSE);
613
614@@ -718,7 +772,15 @@
615
616 changed();
617 }
618- curbuf = savebuf;
619+
620+#ifdef FEAT_AUTOCMD
621+ /* restore curwin/curbuf and a few other things */
622+ aucmd_restbuf(&aco);
623+ /* Careful: autocommands may have made "buf" invalid! */
624+#else
625+ curwin->w_buffer = save_curbuf;
626+ curbuf = save_curbuf;
627+#endif
628 update_curbuf(NOT_VALID);
629 }
630 else {
631diff -Naur vim70.orig/src/main.c vim70/src/main.c
632--- vim70.orig/src/main.c 2006-05-03 10:36:44.000000000 -0700
633+++ vim70/src/main.c 2006-06-21 23:51:37.000000000 -0700
634@@ -564,7 +564,11 @@
635 */
636 if (p_lpl)
637 {
638+# ifdef VMS /* Somehow VMS doesn't handle the "**". */
639+ source_runtime((char_u *)"plugin/*.vim", TRUE);
640+# else
641 source_runtime((char_u *)"plugin/**/*.vim", TRUE);
642+# endif
643 TIME_MSG("loading plugins");
644 }
645 #endif
646diff -Naur vim70.orig/src/Makefile vim70/src/Makefile
647--- vim70.orig/src/Makefile 2006-05-07 06:25:27.000000000 -0700
648+++ vim70/src/Makefile 2006-06-21 23:50:50.000000000 -0700
[34f53b7]649@@ -2177,6 +2177,7 @@
650 cd $(SHADOWDIR)/xxd; ln -s ../../xxd/*.[ch] ../../xxd/Make* .
651 if test -d $(RSRC_DIR); then \
652 cd $(SHADOWDIR); \
653+ ln -s ../infplist.xml .; \
654 ln -s ../$(RSRC_DIR) ../os_mac.rsr.hqx ../dehqx.py .; \
655 fi
656 mkdir $(SHADOWDIR)/testdir
[4f46927]657diff -Naur vim70.orig/src/mbyte.c vim70/src/mbyte.c
658--- vim70.orig/src/mbyte.c 2006-04-30 04:51:01.000000000 -0700
659+++ vim70/src/mbyte.c 2006-06-21 23:50:50.000000000 -0700
[fefaf43]660@@ -311,7 +311,11 @@
661
662 #define IDX_MACROMAN 57
663 {"macroman", ENC_8BIT + ENC_MACROMAN, 0}, /* Mac OS */
664-#define IDX_COUNT 58
665+#define IDX_DECMCS 58
666+ {"dec-mcs", ENC_8BIT, 0}, /* DEC MCS */
667+#define IDX_HPROMAN8 59
668+ {"hp-roman8", ENC_8BIT, 0}, /* HP Roman8 */
669+#define IDX_COUNT 60
670 };
671
672 /*
673@@ -386,6 +390,7 @@
674 {"950", IDX_BIG5},
675 #endif
676 {"mac", IDX_MACROMAN},
677+ {"mac-roman", IDX_MACROMAN},
678 {NULL, 0}
679 };
680
[4f46927]681diff -Naur vim70.orig/src/message.c vim70/src/message.c
682--- vim70.orig/src/message.c 2006-05-06 13:07:37.000000000 -0700
683+++ vim70/src/message.c 2006-06-21 23:50:50.000000000 -0700
[34f53b7]684@@ -4175,15 +4175,16 @@
685 str_arg_l = 0;
686 else
687 {
688- /* memchr on HP does not like n > 2^31 !!! */
689- char *q = memchr(str_arg, '\0',
690+ /* Don't put the #if inside memchr(), it can be a
691+ * macro. */
692 #if SIZEOF_INT <= 2
693- precision
694+ char *q = memchr(str_arg, '\0', precision);
695 #else
696- precision <= (size_t)0x7fffffffL ? precision
697- : (size_t)0x7fffffffL
698+ /* memchr on HP does not like n > 2^31 !!! */
699+ char *q = memchr(str_arg, '\0',
700+ precision <= (size_t)0x7fffffffL ? precision
701+ : (size_t)0x7fffffffL);
702 #endif
703- );
704 str_arg_l = (q == NULL) ? precision : q - str_arg;
705 }
706 break;
[4f46927]707diff -Naur vim70.orig/src/ops.c vim70/src/ops.c
708--- vim70.orig/src/ops.c 2006-04-30 08:13:44.000000000 -0700
709+++ vim70/src/ops.c 2006-06-21 23:52:03.000000000 -0700
710@@ -2413,6 +2413,7 @@
711 else
712 {
713 curwin->w_cursor = oap->end;
714+ check_cursor_col();
715
716 /* Works just like an 'i'nsert on the next character. */
717 if (!lineempty(curwin->w_cursor.lnum)
718diff -Naur vim70.orig/src/option.c vim70/src/option.c
719--- vim70.orig/src/option.c 2006-05-03 10:32:28.000000000 -0700
720+++ vim70/src/option.c 2006-06-21 23:50:50.000000000 -0700
[34f53b7]721@@ -2294,7 +2294,7 @@
722 {(char_u *)0L, (char_u *)0L}
723 #endif
724 },
725- {"spellsuggest", "sps", P_STRING|P_VI_DEF|P_EXPAND|P_SECURE,
726+ {"spellsuggest", "sps", P_STRING|P_VI_DEF|P_EXPAND|P_SECURE|P_COMMA,
727 #ifdef FEAT_SPELL
728 (char_u *)&p_sps, PV_NONE,
729 {(char_u *)"best", (char_u *)0L}
730@@ -5227,13 +5227,13 @@
731 case PV_STL: return &curwin->w_p_stl_flags;
732 #endif
733 #ifdef FEAT_EVAL
734+# ifdef FEAT_FOLDING
735 case PV_FDE: return &curwin->w_p_fde_flags;
736 case PV_FDT: return &curwin->w_p_fdt_flags;
737+# endif
738 # ifdef FEAT_BEVAL
739 case PV_BEXPR: return &curbuf->b_p_bexpr_flags;
740 # endif
741-#endif
742-#if defined(FEAT_EVAL)
743 # if defined(FEAT_CINDENT)
744 case PV_INDE: return &curbuf->b_p_inde_flags;
745 # endif
[4f46927]746diff -Naur vim70.orig/src/quickfix.c vim70/src/quickfix.c
747--- vim70.orig/src/quickfix.c 2006-05-03 00:47:42.000000000 -0700
748+++ vim70/src/quickfix.c 2006-06-21 23:54:05.000000000 -0700
749@@ -602,13 +602,19 @@
750 else
751 type = 0;
752 /*
753- * Extract error message data from matched line
754+ * Extract error message data from matched line.
755+ * We check for an actual submatch, because "\[" and "\]" in
756+ * the 'errorformat' may cause the wrong submatch to be used.
757 */
758 if ((i = (int)fmt_ptr->addr[0]) > 0) /* %f */
759 {
760- int c = *regmatch.endp[i];
761+ int c;
762+
763+ if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
764+ continue;
765
766 /* Expand ~/file and $HOME/file to full path. */
767+ c = *regmatch.endp[i];
768 *regmatch.endp[i] = NUL;
769 expand_env(regmatch.startp[i], namebuf, CMDBUFFSIZE);
770 *regmatch.endp[i] = c;
771@@ -618,35 +624,63 @@
772 continue;
773 }
774 if ((i = (int)fmt_ptr->addr[1]) > 0) /* %n */
775+ {
776+ if (regmatch.startp[i] == NULL)
777+ continue;
778 enr = (int)atol((char *)regmatch.startp[i]);
779+ }
780 if ((i = (int)fmt_ptr->addr[2]) > 0) /* %l */
781+ {
782+ if (regmatch.startp[i] == NULL)
783+ continue;
784 lnum = atol((char *)regmatch.startp[i]);
785+ }
786 if ((i = (int)fmt_ptr->addr[3]) > 0) /* %c */
787+ {
788+ if (regmatch.startp[i] == NULL)
789+ continue;
790 col = (int)atol((char *)regmatch.startp[i]);
791+ }
792 if ((i = (int)fmt_ptr->addr[4]) > 0) /* %t */
793+ {
794+ if (regmatch.startp[i] == NULL)
795+ continue;
796 type = *regmatch.startp[i];
797+ }
798 if (fmt_ptr->flags == '+' && !multiscan) /* %+ */
799 STRCPY(errmsg, IObuff);
800 else if ((i = (int)fmt_ptr->addr[5]) > 0) /* %m */
801 {
802+ if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
803+ continue;
804 len = (int)(regmatch.endp[i] - regmatch.startp[i]);
805 vim_strncpy(errmsg, regmatch.startp[i], len);
806 }
807 if ((i = (int)fmt_ptr->addr[6]) > 0) /* %r */
808+ {
809+ if (regmatch.startp[i] == NULL)
810+ continue;
811 tail = regmatch.startp[i];
812+ }
813 if ((i = (int)fmt_ptr->addr[7]) > 0) /* %p */
814 {
815+ if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
816+ continue;
817 col = (int)(regmatch.endp[i] - regmatch.startp[i] + 1);
818 if (*((char_u *)regmatch.startp[i]) != TAB)
819 use_viscol = TRUE;
820 }
821 if ((i = (int)fmt_ptr->addr[8]) > 0) /* %v */
822 {
823+ if (regmatch.startp[i] == NULL)
824+ continue;
825 col = (int)atol((char *)regmatch.startp[i]);
826 use_viscol = TRUE;
827 }
828 if ((i = (int)fmt_ptr->addr[9]) > 0) /* %s */
829 {
830+ if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
831+ continue;
832 len = (int)(regmatch.endp[i] - regmatch.startp[i]);
833 if (len > CMDBUFFSIZE - 5)
834 len = CMDBUFFSIZE - 5;
835diff -Naur vim70.orig/src/spell.c vim70/src/spell.c
836--- vim70.orig/src/spell.c 2006-05-05 00:49:58.000000000 -0700
837+++ vim70/src/spell.c 2006-06-21 23:50:50.000000000 -0700
[34f53b7]838@@ -2108,7 +2108,8 @@
839 * possible. */
840 STRCPY(buf, line);
841 if (lnum < wp->w_buffer->b_ml.ml_line_count)
842- spell_cat_line(buf + STRLEN(buf), ml_get(lnum + 1), MAXWLEN);
843+ spell_cat_line(buf + STRLEN(buf),
844+ ml_get_buf(wp->w_buffer, lnum + 1, FALSE), MAXWLEN);
845
846 p = buf + skip;
847 endp = buf + len;
[4f46927]848diff -Naur vim70.orig/src/version.c vim70/src/version.c
849--- vim70.orig/src/version.c 2006-05-03 00:50:42.000000000 -0700
850+++ vim70/src/version.c 2006-06-21 23:56:28.000000000 -0700
851@@ -667,6 +667,48 @@
[34f53b7]852 static int included_patches[] =
853 { /* Add new patch number below this line */
854 /**/
[4f46927]855+ 22,
856+/**/
857+ 21,
858+/**/
859+ 20,
860+/**/
861+ 19,
862+/**/
863+ 18,
864+/**/
[fefaf43]865+ 17,
866+/**/
867+ 16,
868+/**/
[34f53b7]869+ 15,
870+/**/
871+ 14,
872+/**/
873+ 13,
874+/**/
875+ 12,
876+/**/
877+ 11,
878+/**/
879+ 10,
880+/**/
881+ 9,
882+/**/
883+ 8,
884+/**/
885+ 7,
886+/**/
887+ 6,
888+/**/
889+ 4,
890+/**/
891+ 3,
892+/**/
893+ 2,
894+/**/
895+ 1,
896+/**/
897 0
898 };
899
[4f46927]900
Note: See TracBrowser for help on using the repository browser.