1 Submitted By: Jim Gifford (jim at linuxfromscratch dot org)
3 Initial Package Version: 7.0
5 Upstream Status: Applied
6 Description: 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
9 diff -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
13 " Vim completion script
15 " Maintainer: Bram Moolenaar <Bram@vim.org>
16 -" Last Change: 2006 May 03
17 +" Last Change: 2006 May 08
20 " This function is used for the 'omnifunc' option.
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, " \\#%")'))
30 diff -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
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
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.
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'
50 diff -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
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
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'
63 let s:spellfile_URL = '' " Start with nothing so that s:donedict is reset.
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.
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'
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'
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 . '"'
101 diff -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
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
111 " - this plugin was already loaded (or disabled)
113 " Find the match. When it was just before the cursor move it there for a
116 - let save_cursor = getpos('.')
117 + let save_cursor = winsaveview()
118 call cursor(c_lnum, c_col - before)
122 let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
125 - call setpos('.', save_cursor)
126 + call winrestview(save_cursor)
129 " If a match is found setup match highlighting.
130 diff -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
134 #ifdef FEAT_INS_EXPAND
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.
141 - if (compl_started && pum_wanted() && curwin->w_cursor.col >= compl_col)
144 + && curwin->w_cursor.col >= compl_col
145 + && (compl_shown_match == NULL
146 + || compl_shown_match != compl_shown_match->cp_next))
148 /* BS: Delete one character from "compl_leader". */
149 if ((c == K_BS || c == Ctrl_H)
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)
163 - /* For redo we need to repeat this backspace. */
164 - AppendCharToRedobuff(K_BS);
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 @@
171 ins_bytes(compl_leader + curwin->w_cursor.col - compl_col);
172 compl_used_match = FALSE;
173 - compl_enter_selects = FALSE;
176 ins_compl_set_original_text(compl_leader);
177 @@ -3076,6 +3077,7 @@
178 compl_restarting = FALSE;
181 +#if 0 /* disabled, made CTRL-L, BS and typing char jump to original text. */
182 if (!compl_used_match)
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;
190 + compl_enter_selects = !compl_used_match;
192 /* Show the popup menu with a different set of matches. */
193 ins_compl_show_pum();
194 @@ -3115,10 +3119,6 @@
198 - /* For redo we need to count this character so that the number of
199 - * backspaces is correct. */
200 - AppendCharToRedobuff(c);
202 /* If we didn't complete finding matches we must search again. */
203 if (compl_was_interrupted)
205 @@ -3175,10 +3175,32 @@
207 int len = curwin->w_cursor.col - compl_col;
211 p = compl_shown_match->cp_str;
212 if ((int)STRLEN(p) <= len) /* the match is too short */
215 + /* When still at the original match use the first entry that matches
217 + if (compl_shown_match->cp_flags & ORIGINAL_TEXT)
220 + for (cp = compl_shown_match->cp_next; cp != NULL
221 + && cp != compl_first_match; cp = cp->cp_next)
223 + if (ins_compl_equal(cp, compl_leader,
224 + (int)STRLEN(compl_leader)))
230 + if (p == NULL || (int)STRLEN(p) <= len)
239 @@ -3369,16 +3391,21 @@
242 ptr = compl_orig_text;
243 - p = compl_orig_text;
244 - for (temp = 0; p[temp] != NUL && p[temp] == ptr[temp]; ++temp)
246 + if (compl_orig_text != NULL)
248 + p = compl_orig_text;
249 + for (temp = 0; p[temp] != NUL && p[temp] == ptr[temp];
254 - temp -= (*mb_head_off)(compl_orig_text, p + temp);
256 + temp -= (*mb_head_off)(compl_orig_text, p + temp);
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);
265 + AppendToRedobuffLit(ptr + temp, -1);
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;
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))
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;
290 if (allow_get_expansion && insert_match
291 @@ -4124,8 +4166,6 @@
293 if (compl_shows_dir == FORWARD && compl_shown_match->cp_next != NULL)
295 - if (compl_pending != 0)
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)
304 - if (compl_pending != 0)
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);
312 + if (!allow_get_expansion)
316 + if (compl_shows_dir == BACKWARD)
317 + compl_pending -= todo + 1;
319 + compl_pending += todo + 1;
326 if (compl_shows_dir == BACKWARD)
327 @@ -4149,14 +4199,27 @@
331 - if (!allow_get_expansion)
335 num_matches = ins_compl_get_exp(&compl_startpos);
336 - if (compl_pending != 0 && compl_direction == compl_shows_dir
338 + /* handle any pending completions */
339 + while (compl_pending != 0 && compl_direction == compl_shows_dir
341 - compl_shown_match = compl_curr_match;
343 + if (compl_pending > 0 && compl_shown_match->cp_next != NULL)
345 + compl_shown_match = compl_shown_match->cp_next;
348 + if (compl_pending < 0 && compl_shown_match->cp_prev != NULL)
350 + compl_shown_match = compl_shown_match->cp_prev;
358 if ((compl_shown_match->cp_flags & ORIGINAL_TEXT) == 0
359 @@ -4265,9 +4328,9 @@
364 + /* Check for a typed key. Do use mappings, otherwise vim_is_ctrl_x_key()
365 + * can't do its work correctly. */
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);
375 - else if (c != Ctrl_R)
376 - compl_interrupted = TRUE;
379 + /* Need to get the character to have KeyTyped set. We'll put it
380 + * back with vungetc() below. */
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;
391 if (compl_pending != 0 && !got_int)
392 - (void)ins_compl_next(FALSE, compl_pending > 0
393 - ? compl_pending : -compl_pending, TRUE);
395 + int todo = compl_pending > 0 ? compl_pending : -compl_pending;
398 + (void)ins_compl_next(FALSE, todo, TRUE);
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)
408 - startcol = (int)(compl_xp.xp_pattern - compl_pattern);
409 - compl_col = startcol;
410 - compl_length = curs_col - startcol;
412 + compl_col = curs_col;
414 + vim_free(compl_pattern);
415 + compl_pattern = NULL;
419 + startcol = (int)(compl_xp.xp_pattern - compl_pattern);
420 + compl_col = startcol;
421 + compl_length = curs_col - startcol;
424 else if (ctrl_x_mode == CTRL_X_FUNCTION || ctrl_x_mode == CTRL_X_OMNI)
426 @@ -4668,11 +4754,17 @@
428 compl_col = spell_word_start(startcol);
429 if (compl_col >= (colnr_T)startcol)
431 - spell_expand_check_cap(compl_col);
434 + compl_col = curs_col;
438 + spell_expand_check_cap(compl_col);
439 + compl_length = (int)curs_col - compl_col;
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)
447 diff -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"));
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())
460 if (argvars[1].v_type != VAR_LIST || argvars[1].vval.v_list == NULL)
463 @@ -9792,6 +9798,9 @@
467 + /* Position the cursor. Needed after a message that ends in a space. */
468 + windgoto(msg_row, msg_col);
472 if (argvars[0].v_type == VAR_UNKNOWN)
473 @@ -11312,14 +11321,19 @@
475 static int inputsecret_flag = 0;
477 +static void get_user_input __ARGS((typval_T *argvars, typval_T *rettv, int inputdialog));
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.
488 -f_input(argvars, rettv)
489 +get_user_input(argvars, rettv, inputdialog)
494 char_u *prompt = get_tv_string_chk(&argvars[0]);
496 @@ -11369,10 +11383,10 @@
498 stuffReadbuffSpec(defstr);
500 - if (argvars[2].v_type != VAR_UNKNOWN)
501 + if (!inputdialog && argvars[2].v_type != VAR_UNKNOWN)
508 rettv->vval.v_string = NULL;
509 @@ -11404,6 +11418,18 @@
513 + * "input()" function
514 + * Also handles inputsecret() when inputsecret is set.
517 +f_input(argvars, rettv)
521 + get_user_input(argvars, rettv, FALSE);
525 * "inputdialog()" function
528 @@ -11443,7 +11469,7 @@
532 - f_input(argvars, rettv);
533 + get_user_input(argvars, rettv, TRUE);
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"))
544 key = get_tv_string_chk(&argvars[1]);
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"))
555 @@ -17759,6 +17785,13 @@
557 else /* add a new variable */
559 + /* Can't add "v:" variable. */
560 + if (ht == &vimvarht)
562 + EMSG2(_(e_illvar), name);
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 @@
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))
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;
586 * Set a:firstline to "firstline" and a:lastline to "lastline".
587 diff -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
591 EX(CMD_comclear, "comclear", ex_comclear,
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,
599 diff -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
603 * If requested, store and reset the global values controlling the
604 * exception handling (used when debugging).
606 - else if (flags & DOCMD_EXCRESET)
607 + if (flags & DOCMD_EXCRESET)
608 save_dbg_stuff(&debug_saved);
610 initial_trylevel = trylevel;
611 diff -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 @@
619 + int nw = (int)(long)pnew;
621 dir = &(SFdirs[SFdirPtr + (int)(long)n]);
623 #ifdef FEAT_GUI_NEXTAW
624 - if ((int)(long)pnew < 0)
627 - if ((int)(long)pnew > -SFvScrollHeight)
628 - (int)(long)pnew = -1;
629 + if (nw > -SFvScrollHeight)
632 - (int)(long)pnew = -SFlistSize;
635 - else if ((int)(long)pnew > 0)
638 - if ((int)(long)pnew < SFvScrollHeight)
639 - (int)(long)pnew = 1;
640 + if (nw < SFvScrollHeight)
643 - (int)(long)pnew = SFlistSize;
647 - nw = dir->vOrigin + (int)(long)pnew;
648 + nw += dir->vOrigin;
650 if (nw > dir->nEntries - SFlistSize)
651 nw = dir->nEntries - SFlistSize;
652 @@ -1941,27 +1941,27 @@
657 + int nw = (int)(long)pnew;
659 dir = &(SFdirs[SFdirPtr + (int)(long)n]);
661 #ifdef FEAT_GUI_NEXTAW
662 - if ((int)(long)pnew < 0)
665 - if ((int)(long)pnew > -SFhScrollWidth)
666 - (int)(long)pnew = -1;
667 + if (nw > -SFhScrollWidth)
670 - (int)(long)pnew = -SFcharsPerEntry;
671 + nw = -SFcharsPerEntry;
673 - else if ((int)(long)pnew > 0)
676 - if ((int)(long)pnew < SFhScrollWidth)
677 - (int)(long)pnew = 1;
678 + if (nw < SFhScrollWidth)
681 - (int)(long)pnew = SFcharsPerEntry;
682 + nw = SFcharsPerEntry;
685 - nw = dir->hOrigin + (int)(long)pnew;
686 + nw += dir->hOrigin;
688 if (nw > dir->nChars - SFcharsPerEntry)
689 nw = dir->nChars - SFcharsPerEntry;
690 @@ -2038,26 +2038,26 @@
691 XtPointer client_data;
695 + int nw = (int)(long)pnew;
698 #ifdef FEAT_GUI_NEXTAW
699 - if ((int)(long)pnew < 0)
702 - if ((int)(long)pnew > -SFpathScrollWidth)
703 - (int)(long)pnew = -1;
704 + if (nw > -SFpathScrollWidth)
707 - (int)(long)pnew = -3;
710 - else if ((int)(long)pnew > 0)
713 - if ((int)(long)pnew < SFpathScrollWidth)
714 - (int)(long)pnew = 1;
715 + if (nw < SFpathScrollWidth)
718 - (int)(long)pnew = 3;
722 - nw = SFdirPtr + (int)(long)pnew;
725 if (nw > SFdirEnd - 3)
727 diff -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 @@
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)
745 - if (Y_2_ROW(y) >= tabline_height())
748 + && Y_2_ROW(y) >= tabline_height()
752 if (wp != curwin && wp != NULL) /* If in other than current window */
754 diff -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
758 #include "gui_xmebwp.h"
760 /* Provide some missing wrappers, which are missed from the LessTif
762 + * implementation. Also missing in Motif 1.2 and earlier.
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.
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)
774 || (eb->core.height <= 2 * eb->primitive.highlight_thickness))
777 -#ifndef LESSTIF_VERSION
778 +#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
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;
792 if ((((ShellWidget) XtParent(XtParent(eb)))->shell.popped_up)
793 && _XmGetInDragMode((Widget) eb))
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;
802 if (Lab_IsMenupane(eb))
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;
809 @@ -1150,7 +1150,7 @@
810 Redisplay(Widget w, XEvent *event, Region region)
812 XmEnhancedButtonWidget eb = (XmEnhancedButtonWidget) w;
813 -#ifndef LESSTIF_VERSION
814 +#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
816 XtEnum default_button_emphasis;
818 @@ -1162,7 +1162,7 @@
819 if (!XtIsRealized((Widget)eb))
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;
827 @@ -1241,7 +1241,7 @@
831 -#ifndef LESSTIF_VERSION
832 +#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
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);
840 -#ifndef LESSTIF_VERSION
841 +#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
842 switch (default_button_emphasis)
844 case XmINTERNAL_HIGHLIGHT:
845 @@ -1365,7 +1365,7 @@
846 default_button_shadow_thickness =
847 eb->pushbutton.default_button_shadow_thickness;
849 -#ifndef LESSTIF_VERSION
850 +#if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
852 * Compute location of bounding box to contain the
853 * defaultButtonShadow.
854 diff -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 @@
859 static VALUE set_buffer_line(buf_T *buf, linenr_T n, VALUE str)
861 - buf_T *savebuf = curbuf;
862 - char *line = STR2CSTR(str);
863 + char *line = STR2CSTR(str);
867 + buf_T *save_curbuf = curbuf;
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)
874 + /* set curwin/curbuf for "buf" and save some things */
875 + aucmd_prepbuf(&aco, buf);
878 + curwin->w_buffer = buf;
881 if (u_savesub(n) == OK) {
882 ml_replace(n, (char_u *)line, TRUE);
884 @@ -655,10 +667,19 @@
885 syn_changed(n); /* recompute syntax hl. for this line */
891 + /* restore curwin/curbuf and a few other things */
892 + aucmd_restbuf(&aco);
893 + /* Careful: autocommands may have made "buf" invalid! */
895 + curwin->w_buffer = save_curbuf;
896 + curbuf = save_curbuf;
898 update_curbuf(NOT_VALID);
903 rb_raise(rb_eIndexError, "index %d out of buffer", n);
904 return Qnil; /* For stop warning */
906 @@ -676,12 +697,24 @@
908 static VALUE buffer_delete(VALUE self, VALUE num)
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);
918 + buf_T *save_curbuf = curbuf;
921 - if (n > 0 && n <= buf->b_ml.ml_line_count) {
922 + if (n > 0 && n <= buf->b_ml.ml_line_count)
925 + /* set curwin/curbuf for "buf" and save some things */
926 + aucmd_prepbuf(&aco, buf);
929 + curwin->w_buffer = buf;
932 if (u_savedel(n, 1) == OK) {
935 @@ -691,10 +724,19 @@
942 + /* restore curwin/curbuf and a few other things */
943 + aucmd_restbuf(&aco);
944 + /* Careful: autocommands may have made "buf" invalid! */
946 + curwin->w_buffer = save_curbuf;
947 + curbuf = save_curbuf;
949 update_curbuf(NOT_VALID);
954 rb_raise(rb_eIndexError, "index %d out of buffer", n);
957 @@ -702,13 +744,25 @@
959 static VALUE buffer_append(VALUE self, VALUE num, VALUE str)
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);
971 + buf_T *save_curbuf = curbuf;
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)
978 + /* set curwin/curbuf for "buf" and save some things */
979 + aucmd_prepbuf(&aco, buf);
982 + curwin->w_buffer = buf;
985 if (u_inssub(n + 1) == OK) {
986 ml_append(n, (char_u *) line, (colnr_T) 0, FALSE);
995 + /* restore curwin/curbuf and a few other things */
996 + aucmd_restbuf(&aco);
997 + /* Careful: autocommands may have made "buf" invalid! */
999 + curwin->w_buffer = save_curbuf;
1000 + curbuf = save_curbuf;
1002 update_curbuf(NOT_VALID);
1005 diff -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 @@
1012 +# ifdef VMS /* Somehow VMS doesn't handle the "**". */
1013 + source_runtime((char_u *)"plugin/*.vim", TRUE);
1015 source_runtime((char_u *)"plugin/**/*.vim", TRUE);
1017 TIME_MSG("loading plugins");
1020 diff -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 \
1027 + ln -s ../infplist.xml .; \
1028 ln -s ../$(RSRC_DIR) ../os_mac.rsr.hqx ../dehqx.py .; \
1030 mkdir $(SHADOWDIR)/testdir
1031 diff -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 @@
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
1050 {"mac", IDX_MACROMAN},
1051 + {"mac-roman", IDX_MACROMAN},
1055 diff -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 @@
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
1068 + char *q = memchr(str_arg, '\0', precision);
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);
1078 str_arg_l = (q == NULL) ? precision : q - str_arg;
1081 diff -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 @@
1087 curwin->w_cursor = oap->end;
1088 + check_cursor_col();
1090 /* Works just like an 'i'nsert on the next character. */
1091 if (!lineempty(curwin->w_cursor.lnum)
1092 diff -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}
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,
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;
1108 +# ifdef FEAT_FOLDING
1109 case PV_FDE: return &curwin->w_p_fde_flags;
1110 case PV_FDT: return &curwin->w_p_fdt_flags;
1113 case PV_BEXPR: return &curbuf->b_p_bexpr_flags;
1116 -#if defined(FEAT_EVAL)
1117 # if defined(FEAT_CINDENT)
1118 case PV_INDE: return &curbuf->b_p_inde_flags;
1120 diff -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)
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))
1131 (*file)[*num_file][len] = psepc;
1132 (*file)[*num_file][len + 1] = NUL;
1133 @@ -5757,8 +5758,13 @@
1135 int success = FALSE;
1137 - /* Get a handle to the DLL module. */
1139 + * Get a handle to the DLL module.
1141 # if defined(USE_DLOPEN)
1142 + /* First clear any error, it's not cleared by the dlopen() call. */
1145 hinstLib = dlopen((char *)libname, RTLD_LAZY
1148 diff -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
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));
1159 diff -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 @@
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.
1171 if ((i = (int)fmt_ptr->addr[0]) > 0) /* %f */
1173 - int c = *regmatch.endp[i];
1176 + if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
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 @@
1187 if ((i = (int)fmt_ptr->addr[1]) > 0) /* %n */
1189 + if (regmatch.startp[i] == NULL)
1191 enr = (int)atol((char *)regmatch.startp[i]);
1193 if ((i = (int)fmt_ptr->addr[2]) > 0) /* %l */
1195 + if (regmatch.startp[i] == NULL)
1197 lnum = atol((char *)regmatch.startp[i]);
1199 if ((i = (int)fmt_ptr->addr[3]) > 0) /* %c */
1201 + if (regmatch.startp[i] == NULL)
1203 col = (int)atol((char *)regmatch.startp[i]);
1205 if ((i = (int)fmt_ptr->addr[4]) > 0) /* %t */
1207 + if (regmatch.startp[i] == NULL)
1209 type = *regmatch.startp[i];
1211 if (fmt_ptr->flags == '+' && !multiscan) /* %+ */
1212 STRCPY(errmsg, IObuff);
1213 else if ((i = (int)fmt_ptr->addr[5]) > 0) /* %m */
1215 + if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
1217 len = (int)(regmatch.endp[i] - regmatch.startp[i]);
1218 vim_strncpy(errmsg, regmatch.startp[i], len);
1220 if ((i = (int)fmt_ptr->addr[6]) > 0) /* %r */
1222 + if (regmatch.startp[i] == NULL)
1224 tail = regmatch.startp[i];
1226 if ((i = (int)fmt_ptr->addr[7]) > 0) /* %p */
1228 + if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
1230 col = (int)(regmatch.endp[i] - regmatch.startp[i] + 1);
1231 if (*((char_u *)regmatch.startp[i]) != TAB)
1234 if ((i = (int)fmt_ptr->addr[8]) > 0) /* %v */
1236 + if (regmatch.startp[i] == NULL)
1238 col = (int)atol((char *)regmatch.startp[i]);
1241 if ((i = (int)fmt_ptr->addr[9]) > 0) /* %s */
1243 + if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
1245 len = (int)(regmatch.endp[i] - regmatch.startp[i]);
1246 if (len > CMDBUFFSIZE - 5)
1247 len = CMDBUFFSIZE - 5;
1248 diff -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;
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)
1259 int line_attr = 0; /* atrribute for the whole line */
1261 @@ -2626,7 +2627,7 @@
1262 int prev_c = 0; /* previous Arabic character */
1263 int prev_c1 = 0; /* first composing char for prev_c */
1265 -#if defined(FEAT_DIFF) || defined(LINE_ATTR)
1266 +#if defined(LINE_ATTR)
1267 int did_line_attr = 0;
1270 @@ -4116,17 +4117,12 @@
1271 --ptr; /* put it back at the NUL */
1274 -#if defined(FEAT_DIFF) || defined(LINE_ATTR)
1275 +#if defined(LINE_ATTR)
1278 - diff_hlf != (hlf_T)0
1282 + diff_hlf != (hlf_T)0 ||
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.
1294 -#if defined(FEAT_DIFF) || defined(LINE_ATTR)
1295 +#if defined(LINE_ATTR)
1296 || did_line_attr == 1
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
1308 @@ -7133,6 +7129,12 @@
1313 + * Note that the window sizes are updated before reallocating the arrays,
1314 + * thus we must not redraw here!
1316 + ++RedrawingDisabled;
1318 win_new_shellsize(); /* fit the windows in the new sized shell */
1320 comp_col(); /* recompute columns for shown command and ruler */
1321 @@ -7367,6 +7369,7 @@
1325 + --RedrawingDisabled;
1329 diff -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 @@
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);
1342 diff -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
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));
1354 * Return TRUE when undo is allowed. Otherwise give an error message and
1361 /* Don't allow changes when 'modifiable' is off. */
1362 diff -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 */
1444 diff -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
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 */
1453 #define REPLACE_FLAG 0x40 /* Replace mode flag */
1454 #define REPLACE (REPLACE_FLAG + INSERT)
1456 #define CONFIRM 0x800 /* ":confirm" prompt */
1457 #define SELECTMODE 0x1000 /* Select mode, only for mappings */
1459 +#define MAP_ALL_MODES (0x3f | SELECTMODE) /* all mode bits used for
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