]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/vim-7.0-fixes-7.patch
Stop dhcpcd before starting if it was running
[people/pmueller/ipfire-2.x.git] / src / patches / vim-7.0-fixes-7.patch
CommitLineData
90d372c4
MT
1Submitted By: Jim Gifford (jim at linuxfromscratch dot org)
2Date: 2006-07-14
3Initial Package Version: 7.0
4Origin: Upstream
5Upstream Status: Applied
6Description: Contains Patch 001-004, 006-026, 028-031, and 033-039 from Upstream
7 005, 027, and 032 is for the extras and Windows 32 only
8
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-07-14 08:51:21.000000000 -0700
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
30diff -Naur vim70.orig/runtime/autoload/paste.vim vim70/runtime/autoload/paste.vim
31--- vim70.orig/runtime/autoload/paste.vim 2006-04-21 11:31:01.000000000 -0700
32+++ vim70/runtime/autoload/paste.vim 2006-07-14 08:51:21.000000000 -0700
33@@ -1,6 +1,6 @@
34 " Vim support file to help with paste mappings and menus
35 " Maintainer: Bram Moolenaar <Bram@vim.org>
36-" Last Change: 2006 Apr 21
37+" Last Change: 2006 Jun 23
38
39 " Define the string to use for items that are present both in Edit, Popup and
40 " Toolbar menu. Also used in mswin.vim and macmap.vim.
41@@ -12,7 +12,7 @@
42 if has("virtualedit")
43 let paste#paste_cmd = {'n': ":call paste#Paste()<CR>"}
44 let paste#paste_cmd['v'] = '"-c<Esc>' . paste#paste_cmd['n']
45- let paste#paste_cmd['i'] = '<Esc>' . paste#paste_cmd['n'] . 'gi'
46+ let paste#paste_cmd['i'] = 'x<BS><Esc>' . paste#paste_cmd['n'] . 'gi'
47
48 func! paste#Paste()
49 let ove = &ve
50diff -Naur vim70.orig/runtime/autoload/spellfile.vim vim70/runtime/autoload/spellfile.vim
51--- vim70.orig/runtime/autoload/spellfile.vim 2006-02-01 04:12:24.000000000 -0800
52+++ vim70/runtime/autoload/spellfile.vim 2006-07-14 08:51:21.000000000 -0700
53@@ -1,9 +1,9 @@
54 " Vim script to download a missing spell file
55 " Maintainer: Bram Moolenaar <Bram@vim.org>
56-" Last Change: 2006 Feb 01
57+" Last Change: 2006 May 10
58
59 if !exists('g:spellfile_URL')
60- let g:spellfile_URL = 'ftp://ftp.vim.org/pub/vim/unstable/runtime/spell'
61+ let g:spellfile_URL = 'ftp://ftp.vim.org/pub/vim/runtime/spell'
62 endif
63 let s:spellfile_URL = '' " Start with nothing so that s:donedict is reset.
64
65@@ -61,13 +61,13 @@
66 new
67 setlocal bin
68 echo 'Downloading ' . fname . '...'
69- exe 'Nread ' g:spellfile_URL . '/' . fname
70+ call spellfile#Nread(fname)
71 if getline(2) !~ 'VIMspell'
72 " Didn't work, perhaps there is an ASCII one.
73 g/^/d
74 let fname = a:lang . '.ascii.spl'
75 echo 'Could not find it, trying ' . fname . '...'
76- exe 'Nread ' g:spellfile_URL . '/' . fname
77+ call spellfile#Nread(fname)
78 if getline(2) !~ 'VIMspell'
79 echo 'Sorry, downloading failed'
80 bwipe!
81@@ -95,7 +95,7 @@
82 g/^/d
83 let fname = substitute(fname, '\.spl$', '.sug', '')
84 echo 'Downloading ' . fname . '...'
85- exe 'Nread ' g:spellfile_URL . '/' . fname
86+ call spellfile#Nread(fname)
87 if getline(2) !~ 'VIMsug'
88 echo 'Sorry, downloading failed'
89 else
90@@ -109,3 +109,10 @@
91 bwipe
92 endif
93 endfunc
94+
95+" Read "fname" from the ftp server.
96+function! spellfile#Nread(fname)
97+ let machine = substitute(g:spellfile_URL, 'ftp://\([^/]*\).*', '\1', '')
98+ let dir = substitute(g:spellfile_URL, 'ftp://[^/]*/\(.*\)', '\1', '')
99+ exe 'Nread "' . machine . ' anonymous vim7user ' . dir . '/' . a:fname . '"'
100+endfunc
101diff -Naur vim70.orig/runtime/plugin/matchparen.vim vim70/runtime/plugin/matchparen.vim
102--- vim70.orig/runtime/plugin/matchparen.vim 2006-04-27 06:31:26.000000000 -0700
103+++ vim70/runtime/plugin/matchparen.vim 2006-07-14 08:51:21.000000000 -0700
104@@ -1,6 +1,6 @@
105 " Vim plugin for showing matching parens
106 " Maintainer: Bram Moolenaar <Bram@vim.org>
107-" Last Change: 2006 Apr 27
108+" Last Change: 2006 May 11
109
110 " Exit quickly when:
111 " - this plugin was already loaded (or disabled)
112@@ -90,7 +90,7 @@
113 " Find the match. When it was just before the cursor move it there for a
114 " moment.
115 if before > 0
116- let save_cursor = getpos('.')
117+ let save_cursor = winsaveview()
118 call cursor(c_lnum, c_col - before)
119 endif
120
121@@ -102,7 +102,7 @@
122 let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
123
124 if before > 0
125- call setpos('.', save_cursor)
126+ call winrestview(save_cursor)
127 endif
128
129 " If a match is found setup match highlighting.
130diff -Naur vim70.orig/src/edit.c vim70/src/edit.c
131--- vim70.orig/src/edit.c 2006-05-07 04:48:51.000000000 -0700
132+++ vim70/src/edit.c 2006-07-14 08:51:21.000000000 -0700
133@@ -719,9 +719,14 @@
134 #ifdef FEAT_INS_EXPAND
135 /*
136 * Special handling of keys while the popup menu is visible or wanted
137- * and the cursor is still in the completed word.
138+ * and the cursor is still in the completed word. Only when there is
139+ * a match, skip this when no matches were found.
140 */
141- if (compl_started && pum_wanted() && curwin->w_cursor.col >= compl_col)
142+ if (compl_started
143+ && pum_wanted()
144+ && curwin->w_cursor.col >= compl_col
145+ && (compl_shown_match == NULL
146+ || compl_shown_match != compl_shown_match->cp_next))
147 {
148 /* BS: Delete one character from "compl_leader". */
149 if ((c == K_BS || c == Ctrl_H)
150@@ -751,7 +756,7 @@
151 continue;
152 }
153
154- /* Pressing CTRL-Y selects the current match. Shen
155+ /* Pressing CTRL-Y selects the current match. When
156 * compl_enter_selects is set the Enter key does the same. */
157 if (c == Ctrl_Y || (compl_enter_selects
158 && (c == CAR || c == K_KENTER || c == NL)))
159@@ -3015,9 +3020,6 @@
160 if ((int)(p - line) - (int)compl_col <= 0)
161 return K_BS;
162
163- /* For redo we need to repeat this backspace. */
164- AppendCharToRedobuff(K_BS);
165-
166 /* Deleted more than what was used to find matches or didn't finish
167 * finding all matches: need to look for matches all over again. */
168 if (curwin->w_cursor.col <= compl_col + compl_length
169@@ -3046,7 +3048,6 @@
170 ins_compl_delete();
171 ins_bytes(compl_leader + curwin->w_cursor.col - compl_col);
172 compl_used_match = FALSE;
173- compl_enter_selects = FALSE;
174
175 if (compl_started)
176 ins_compl_set_original_text(compl_leader);
177@@ -3076,6 +3077,7 @@
178 compl_restarting = FALSE;
179 }
180
181+#if 0 /* disabled, made CTRL-L, BS and typing char jump to original text. */
182 if (!compl_used_match)
183 {
184 /* Go to the original text, since none of the matches is inserted. */
185@@ -3087,6 +3089,8 @@
186 compl_curr_match = compl_shown_match;
187 compl_shows_dir = compl_direction;
188 }
189+#endif
190+ compl_enter_selects = !compl_used_match;
191
192 /* Show the popup menu with a different set of matches. */
193 ins_compl_show_pum();
194@@ -3115,10 +3119,6 @@
195 #endif
196 ins_char(c);
197
198- /* For redo we need to count this character so that the number of
199- * backspaces is correct. */
200- AppendCharToRedobuff(c);
201-
202 /* If we didn't complete finding matches we must search again. */
203 if (compl_was_interrupted)
204 ins_compl_restart();
205@@ -3175,10 +3175,32 @@
206 char_u *p;
207 int len = curwin->w_cursor.col - compl_col;
208 int c;
209+ compl_T *cp;
210
211 p = compl_shown_match->cp_str;
212 if ((int)STRLEN(p) <= len) /* the match is too short */
213- return;
214+ {
215+ /* When still at the original match use the first entry that matches
216+ * the leader. */
217+ if (compl_shown_match->cp_flags & ORIGINAL_TEXT)
218+ {
219+ p = NULL;
220+ for (cp = compl_shown_match->cp_next; cp != NULL
221+ && cp != compl_first_match; cp = cp->cp_next)
222+ {
223+ if (ins_compl_equal(cp, compl_leader,
224+ (int)STRLEN(compl_leader)))
225+ {
226+ p = cp->cp_str;
227+ break;
228+ }
229+ }
230+ if (p == NULL || (int)STRLEN(p) <= len)
231+ return;
232+ }
233+ else
234+ return;
235+ }
236 p += len;
237 #ifdef FEAT_MBYTE
238 c = mb_ptr2char(p);
239@@ -3369,16 +3391,21 @@
240 ptr = compl_leader;
241 else
242 ptr = compl_orig_text;
243- p = compl_orig_text;
244- for (temp = 0; p[temp] != NUL && p[temp] == ptr[temp]; ++temp)
245- ;
246+ if (compl_orig_text != NULL)
247+ {
248+ p = compl_orig_text;
249+ for (temp = 0; p[temp] != NUL && p[temp] == ptr[temp];
250+ ++temp)
251+ ;
252 #ifdef FEAT_MBYTE
253- if (temp > 0)
254- temp -= (*mb_head_off)(compl_orig_text, p + temp);
255+ if (temp > 0)
256+ temp -= (*mb_head_off)(compl_orig_text, p + temp);
257 #endif
258- for (p += temp; *p != NUL; mb_ptr_adv(p))
259- AppendCharToRedobuff(K_BS);
260- AppendToRedobuffLit(ptr + temp, -1);
261+ for (p += temp; *p != NUL; mb_ptr_adv(p))
262+ AppendCharToRedobuff(K_BS);
263+ }
264+ if (ptr != NULL)
265+ AppendToRedobuffLit(ptr + temp, -1);
266 }
267
268 #ifdef FEAT_CINDENT
269@@ -4100,6 +4127,21 @@
270 && compl_shown_match->cp_next != NULL
271 && compl_shown_match->cp_next != compl_first_match)
272 compl_shown_match = compl_shown_match->cp_next;
273+
274+ /* If we didn't find it searching forward, and compl_shows_dir is
275+ * backward, find the last match. */
276+ if (compl_shows_dir == BACKWARD
277+ && !ins_compl_equal(compl_shown_match,
278+ compl_leader, (int)STRLEN(compl_leader))
279+ && (compl_shown_match->cp_next == NULL
280+ || compl_shown_match->cp_next == compl_first_match))
281+ {
282+ while (!ins_compl_equal(compl_shown_match,
283+ compl_leader, (int)STRLEN(compl_leader))
284+ && compl_shown_match->cp_prev != NULL
285+ && compl_shown_match->cp_prev != compl_first_match)
286+ compl_shown_match = compl_shown_match->cp_prev;
287+ }
288 }
289
290 if (allow_get_expansion && insert_match
291@@ -4124,8 +4166,6 @@
292 {
293 if (compl_shows_dir == FORWARD && compl_shown_match->cp_next != NULL)
294 {
295- if (compl_pending != 0)
296- --compl_pending;
297 compl_shown_match = compl_shown_match->cp_next;
298 found_end = (compl_first_match != NULL
299 && (compl_shown_match->cp_next == compl_first_match
300@@ -4134,14 +4174,24 @@
301 else if (compl_shows_dir == BACKWARD
302 && compl_shown_match->cp_prev != NULL)
303 {
304- if (compl_pending != 0)
305- ++compl_pending;
306 found_end = (compl_shown_match == compl_first_match);
307 compl_shown_match = compl_shown_match->cp_prev;
308 found_end |= (compl_shown_match == compl_first_match);
309 }
310 else
311 {
312+ if (!allow_get_expansion)
313+ {
314+ if (advance)
315+ {
316+ if (compl_shows_dir == BACKWARD)
317+ compl_pending -= todo + 1;
318+ else
319+ compl_pending += todo + 1;
320+ }
321+ return -1;
322+ }
323+
324 if (advance)
325 {
326 if (compl_shows_dir == BACKWARD)
327@@ -4149,14 +4199,27 @@
328 else
329 ++compl_pending;
330 }
331- if (!allow_get_expansion)
332- return -1;
333
334 /* Find matches. */
335 num_matches = ins_compl_get_exp(&compl_startpos);
336- if (compl_pending != 0 && compl_direction == compl_shows_dir
337+
338+ /* handle any pending completions */
339+ while (compl_pending != 0 && compl_direction == compl_shows_dir
340 && advance)
341- compl_shown_match = compl_curr_match;
342+ {
343+ if (compl_pending > 0 && compl_shown_match->cp_next != NULL)
344+ {
345+ compl_shown_match = compl_shown_match->cp_next;
346+ --compl_pending;
347+ }
348+ if (compl_pending < 0 && compl_shown_match->cp_prev != NULL)
349+ {
350+ compl_shown_match = compl_shown_match->cp_prev;
351+ ++compl_pending;
352+ }
353+ else
354+ break;
355+ }
356 found_end = FALSE;
357 }
358 if ((compl_shown_match->cp_flags & ORIGINAL_TEXT) == 0
359@@ -4265,9 +4328,9 @@
360 return;
361 count = 0;
362
363- ++no_mapping;
364+ /* Check for a typed key. Do use mappings, otherwise vim_is_ctrl_x_key()
365+ * can't do its work correctly. */
366 c = vpeekc_any();
367- --no_mapping;
368 if (c != NUL)
369 {
370 if (vim_is_ctrl_x_key(c) && c != Ctrl_X && c != Ctrl_R)
371@@ -4277,12 +4340,27 @@
372 (void)ins_compl_next(FALSE, ins_compl_key2count(c),
373 c != K_UP && c != K_DOWN);
374 }
375- else if (c != Ctrl_R)
376- compl_interrupted = TRUE;
377+ else
378+ {
379+ /* Need to get the character to have KeyTyped set. We'll put it
380+ * back with vungetc() below. */
381+ c = safe_vgetc();
382+
383+ /* Don't interrupt completion when the character wasn't typed,
384+ * e.g., when doing @q to replay keys. */
385+ if (c != Ctrl_R && KeyTyped)
386+ compl_interrupted = TRUE;
387+
388+ vungetc(c);
389+ }
390 }
391 if (compl_pending != 0 && !got_int)
392- (void)ins_compl_next(FALSE, compl_pending > 0
393- ? compl_pending : -compl_pending, TRUE);
394+ {
395+ int todo = compl_pending > 0 ? compl_pending : -compl_pending;
396+
397+ compl_pending = 0;
398+ (void)ins_compl_next(FALSE, todo, TRUE);
399+ }
400 }
401
402 /*
403@@ -4611,10 +4689,18 @@
404 (int)STRLEN(compl_pattern), curs_col);
405 if (compl_xp.xp_context == EXPAND_UNSUCCESSFUL
406 || compl_xp.xp_context == EXPAND_NOTHING)
407- return FAIL;
408- startcol = (int)(compl_xp.xp_pattern - compl_pattern);
409- compl_col = startcol;
410- compl_length = curs_col - startcol;
411+ {
412+ compl_col = curs_col;
413+ compl_length = 0;
414+ vim_free(compl_pattern);
415+ compl_pattern = NULL;
416+ }
417+ else
418+ {
419+ startcol = (int)(compl_xp.xp_pattern - compl_pattern);
420+ compl_col = startcol;
421+ compl_length = curs_col - startcol;
422+ }
423 }
424 else if (ctrl_x_mode == CTRL_X_FUNCTION || ctrl_x_mode == CTRL_X_OMNI)
425 {
426@@ -4668,11 +4754,17 @@
427 else
428 compl_col = spell_word_start(startcol);
429 if (compl_col >= (colnr_T)startcol)
430- return FAIL;
431- spell_expand_check_cap(compl_col);
432+ {
433+ compl_length = 0;
434+ compl_col = curs_col;
435+ }
436+ else
437+ {
438+ spell_expand_check_cap(compl_col);
439+ compl_length = (int)curs_col - compl_col;
440+ }
441 /* Need to obtain "line" again, it may have become invalid. */
442 line = ml_get(curwin->w_cursor.lnum);
443- compl_length = (int)curs_col - compl_col;
444 compl_pattern = vim_strnsave(line + compl_col, compl_length);
445 if (compl_pattern == NULL)
446 #endif
447diff -Naur vim70.orig/src/eval.c vim70/src/eval.c
448--- vim70.orig/src/eval.c 2006-05-05 10:15:26.000000000 -0700
449+++ vim70/src/eval.c 2006-07-14 10:51:54.000000000 -0700
450@@ -8252,6 +8252,12 @@
451 EMSG(_("E785: complete() can only be used in Insert mode"));
452 return;
453 }
454+
455+ /* Check for undo allowed here, because if something was already inserted
456+ * the line was already saved for undo and this check isn't done. */
457+ if (!undo_allowed())
458+ return;
459+
460 if (argvars[1].v_type != VAR_LIST || argvars[1].vval.v_list == NULL)
461 {
462 EMSG(_(e_invarg));
463@@ -9792,6 +9798,9 @@
464 varnumber_T n;
465 int error = FALSE;
466
467+ /* Position the cursor. Needed after a message that ends in a space. */
468+ windgoto(msg_row, msg_col);
469+
470 ++no_mapping;
471 ++allow_keys;
472 if (argvars[0].v_type == VAR_UNKNOWN)
473@@ -11312,14 +11321,19 @@
474
475 static int inputsecret_flag = 0;
476
477+static void get_user_input __ARGS((typval_T *argvars, typval_T *rettv, int inputdialog));
478+
479 /*
480- * "input()" function
481- * Also handles inputsecret() when inputsecret is set.
482+ * This function is used by f_input() and f_inputdialog() functions. The third
483+ * argument to f_input() specifies the type of completion to use at the
484+ * prompt. The third argument to f_inputdialog() specifies the value to return
485+ * when the user cancels the prompt.
486 */
487 static void
488-f_input(argvars, rettv)
489+get_user_input(argvars, rettv, inputdialog)
490 typval_T *argvars;
491 typval_T *rettv;
492+ int inputdialog;
493 {
494 char_u *prompt = get_tv_string_chk(&argvars[0]);
495 char_u *p = NULL;
496@@ -11369,10 +11383,10 @@
497 if (defstr != NULL)
498 stuffReadbuffSpec(defstr);
499
500- if (argvars[2].v_type != VAR_UNKNOWN)
501+ if (!inputdialog && argvars[2].v_type != VAR_UNKNOWN)
502 {
503 char_u *xp_name;
504- int xp_namelen;
505+ int xp_namelen;
506 long argt;
507
508 rettv->vval.v_string = NULL;
509@@ -11404,6 +11418,18 @@
510 }
511
512 /*
513+ * "input()" function
514+ * Also handles inputsecret() when inputsecret is set.
515+ */
516+ static void
517+f_input(argvars, rettv)
518+ typval_T *argvars;
519+ typval_T *rettv;
520+{
521+ get_user_input(argvars, rettv, FALSE);
522+}
523+
524+/*
525 * "inputdialog()" function
526 */
527 static void
528@@ -11443,7 +11469,7 @@
529 }
530 else
531 #endif
532- f_input(argvars, rettv);
533+ get_user_input(argvars, rettv, TRUE);
534 }
535
536 /*
537@@ -13250,7 +13276,7 @@
538 if (argvars[2].v_type != VAR_UNKNOWN)
539 EMSG2(_(e_toomanyarg), "remove()");
540 else if ((d = argvars[0].vval.v_dict) != NULL
541- && !tv_check_lock(d->dv_lock, (char_u *)"remove()"))
542+ && !tv_check_lock(d->dv_lock, (char_u *)"remove() argument"))
543 {
544 key = get_tv_string_chk(&argvars[1]);
545 if (key != NULL)
546@@ -13270,7 +13296,7 @@
547 else if (argvars[0].v_type != VAR_LIST)
548 EMSG2(_(e_listdictarg), "remove()");
549 else if ((l = argvars[0].vval.v_list) != NULL
550- && !tv_check_lock(l->lv_lock, (char_u *)"remove()"))
551+ && !tv_check_lock(l->lv_lock, (char_u *)"remove() argument"))
552 {
553 int error = FALSE;
554
555@@ -17759,6 +17785,13 @@
556 }
557 else /* add a new variable */
558 {
559+ /* Can't add "v:" variable. */
560+ if (ht == &vimvarht)
561+ {
562+ EMSG2(_(e_illvar), name);
563+ return;
564+ }
565+
566 /* Make sure the variable name is valid. */
567 for (p = varname; *p != NUL; ++p)
568 if (!eval_isnamec1(*p) && (p == varname || !VIM_ISDIGIT(*p))
569@@ -18963,7 +18996,8 @@
570 else if (lead > 0)
571 {
572 lead = 3;
573- if (eval_fname_sid(lv.ll_exp_name != NULL ? lv.ll_exp_name : *pp))
574+ if ((lv.ll_exp_name != NULL && eval_fname_sid(lv.ll_exp_name))
575+ || eval_fname_sid(*pp))
576 {
577 /* It's "s:" or "<SID>" */
578 if (current_SID <= 0)
579@@ -19685,6 +19719,7 @@
580 v->di_tv.vval.v_list = &fc.l_varlist;
581 vim_memset(&fc.l_varlist, 0, sizeof(list_T));
582 fc.l_varlist.lv_refcount = 99999;
583+ fc.l_varlist.lv_lock = VAR_FIXED;
584
585 /*
586 * Set a:firstline to "firstline" and a:lastline to "lastline".
587diff -Naur vim70.orig/src/ex_cmds.h vim70/src/ex_cmds.h
588--- vim70.orig/src/ex_cmds.h 2006-04-07 02:44:46.000000000 -0700
589+++ vim70/src/ex_cmds.h 2006-07-14 08:51:21.000000000 -0700
590@@ -262,7 +262,7 @@
591 EX(CMD_comclear, "comclear", ex_comclear,
592 TRLBAR|CMDWIN),
593 EX(CMD_compiler, "compiler", ex_compiler,
594- BANG|TRLBAR|WORD1),
595+ BANG|TRLBAR|WORD1|CMDWIN),
596 EX(CMD_continue, "continue", ex_continue,
597 TRLBAR|SBOXOK|CMDWIN),
598 EX(CMD_confirm, "confirm", ex_wrongmodifier,
599diff -Naur vim70.orig/src/ex_docmd.c vim70/src/ex_docmd.c
600--- vim70.orig/src/ex_docmd.c 2006-05-05 09:33:19.000000000 -0700
601+++ vim70/src/ex_docmd.c 2006-07-14 08:51:21.000000000 -0700
602@@ -833,7 +833,7 @@
603 * If requested, store and reset the global values controlling the
604 * exception handling (used when debugging).
605 */
606- else if (flags & DOCMD_EXCRESET)
607+ if (flags & DOCMD_EXCRESET)
608 save_dbg_stuff(&debug_saved);
609
610 initial_trylevel = trylevel;
611diff -Naur vim70.orig/src/gui_at_fs.c vim70/src/gui_at_fs.c
612--- vim70.orig/src/gui_at_fs.c 2005-07-09 04:30:17.000000000 -0700
613+++ vim70/src/gui_at_fs.c 2006-07-14 08:51:21.000000000 -0700
614@@ -1861,27 +1861,27 @@
615 XtPointer pnew;
616 {
617 SFDir *dir;
618- int nw;
619+ int nw = (int)(long)pnew;
620
621 dir = &(SFdirs[SFdirPtr + (int)(long)n]);
622
623 #ifdef FEAT_GUI_NEXTAW
624- if ((int)(long)pnew < 0)
625+ if (nw < 0)
626 {
627- if ((int)(long)pnew > -SFvScrollHeight)
628- (int)(long)pnew = -1;
629+ if (nw > -SFvScrollHeight)
630+ nw = -1;
631 else
632- (int)(long)pnew = -SFlistSize;
633+ nw = -SFlistSize;
634 }
635- else if ((int)(long)pnew > 0)
636+ else if (nw > 0)
637 {
638- if ((int)(long)pnew < SFvScrollHeight)
639- (int)(long)pnew = 1;
640+ if (nw < SFvScrollHeight)
641+ nw = 1;
642 else
643- (int)(long)pnew = SFlistSize;
644+ nw = SFlistSize;
645 }
646 #endif
647- nw = dir->vOrigin + (int)(long)pnew;
648+ nw += dir->vOrigin;
649
650 if (nw > dir->nEntries - SFlistSize)
651 nw = dir->nEntries - SFlistSize;
652@@ -1941,27 +1941,27 @@
653 XtPointer pnew;
654 {
655 SFDir *dir;
656- int nw;
657+ int nw = (int)(long)pnew;
658
659 dir = &(SFdirs[SFdirPtr + (int)(long)n]);
660
661 #ifdef FEAT_GUI_NEXTAW
662- if ((int)(long)pnew < 0)
663+ if (nw < 0)
664 {
665- if ((int)(long)pnew > -SFhScrollWidth)
666- (int)(long)pnew = -1;
667+ if (nw > -SFhScrollWidth)
668+ nw = -1;
669 else
670- (int)(long)pnew = -SFcharsPerEntry;
671+ nw = -SFcharsPerEntry;
672 }
673- else if ((int)(long)pnew > 0)
674+ else if (nw > 0)
675 {
676- if ((int)(long)pnew < SFhScrollWidth)
677- (int)(long)pnew = 1;
678+ if (nw < SFhScrollWidth)
679+ nw = 1;
680 else
681- (int)(long)pnew = SFcharsPerEntry;
682+ nw = SFcharsPerEntry;
683 }
684 #endif
685- nw = dir->hOrigin + (int)(long)pnew;
686+ nw += dir->hOrigin;
687
688 if (nw > dir->nChars - SFcharsPerEntry)
689 nw = dir->nChars - SFcharsPerEntry;
690@@ -2038,26 +2038,26 @@
691 XtPointer client_data;
692 XtPointer pnew;
693 {
694- int nw;
695+ int nw = (int)(long)pnew;
696 float f;
697
698 #ifdef FEAT_GUI_NEXTAW
699- if ((int)(long)pnew < 0)
700+ if (nw < 0)
701 {
702- if ((int)(long)pnew > -SFpathScrollWidth)
703- (int)(long)pnew = -1;
704+ if (nw > -SFpathScrollWidth)
705+ nw = -1;
706 else
707- (int)(long)pnew = -3;
708+ nw = -3;
709 }
710- else if ((int)(long)pnew > 0)
711+ else if (nw > 0)
712 {
713- if ((int)(long)pnew < SFpathScrollWidth)
714- (int)(long)pnew = 1;
715+ if (nw < SFpathScrollWidth)
716+ nw = 1;
717 else
718- (int)(long)pnew = 3;
719+ nw = 3;
720 }
721 #endif
722- nw = SFdirPtr + (int)(long)pnew;
723+ nw += SFdirPtr;
724
725 if (nw > SFdirEnd - 3)
726 nw = SFdirEnd - 3;
727diff -Naur vim70.orig/src/gui.c vim70/src/gui.c
728--- vim70.orig/src/gui.c 2006-05-03 04:00:59.000000000 -0700
729+++ vim70/src/gui.c 2006-07-14 08:51:21.000000000 -0700
730@@ -4515,7 +4515,7 @@
731 int y;
732 {
733 win_T *wp;
734- char_u st[6];
735+ char_u st[8];
736
737 /* Ignore this while still starting up. */
738 if (!gui.in_use || gui.starting)
739@@ -4603,11 +4603,11 @@
740 /* Don't move the mouse when it's left or right of the Vim window */
741 if (x < 0 || x > Columns * gui.char_width)
742 return;
743+ if (y >= 0
744 # ifdef FEAT_WINDOWS
745- if (Y_2_ROW(y) >= tabline_height())
746-# else
747- if (y >= 0)
748+ && Y_2_ROW(y) >= tabline_height()
749 # endif
750+ )
751 wp = xy2win(x, y);
752 if (wp != curwin && wp != NULL) /* If in other than current window */
753 {
754diff -Naur vim70.orig/src/gui_xmebw.c vim70/src/gui_xmebw.c
755--- vim70.orig/src/gui_xmebw.c 2006-04-30 08:32:32.000000000 -0700
756+++ vim70/src/gui_xmebw.c 2006-07-14 08:51:21.000000000 -0700
757@@ -47,13 +47,13 @@
758 #include "gui_xmebwp.h"
759
760 /* Provide some missing wrappers, which are missed from the LessTif
761- * implementation.
762+ * implementation. Also missing in Motif 1.2 and earlier.
763 *
764 * We neither use XmeGetPixmapData or _XmGetPixmapData, since with LessTif the
765 * pixmap will not appear in it's caches properly. We cache the interresting
766 * values in XmEnhancedButtonPart instead ourself.
767 */
768-#ifdef LESSTIF_VERSION
769+#if defined(LESSTIF_VERSION) || (XmVersion <= 1002)
770 # ifndef Lab_IsMenupane
771 # define Lab_IsMenupane(w) (Lab_MenuType(w) == (int)XmMENU_POPUP || \
772 Lab_MenuType(w) == (int)XmMENU_PULLDOWN)
773@@ -480,7 +480,7 @@
774 || (eb->core.height <= 2 * eb->primitive.highlight_thickness))
775 return;
776
777-#ifndef LESSTIF_VERSION
778+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
779 {
780 XmDisplay dpy;
781
782@@ -641,7 +641,7 @@
783 GC tmp_gc = NULL;
784 Boolean replaceGC = False;
785 Boolean deadjusted = False;
786-#ifndef LESSTIF_VERSION
787+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
788 XmDisplay dpy = (XmDisplay)XmGetXmDisplay(XtDisplay(eb));
789 Boolean etched_in = dpy->display.enable_etched_in_menu;
790 #else
791@@ -726,7 +726,7 @@
792 if ((((ShellWidget) XtParent(XtParent(eb)))->shell.popped_up)
793 && _XmGetInDragMode((Widget) eb))
794 {
795-#ifndef LESSTIF_VERSION
796+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
797 XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid));
798 Boolean etched_in = dpy->display.enable_etched_in_menu;
799 #else
800@@ -810,7 +810,7 @@
801
802 if (Lab_IsMenupane(eb))
803 {
804-#ifndef LESSTIF_VERSION
805+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
806 XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid));
807 Boolean etched_in = dpy->display.enable_etched_in_menu;
808 #else
809@@ -1150,7 +1150,7 @@
810 Redisplay(Widget w, XEvent *event, Region region)
811 {
812 XmEnhancedButtonWidget eb = (XmEnhancedButtonWidget) w;
813-#ifndef LESSTIF_VERSION
814+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
815 XmDisplay dpy;
816 XtEnum default_button_emphasis;
817 #endif
818@@ -1162,7 +1162,7 @@
819 if (!XtIsRealized((Widget)eb))
820 return;
821
822-#ifndef LESSTIF_VERSION
823+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
824 dpy = (XmDisplay)XmGetXmDisplay(XtDisplay(eb));
825 default_button_emphasis = dpy->display.default_button_emphasis;
826 #endif
827@@ -1241,7 +1241,7 @@
828 {
829 int adjust = 0;
830
831-#ifndef LESSTIF_VERSION
832+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
833 /*
834 * NOTE: PushButton has two types of shadows: primitive-shadow and
835 * default-button-shadow. If pushbutton is in a menu only primitive
836@@ -1289,7 +1289,7 @@
837 adjust, adjust, rectwidth, rectheight, borderwidth);
838 }
839
840-#ifndef LESSTIF_VERSION
841+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
842 switch (default_button_emphasis)
843 {
844 case XmINTERNAL_HIGHLIGHT:
845@@ -1365,7 +1365,7 @@
846 default_button_shadow_thickness =
847 eb->pushbutton.default_button_shadow_thickness;
848
849-#ifndef LESSTIF_VERSION
850+#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
851 /*
852 * Compute location of bounding box to contain the
853 * defaultButtonShadow.
854diff -Naur vim70.orig/src/if_ruby.c vim70/src/if_ruby.c
855--- vim70.orig/src/if_ruby.c 2006-04-30 08:37:52.000000000 -0700
856+++ vim70/src/if_ruby.c 2006-07-14 08:51:21.000000000 -0700
857@@ -643,11 +643,23 @@
858
859 static VALUE set_buffer_line(buf_T *buf, linenr_T n, VALUE str)
860 {
861- buf_T *savebuf = curbuf;
862- char *line = STR2CSTR(str);
863+ char *line = STR2CSTR(str);
864+#ifdef FEAT_AUTOCMD
865+ aco_save_T aco;
866+#else
867+ buf_T *save_curbuf = curbuf;
868+#endif
869
870- if (n > 0 && n <= buf->b_ml.ml_line_count && line != NULL) {
871+ if (n > 0 && n <= buf->b_ml.ml_line_count && line != NULL)
872+ {
873+#ifdef FEAT_AUTOCMD
874+ /* set curwin/curbuf for "buf" and save some things */
875+ aucmd_prepbuf(&aco, buf);
876+#else
877 curbuf = buf;
878+ curwin->w_buffer = buf;
879+#endif
880+
881 if (u_savesub(n) == OK) {
882 ml_replace(n, (char_u *)line, TRUE);
883 changed();
884@@ -655,10 +667,19 @@
885 syn_changed(n); /* recompute syntax hl. for this line */
886 #endif
887 }
888- curbuf = savebuf;
889+
890+#ifdef FEAT_AUTOCMD
891+ /* restore curwin/curbuf and a few other things */
892+ aucmd_restbuf(&aco);
893+ /* Careful: autocommands may have made "buf" invalid! */
894+#else
895+ curwin->w_buffer = save_curbuf;
896+ curbuf = save_curbuf;
897+#endif
898 update_curbuf(NOT_VALID);
899 }
900- else {
901+ else
902+ {
903 rb_raise(rb_eIndexError, "index %d out of buffer", n);
904 return Qnil; /* For stop warning */
905 }
906@@ -676,12 +697,24 @@
907
908 static VALUE buffer_delete(VALUE self, VALUE num)
909 {
910- buf_T *buf = get_buf(self);
911- buf_T *savebuf = curbuf;
912- long n = NUM2LONG(num);
913+ buf_T *buf = get_buf(self);
914+ long n = NUM2LONG(num);
915+#ifdef FEAT_AUTOCMD
916+ aco_save_T aco;
917+#else
918+ buf_T *save_curbuf = curbuf;
919+#endif
920
921- if (n > 0 && n <= buf->b_ml.ml_line_count) {
922+ if (n > 0 && n <= buf->b_ml.ml_line_count)
923+ {
924+#ifdef FEAT_AUTOCMD
925+ /* set curwin/curbuf for "buf" and save some things */
926+ aucmd_prepbuf(&aco, buf);
927+#else
928 curbuf = buf;
929+ curwin->w_buffer = buf;
930+#endif
931+
932 if (u_savedel(n, 1) == OK) {
933 ml_delete(n, 0);
934
935@@ -691,10 +724,19 @@
936
937 changed();
938 }
939- curbuf = savebuf;
940+
941+#ifdef FEAT_AUTOCMD
942+ /* restore curwin/curbuf and a few other things */
943+ aucmd_restbuf(&aco);
944+ /* Careful: autocommands may have made "buf" invalid! */
945+#else
946+ curwin->w_buffer = save_curbuf;
947+ curbuf = save_curbuf;
948+#endif
949 update_curbuf(NOT_VALID);
950 }
951- else {
952+ else
953+ {
954 rb_raise(rb_eIndexError, "index %d out of buffer", n);
955 }
956 return Qnil;
957@@ -702,13 +744,25 @@
958
959 static VALUE buffer_append(VALUE self, VALUE num, VALUE str)
960 {
961- buf_T *buf = get_buf(self);
962- buf_T *savebuf = curbuf;
963- char *line = STR2CSTR(str);
964- long n = NUM2LONG(num);
965+ buf_T *buf = get_buf(self);
966+ char *line = STR2CSTR(str);
967+ long n = NUM2LONG(num);
968+#ifdef FEAT_AUTOCMD
969+ aco_save_T aco;
970+#else
971+ buf_T *save_curbuf = curbuf;
972+#endif
973
974- if (n >= 0 && n <= buf->b_ml.ml_line_count && line != NULL) {
975+ if (n >= 0 && n <= buf->b_ml.ml_line_count && line != NULL)
976+ {
977+#ifdef FEAT_AUTOCMD
978+ /* set curwin/curbuf for "buf" and save some things */
979+ aucmd_prepbuf(&aco, buf);
980+#else
981 curbuf = buf;
982+ curwin->w_buffer = buf;
983+#endif
984+
985 if (u_inssub(n + 1) == OK) {
986 ml_append(n, (char_u *) line, (colnr_T) 0, FALSE);
987
988@@ -718,7 +772,15 @@
989
990 changed();
991 }
992- curbuf = savebuf;
993+
994+#ifdef FEAT_AUTOCMD
995+ /* restore curwin/curbuf and a few other things */
996+ aucmd_restbuf(&aco);
997+ /* Careful: autocommands may have made "buf" invalid! */
998+#else
999+ curwin->w_buffer = save_curbuf;
1000+ curbuf = save_curbuf;
1001+#endif
1002 update_curbuf(NOT_VALID);
1003 }
1004 else {
1005diff -Naur vim70.orig/src/main.c vim70/src/main.c
1006--- vim70.orig/src/main.c 2006-05-03 10:36:44.000000000 -0700
1007+++ vim70/src/main.c 2006-07-14 08:51:21.000000000 -0700
1008@@ -564,7 +564,11 @@
1009 */
1010 if (p_lpl)
1011 {
1012+# ifdef VMS /* Somehow VMS doesn't handle the "**". */
1013+ source_runtime((char_u *)"plugin/*.vim", TRUE);
1014+# else
1015 source_runtime((char_u *)"plugin/**/*.vim", TRUE);
1016+# endif
1017 TIME_MSG("loading plugins");
1018 }
1019 #endif
1020diff -Naur vim70.orig/src/Makefile vim70/src/Makefile
1021--- vim70.orig/src/Makefile 2006-05-07 06:25:27.000000000 -0700
1022+++ vim70/src/Makefile 2006-07-14 08:51:21.000000000 -0700
1023@@ -2177,6 +2177,7 @@
1024 cd $(SHADOWDIR)/xxd; ln -s ../../xxd/*.[ch] ../../xxd/Make* .
1025 if test -d $(RSRC_DIR); then \
1026 cd $(SHADOWDIR); \
1027+ ln -s ../infplist.xml .; \
1028 ln -s ../$(RSRC_DIR) ../os_mac.rsr.hqx ../dehqx.py .; \
1029 fi
1030 mkdir $(SHADOWDIR)/testdir
1031diff -Naur vim70.orig/src/mbyte.c vim70/src/mbyte.c
1032--- vim70.orig/src/mbyte.c 2006-04-30 04:51:01.000000000 -0700
1033+++ vim70/src/mbyte.c 2006-07-14 08:51:21.000000000 -0700
1034@@ -311,7 +311,11 @@
1035
1036 #define IDX_MACROMAN 57
1037 {"macroman", ENC_8BIT + ENC_MACROMAN, 0}, /* Mac OS */
1038-#define IDX_COUNT 58
1039+#define IDX_DECMCS 58
1040+ {"dec-mcs", ENC_8BIT, 0}, /* DEC MCS */
1041+#define IDX_HPROMAN8 59
1042+ {"hp-roman8", ENC_8BIT, 0}, /* HP Roman8 */
1043+#define IDX_COUNT 60
1044 };
1045
1046 /*
1047@@ -386,6 +390,7 @@
1048 {"950", IDX_BIG5},
1049 #endif
1050 {"mac", IDX_MACROMAN},
1051+ {"mac-roman", IDX_MACROMAN},
1052 {NULL, 0}
1053 };
1054
1055diff -Naur vim70.orig/src/message.c vim70/src/message.c
1056--- vim70.orig/src/message.c 2006-05-06 13:07:37.000000000 -0700
1057+++ vim70/src/message.c 2006-07-14 08:51:21.000000000 -0700
1058@@ -4175,15 +4175,16 @@
1059 str_arg_l = 0;
1060 else
1061 {
1062- /* memchr on HP does not like n > 2^31 !!! */
1063- char *q = memchr(str_arg, '\0',
1064+ /* Don't put the #if inside memchr(), it can be a
1065+ * macro. */
1066 #if SIZEOF_INT <= 2
1067- precision
1068+ char *q = memchr(str_arg, '\0', precision);
1069 #else
1070- precision <= (size_t)0x7fffffffL ? precision
1071- : (size_t)0x7fffffffL
1072+ /* memchr on HP does not like n > 2^31 !!! */
1073+ char *q = memchr(str_arg, '\0',
1074+ precision <= (size_t)0x7fffffffL ? precision
1075+ : (size_t)0x7fffffffL);
1076 #endif
1077- );
1078 str_arg_l = (q == NULL) ? precision : q - str_arg;
1079 }
1080 break;
1081diff -Naur vim70.orig/src/ops.c vim70/src/ops.c
1082--- vim70.orig/src/ops.c 2006-04-30 08:13:44.000000000 -0700
1083+++ vim70/src/ops.c 2006-07-14 08:51:21.000000000 -0700
1084@@ -2413,6 +2413,7 @@
1085 else
1086 {
1087 curwin->w_cursor = oap->end;
1088+ check_cursor_col();
1089
1090 /* Works just like an 'i'nsert on the next character. */
1091 if (!lineempty(curwin->w_cursor.lnum)
1092diff -Naur vim70.orig/src/option.c vim70/src/option.c
1093--- vim70.orig/src/option.c 2006-05-03 10:32:28.000000000 -0700
1094+++ vim70/src/option.c 2006-07-14 08:51:21.000000000 -0700
1095@@ -2294,7 +2294,7 @@
1096 {(char_u *)0L, (char_u *)0L}
1097 #endif
1098 },
1099- {"spellsuggest", "sps", P_STRING|P_VI_DEF|P_EXPAND|P_SECURE,
1100+ {"spellsuggest", "sps", P_STRING|P_VI_DEF|P_EXPAND|P_SECURE|P_COMMA,
1101 #ifdef FEAT_SPELL
1102 (char_u *)&p_sps, PV_NONE,
1103 {(char_u *)"best", (char_u *)0L}
1104@@ -5227,13 +5227,13 @@
1105 case PV_STL: return &curwin->w_p_stl_flags;
1106 #endif
1107 #ifdef FEAT_EVAL
1108+# ifdef FEAT_FOLDING
1109 case PV_FDE: return &curwin->w_p_fde_flags;
1110 case PV_FDT: return &curwin->w_p_fdt_flags;
1111+# endif
1112 # ifdef FEAT_BEVAL
1113 case PV_BEXPR: return &curbuf->b_p_bexpr_flags;
1114 # endif
1115-#endif
1116-#if defined(FEAT_EVAL)
1117 # if defined(FEAT_CINDENT)
1118 case PV_INDE: return &curbuf->b_p_inde_flags;
1119 # endif
1120diff -Naur vim70.orig/src/os_unix.c vim70/src/os_unix.c
1121--- vim70.orig/src/os_unix.c 2006-05-01 01:13:15.000000000 -0700
1122+++ vim70/src/os_unix.c 2006-07-14 08:51:21.000000000 -0700
1123@@ -4971,7 +4971,8 @@
1124 if (((*file)[*num_file] = alloc(len + 2)) != NULL)
1125 {
1126 STRCPY((*file)[*num_file], p);
1127- if (!after_pathsep((*file)[*num_file] + len))
1128+ if (!after_pathsep((*file)[*num_file],
1129+ (*file)[*num_file] + len))
1130 {
1131 (*file)[*num_file][len] = psepc;
1132 (*file)[*num_file][len + 1] = NUL;
1133@@ -5757,8 +5758,13 @@
1134 int retval_int = 0;
1135 int success = FALSE;
1136
1137- /* Get a handle to the DLL module. */
1138+ /*
1139+ * Get a handle to the DLL module.
1140+ */
1141 # if defined(USE_DLOPEN)
1142+ /* First clear any error, it's not cleared by the dlopen() call. */
1143+ (void)dlerror();
1144+
1145 hinstLib = dlopen((char *)libname, RTLD_LAZY
1146 # ifdef RTLD_LOCAL
1147 | RTLD_LOCAL
1148diff -Naur vim70.orig/src/proto/undo.pro vim70/src/proto/undo.pro
1149--- vim70.orig/src/proto/undo.pro 2006-05-07 06:09:11.000000000 -0700
1150+++ vim70/src/proto/undo.pro 2006-07-14 10:51:11.000000000 -0700
1151@@ -4,6 +4,7 @@
1152 extern int u_savesub __ARGS((linenr_T lnum));
1153 extern int u_inssub __ARGS((linenr_T lnum));
1154 extern int u_savedel __ARGS((linenr_T lnum, long nlines));
1155+extern int undo_allowed __ARGS((void));
1156 extern void u_undo __ARGS((int count));
1157 extern void u_redo __ARGS((int count));
1158 extern void undo_time __ARGS((long step, int sec, int absolute));
1159diff -Naur vim70.orig/src/quickfix.c vim70/src/quickfix.c
1160--- vim70.orig/src/quickfix.c 2006-05-03 00:47:42.000000000 -0700
1161+++ vim70/src/quickfix.c 2006-07-14 08:51:21.000000000 -0700
1162@@ -602,13 +602,19 @@
1163 else
1164 type = 0;
1165 /*
1166- * Extract error message data from matched line
1167+ * Extract error message data from matched line.
1168+ * We check for an actual submatch, because "\[" and "\]" in
1169+ * the 'errorformat' may cause the wrong submatch to be used.
1170 */
1171 if ((i = (int)fmt_ptr->addr[0]) > 0) /* %f */
1172 {
1173- int c = *regmatch.endp[i];
1174+ int c;
1175+
1176+ if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
1177+ continue;
1178
1179 /* Expand ~/file and $HOME/file to full path. */
1180+ c = *regmatch.endp[i];
1181 *regmatch.endp[i] = NUL;
1182 expand_env(regmatch.startp[i], namebuf, CMDBUFFSIZE);
1183 *regmatch.endp[i] = c;
1184@@ -618,35 +624,63 @@
1185 continue;
1186 }
1187 if ((i = (int)fmt_ptr->addr[1]) > 0) /* %n */
1188+ {
1189+ if (regmatch.startp[i] == NULL)
1190+ continue;
1191 enr = (int)atol((char *)regmatch.startp[i]);
1192+ }
1193 if ((i = (int)fmt_ptr->addr[2]) > 0) /* %l */
1194+ {
1195+ if (regmatch.startp[i] == NULL)
1196+ continue;
1197 lnum = atol((char *)regmatch.startp[i]);
1198+ }
1199 if ((i = (int)fmt_ptr->addr[3]) > 0) /* %c */
1200+ {
1201+ if (regmatch.startp[i] == NULL)
1202+ continue;
1203 col = (int)atol((char *)regmatch.startp[i]);
1204+ }
1205 if ((i = (int)fmt_ptr->addr[4]) > 0) /* %t */
1206+ {
1207+ if (regmatch.startp[i] == NULL)
1208+ continue;
1209 type = *regmatch.startp[i];
1210+ }
1211 if (fmt_ptr->flags == '+' && !multiscan) /* %+ */
1212 STRCPY(errmsg, IObuff);
1213 else if ((i = (int)fmt_ptr->addr[5]) > 0) /* %m */
1214 {
1215+ if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
1216+ continue;
1217 len = (int)(regmatch.endp[i] - regmatch.startp[i]);
1218 vim_strncpy(errmsg, regmatch.startp[i], len);
1219 }
1220 if ((i = (int)fmt_ptr->addr[6]) > 0) /* %r */
1221+ {
1222+ if (regmatch.startp[i] == NULL)
1223+ continue;
1224 tail = regmatch.startp[i];
1225+ }
1226 if ((i = (int)fmt_ptr->addr[7]) > 0) /* %p */
1227 {
1228+ if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
1229+ continue;
1230 col = (int)(regmatch.endp[i] - regmatch.startp[i] + 1);
1231 if (*((char_u *)regmatch.startp[i]) != TAB)
1232 use_viscol = TRUE;
1233 }
1234 if ((i = (int)fmt_ptr->addr[8]) > 0) /* %v */
1235 {
1236+ if (regmatch.startp[i] == NULL)
1237+ continue;
1238 col = (int)atol((char *)regmatch.startp[i]);
1239 use_viscol = TRUE;
1240 }
1241 if ((i = (int)fmt_ptr->addr[9]) > 0) /* %s */
1242 {
1243+ if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
1244+ continue;
1245 len = (int)(regmatch.endp[i] - regmatch.startp[i]);
1246 if (len > CMDBUFFSIZE - 5)
1247 len = CMDBUFFSIZE - 5;
1248diff -Naur vim70.orig/src/screen.c vim70/src/screen.c
1249--- vim70.orig/src/screen.c 2006-05-05 03:13:55.000000000 -0700
1250+++ vim70/src/screen.c 2006-07-14 10:50:30.000000000 -0700
1251@@ -2612,7 +2612,8 @@
1252 #ifdef FEAT_LINEBREAK
1253 int need_showbreak = FALSE;
1254 #endif
1255-#if defined(FEAT_SIGNS) || (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS))
1256+#if defined(FEAT_SIGNS) || (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \
1257+ || defined(FEAT_SYN_HL) || defined(FEAT_DIFF)
1258 # define LINE_ATTR
1259 int line_attr = 0; /* atrribute for the whole line */
1260 #endif
1261@@ -2626,7 +2627,7 @@
1262 int prev_c = 0; /* previous Arabic character */
1263 int prev_c1 = 0; /* first composing char for prev_c */
1264 #endif
1265-#if defined(FEAT_DIFF) || defined(LINE_ATTR)
1266+#if defined(LINE_ATTR)
1267 int did_line_attr = 0;
1268 #endif
1269
1270@@ -4116,17 +4117,12 @@
1271 --ptr; /* put it back at the NUL */
1272 }
1273 #endif
1274-#if defined(FEAT_DIFF) || defined(LINE_ATTR)
1275+#if defined(LINE_ATTR)
1276 else if ((
1277 # ifdef FEAT_DIFF
1278- diff_hlf != (hlf_T)0
1279-# ifdef LINE_ATTR
1280- ||
1281-# endif
1282+ diff_hlf != (hlf_T)0 ||
1283 # endif
1284-# ifdef LINE_ATTR
1285 line_attr != 0
1286-# endif
1287 ) && (
1288 # ifdef FEAT_RIGHTLEFT
1289 wp->w_p_rl ? (col >= 0) :
1290@@ -4237,7 +4233,7 @@
1291 * At end of the text line or just after the last character.
1292 */
1293 if (c == NUL
1294-#if defined(FEAT_DIFF) || defined(LINE_ATTR)
1295+#if defined(LINE_ATTR)
1296 || did_line_attr == 1
1297 #endif
1298 )
1299@@ -4258,7 +4254,7 @@
1300 || prevcol == (long)match_hl[0].startcol
1301 || prevcol == (long)match_hl[1].startcol
1302 || prevcol == (long)match_hl[2].startcol)
1303-# if defined(FEAT_DIFF) || defined(LINE_ATTR)
1304+# if defined(LINE_ATTR)
1305 && did_line_attr <= 1
1306 # endif
1307 )
1308@@ -7133,6 +7129,12 @@
1309 return;
1310 entered = TRUE;
1311
1312+ /*
1313+ * Note that the window sizes are updated before reallocating the arrays,
1314+ * thus we must not redraw here!
1315+ */
1316+ ++RedrawingDisabled;
1317+
1318 win_new_shellsize(); /* fit the windows in the new sized shell */
1319
1320 comp_col(); /* recompute columns for shown command and ruler */
1321@@ -7367,6 +7369,7 @@
1322 #endif
1323
1324 entered = FALSE;
1325+ --RedrawingDisabled;
1326
1327 #ifdef FEAT_AUTOCMD
1328 if (starting == 0)
1329diff -Naur vim70.orig/src/spell.c vim70/src/spell.c
1330--- vim70.orig/src/spell.c 2006-05-05 00:49:58.000000000 -0700
1331+++ vim70/src/spell.c 2006-07-14 08:51:21.000000000 -0700
1332@@ -2108,7 +2108,8 @@
1333 * possible. */
1334 STRCPY(buf, line);
1335 if (lnum < wp->w_buffer->b_ml.ml_line_count)
1336- spell_cat_line(buf + STRLEN(buf), ml_get(lnum + 1), MAXWLEN);
1337+ spell_cat_line(buf + STRLEN(buf),
1338+ ml_get_buf(wp->w_buffer, lnum + 1, FALSE), MAXWLEN);
1339
1340 p = buf + skip;
1341 endp = buf + len;
1342diff -Naur vim70.orig/src/undo.c vim70/src/undo.c
1343--- vim70.orig/src/undo.c 2006-04-21 02:30:59.000000000 -0700
1344+++ vim70/src/undo.c 2006-07-14 10:51:11.000000000 -0700
1345@@ -84,7 +84,6 @@
1346 static void u_unch_branch __ARGS((u_header_T *uhp));
1347 static u_entry_T *u_get_headentry __ARGS((void));
1348 static void u_getbot __ARGS((void));
1349-static int undo_allowed __ARGS((void));
1350 static int u_savecommon __ARGS((linenr_T, linenr_T, linenr_T));
1351 static void u_doit __ARGS((int count));
1352 static void u_undoredo __ARGS((int undo));
1353@@ -196,7 +195,7 @@
1354 * Return TRUE when undo is allowed. Otherwise give an error message and
1355 * return FALSE.
1356 */
1357- static int
1358+ int
1359 undo_allowed()
1360 {
1361 /* Don't allow changes when 'modifiable' is off. */
1362diff -Naur vim70.orig/src/version.c vim70/src/version.c
1363--- vim70.orig/src/version.c 2006-05-03 00:50:42.000000000 -0700
1364+++ vim70/src/version.c 2006-07-14 10:51:54.000000000 -0700
1365@@ -667,6 +667,78 @@
1366 static int included_patches[] =
1367 { /* Add new patch number below this line */
1368 /**/
1369+ 39,
1370+/**/
1371+ 38,
1372+/**/
1373+ 37,
1374+/**/
1375+ 36,
1376+/**/
1377+ 35,
1378+/**/
1379+ 34,
1380+/**/
1381+ 33,
1382+/**/
1383+ 31,
1384+/**/
1385+ 30,
1386+/**/
1387+ 29,
1388+/**/
1389+ 28,
1390+/**/
1391+ 26,
1392+/**/
1393+ 25,
1394+/**/
1395+ 24,
1396+/**/
1397+ 23,
1398+/**/
1399+ 22,
1400+/**/
1401+ 21,
1402+/**/
1403+ 20,
1404+/**/
1405+ 19,
1406+/**/
1407+ 18,
1408+/**/
1409+ 17,
1410+/**/
1411+ 16,
1412+/**/
1413+ 15,
1414+/**/
1415+ 14,
1416+/**/
1417+ 13,
1418+/**/
1419+ 12,
1420+/**/
1421+ 11,
1422+/**/
1423+ 10,
1424+/**/
1425+ 9,
1426+/**/
1427+ 8,
1428+/**/
1429+ 7,
1430+/**/
1431+ 6,
1432+/**/
1433+ 4,
1434+/**/
1435+ 3,
1436+/**/
1437+ 2,
1438+/**/
1439+ 1,
1440+/**/
1441 0
1442 };
1443
1444diff -Naur vim70.orig/src/vim.h vim70/src/vim.h
1445--- vim70.orig/src/vim.h 2006-04-30 08:32:38.000000000 -0700
1446+++ vim70/src/vim.h 2006-07-14 08:51:21.000000000 -0700
1447@@ -585,7 +585,6 @@
1448 #define INSERT 0x10 /* Insert mode */
1449 #define LANGMAP 0x20 /* Language mapping, can be combined with
1450 INSERT and CMDLINE */
1451-#define MAP_ALL_MODES 0x3f /* all mode bits used for mapping */
1452
1453 #define REPLACE_FLAG 0x40 /* Replace mode flag */
1454 #define REPLACE (REPLACE_FLAG + INSERT)
1455@@ -605,6 +604,9 @@
1456 #define CONFIRM 0x800 /* ":confirm" prompt */
1457 #define SELECTMODE 0x1000 /* Select mode, only for mappings */
1458
1459+#define MAP_ALL_MODES (0x3f | SELECTMODE) /* all mode bits used for
1460+ * mapping */
1461+
1462 /* directions */
1463 #define FORWARD 1
1464 #define BACKWARD (-1)
1465@@ -1983,7 +1985,7 @@
1466 /* values for vim_handle_signal() that are not a signal */
1467 #define SIGNAL_BLOCK -1
1468 #define SIGNAL_UNBLOCK -2
1469-#if !defined(UNIX) && !defined(VMS)
1470+#if !defined(UNIX) && !defined(VMS) && !defined(OS2)
1471 # define vim_handle_signal(x) 0
1472 #endif
1473