source: patches/vim-7.0-fixes-5.patch@ 3b37ab5

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

Updated Vim 7.0 patch

  • Property mode set to 100644
File size: 30.4 KB
RevLine 
[4f46927]1Submitted By: Jim Gifford (jim at linuxfromscratch dot org)
[f4f275f]2Date: 2006-06-22
[34f53b7]3Initial Package Version: 7.0
4Origin: Upstream
5Upstream Status: Applied
[f4f275f]6Description: Contains Patch 001-004, 006-026, and 028 from Upstream
7 005 and 027 is for the extras and Windows 32 only
[34f53b7]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
[f4f275f]112+++ vim70/src/edit.c 2006-06-22 11:03:06.000000000 -0700
113@@ -719,9 +719,14 @@
114 #ifdef FEAT_INS_EXPAND
115 /*
116 * Special handling of keys while the popup menu is visible or wanted
117- * and the cursor is still in the completed word.
118+ * and the cursor is still in the completed word. Only when there is
119+ * a match, skip this when no matches were found.
120 */
121- if (compl_started && pum_wanted() && curwin->w_cursor.col >= compl_col)
122+ if (compl_started
123+ && pum_wanted()
124+ && curwin->w_cursor.col >= compl_col
125+ && (compl_shown_match == NULL
126+ || compl_shown_match != compl_shown_match->cp_next))
127 {
128 /* BS: Delete one character from "compl_leader". */
129 if ((c == K_BS || c == Ctrl_H)
130@@ -751,7 +756,7 @@
[34f53b7]131 continue;
132 }
133
134- /* Pressing CTRL-Y selects the current match. Shen
135+ /* Pressing CTRL-Y selects the current match. When
136 * compl_enter_selects is set the Enter key does the same. */
137 if (c == Ctrl_Y || (compl_enter_selects
138 && (c == CAR || c == K_KENTER || c == NL)))
[f4f275f]139@@ -3046,7 +3051,6 @@
[34f53b7]140 ins_compl_delete();
141 ins_bytes(compl_leader + curwin->w_cursor.col - compl_col);
142 compl_used_match = FALSE;
143- compl_enter_selects = FALSE;
144
145 if (compl_started)
146 ins_compl_set_original_text(compl_leader);
[f4f275f]147@@ -3076,6 +3080,7 @@
[34f53b7]148 compl_restarting = FALSE;
149 }
150
151+#if 0 /* disabled, made CTRL-L, BS and typing char jump to original text. */
152 if (!compl_used_match)
153 {
154 /* Go to the original text, since none of the matches is inserted. */
[f4f275f]155@@ -3087,6 +3092,8 @@
[34f53b7]156 compl_curr_match = compl_shown_match;
157 compl_shows_dir = compl_direction;
158 }
159+#endif
160+ compl_enter_selects = !compl_used_match;
161
162 /* Show the popup menu with a different set of matches. */
163 ins_compl_show_pum();
[f4f275f]164@@ -3175,10 +3182,32 @@
[34f53b7]165 char_u *p;
166 int len = curwin->w_cursor.col - compl_col;
167 int c;
168+ compl_T *cp;
169
170 p = compl_shown_match->cp_str;
171 if ((int)STRLEN(p) <= len) /* the match is too short */
172- return;
173+ {
174+ /* When still at the original match use the first entry that matches
175+ * the leader. */
176+ if (compl_shown_match->cp_flags & ORIGINAL_TEXT)
177+ {
178+ p = NULL;
179+ for (cp = compl_shown_match->cp_next; cp != NULL
180+ && cp != compl_first_match; cp = cp->cp_next)
181+ {
182+ if (ins_compl_equal(cp, compl_leader,
183+ (int)STRLEN(compl_leader)))
184+ {
185+ p = cp->cp_str;
186+ break;
187+ }
188+ }
189+ if (p == NULL || (int)STRLEN(p) <= len)
190+ return;
191+ }
192+ else
193+ return;
194+ }
195 p += len;
196 #ifdef FEAT_MBYTE
197 c = mb_ptr2char(p);
[f4f275f]198@@ -3369,16 +3398,21 @@
199 ptr = compl_leader;
200 else
201 ptr = compl_orig_text;
202- p = compl_orig_text;
203- for (temp = 0; p[temp] != NUL && p[temp] == ptr[temp]; ++temp)
204- ;
205+ if (compl_orig_text != NULL)
206+ {
207+ p = compl_orig_text;
208+ for (temp = 0; p[temp] != NUL && p[temp] == ptr[temp];
209+ ++temp)
210+ ;
211 #ifdef FEAT_MBYTE
212- if (temp > 0)
213- temp -= (*mb_head_off)(compl_orig_text, p + temp);
214+ if (temp > 0)
215+ temp -= (*mb_head_off)(compl_orig_text, p + temp);
216 #endif
217- for (p += temp; *p != NUL; mb_ptr_adv(p))
218- AppendCharToRedobuff(K_BS);
219- AppendToRedobuffLit(ptr + temp, -1);
220+ for (p += temp; *p != NUL; mb_ptr_adv(p))
221+ AppendCharToRedobuff(K_BS);
222+ }
223+ if (ptr != NULL)
224+ AppendToRedobuffLit(ptr + temp, -1);
225 }
226
227 #ifdef FEAT_CINDENT
228@@ -4100,6 +4134,21 @@
[34f53b7]229 && compl_shown_match->cp_next != NULL
230 && compl_shown_match->cp_next != compl_first_match)
231 compl_shown_match = compl_shown_match->cp_next;
232+
233+ /* If we didn't find it searching forward, and compl_shows_dir is
234+ * backward, find the last match. */
235+ if (compl_shows_dir == BACKWARD
236+ && !ins_compl_equal(compl_shown_match,
237+ compl_leader, (int)STRLEN(compl_leader))
238+ && (compl_shown_match->cp_next == NULL
239+ || compl_shown_match->cp_next == compl_first_match))
240+ {
241+ while (!ins_compl_equal(compl_shown_match,
242+ compl_leader, (int)STRLEN(compl_leader))
243+ && compl_shown_match->cp_prev != NULL
244+ && compl_shown_match->cp_prev != compl_first_match)
245+ compl_shown_match = compl_shown_match->cp_prev;
246+ }
247 }
248
249 if (allow_get_expansion && insert_match
[f4f275f]250@@ -4611,10 +4660,18 @@
251 (int)STRLEN(compl_pattern), curs_col);
252 if (compl_xp.xp_context == EXPAND_UNSUCCESSFUL
253 || compl_xp.xp_context == EXPAND_NOTHING)
254- return FAIL;
255- startcol = (int)(compl_xp.xp_pattern - compl_pattern);
256- compl_col = startcol;
257- compl_length = curs_col - startcol;
258+ {
259+ compl_col = curs_col;
260+ compl_length = 0;
261+ vim_free(compl_pattern);
262+ compl_pattern = NULL;
263+ }
264+ else
265+ {
266+ startcol = (int)(compl_xp.xp_pattern - compl_pattern);
267+ compl_col = startcol;
268+ compl_length = curs_col - startcol;
269+ }
270 }
271 else if (ctrl_x_mode == CTRL_X_FUNCTION || ctrl_x_mode == CTRL_X_OMNI)
272 {
273@@ -4668,11 +4725,17 @@
274 else
275 compl_col = spell_word_start(startcol);
276 if (compl_col >= (colnr_T)startcol)
277- return FAIL;
278- spell_expand_check_cap(compl_col);
279+ {
280+ compl_length = 0;
281+ compl_col = curs_col;
282+ }
283+ else
284+ {
285+ spell_expand_check_cap(compl_col);
286+ compl_length = (int)curs_col - compl_col;
287+ }
288 /* Need to obtain "line" again, it may have become invalid. */
289 line = ml_get(curwin->w_cursor.lnum);
290- compl_length = (int)curs_col - compl_col;
291 compl_pattern = vim_strnsave(line + compl_col, compl_length);
292 if (compl_pattern == NULL)
293 #endif
[4f46927]294diff -Naur vim70.orig/src/eval.c vim70/src/eval.c
295--- vim70.orig/src/eval.c 2006-05-05 10:15:26.000000000 -0700
[f4f275f]296+++ vim70/src/eval.c 2006-06-22 11:03:59.000000000 -0700
[34f53b7]297@@ -11372,7 +11372,7 @@
298 if (argvars[2].v_type != VAR_UNKNOWN)
299 {
300 char_u *xp_name;
301- int xp_namelen;
302+ int xp_namelen;
303 long argt;
304
305 rettv->vval.v_string = NULL;
[f4f275f]306@@ -13250,7 +13250,7 @@
307 if (argvars[2].v_type != VAR_UNKNOWN)
308 EMSG2(_(e_toomanyarg), "remove()");
309 else if ((d = argvars[0].vval.v_dict) != NULL
310- && !tv_check_lock(d->dv_lock, (char_u *)"remove()"))
311+ && !tv_check_lock(d->dv_lock, (char_u *)"remove() argument"))
312 {
313 key = get_tv_string_chk(&argvars[1]);
314 if (key != NULL)
315@@ -13270,7 +13270,7 @@
316 else if (argvars[0].v_type != VAR_LIST)
317 EMSG2(_(e_listdictarg), "remove()");
318 else if ((l = argvars[0].vval.v_list) != NULL
319- && !tv_check_lock(l->lv_lock, (char_u *)"remove()"))
320+ && !tv_check_lock(l->lv_lock, (char_u *)"remove() argument"))
321 {
322 int error = FALSE;
323
324@@ -17759,6 +17759,13 @@
325 }
326 else /* add a new variable */
327 {
328+ /* Can't add "v:" variable. */
329+ if (ht == &vimvarht)
330+ {
331+ EMSG2(_(e_illvar), name);
332+ return;
333+ }
334+
335 /* Make sure the variable name is valid. */
336 for (p = varname; *p != NUL; ++p)
337 if (!eval_isnamec1(*p) && (p == varname || !VIM_ISDIGIT(*p))
338@@ -18963,7 +18970,8 @@
[34f53b7]339 else if (lead > 0)
340 {
341 lead = 3;
342- if (eval_fname_sid(lv.ll_exp_name != NULL ? lv.ll_exp_name : *pp))
343+ if ((lv.ll_exp_name != NULL && eval_fname_sid(lv.ll_exp_name))
344+ || eval_fname_sid(*pp))
345 {
346 /* It's "s:" or "<SID>" */
347 if (current_SID <= 0)
[f4f275f]348@@ -19685,6 +19693,7 @@
349 v->di_tv.vval.v_list = &fc.l_varlist;
350 vim_memset(&fc.l_varlist, 0, sizeof(list_T));
351 fc.l_varlist.lv_refcount = 99999;
352+ fc.l_varlist.lv_lock = VAR_FIXED;
353
354 /*
355 * Set a:firstline to "firstline" and a:lastline to "lastline".
[4f46927]356diff -Naur vim70.orig/src/ex_docmd.c vim70/src/ex_docmd.c
357--- vim70.orig/src/ex_docmd.c 2006-05-05 09:33:19.000000000 -0700
358+++ vim70/src/ex_docmd.c 2006-06-21 23:50:50.000000000 -0700
[34f53b7]359@@ -833,7 +833,7 @@
360 * If requested, store and reset the global values controlling the
361 * exception handling (used when debugging).
362 */
363- else if (flags & DOCMD_EXCRESET)
364+ if (flags & DOCMD_EXCRESET)
365 save_dbg_stuff(&debug_saved);
366
367 initial_trylevel = trylevel;
[4f46927]368diff -Naur vim70.orig/src/gui_at_fs.c vim70/src/gui_at_fs.c
369--- vim70.orig/src/gui_at_fs.c 2005-07-09 04:30:17.000000000 -0700
370+++ vim70/src/gui_at_fs.c 2006-06-21 23:50:50.000000000 -0700
[34f53b7]371@@ -1861,27 +1861,27 @@
372 XtPointer pnew;
373 {
374 SFDir *dir;
375- int nw;
376+ int nw = (int)(long)pnew;
377
378 dir = &(SFdirs[SFdirPtr + (int)(long)n]);
379
380 #ifdef FEAT_GUI_NEXTAW
381- if ((int)(long)pnew < 0)
382+ if (nw < 0)
383 {
384- if ((int)(long)pnew > -SFvScrollHeight)
385- (int)(long)pnew = -1;
386+ if (nw > -SFvScrollHeight)
387+ nw = -1;
388 else
389- (int)(long)pnew = -SFlistSize;
390+ nw = -SFlistSize;
391 }
392- else if ((int)(long)pnew > 0)
393+ else if (nw > 0)
394 {
395- if ((int)(long)pnew < SFvScrollHeight)
396- (int)(long)pnew = 1;
397+ if (nw < SFvScrollHeight)
398+ nw = 1;
399 else
400- (int)(long)pnew = SFlistSize;
401+ nw = SFlistSize;
402 }
403 #endif
404- nw = dir->vOrigin + (int)(long)pnew;
405+ nw += dir->vOrigin;
406
407 if (nw > dir->nEntries - SFlistSize)
408 nw = dir->nEntries - SFlistSize;
409@@ -1941,27 +1941,27 @@
410 XtPointer pnew;
411 {
412 SFDir *dir;
413- int nw;
414+ int nw = (int)(long)pnew;
415
416 dir = &(SFdirs[SFdirPtr + (int)(long)n]);
417
418 #ifdef FEAT_GUI_NEXTAW
419- if ((int)(long)pnew < 0)
420+ if (nw < 0)
421 {
422- if ((int)(long)pnew > -SFhScrollWidth)
423- (int)(long)pnew = -1;
424+ if (nw > -SFhScrollWidth)
425+ nw = -1;
426 else
427- (int)(long)pnew = -SFcharsPerEntry;
428+ nw = -SFcharsPerEntry;
429 }
430- else if ((int)(long)pnew > 0)
431+ else if (nw > 0)
432 {
433- if ((int)(long)pnew < SFhScrollWidth)
434- (int)(long)pnew = 1;
435+ if (nw < SFhScrollWidth)
436+ nw = 1;
437 else
438- (int)(long)pnew = SFcharsPerEntry;
439+ nw = SFcharsPerEntry;
440 }
441 #endif
442- nw = dir->hOrigin + (int)(long)pnew;
443+ nw += dir->hOrigin;
444
445 if (nw > dir->nChars - SFcharsPerEntry)
446 nw = dir->nChars - SFcharsPerEntry;
447@@ -2038,26 +2038,26 @@
448 XtPointer client_data;
449 XtPointer pnew;
450 {
451- int nw;
452+ int nw = (int)(long)pnew;
453 float f;
454
455 #ifdef FEAT_GUI_NEXTAW
456- if ((int)(long)pnew < 0)
457+ if (nw < 0)
458 {
459- if ((int)(long)pnew > -SFpathScrollWidth)
460- (int)(long)pnew = -1;
461+ if (nw > -SFpathScrollWidth)
462+ nw = -1;
463 else
464- (int)(long)pnew = -3;
465+ nw = -3;
466 }
467- else if ((int)(long)pnew > 0)
468+ else if (nw > 0)
469 {
470- if ((int)(long)pnew < SFpathScrollWidth)
471- (int)(long)pnew = 1;
472+ if (nw < SFpathScrollWidth)
473+ nw = 1;
474 else
475- (int)(long)pnew = 3;
476+ nw = 3;
477 }
478 #endif
479- nw = SFdirPtr + (int)(long)pnew;
480+ nw += SFdirPtr;
481
482 if (nw > SFdirEnd - 3)
483 nw = SFdirEnd - 3;
[4f46927]484diff -Naur vim70.orig/src/gui.c vim70/src/gui.c
485--- vim70.orig/src/gui.c 2006-05-03 04:00:59.000000000 -0700
486+++ vim70/src/gui.c 2006-06-21 23:52:38.000000000 -0700
487@@ -4515,7 +4515,7 @@
488 int y;
489 {
490 win_T *wp;
491- char_u st[6];
492+ char_u st[8];
493
494 /* Ignore this while still starting up. */
495 if (!gui.in_use || gui.starting)
[34f53b7]496@@ -4603,11 +4603,11 @@
497 /* Don't move the mouse when it's left or right of the Vim window */
498 if (x < 0 || x > Columns * gui.char_width)
499 return;
500+ if (y >= 0
501 # ifdef FEAT_WINDOWS
502- if (Y_2_ROW(y) >= tabline_height())
503-# else
504- if (y >= 0)
505+ && Y_2_ROW(y) >= tabline_height()
506 # endif
507+ )
508 wp = xy2win(x, y);
509 if (wp != curwin && wp != NULL) /* If in other than current window */
510 {
[4f46927]511diff -Naur vim70.orig/src/gui_xmebw.c vim70/src/gui_xmebw.c
512--- vim70.orig/src/gui_xmebw.c 2006-04-30 08:32:32.000000000 -0700
513+++ vim70/src/gui_xmebw.c 2006-06-21 23:50:50.000000000 -0700
[fefaf43]514@@ -47,13 +47,13 @@
515 #include "gui_xmebwp.h"
516
517 /* Provide some missing wrappers, which are missed from the LessTif
518- * implementation.
519+ * implementation. Also missing in Motif 1.2 and earlier.
520 *
521 * We neither use XmeGetPixmapData or _XmGetPixmapData, since with LessTif the
522 * pixmap will not appear in it's caches properly. We cache the interresting
523 * values in XmEnhancedButtonPart instead ourself.
524 */
525-#ifdef LESSTIF_VERSION
526+#if defined(LESSTIF_VERSION) || (XmVersion <= 1002)
527 # ifndef Lab_IsMenupane
528 # define Lab_IsMenupane(w) (Lab_MenuType(w) == (int)XmMENU_POPUP || \
529 Lab_MenuType(w) == (int)XmMENU_PULLDOWN)
[34f53b7]530@@ -480,7 +480,7 @@
531 || (eb->core.height <= 2 * eb->primitive.highlight_thickness))
532 return;
533
534-#ifndef LESSTIF_VERSION
535+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
536 {
537 XmDisplay dpy;
538
539@@ -641,7 +641,7 @@
540 GC tmp_gc = NULL;
541 Boolean replaceGC = False;
542 Boolean deadjusted = False;
543-#ifndef LESSTIF_VERSION
544+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
545 XmDisplay dpy = (XmDisplay)XmGetXmDisplay(XtDisplay(eb));
546 Boolean etched_in = dpy->display.enable_etched_in_menu;
547 #else
548@@ -726,7 +726,7 @@
549 if ((((ShellWidget) XtParent(XtParent(eb)))->shell.popped_up)
550 && _XmGetInDragMode((Widget) eb))
551 {
552-#ifndef LESSTIF_VERSION
553+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
554 XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid));
555 Boolean etched_in = dpy->display.enable_etched_in_menu;
556 #else
557@@ -810,7 +810,7 @@
558
559 if (Lab_IsMenupane(eb))
560 {
561-#ifndef LESSTIF_VERSION
562+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
563 XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid));
564 Boolean etched_in = dpy->display.enable_etched_in_menu;
565 #else
566@@ -1150,7 +1150,7 @@
567 Redisplay(Widget w, XEvent *event, Region region)
568 {
569 XmEnhancedButtonWidget eb = (XmEnhancedButtonWidget) w;
570-#ifndef LESSTIF_VERSION
571+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
572 XmDisplay dpy;
573 XtEnum default_button_emphasis;
574 #endif
575@@ -1162,7 +1162,7 @@
576 if (!XtIsRealized((Widget)eb))
577 return;
578
579-#ifndef LESSTIF_VERSION
580+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
581 dpy = (XmDisplay)XmGetXmDisplay(XtDisplay(eb));
582 default_button_emphasis = dpy->display.default_button_emphasis;
583 #endif
584@@ -1241,7 +1241,7 @@
585 {
586 int adjust = 0;
587
588-#ifndef LESSTIF_VERSION
589+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
590 /*
591 * NOTE: PushButton has two types of shadows: primitive-shadow and
592 * default-button-shadow. If pushbutton is in a menu only primitive
593@@ -1289,7 +1289,7 @@
594 adjust, adjust, rectwidth, rectheight, borderwidth);
595 }
596
597-#ifndef LESSTIF_VERSION
598+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
599 switch (default_button_emphasis)
600 {
601 case XmINTERNAL_HIGHLIGHT:
602@@ -1365,7 +1365,7 @@
603 default_button_shadow_thickness =
604 eb->pushbutton.default_button_shadow_thickness;
605
606-#ifndef LESSTIF_VERSION
607+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
608 /*
609 * Compute location of bounding box to contain the
610 * defaultButtonShadow.
[4f46927]611diff -Naur vim70.orig/src/if_ruby.c vim70/src/if_ruby.c
612--- vim70.orig/src/if_ruby.c 2006-04-30 08:37:52.000000000 -0700
613+++ vim70/src/if_ruby.c 2006-06-21 23:56:28.000000000 -0700
614@@ -643,11 +643,23 @@
615
616 static VALUE set_buffer_line(buf_T *buf, linenr_T n, VALUE str)
617 {
618- buf_T *savebuf = curbuf;
619- char *line = STR2CSTR(str);
620+ char *line = STR2CSTR(str);
621+#ifdef FEAT_AUTOCMD
622+ aco_save_T aco;
623+#else
624+ buf_T *save_curbuf = curbuf;
625+#endif
626
627- if (n > 0 && n <= buf->b_ml.ml_line_count && line != NULL) {
628+ if (n > 0 && n <= buf->b_ml.ml_line_count && line != NULL)
629+ {
630+#ifdef FEAT_AUTOCMD
631+ /* set curwin/curbuf for "buf" and save some things */
632+ aucmd_prepbuf(&aco, buf);
633+#else
634 curbuf = buf;
635+ curwin->w_buffer = buf;
636+#endif
637+
638 if (u_savesub(n) == OK) {
639 ml_replace(n, (char_u *)line, TRUE);
640 changed();
641@@ -655,10 +667,19 @@
642 syn_changed(n); /* recompute syntax hl. for this line */
643 #endif
644 }
645- curbuf = savebuf;
646+
647+#ifdef FEAT_AUTOCMD
648+ /* restore curwin/curbuf and a few other things */
649+ aucmd_restbuf(&aco);
650+ /* Careful: autocommands may have made "buf" invalid! */
651+#else
652+ curwin->w_buffer = save_curbuf;
653+ curbuf = save_curbuf;
654+#endif
655 update_curbuf(NOT_VALID);
656 }
657- else {
658+ else
659+ {
660 rb_raise(rb_eIndexError, "index %d out of buffer", n);
661 return Qnil; /* For stop warning */
662 }
663@@ -676,12 +697,24 @@
664
665 static VALUE buffer_delete(VALUE self, VALUE num)
666 {
667- buf_T *buf = get_buf(self);
668- buf_T *savebuf = curbuf;
669- long n = NUM2LONG(num);
670+ buf_T *buf = get_buf(self);
671+ long n = NUM2LONG(num);
672+#ifdef FEAT_AUTOCMD
673+ aco_save_T aco;
674+#else
675+ buf_T *save_curbuf = curbuf;
676+#endif
677
678- if (n > 0 && n <= buf->b_ml.ml_line_count) {
679+ if (n > 0 && n <= buf->b_ml.ml_line_count)
680+ {
681+#ifdef FEAT_AUTOCMD
682+ /* set curwin/curbuf for "buf" and save some things */
683+ aucmd_prepbuf(&aco, buf);
684+#else
685 curbuf = buf;
686+ curwin->w_buffer = buf;
687+#endif
688+
689 if (u_savedel(n, 1) == OK) {
690 ml_delete(n, 0);
691
692@@ -691,10 +724,19 @@
693
694 changed();
695 }
696- curbuf = savebuf;
697+
698+#ifdef FEAT_AUTOCMD
699+ /* restore curwin/curbuf and a few other things */
700+ aucmd_restbuf(&aco);
701+ /* Careful: autocommands may have made "buf" invalid! */
702+#else
703+ curwin->w_buffer = save_curbuf;
704+ curbuf = save_curbuf;
705+#endif
706 update_curbuf(NOT_VALID);
707 }
708- else {
709+ else
710+ {
711 rb_raise(rb_eIndexError, "index %d out of buffer", n);
712 }
713 return Qnil;
714@@ -702,13 +744,25 @@
715
716 static VALUE buffer_append(VALUE self, VALUE num, VALUE str)
717 {
718- buf_T *buf = get_buf(self);
719- buf_T *savebuf = curbuf;
720- char *line = STR2CSTR(str);
721- long n = NUM2LONG(num);
722+ buf_T *buf = get_buf(self);
723+ char *line = STR2CSTR(str);
724+ long n = NUM2LONG(num);
725+#ifdef FEAT_AUTOCMD
726+ aco_save_T aco;
727+#else
728+ buf_T *save_curbuf = curbuf;
729+#endif
730
731- if (n >= 0 && n <= buf->b_ml.ml_line_count && line != NULL) {
732+ if (n >= 0 && n <= buf->b_ml.ml_line_count && line != NULL)
733+ {
734+#ifdef FEAT_AUTOCMD
735+ /* set curwin/curbuf for "buf" and save some things */
736+ aucmd_prepbuf(&aco, buf);
737+#else
738 curbuf = buf;
739+ curwin->w_buffer = buf;
740+#endif
741+
742 if (u_inssub(n + 1) == OK) {
743 ml_append(n, (char_u *) line, (colnr_T) 0, FALSE);
744
745@@ -718,7 +772,15 @@
746
747 changed();
748 }
749- curbuf = savebuf;
750+
751+#ifdef FEAT_AUTOCMD
752+ /* restore curwin/curbuf and a few other things */
753+ aucmd_restbuf(&aco);
754+ /* Careful: autocommands may have made "buf" invalid! */
755+#else
756+ curwin->w_buffer = save_curbuf;
757+ curbuf = save_curbuf;
758+#endif
759 update_curbuf(NOT_VALID);
760 }
761 else {
762diff -Naur vim70.orig/src/main.c vim70/src/main.c
763--- vim70.orig/src/main.c 2006-05-03 10:36:44.000000000 -0700
764+++ vim70/src/main.c 2006-06-21 23:51:37.000000000 -0700
765@@ -564,7 +564,11 @@
766 */
767 if (p_lpl)
768 {
769+# ifdef VMS /* Somehow VMS doesn't handle the "**". */
770+ source_runtime((char_u *)"plugin/*.vim", TRUE);
771+# else
772 source_runtime((char_u *)"plugin/**/*.vim", TRUE);
773+# endif
774 TIME_MSG("loading plugins");
775 }
776 #endif
777diff -Naur vim70.orig/src/Makefile vim70/src/Makefile
778--- vim70.orig/src/Makefile 2006-05-07 06:25:27.000000000 -0700
779+++ vim70/src/Makefile 2006-06-21 23:50:50.000000000 -0700
[34f53b7]780@@ -2177,6 +2177,7 @@
781 cd $(SHADOWDIR)/xxd; ln -s ../../xxd/*.[ch] ../../xxd/Make* .
782 if test -d $(RSRC_DIR); then \
783 cd $(SHADOWDIR); \
784+ ln -s ../infplist.xml .; \
785 ln -s ../$(RSRC_DIR) ../os_mac.rsr.hqx ../dehqx.py .; \
786 fi
787 mkdir $(SHADOWDIR)/testdir
[4f46927]788diff -Naur vim70.orig/src/mbyte.c vim70/src/mbyte.c
789--- vim70.orig/src/mbyte.c 2006-04-30 04:51:01.000000000 -0700
790+++ vim70/src/mbyte.c 2006-06-21 23:50:50.000000000 -0700
[fefaf43]791@@ -311,7 +311,11 @@
792
793 #define IDX_MACROMAN 57
794 {"macroman", ENC_8BIT + ENC_MACROMAN, 0}, /* Mac OS */
795-#define IDX_COUNT 58
796+#define IDX_DECMCS 58
797+ {"dec-mcs", ENC_8BIT, 0}, /* DEC MCS */
798+#define IDX_HPROMAN8 59
799+ {"hp-roman8", ENC_8BIT, 0}, /* HP Roman8 */
800+#define IDX_COUNT 60
801 };
802
803 /*
804@@ -386,6 +390,7 @@
805 {"950", IDX_BIG5},
806 #endif
807 {"mac", IDX_MACROMAN},
808+ {"mac-roman", IDX_MACROMAN},
809 {NULL, 0}
810 };
811
[4f46927]812diff -Naur vim70.orig/src/message.c vim70/src/message.c
813--- vim70.orig/src/message.c 2006-05-06 13:07:37.000000000 -0700
814+++ vim70/src/message.c 2006-06-21 23:50:50.000000000 -0700
[34f53b7]815@@ -4175,15 +4175,16 @@
816 str_arg_l = 0;
817 else
818 {
819- /* memchr on HP does not like n > 2^31 !!! */
820- char *q = memchr(str_arg, '\0',
821+ /* Don't put the #if inside memchr(), it can be a
822+ * macro. */
823 #if SIZEOF_INT <= 2
824- precision
825+ char *q = memchr(str_arg, '\0', precision);
826 #else
827- precision <= (size_t)0x7fffffffL ? precision
828- : (size_t)0x7fffffffL
829+ /* memchr on HP does not like n > 2^31 !!! */
830+ char *q = memchr(str_arg, '\0',
831+ precision <= (size_t)0x7fffffffL ? precision
832+ : (size_t)0x7fffffffL);
833 #endif
834- );
835 str_arg_l = (q == NULL) ? precision : q - str_arg;
836 }
837 break;
[4f46927]838diff -Naur vim70.orig/src/ops.c vim70/src/ops.c
839--- vim70.orig/src/ops.c 2006-04-30 08:13:44.000000000 -0700
840+++ vim70/src/ops.c 2006-06-21 23:52:03.000000000 -0700
841@@ -2413,6 +2413,7 @@
842 else
843 {
844 curwin->w_cursor = oap->end;
845+ check_cursor_col();
846
847 /* Works just like an 'i'nsert on the next character. */
848 if (!lineempty(curwin->w_cursor.lnum)
849diff -Naur vim70.orig/src/option.c vim70/src/option.c
850--- vim70.orig/src/option.c 2006-05-03 10:32:28.000000000 -0700
851+++ vim70/src/option.c 2006-06-21 23:50:50.000000000 -0700
[34f53b7]852@@ -2294,7 +2294,7 @@
853 {(char_u *)0L, (char_u *)0L}
854 #endif
855 },
856- {"spellsuggest", "sps", P_STRING|P_VI_DEF|P_EXPAND|P_SECURE,
857+ {"spellsuggest", "sps", P_STRING|P_VI_DEF|P_EXPAND|P_SECURE|P_COMMA,
858 #ifdef FEAT_SPELL
859 (char_u *)&p_sps, PV_NONE,
860 {(char_u *)"best", (char_u *)0L}
861@@ -5227,13 +5227,13 @@
862 case PV_STL: return &curwin->w_p_stl_flags;
863 #endif
864 #ifdef FEAT_EVAL
865+# ifdef FEAT_FOLDING
866 case PV_FDE: return &curwin->w_p_fde_flags;
867 case PV_FDT: return &curwin->w_p_fdt_flags;
868+# endif
869 # ifdef FEAT_BEVAL
870 case PV_BEXPR: return &curbuf->b_p_bexpr_flags;
871 # endif
872-#endif
873-#if defined(FEAT_EVAL)
874 # if defined(FEAT_CINDENT)
875 case PV_INDE: return &curbuf->b_p_inde_flags;
876 # endif
[f4f275f]877diff -Naur vim70.orig/src/os_unix.c vim70/src/os_unix.c
878--- vim70.orig/src/os_unix.c 2006-05-01 01:13:15.000000000 -0700
879+++ vim70/src/os_unix.c 2006-06-22 11:06:09.000000000 -0700
880@@ -4971,7 +4971,8 @@
881 if (((*file)[*num_file] = alloc(len + 2)) != NULL)
882 {
883 STRCPY((*file)[*num_file], p);
884- if (!after_pathsep((*file)[*num_file] + len))
885+ if (!after_pathsep((*file)[*num_file],
886+ (*file)[*num_file] + len))
887 {
888 (*file)[*num_file][len] = psepc;
889 (*file)[*num_file][len + 1] = NUL;
890@@ -5757,8 +5758,13 @@
891 int retval_int = 0;
892 int success = FALSE;
893
894- /* Get a handle to the DLL module. */
895+ /*
896+ * Get a handle to the DLL module.
897+ */
898 # if defined(USE_DLOPEN)
899+ /* First clear any error, it's not cleared by the dlopen() call. */
900+ (void)dlerror();
901+
902 hinstLib = dlopen((char *)libname, RTLD_LAZY
903 # ifdef RTLD_LOCAL
904 | RTLD_LOCAL
[4f46927]905diff -Naur vim70.orig/src/quickfix.c vim70/src/quickfix.c
906--- vim70.orig/src/quickfix.c 2006-05-03 00:47:42.000000000 -0700
907+++ vim70/src/quickfix.c 2006-06-21 23:54:05.000000000 -0700
908@@ -602,13 +602,19 @@
909 else
910 type = 0;
911 /*
912- * Extract error message data from matched line
913+ * Extract error message data from matched line.
914+ * We check for an actual submatch, because "\[" and "\]" in
915+ * the 'errorformat' may cause the wrong submatch to be used.
916 */
917 if ((i = (int)fmt_ptr->addr[0]) > 0) /* %f */
918 {
919- int c = *regmatch.endp[i];
920+ int c;
921+
922+ if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
923+ continue;
924
925 /* Expand ~/file and $HOME/file to full path. */
926+ c = *regmatch.endp[i];
927 *regmatch.endp[i] = NUL;
928 expand_env(regmatch.startp[i], namebuf, CMDBUFFSIZE);
929 *regmatch.endp[i] = c;
930@@ -618,35 +624,63 @@
931 continue;
932 }
933 if ((i = (int)fmt_ptr->addr[1]) > 0) /* %n */
934+ {
935+ if (regmatch.startp[i] == NULL)
936+ continue;
937 enr = (int)atol((char *)regmatch.startp[i]);
938+ }
939 if ((i = (int)fmt_ptr->addr[2]) > 0) /* %l */
940+ {
941+ if (regmatch.startp[i] == NULL)
942+ continue;
943 lnum = atol((char *)regmatch.startp[i]);
944+ }
945 if ((i = (int)fmt_ptr->addr[3]) > 0) /* %c */
946+ {
947+ if (regmatch.startp[i] == NULL)
948+ continue;
949 col = (int)atol((char *)regmatch.startp[i]);
950+ }
951 if ((i = (int)fmt_ptr->addr[4]) > 0) /* %t */
952+ {
953+ if (regmatch.startp[i] == NULL)
954+ continue;
955 type = *regmatch.startp[i];
956+ }
957 if (fmt_ptr->flags == '+' && !multiscan) /* %+ */
958 STRCPY(errmsg, IObuff);
959 else if ((i = (int)fmt_ptr->addr[5]) > 0) /* %m */
960 {
961+ if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
962+ continue;
963 len = (int)(regmatch.endp[i] - regmatch.startp[i]);
964 vim_strncpy(errmsg, regmatch.startp[i], len);
965 }
966 if ((i = (int)fmt_ptr->addr[6]) > 0) /* %r */
967+ {
968+ if (regmatch.startp[i] == NULL)
969+ continue;
970 tail = regmatch.startp[i];
971+ }
972 if ((i = (int)fmt_ptr->addr[7]) > 0) /* %p */
973 {
974+ if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
975+ continue;
976 col = (int)(regmatch.endp[i] - regmatch.startp[i] + 1);
977 if (*((char_u *)regmatch.startp[i]) != TAB)
978 use_viscol = TRUE;
979 }
980 if ((i = (int)fmt_ptr->addr[8]) > 0) /* %v */
981 {
982+ if (regmatch.startp[i] == NULL)
983+ continue;
984 col = (int)atol((char *)regmatch.startp[i]);
985 use_viscol = TRUE;
986 }
987 if ((i = (int)fmt_ptr->addr[9]) > 0) /* %s */
988 {
989+ if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
990+ continue;
991 len = (int)(regmatch.endp[i] - regmatch.startp[i]);
992 if (len > CMDBUFFSIZE - 5)
993 len = CMDBUFFSIZE - 5;
994diff -Naur vim70.orig/src/spell.c vim70/src/spell.c
995--- vim70.orig/src/spell.c 2006-05-05 00:49:58.000000000 -0700
996+++ vim70/src/spell.c 2006-06-21 23:50:50.000000000 -0700
[34f53b7]997@@ -2108,7 +2108,8 @@
998 * possible. */
999 STRCPY(buf, line);
1000 if (lnum < wp->w_buffer->b_ml.ml_line_count)
1001- spell_cat_line(buf + STRLEN(buf), ml_get(lnum + 1), MAXWLEN);
1002+ spell_cat_line(buf + STRLEN(buf),
1003+ ml_get_buf(wp->w_buffer, lnum + 1, FALSE), MAXWLEN);
1004
1005 p = buf + skip;
1006 endp = buf + len;
[4f46927]1007diff -Naur vim70.orig/src/version.c vim70/src/version.c
1008--- vim70.orig/src/version.c 2006-05-03 00:50:42.000000000 -0700
[f4f275f]1009+++ vim70/src/version.c 2006-06-22 11:06:13.000000000 -0700
1010@@ -667,6 +667,58 @@
[34f53b7]1011 static int included_patches[] =
1012 { /* Add new patch number below this line */
1013 /**/
[f4f275f]1014+ 28,
1015+/**/
1016+ 26,
1017+/**/
1018+ 25,
1019+/**/
1020+ 24,
1021+/**/
1022+ 23,
1023+/**/
[4f46927]1024+ 22,
1025+/**/
1026+ 21,
1027+/**/
1028+ 20,
1029+/**/
1030+ 19,
1031+/**/
1032+ 18,
1033+/**/
[fefaf43]1034+ 17,
1035+/**/
1036+ 16,
1037+/**/
[34f53b7]1038+ 15,
1039+/**/
1040+ 14,
1041+/**/
1042+ 13,
1043+/**/
1044+ 12,
1045+/**/
1046+ 11,
1047+/**/
1048+ 10,
1049+/**/
1050+ 9,
1051+/**/
1052+ 8,
1053+/**/
1054+ 7,
1055+/**/
1056+ 6,
1057+/**/
1058+ 4,
1059+/**/
1060+ 3,
1061+/**/
1062+ 2,
1063+/**/
1064+ 1,
1065+/**/
1066 0
1067 };
1068
[f4f275f]1069diff -Naur vim70.orig/src/vim.h vim70/src/vim.h
1070--- vim70.orig/src/vim.h 2006-04-30 08:32:38.000000000 -0700
1071+++ vim70/src/vim.h 2006-06-22 11:06:09.000000000 -0700
1072@@ -1983,7 +1983,7 @@
1073 /* values for vim_handle_signal() that are not a signal */
1074 #define SIGNAL_BLOCK -1
1075 #define SIGNAL_UNBLOCK -2
1076-#if !defined(UNIX) && !defined(VMS)
1077+#if !defined(UNIX) && !defined(VMS) && !defined(OS2)
1078 # define vim_handle_signal(x) 0
1079 #endif
[4f46927]1080
[f4f275f]1081
Note: See TracBrowser for help on using the repository browser.