-
Submitted By: Hatzimanikas Agathoklis (a dot hatzim at gmail dot com)
Date: 2006-06-31
Initial Package Version: 7.0
Origin: Upstream
Upstream Status: Applied
Description:A consolidated patch that includes the 001-004, 006-026, 029-031, and 033-042 patches
from Upstream(005, 027,028 and 032 is for the extras and Windows 32 only) and one patch
from Alexander E. Patrakov.
Submitted By: Alexander E. Patrakov
Date: 2006-07-25
Initial Package Version: 7.0
Origin: Alexander E. Patrakov
Upstream Status: Sent
Description: Allows downloading spellfiles via HTTP,
thus reverting the negative effect of ftp://ftp.vim.org/pub/vim/patches/7.0/7.0.010
For more details,please see ticket 1843 http://wiki.linuxfromscratch.org/lfs/ticket/1843
diff -Naur vim70.orig/runtime/autoload/ccomplete.vim vim70/runtime/autoload/ccomplete.vim
old
|
new
|
|
1 | 1 | " Vim completion script |
2 | 2 | " Language: C |
3 | 3 | " Maintainer: Bram Moolenaar <Bram@vim.org> |
4 | | " Last Change: 2006 May 03 |
| 4 | " Last Change: 2006 May 08 |
5 | 5 | |
6 | 6 | |
7 | 7 | " This function is used for the 'omnifunc' option. |
… |
… |
|
458 | 458 | " member. |
459 | 459 | function! s:StructMembers(typename, items, all) |
460 | 460 | " Todo: What about local structures? |
461 | | let fnames = join(map(tagfiles(), 'escape(v:val, " \\")')) |
| 461 | let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")')) |
462 | 462 | if fnames == '' |
463 | 463 | return [] |
464 | 464 | endif |
-
diff -Naur vim70.orig/runtime/autoload/paste.vim vim70/runtime/autoload/paste.vim
old
|
new
|
|
1 | 1 | " Vim support file to help with paste mappings and menus |
2 | 2 | " Maintainer: Bram Moolenaar <Bram@vim.org> |
3 | | " Last Change: 2006 Apr 21 |
| 3 | " Last Change: 2006 Jun 23 |
4 | 4 | |
5 | 5 | " Define the string to use for items that are present both in Edit, Popup and |
6 | 6 | " Toolbar menu. Also used in mswin.vim and macmap.vim. |
… |
… |
|
12 | 12 | if has("virtualedit") |
13 | 13 | let paste#paste_cmd = {'n': ":call paste#Paste()<CR>"} |
14 | 14 | let paste#paste_cmd['v'] = '"-c<Esc>' . paste#paste_cmd['n'] |
15 | | let paste#paste_cmd['i'] = '<Esc>' . paste#paste_cmd['n'] . 'gi' |
| 15 | let paste#paste_cmd['i'] = 'x<BS><Esc>' . paste#paste_cmd['n'] . 'gi' |
16 | 16 | |
17 | 17 | func! paste#Paste() |
18 | 18 | let ove = &ve |
-
diff -Naur vim70.orig/runtime/autoload/spellfile.vim vim70/runtime/autoload/spellfile.vim
old
|
new
|
|
1 | 1 | " Vim script to download a missing spell file |
2 | 2 | " Maintainer: Bram Moolenaar <Bram@vim.org> |
3 | | " Last Change: 2006 Feb 01 |
| 3 | " Last Change: 2006 May 10 |
4 | 4 | |
5 | 5 | if !exists('g:spellfile_URL') |
6 | | let g:spellfile_URL = 'ftp://ftp.vim.org/pub/vim/unstable/runtime/spell' |
| 6 | let g:spellfile_URL = 'ftp://ftp.vim.org/pub/vim/runtime/spell' |
7 | 7 | endif |
8 | 8 | let s:spellfile_URL = '' " Start with nothing so that s:donedict is reset. |
9 | 9 | |
… |
… |
|
61 | 61 | new |
62 | 62 | setlocal bin |
63 | 63 | echo 'Downloading ' . fname . '...' |
64 | | exe 'Nread ' g:spellfile_URL . '/' . fname |
| 64 | call spellfile#Nread(fname) |
65 | 65 | if getline(2) !~ 'VIMspell' |
66 | 66 | " Didn't work, perhaps there is an ASCII one. |
67 | 67 | g/^/d |
68 | 68 | let fname = a:lang . '.ascii.spl' |
69 | 69 | echo 'Could not find it, trying ' . fname . '...' |
70 | | exe 'Nread ' g:spellfile_URL . '/' . fname |
| 70 | call spellfile#Nread(fname) |
71 | 71 | if getline(2) !~ 'VIMspell' |
72 | 72 | echo 'Sorry, downloading failed' |
73 | 73 | bwipe! |
… |
… |
|
95 | 95 | g/^/d |
96 | 96 | let fname = substitute(fname, '\.spl$', '.sug', '') |
97 | 97 | echo 'Downloading ' . fname . '...' |
98 | | exe 'Nread ' g:spellfile_URL . '/' . fname |
| 98 | call spellfile#Nread(fname) |
99 | 99 | if getline(2) !~ 'VIMsug' |
100 | 100 | echo 'Sorry, downloading failed' |
101 | 101 | else |
… |
… |
|
109 | 109 | bwipe |
110 | 110 | endif |
111 | 111 | endfunc |
| 112 | |
| 113 | " Read "fname" from the server. |
| 114 | function! spellfile#Nread(fname) |
| 115 | if strpart(g:spellfile_URL, 0, 6) == 'ftp://' |
| 116 | " Avoid the password prompt by providing the default username and password |
| 117 | let machine = substitute(g:spellfile_URL, 'ftp://\([^/]*\).*', '\1', '') |
| 118 | let dir = substitute(g:spellfile_URL, 'ftp://[^/]*/\(.*\)', '\1', '') |
| 119 | exe 'Nread "' . machine . ' anonymous vim7user ' . dir . '/' . a:fname . '"' |
| 120 | else |
| 121 | exe 'Nread "' . g:spellfile_URL . '/' . a:fname . '"' |
| 122 | endif |
| 123 | endfunc |
-
diff -Naur vim70.orig/runtime/plugin/matchparen.vim vim70/runtime/plugin/matchparen.vim
old
|
new
|
|
1 | 1 | " Vim plugin for showing matching parens |
2 | 2 | " Maintainer: Bram Moolenaar <Bram@vim.org> |
3 | | " Last Change: 2006 Apr 27 |
| 3 | " Last Change: 2006 May 11 |
4 | 4 | |
5 | 5 | " Exit quickly when: |
6 | 6 | " - this plugin was already loaded (or disabled) |
… |
… |
|
90 | 90 | " Find the match. When it was just before the cursor move it there for a |
91 | 91 | " moment. |
92 | 92 | if before > 0 |
93 | | let save_cursor = getpos('.') |
| 93 | let save_cursor = winsaveview() |
94 | 94 | call cursor(c_lnum, c_col - before) |
95 | 95 | endif |
96 | 96 | |
… |
… |
|
102 | 102 | let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline) |
103 | 103 | |
104 | 104 | if before > 0 |
105 | | call setpos('.', save_cursor) |
| 105 | call winrestview(save_cursor) |
106 | 106 | endif |
107 | 107 | |
108 | 108 | " If a match is found setup match highlighting. |
-
diff -Naur vim70.orig/src/edit.c vim70/src/edit.c
old
|
new
|
|
719 | 719 | #ifdef FEAT_INS_EXPAND |
720 | 720 | /* |
721 | 721 | * Special handling of keys while the popup menu is visible or wanted |
722 | | * and the cursor is still in the completed word. |
| 722 | * and the cursor is still in the completed word. Only when there is |
| 723 | * a match, skip this when no matches were found. |
723 | 724 | */ |
724 | | if (compl_started && pum_wanted() && curwin->w_cursor.col >= compl_col) |
| 725 | if (compl_started |
| 726 | && pum_wanted() |
| 727 | && curwin->w_cursor.col >= compl_col |
| 728 | && (compl_shown_match == NULL |
| 729 | || compl_shown_match != compl_shown_match->cp_next)) |
725 | 730 | { |
726 | 731 | /* BS: Delete one character from "compl_leader". */ |
727 | 732 | if ((c == K_BS || c == Ctrl_H) |
… |
… |
|
751 | 756 | continue; |
752 | 757 | } |
753 | 758 | |
754 | | /* Pressing CTRL-Y selects the current match. Shen |
| 759 | /* Pressing CTRL-Y selects the current match. When |
755 | 760 | * compl_enter_selects is set the Enter key does the same. */ |
756 | 761 | if (c == Ctrl_Y || (compl_enter_selects |
757 | 762 | && (c == CAR || c == K_KENTER || c == NL))) |
… |
… |
|
3015 | 3020 | if ((int)(p - line) - (int)compl_col <= 0) |
3016 | 3021 | return K_BS; |
3017 | 3022 | |
3018 | | /* For redo we need to repeat this backspace. */ |
3019 | | AppendCharToRedobuff(K_BS); |
3020 | | |
3021 | 3023 | /* Deleted more than what was used to find matches or didn't finish |
3022 | 3024 | * finding all matches: need to look for matches all over again. */ |
3023 | 3025 | if (curwin->w_cursor.col <= compl_col + compl_length |
… |
… |
|
3046 | 3048 | ins_compl_delete(); |
3047 | 3049 | ins_bytes(compl_leader + curwin->w_cursor.col - compl_col); |
3048 | 3050 | compl_used_match = FALSE; |
3049 | | compl_enter_selects = FALSE; |
3050 | 3051 | |
3051 | 3052 | if (compl_started) |
3052 | 3053 | ins_compl_set_original_text(compl_leader); |
… |
… |
|
3076 | 3077 | compl_restarting = FALSE; |
3077 | 3078 | } |
3078 | 3079 | |
| 3080 | #if 0 /* disabled, made CTRL-L, BS and typing char jump to original text. */ |
3079 | 3081 | if (!compl_used_match) |
3080 | 3082 | { |
3081 | 3083 | /* Go to the original text, since none of the matches is inserted. */ |
… |
… |
|
3087 | 3089 | compl_curr_match = compl_shown_match; |
3088 | 3090 | compl_shows_dir = compl_direction; |
3089 | 3091 | } |
| 3092 | #endif |
| 3093 | compl_enter_selects = !compl_used_match; |
3090 | 3094 | |
3091 | 3095 | /* Show the popup menu with a different set of matches. */ |
3092 | 3096 | ins_compl_show_pum(); |
… |
… |
|
3115 | 3119 | #endif |
3116 | 3120 | ins_char(c); |
3117 | 3121 | |
3118 | | /* For redo we need to count this character so that the number of |
3119 | | * backspaces is correct. */ |
3120 | | AppendCharToRedobuff(c); |
3121 | | |
3122 | 3122 | /* If we didn't complete finding matches we must search again. */ |
3123 | 3123 | if (compl_was_interrupted) |
3124 | 3124 | ins_compl_restart(); |
… |
… |
|
3175 | 3175 | char_u *p; |
3176 | 3176 | int len = curwin->w_cursor.col - compl_col; |
3177 | 3177 | int c; |
| 3178 | compl_T *cp; |
3178 | 3179 | |
3179 | 3180 | p = compl_shown_match->cp_str; |
3180 | 3181 | if ((int)STRLEN(p) <= len) /* the match is too short */ |
3181 | | return; |
| 3182 | { |
| 3183 | /* When still at the original match use the first entry that matches |
| 3184 | * the leader. */ |
| 3185 | if (compl_shown_match->cp_flags & ORIGINAL_TEXT) |
| 3186 | { |
| 3187 | p = NULL; |
| 3188 | for (cp = compl_shown_match->cp_next; cp != NULL |
| 3189 | && cp != compl_first_match; cp = cp->cp_next) |
| 3190 | { |
| 3191 | if (ins_compl_equal(cp, compl_leader, |
| 3192 | (int)STRLEN(compl_leader))) |
| 3193 | { |
| 3194 | p = cp->cp_str; |
| 3195 | break; |
| 3196 | } |
| 3197 | } |
| 3198 | if (p == NULL || (int)STRLEN(p) <= len) |
| 3199 | return; |
| 3200 | } |
| 3201 | else |
| 3202 | return; |
| 3203 | } |
3182 | 3204 | p += len; |
3183 | 3205 | #ifdef FEAT_MBYTE |
3184 | 3206 | c = mb_ptr2char(p); |
… |
… |
|
3369 | 3391 | ptr = compl_leader; |
3370 | 3392 | else |
3371 | 3393 | ptr = compl_orig_text; |
3372 | | p = compl_orig_text; |
3373 | | for (temp = 0; p[temp] != NUL && p[temp] == ptr[temp]; ++temp) |
3374 | | ; |
| 3394 | if (compl_orig_text != NULL) |
| 3395 | { |
| 3396 | p = compl_orig_text; |
| 3397 | for (temp = 0; p[temp] != NUL && p[temp] == ptr[temp]; |
| 3398 | ++temp) |
| 3399 | ; |
3375 | 3400 | #ifdef FEAT_MBYTE |
3376 | | if (temp > 0) |
3377 | | temp -= (*mb_head_off)(compl_orig_text, p + temp); |
| 3401 | if (temp > 0) |
| 3402 | temp -= (*mb_head_off)(compl_orig_text, p + temp); |
3378 | 3403 | #endif |
3379 | | for (p += temp; *p != NUL; mb_ptr_adv(p)) |
3380 | | AppendCharToRedobuff(K_BS); |
3381 | | AppendToRedobuffLit(ptr + temp, -1); |
| 3404 | for (p += temp; *p != NUL; mb_ptr_adv(p)) |
| 3405 | AppendCharToRedobuff(K_BS); |
| 3406 | } |
| 3407 | if (ptr != NULL) |
| 3408 | AppendToRedobuffLit(ptr + temp, -1); |
3382 | 3409 | } |
3383 | 3410 | |
3384 | 3411 | #ifdef FEAT_CINDENT |
… |
… |
|
4100 | 4127 | && compl_shown_match->cp_next != NULL |
4101 | 4128 | && compl_shown_match->cp_next != compl_first_match) |
4102 | 4129 | compl_shown_match = compl_shown_match->cp_next; |
| 4130 | |
| 4131 | /* If we didn't find it searching forward, and compl_shows_dir is |
| 4132 | * backward, find the last match. */ |
| 4133 | if (compl_shows_dir == BACKWARD |
| 4134 | && !ins_compl_equal(compl_shown_match, |
| 4135 | compl_leader, (int)STRLEN(compl_leader)) |
| 4136 | && (compl_shown_match->cp_next == NULL |
| 4137 | || compl_shown_match->cp_next == compl_first_match)) |
| 4138 | { |
| 4139 | while (!ins_compl_equal(compl_shown_match, |
| 4140 | compl_leader, (int)STRLEN(compl_leader)) |
| 4141 | && compl_shown_match->cp_prev != NULL |
| 4142 | && compl_shown_match->cp_prev != compl_first_match) |
| 4143 | compl_shown_match = compl_shown_match->cp_prev; |
| 4144 | } |
4103 | 4145 | } |
4104 | 4146 | |
4105 | 4147 | if (allow_get_expansion && insert_match |
… |
… |
|
4124 | 4166 | { |
4125 | 4167 | if (compl_shows_dir == FORWARD && compl_shown_match->cp_next != NULL) |
4126 | 4168 | { |
4127 | | if (compl_pending != 0) |
4128 | | --compl_pending; |
4129 | 4169 | compl_shown_match = compl_shown_match->cp_next; |
4130 | 4170 | found_end = (compl_first_match != NULL |
4131 | 4171 | && (compl_shown_match->cp_next == compl_first_match |
… |
… |
|
4134 | 4174 | else if (compl_shows_dir == BACKWARD |
4135 | 4175 | && compl_shown_match->cp_prev != NULL) |
4136 | 4176 | { |
4137 | | if (compl_pending != 0) |
4138 | | ++compl_pending; |
4139 | 4177 | found_end = (compl_shown_match == compl_first_match); |
4140 | 4178 | compl_shown_match = compl_shown_match->cp_prev; |
4141 | 4179 | found_end |= (compl_shown_match == compl_first_match); |
4142 | 4180 | } |
4143 | 4181 | else |
4144 | 4182 | { |
| 4183 | if (!allow_get_expansion) |
| 4184 | { |
| 4185 | if (advance) |
| 4186 | { |
| 4187 | if (compl_shows_dir == BACKWARD) |
| 4188 | compl_pending -= todo + 1; |
| 4189 | else |
| 4190 | compl_pending += todo + 1; |
| 4191 | } |
| 4192 | return -1; |
| 4193 | } |
| 4194 | |
4145 | 4195 | if (advance) |
4146 | 4196 | { |
4147 | 4197 | if (compl_shows_dir == BACKWARD) |
… |
… |
|
4149 | 4199 | else |
4150 | 4200 | ++compl_pending; |
4151 | 4201 | } |
4152 | | if (!allow_get_expansion) |
4153 | | return -1; |
4154 | 4202 | |
4155 | 4203 | /* Find matches. */ |
4156 | 4204 | num_matches = ins_compl_get_exp(&compl_startpos); |
4157 | | if (compl_pending != 0 && compl_direction == compl_shows_dir |
| 4205 | |
| 4206 | /* handle any pending completions */ |
| 4207 | while (compl_pending != 0 && compl_direction == compl_shows_dir |
4158 | 4208 | && advance) |
4159 | | compl_shown_match = compl_curr_match; |
| 4209 | { |
| 4210 | if (compl_pending > 0 && compl_shown_match->cp_next != NULL) |
| 4211 | { |
| 4212 | compl_shown_match = compl_shown_match->cp_next; |
| 4213 | --compl_pending; |
| 4214 | } |
| 4215 | if (compl_pending < 0 && compl_shown_match->cp_prev != NULL) |
| 4216 | { |
| 4217 | compl_shown_match = compl_shown_match->cp_prev; |
| 4218 | ++compl_pending; |
| 4219 | } |
| 4220 | else |
| 4221 | break; |
| 4222 | } |
4160 | 4223 | found_end = FALSE; |
4161 | 4224 | } |
4162 | 4225 | if ((compl_shown_match->cp_flags & ORIGINAL_TEXT) == 0 |
… |
… |
|
4265 | 4328 | return; |
4266 | 4329 | count = 0; |
4267 | 4330 | |
4268 | | ++no_mapping; |
| 4331 | /* Check for a typed key. Do use mappings, otherwise vim_is_ctrl_x_key() |
| 4332 | * can't do its work correctly. */ |
4269 | 4333 | c = vpeekc_any(); |
4270 | | --no_mapping; |
4271 | 4334 | if (c != NUL) |
4272 | 4335 | { |
4273 | 4336 | if (vim_is_ctrl_x_key(c) && c != Ctrl_X && c != Ctrl_R) |
… |
… |
|
4277 | 4340 | (void)ins_compl_next(FALSE, ins_compl_key2count(c), |
4278 | 4341 | c != K_UP && c != K_DOWN); |
4279 | 4342 | } |
4280 | | else if (c != Ctrl_R) |
4281 | | compl_interrupted = TRUE; |
| 4343 | else |
| 4344 | { |
| 4345 | /* Need to get the character to have KeyTyped set. We'll put it |
| 4346 | * back with vungetc() below. */ |
| 4347 | c = safe_vgetc(); |
| 4348 | |
| 4349 | /* Don't interrupt completion when the character wasn't typed, |
| 4350 | * e.g., when doing @q to replay keys. */ |
| 4351 | if (c != Ctrl_R && KeyTyped) |
| 4352 | compl_interrupted = TRUE; |
| 4353 | |
| 4354 | vungetc(c); |
| 4355 | } |
4282 | 4356 | } |
4283 | 4357 | if (compl_pending != 0 && !got_int) |
4284 | | (void)ins_compl_next(FALSE, compl_pending > 0 |
4285 | | ? compl_pending : -compl_pending, TRUE); |
| 4358 | { |
| 4359 | int todo = compl_pending > 0 ? compl_pending : -compl_pending; |
| 4360 | |
| 4361 | compl_pending = 0; |
| 4362 | (void)ins_compl_next(FALSE, todo, TRUE); |
| 4363 | } |
4286 | 4364 | } |
4287 | 4365 | |
4288 | 4366 | /* |
… |
… |
|
4611 | 4689 | (int)STRLEN(compl_pattern), curs_col); |
4612 | 4690 | if (compl_xp.xp_context == EXPAND_UNSUCCESSFUL |
4613 | 4691 | || compl_xp.xp_context == EXPAND_NOTHING) |
4614 | | return FAIL; |
4615 | | startcol = (int)(compl_xp.xp_pattern - compl_pattern); |
4616 | | compl_col = startcol; |
4617 | | compl_length = curs_col - startcol; |
| 4692 | { |
| 4693 | compl_col = curs_col; |
| 4694 | compl_length = 0; |
| 4695 | vim_free(compl_pattern); |
| 4696 | compl_pattern = NULL; |
| 4697 | } |
| 4698 | else |
| 4699 | { |
| 4700 | startcol = (int)(compl_xp.xp_pattern - compl_pattern); |
| 4701 | compl_col = startcol; |
| 4702 | compl_length = curs_col - startcol; |
| 4703 | } |
4618 | 4704 | } |
4619 | 4705 | else if (ctrl_x_mode == CTRL_X_FUNCTION || ctrl_x_mode == CTRL_X_OMNI) |
4620 | 4706 | { |
… |
… |
|
4668 | 4754 | else |
4669 | 4755 | compl_col = spell_word_start(startcol); |
4670 | 4756 | if (compl_col >= (colnr_T)startcol) |
4671 | | return FAIL; |
4672 | | spell_expand_check_cap(compl_col); |
| 4757 | { |
| 4758 | compl_length = 0; |
| 4759 | compl_col = curs_col; |
| 4760 | } |
| 4761 | else |
| 4762 | { |
| 4763 | spell_expand_check_cap(compl_col); |
| 4764 | compl_length = (int)curs_col - compl_col; |
| 4765 | } |
4673 | 4766 | /* Need to obtain "line" again, it may have become invalid. */ |
4674 | 4767 | line = ml_get(curwin->w_cursor.lnum); |
4675 | | compl_length = (int)curs_col - compl_col; |
4676 | 4768 | compl_pattern = vim_strnsave(line + compl_col, compl_length); |
4677 | 4769 | if (compl_pattern == NULL) |
4678 | 4770 | #endif |
-
diff -Naur vim70.orig/src/eval.c vim70/src/eval.c
old
|
new
|
|
8252 | 8252 | EMSG(_("E785: complete() can only be used in Insert mode")); |
8253 | 8253 | return; |
8254 | 8254 | } |
| 8255 | |
| 8256 | /* Check for undo allowed here, because if something was already inserted |
| 8257 | * the line was already saved for undo and this check isn't done. */ |
| 8258 | if (!undo_allowed()) |
| 8259 | return; |
| 8260 | |
8255 | 8261 | if (argvars[1].v_type != VAR_LIST || argvars[1].vval.v_list == NULL) |
8256 | 8262 | { |
8257 | 8263 | EMSG(_(e_invarg)); |
… |
… |
|
9792 | 9798 | varnumber_T n; |
9793 | 9799 | int error = FALSE; |
9794 | 9800 | |
| 9801 | /* Position the cursor. Needed after a message that ends in a space. */ |
| 9802 | windgoto(msg_row, msg_col); |
| 9803 | |
9795 | 9804 | ++no_mapping; |
9796 | 9805 | ++allow_keys; |
9797 | 9806 | if (argvars[0].v_type == VAR_UNKNOWN) |
… |
… |
|
11312 | 11321 | |
11313 | 11322 | static int inputsecret_flag = 0; |
11314 | 11323 | |
| 11324 | static void get_user_input __ARGS((typval_T *argvars, typval_T *rettv, int inputdialog)); |
| 11325 | |
11315 | 11326 | /* |
11316 | | * "input()" function |
11317 | | * Also handles inputsecret() when inputsecret is set. |
| 11327 | * This function is used by f_input() and f_inputdialog() functions. The third |
| 11328 | * argument to f_input() specifies the type of completion to use at the |
| 11329 | * prompt. The third argument to f_inputdialog() specifies the value to return |
| 11330 | * when the user cancels the prompt. |
11318 | 11331 | */ |
11319 | 11332 | static void |
11320 | | f_input(argvars, rettv) |
| 11333 | get_user_input(argvars, rettv, inputdialog) |
11321 | 11334 | typval_T *argvars; |
11322 | 11335 | typval_T *rettv; |
| 11336 | int inputdialog; |
11323 | 11337 | { |
11324 | 11338 | char_u *prompt = get_tv_string_chk(&argvars[0]); |
11325 | 11339 | char_u *p = NULL; |
… |
… |
|
11369 | 11383 | if (defstr != NULL) |
11370 | 11384 | stuffReadbuffSpec(defstr); |
11371 | 11385 | |
11372 | | if (argvars[2].v_type != VAR_UNKNOWN) |
| 11386 | if (!inputdialog && argvars[2].v_type != VAR_UNKNOWN) |
11373 | 11387 | { |
11374 | 11388 | char_u *xp_name; |
11375 | | int xp_namelen; |
| 11389 | int xp_namelen; |
11376 | 11390 | long argt; |
11377 | 11391 | |
11378 | 11392 | rettv->vval.v_string = NULL; |
… |
… |
|
11404 | 11418 | } |
11405 | 11419 | |
11406 | 11420 | /* |
| 11421 | * "input()" function |
| 11422 | * Also handles inputsecret() when inputsecret is set. |
| 11423 | */ |
| 11424 | static void |
| 11425 | f_input(argvars, rettv) |
| 11426 | typval_T *argvars; |
| 11427 | typval_T *rettv; |
| 11428 | { |
| 11429 | get_user_input(argvars, rettv, FALSE); |
| 11430 | } |
| 11431 | |
| 11432 | /* |
11407 | 11433 | * "inputdialog()" function |
11408 | 11434 | */ |
11409 | 11435 | static void |
… |
… |
|
11443 | 11469 | } |
11444 | 11470 | else |
11445 | 11471 | #endif |
11446 | | f_input(argvars, rettv); |
| 11472 | get_user_input(argvars, rettv, TRUE); |
11447 | 11473 | } |
11448 | 11474 | |
11449 | 11475 | /* |
… |
… |
|
11471 | 11497 | } |
11472 | 11498 | |
11473 | 11499 | msg_start(); |
| 11500 | msg_row = Rows - 1; /* for when 'cmdheight' > 1 */ |
11474 | 11501 | lines_left = Rows; /* avoid more prompt */ |
11475 | 11502 | msg_scroll = TRUE; |
11476 | 11503 | msg_clr_eos(); |
… |
… |
|
13250 | 13277 | if (argvars[2].v_type != VAR_UNKNOWN) |
13251 | 13278 | EMSG2(_(e_toomanyarg), "remove()"); |
13252 | 13279 | else if ((d = argvars[0].vval.v_dict) != NULL |
13253 | | && !tv_check_lock(d->dv_lock, (char_u *)"remove()")) |
| 13280 | && !tv_check_lock(d->dv_lock, (char_u *)"remove() argument")) |
13254 | 13281 | { |
13255 | 13282 | key = get_tv_string_chk(&argvars[1]); |
13256 | 13283 | if (key != NULL) |
… |
… |
|
13270 | 13297 | else if (argvars[0].v_type != VAR_LIST) |
13271 | 13298 | EMSG2(_(e_listdictarg), "remove()"); |
13272 | 13299 | else if ((l = argvars[0].vval.v_list) != NULL |
13273 | | && !tv_check_lock(l->lv_lock, (char_u *)"remove()")) |
| 13300 | && !tv_check_lock(l->lv_lock, (char_u *)"remove() argument")) |
13274 | 13301 | { |
13275 | 13302 | int error = FALSE; |
13276 | 13303 | |
… |
… |
|
16438 | 16465 | long i = 0; |
16439 | 16466 | long n; |
16440 | 16467 | |
16441 | | /* List must be: [fnum, lnum, col, coladd] */ |
16442 | | if (arg->v_type != VAR_LIST || l == NULL |
16443 | | || l->lv_len != (fnump == NULL ? 3 : 4)) |
| 16468 | /* List must be: [fnum, lnum, col, coladd], where "fnum" is only there |
| 16469 | * when "fnump" isn't NULL and "coladd" is optional. */ |
| 16470 | if (arg->v_type != VAR_LIST |
| 16471 | || l == NULL |
| 16472 | || l->lv_len < (fnump == NULL ? 2 : 3) |
| 16473 | || l->lv_len > (fnump == NULL ? 3 : 4)) |
16444 | 16474 | return FAIL; |
16445 | 16475 | |
16446 | 16476 | if (fnump != NULL) |
… |
… |
|
16466 | 16496 | #ifdef FEAT_VIRTUALEDIT |
16467 | 16497 | n = list_find_nr(l, i, NULL); |
16468 | 16498 | if (n < 0) |
16469 | | return FAIL; |
16470 | | posp->coladd = n; |
| 16499 | posp->coladd = 0; |
| 16500 | else |
| 16501 | posp->coladd = n; |
16471 | 16502 | #endif |
16472 | 16503 | |
16473 | 16504 | return OK; |
… |
… |
|
17759 | 17790 | } |
17760 | 17791 | else /* add a new variable */ |
17761 | 17792 | { |
| 17793 | /* Can't add "v:" variable. */ |
| 17794 | if (ht == &vimvarht) |
| 17795 | { |
| 17796 | EMSG2(_(e_illvar), name); |
| 17797 | return; |
| 17798 | } |
| 17799 | |
17762 | 17800 | /* Make sure the variable name is valid. */ |
17763 | 17801 | for (p = varname; *p != NUL; ++p) |
17764 | 17802 | if (!eval_isnamec1(*p) && (p == varname || !VIM_ISDIGIT(*p)) |
… |
… |
|
18963 | 19001 | else if (lead > 0) |
18964 | 19002 | { |
18965 | 19003 | lead = 3; |
18966 | | if (eval_fname_sid(lv.ll_exp_name != NULL ? lv.ll_exp_name : *pp)) |
| 19004 | if ((lv.ll_exp_name != NULL && eval_fname_sid(lv.ll_exp_name)) |
| 19005 | || eval_fname_sid(*pp)) |
18967 | 19006 | { |
18968 | 19007 | /* It's "s:" or "<SID>" */ |
18969 | 19008 | if (current_SID <= 0) |
… |
… |
|
19685 | 19724 | v->di_tv.vval.v_list = &fc.l_varlist; |
19686 | 19725 | vim_memset(&fc.l_varlist, 0, sizeof(list_T)); |
19687 | 19726 | fc.l_varlist.lv_refcount = 99999; |
| 19727 | fc.l_varlist.lv_lock = VAR_FIXED; |
19688 | 19728 | |
19689 | 19729 | /* |
19690 | 19730 | * Set a:firstline to "firstline" and a:lastline to "lastline". |
-
diff -Naur vim70.orig/src/ex_cmds.h vim70/src/ex_cmds.h
old
|
new
|
|
262 | 262 | EX(CMD_comclear, "comclear", ex_comclear, |
263 | 263 | TRLBAR|CMDWIN), |
264 | 264 | EX(CMD_compiler, "compiler", ex_compiler, |
265 | | BANG|TRLBAR|WORD1), |
| 265 | BANG|TRLBAR|WORD1|CMDWIN), |
266 | 266 | EX(CMD_continue, "continue", ex_continue, |
267 | 267 | TRLBAR|SBOXOK|CMDWIN), |
268 | 268 | EX(CMD_confirm, "confirm", ex_wrongmodifier, |
-
diff -Naur vim70.orig/src/ex_docmd.c vim70/src/ex_docmd.c
old
|
new
|
|
833 | 833 | * If requested, store and reset the global values controlling the |
834 | 834 | * exception handling (used when debugging). |
835 | 835 | */ |
836 | | else if (flags & DOCMD_EXCRESET) |
| 836 | if (flags & DOCMD_EXCRESET) |
837 | 837 | save_dbg_stuff(&debug_saved); |
838 | 838 | |
839 | 839 | initial_trylevel = trylevel; |
-
diff -Naur vim70.orig/src/gui_at_fs.c vim70/src/gui_at_fs.c
old
|
new
|
|
1861 | 1861 | XtPointer pnew; |
1862 | 1862 | { |
1863 | 1863 | SFDir *dir; |
1864 | | int nw; |
| 1864 | int nw = (int)(long)pnew; |
1865 | 1865 | |
1866 | 1866 | dir = &(SFdirs[SFdirPtr + (int)(long)n]); |
1867 | 1867 | |
1868 | 1868 | #ifdef FEAT_GUI_NEXTAW |
1869 | | if ((int)(long)pnew < 0) |
| 1869 | if (nw < 0) |
1870 | 1870 | { |
1871 | | if ((int)(long)pnew > -SFvScrollHeight) |
1872 | | (int)(long)pnew = -1; |
| 1871 | if (nw > -SFvScrollHeight) |
| 1872 | nw = -1; |
1873 | 1873 | else |
1874 | | (int)(long)pnew = -SFlistSize; |
| 1874 | nw = -SFlistSize; |
1875 | 1875 | } |
1876 | | else if ((int)(long)pnew > 0) |
| 1876 | else if (nw > 0) |
1877 | 1877 | { |
1878 | | if ((int)(long)pnew < SFvScrollHeight) |
1879 | | (int)(long)pnew = 1; |
| 1878 | if (nw < SFvScrollHeight) |
| 1879 | nw = 1; |
1880 | 1880 | else |
1881 | | (int)(long)pnew = SFlistSize; |
| 1881 | nw = SFlistSize; |
1882 | 1882 | } |
1883 | 1883 | #endif |
1884 | | nw = dir->vOrigin + (int)(long)pnew; |
| 1884 | nw += dir->vOrigin; |
1885 | 1885 | |
1886 | 1886 | if (nw > dir->nEntries - SFlistSize) |
1887 | 1887 | nw = dir->nEntries - SFlistSize; |
… |
… |
|
1941 | 1941 | XtPointer pnew; |
1942 | 1942 | { |
1943 | 1943 | SFDir *dir; |
1944 | | int nw; |
| 1944 | int nw = (int)(long)pnew; |
1945 | 1945 | |
1946 | 1946 | dir = &(SFdirs[SFdirPtr + (int)(long)n]); |
1947 | 1947 | |
1948 | 1948 | #ifdef FEAT_GUI_NEXTAW |
1949 | | if ((int)(long)pnew < 0) |
| 1949 | if (nw < 0) |
1950 | 1950 | { |
1951 | | if ((int)(long)pnew > -SFhScrollWidth) |
1952 | | (int)(long)pnew = -1; |
| 1951 | if (nw > -SFhScrollWidth) |
| 1952 | nw = -1; |
1953 | 1953 | else |
1954 | | (int)(long)pnew = -SFcharsPerEntry; |
| 1954 | nw = -SFcharsPerEntry; |
1955 | 1955 | } |
1956 | | else if ((int)(long)pnew > 0) |
| 1956 | else if (nw > 0) |
1957 | 1957 | { |
1958 | | if ((int)(long)pnew < SFhScrollWidth) |
1959 | | (int)(long)pnew = 1; |
| 1958 | if (nw < SFhScrollWidth) |
| 1959 | nw = 1; |
1960 | 1960 | else |
1961 | | (int)(long)pnew = SFcharsPerEntry; |
| 1961 | nw = SFcharsPerEntry; |
1962 | 1962 | } |
1963 | 1963 | #endif |
1964 | | nw = dir->hOrigin + (int)(long)pnew; |
| 1964 | nw += dir->hOrigin; |
1965 | 1965 | |
1966 | 1966 | if (nw > dir->nChars - SFcharsPerEntry) |
1967 | 1967 | nw = dir->nChars - SFcharsPerEntry; |
… |
… |
|
2038 | 2038 | XtPointer client_data; |
2039 | 2039 | XtPointer pnew; |
2040 | 2040 | { |
2041 | | int nw; |
| 2041 | int nw = (int)(long)pnew; |
2042 | 2042 | float f; |
2043 | 2043 | |
2044 | 2044 | #ifdef FEAT_GUI_NEXTAW |
2045 | | if ((int)(long)pnew < 0) |
| 2045 | if (nw < 0) |
2046 | 2046 | { |
2047 | | if ((int)(long)pnew > -SFpathScrollWidth) |
2048 | | (int)(long)pnew = -1; |
| 2047 | if (nw > -SFpathScrollWidth) |
| 2048 | nw = -1; |
2049 | 2049 | else |
2050 | | (int)(long)pnew = -3; |
| 2050 | nw = -3; |
2051 | 2051 | } |
2052 | | else if ((int)(long)pnew > 0) |
| 2052 | else if (nw > 0) |
2053 | 2053 | { |
2054 | | if ((int)(long)pnew < SFpathScrollWidth) |
2055 | | (int)(long)pnew = 1; |
| 2054 | if (nw < SFpathScrollWidth) |
| 2055 | nw = 1; |
2056 | 2056 | else |
2057 | | (int)(long)pnew = 3; |
| 2057 | nw = 3; |
2058 | 2058 | } |
2059 | 2059 | #endif |
2060 | | nw = SFdirPtr + (int)(long)pnew; |
| 2060 | nw += SFdirPtr; |
2061 | 2061 | |
2062 | 2062 | if (nw > SFdirEnd - 3) |
2063 | 2063 | nw = SFdirEnd - 3; |
-
diff -Naur vim70.orig/src/gui.c vim70/src/gui.c
old
|
new
|
|
4515 | 4515 | int y; |
4516 | 4516 | { |
4517 | 4517 | win_T *wp; |
4518 | | char_u st[6]; |
| 4518 | char_u st[8]; |
4519 | 4519 | |
4520 | 4520 | /* Ignore this while still starting up. */ |
4521 | 4521 | if (!gui.in_use || gui.starting) |
… |
… |
|
4603 | 4603 | /* Don't move the mouse when it's left or right of the Vim window */ |
4604 | 4604 | if (x < 0 || x > Columns * gui.char_width) |
4605 | 4605 | return; |
| 4606 | if (y >= 0 |
4606 | 4607 | # ifdef FEAT_WINDOWS |
4607 | | if (Y_2_ROW(y) >= tabline_height()) |
4608 | | # else |
4609 | | if (y >= 0) |
| 4608 | && Y_2_ROW(y) >= tabline_height() |
4610 | 4609 | # endif |
| 4610 | ) |
4611 | 4611 | wp = xy2win(x, y); |
4612 | 4612 | if (wp != curwin && wp != NULL) /* If in other than current window */ |
4613 | 4613 | { |
-
diff -Naur vim70.orig/src/gui_xmebw.c vim70/src/gui_xmebw.c
old
|
new
|
|
47 | 47 | #include "gui_xmebwp.h" |
48 | 48 | |
49 | 49 | /* Provide some missing wrappers, which are missed from the LessTif |
50 | | * implementation. |
| 50 | * implementation. Also missing in Motif 1.2 and earlier. |
51 | 51 | * |
52 | 52 | * We neither use XmeGetPixmapData or _XmGetPixmapData, since with LessTif the |
53 | 53 | * pixmap will not appear in it's caches properly. We cache the interresting |
54 | 54 | * values in XmEnhancedButtonPart instead ourself. |
55 | 55 | */ |
56 | | #ifdef LESSTIF_VERSION |
| 56 | #if defined(LESSTIF_VERSION) || (XmVersion <= 1002) |
57 | 57 | # ifndef Lab_IsMenupane |
58 | 58 | # define Lab_IsMenupane(w) (Lab_MenuType(w) == (int)XmMENU_POPUP || \ |
59 | 59 | Lab_MenuType(w) == (int)XmMENU_PULLDOWN) |
… |
… |
|
480 | 480 | || (eb->core.height <= 2 * eb->primitive.highlight_thickness)) |
481 | 481 | return; |
482 | 482 | |
483 | | #ifndef LESSTIF_VERSION |
| 483 | #if !defined(LESSTIF_VERSION) && (XmVersion > 1002) |
484 | 484 | { |
485 | 485 | XmDisplay dpy; |
486 | 486 | |
… |
… |
|
641 | 641 | GC tmp_gc = NULL; |
642 | 642 | Boolean replaceGC = False; |
643 | 643 | Boolean deadjusted = False; |
644 | | #ifndef LESSTIF_VERSION |
| 644 | #if !defined(LESSTIF_VERSION) && (XmVersion > 1002) |
645 | 645 | XmDisplay dpy = (XmDisplay)XmGetXmDisplay(XtDisplay(eb)); |
646 | 646 | Boolean etched_in = dpy->display.enable_etched_in_menu; |
647 | 647 | #else |
… |
… |
|
726 | 726 | if ((((ShellWidget) XtParent(XtParent(eb)))->shell.popped_up) |
727 | 727 | && _XmGetInDragMode((Widget) eb)) |
728 | 728 | { |
729 | | #ifndef LESSTIF_VERSION |
| 729 | #if !defined(LESSTIF_VERSION) && (XmVersion > 1002) |
730 | 730 | XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); |
731 | 731 | Boolean etched_in = dpy->display.enable_etched_in_menu; |
732 | 732 | #else |
… |
… |
|
810 | 810 | |
811 | 811 | if (Lab_IsMenupane(eb)) |
812 | 812 | { |
813 | | #ifndef LESSTIF_VERSION |
| 813 | #if !defined(LESSTIF_VERSION) && (XmVersion > 1002) |
814 | 814 | XmDisplay dpy = (XmDisplay) XmGetXmDisplay(XtDisplay(wid)); |
815 | 815 | Boolean etched_in = dpy->display.enable_etched_in_menu; |
816 | 816 | #else |
… |
… |
|
1150 | 1150 | Redisplay(Widget w, XEvent *event, Region region) |
1151 | 1151 | { |
1152 | 1152 | XmEnhancedButtonWidget eb = (XmEnhancedButtonWidget) w; |
1153 | | #ifndef LESSTIF_VERSION |
| 1153 | #if !defined(LESSTIF_VERSION) && (XmVersion > 1002) |
1154 | 1154 | XmDisplay dpy; |
1155 | 1155 | XtEnum default_button_emphasis; |
1156 | 1156 | #endif |
… |
… |
|
1162 | 1162 | if (!XtIsRealized((Widget)eb)) |
1163 | 1163 | return; |
1164 | 1164 | |
1165 | | #ifndef LESSTIF_VERSION |
| 1165 | #if !defined(LESSTIF_VERSION) && (XmVersion > 1002) |
1166 | 1166 | dpy = (XmDisplay)XmGetXmDisplay(XtDisplay(eb)); |
1167 | 1167 | default_button_emphasis = dpy->display.default_button_emphasis; |
1168 | 1168 | #endif |
… |
… |
|
1241 | 1241 | { |
1242 | 1242 | int adjust = 0; |
1243 | 1243 | |
1244 | | #ifndef LESSTIF_VERSION |
| 1244 | #if !defined(LESSTIF_VERSION) && (XmVersion > 1002) |
1245 | 1245 | /* |
1246 | 1246 | * NOTE: PushButton has two types of shadows: primitive-shadow and |
1247 | 1247 | * default-button-shadow. If pushbutton is in a menu only primitive |
… |
… |
|
1289 | 1289 | adjust, adjust, rectwidth, rectheight, borderwidth); |
1290 | 1290 | } |
1291 | 1291 | |
1292 | | #ifndef LESSTIF_VERSION |
| 1292 | #if !defined(LESSTIF_VERSION) && (XmVersion > 1002) |
1293 | 1293 | switch (default_button_emphasis) |
1294 | 1294 | { |
1295 | 1295 | case XmINTERNAL_HIGHLIGHT: |
… |
… |
|
1365 | 1365 | default_button_shadow_thickness = |
1366 | 1366 | eb->pushbutton.default_button_shadow_thickness; |
1367 | 1367 | |
1368 | | #ifndef LESSTIF_VERSION |
| 1368 | #if !defined(LESSTIF_VERSION) && (XmVersion > 1002) |
1369 | 1369 | /* |
1370 | 1370 | * Compute location of bounding box to contain the |
1371 | 1371 | * defaultButtonShadow. |
-
diff -Naur vim70.orig/src/if_ruby.c vim70/src/if_ruby.c
old
|
new
|
|
643 | 643 | |
644 | 644 | static VALUE set_buffer_line(buf_T *buf, linenr_T n, VALUE str) |
645 | 645 | { |
646 | | buf_T *savebuf = curbuf; |
647 | | char *line = STR2CSTR(str); |
| 646 | char *line = STR2CSTR(str); |
| 647 | #ifdef FEAT_AUTOCMD |
| 648 | aco_save_T aco; |
| 649 | #else |
| 650 | buf_T *save_curbuf = curbuf; |
| 651 | #endif |
648 | 652 | |
649 | | if (n > 0 && n <= buf->b_ml.ml_line_count && line != NULL) { |
| 653 | if (n > 0 && n <= buf->b_ml.ml_line_count && line != NULL) |
| 654 | { |
| 655 | #ifdef FEAT_AUTOCMD |
| 656 | /* set curwin/curbuf for "buf" and save some things */ |
| 657 | aucmd_prepbuf(&aco, buf); |
| 658 | #else |
650 | 659 | curbuf = buf; |
| 660 | curwin->w_buffer = buf; |
| 661 | #endif |
| 662 | |
651 | 663 | if (u_savesub(n) == OK) { |
652 | 664 | ml_replace(n, (char_u *)line, TRUE); |
653 | 665 | changed(); |
… |
… |
|
655 | 667 | syn_changed(n); /* recompute syntax hl. for this line */ |
656 | 668 | #endif |
657 | 669 | } |
658 | | curbuf = savebuf; |
| 670 | |
| 671 | #ifdef FEAT_AUTOCMD |
| 672 | /* restore curwin/curbuf and a few other things */ |
| 673 | aucmd_restbuf(&aco); |
| 674 | /* Careful: autocommands may have made "buf" invalid! */ |
| 675 | #else |
| 676 | curwin->w_buffer = save_curbuf; |
| 677 | curbuf = save_curbuf; |
| 678 | #endif |
659 | 679 | update_curbuf(NOT_VALID); |
660 | 680 | } |
661 | | else { |
| 681 | else |
| 682 | { |
662 | 683 | rb_raise(rb_eIndexError, "index %d out of buffer", n); |
663 | 684 | return Qnil; /* For stop warning */ |
664 | 685 | } |
… |
… |
|
676 | 697 | |
677 | 698 | static VALUE buffer_delete(VALUE self, VALUE num) |
678 | 699 | { |
679 | | buf_T *buf = get_buf(self); |
680 | | buf_T *savebuf = curbuf; |
681 | | long n = NUM2LONG(num); |
| 700 | buf_T *buf = get_buf(self); |
| 701 | long n = NUM2LONG(num); |
| 702 | #ifdef FEAT_AUTOCMD |
| 703 | aco_save_T aco; |
| 704 | #else |
| 705 | buf_T *save_curbuf = curbuf; |
| 706 | #endif |
682 | 707 | |
683 | | if (n > 0 && n <= buf->b_ml.ml_line_count) { |
| 708 | if (n > 0 && n <= buf->b_ml.ml_line_count) |
| 709 | { |
| 710 | #ifdef FEAT_AUTOCMD |
| 711 | /* set curwin/curbuf for "buf" and save some things */ |
| 712 | aucmd_prepbuf(&aco, buf); |
| 713 | #else |
684 | 714 | curbuf = buf; |
| 715 | curwin->w_buffer = buf; |
| 716 | #endif |
| 717 | |
685 | 718 | if (u_savedel(n, 1) == OK) { |
686 | 719 | ml_delete(n, 0); |
687 | 720 | |
… |
… |
|
691 | 724 | |
692 | 725 | changed(); |
693 | 726 | } |
694 | | curbuf = savebuf; |
| 727 | |
| 728 | #ifdef FEAT_AUTOCMD |
| 729 | /* restore curwin/curbuf and a few other things */ |
| 730 | aucmd_restbuf(&aco); |
| 731 | /* Careful: autocommands may have made "buf" invalid! */ |
| 732 | #else |
| 733 | curwin->w_buffer = save_curbuf; |
| 734 | curbuf = save_curbuf; |
| 735 | #endif |
695 | 736 | update_curbuf(NOT_VALID); |
696 | 737 | } |
697 | | else { |
| 738 | else |
| 739 | { |
698 | 740 | rb_raise(rb_eIndexError, "index %d out of buffer", n); |
699 | 741 | } |
700 | 742 | return Qnil; |
… |
… |
|
702 | 744 | |
703 | 745 | static VALUE buffer_append(VALUE self, VALUE num, VALUE str) |
704 | 746 | { |
705 | | buf_T *buf = get_buf(self); |
706 | | buf_T *savebuf = curbuf; |
707 | | char *line = STR2CSTR(str); |
708 | | long n = NUM2LONG(num); |
| 747 | buf_T *buf = get_buf(self); |
| 748 | char *line = STR2CSTR(str); |
| 749 | long n = NUM2LONG(num); |
| 750 | #ifdef FEAT_AUTOCMD |
| 751 | aco_save_T aco; |
| 752 | #else |
| 753 | buf_T *save_curbuf = curbuf; |
| 754 | #endif |
709 | 755 | |
710 | | if (n >= 0 && n <= buf->b_ml.ml_line_count && line != NULL) { |
| 756 | if (n >= 0 && n <= buf->b_ml.ml_line_count && line != NULL) |
| 757 | { |
| 758 | #ifdef FEAT_AUTOCMD |
| 759 | /* set curwin/curbuf for "buf" and save some things */ |
| 760 | aucmd_prepbuf(&aco, buf); |
| 761 | #else |
711 | 762 | curbuf = buf; |
| 763 | curwin->w_buffer = buf; |
| 764 | #endif |
| 765 | |
712 | 766 | if (u_inssub(n + 1) == OK) { |
713 | 767 | ml_append(n, (char_u *) line, (colnr_T) 0, FALSE); |
714 | 768 | |
… |
… |
|
718 | 772 | |
719 | 773 | changed(); |
720 | 774 | } |
721 | | curbuf = savebuf; |
| 775 | |
| 776 | #ifdef FEAT_AUTOCMD |
| 777 | /* restore curwin/curbuf and a few other things */ |
| 778 | aucmd_restbuf(&aco); |
| 779 | /* Careful: autocommands may have made "buf" invalid! */ |
| 780 | #else |
| 781 | curwin->w_buffer = save_curbuf; |
| 782 | curbuf = save_curbuf; |
| 783 | #endif |
722 | 784 | update_curbuf(NOT_VALID); |
723 | 785 | } |
724 | 786 | else { |
-
diff -Naur vim70.orig/src/main.c vim70/src/main.c
old
|
new
|
|
564 | 564 | */ |
565 | 565 | if (p_lpl) |
566 | 566 | { |
| 567 | # ifdef VMS /* Somehow VMS doesn't handle the "**". */ |
| 568 | source_runtime((char_u *)"plugin/*.vim", TRUE); |
| 569 | # else |
567 | 570 | source_runtime((char_u *)"plugin/**/*.vim", TRUE); |
| 571 | # endif |
568 | 572 | TIME_MSG("loading plugins"); |
569 | 573 | } |
570 | 574 | #endif |
-
diff -Naur vim70.orig/src/Makefile vim70/src/Makefile
old
|
new
|
|
2177 | 2177 | cd $(SHADOWDIR)/xxd; ln -s ../../xxd/*.[ch] ../../xxd/Make* . |
2178 | 2178 | if test -d $(RSRC_DIR); then \ |
2179 | 2179 | cd $(SHADOWDIR); \ |
| 2180 | ln -s ../infplist.xml .; \ |
2180 | 2181 | ln -s ../$(RSRC_DIR) ../os_mac.rsr.hqx ../dehqx.py .; \ |
2181 | 2182 | fi |
2182 | 2183 | mkdir $(SHADOWDIR)/testdir |
-
diff -Naur vim70.orig/src/mbyte.c vim70/src/mbyte.c
old
|
new
|
|
311 | 311 | |
312 | 312 | #define IDX_MACROMAN 57 |
313 | 313 | {"macroman", ENC_8BIT + ENC_MACROMAN, 0}, /* Mac OS */ |
314 | | #define IDX_COUNT 58 |
| 314 | #define IDX_DECMCS 58 |
| 315 | {"dec-mcs", ENC_8BIT, 0}, /* DEC MCS */ |
| 316 | #define IDX_HPROMAN8 59 |
| 317 | {"hp-roman8", ENC_8BIT, 0}, /* HP Roman8 */ |
| 318 | #define IDX_COUNT 60 |
315 | 319 | }; |
316 | 320 | |
317 | 321 | /* |
… |
… |
|
386 | 390 | {"950", IDX_BIG5}, |
387 | 391 | #endif |
388 | 392 | {"mac", IDX_MACROMAN}, |
| 393 | {"mac-roman", IDX_MACROMAN}, |
389 | 394 | {NULL, 0} |
390 | 395 | }; |
391 | 396 | |
-
diff -Naur vim70.orig/src/message.c vim70/src/message.c
old
|
new
|
|
4175 | 4175 | str_arg_l = 0; |
4176 | 4176 | else |
4177 | 4177 | { |
4178 | | /* memchr on HP does not like n > 2^31 !!! */ |
4179 | | char *q = memchr(str_arg, '\0', |
| 4178 | /* Don't put the #if inside memchr(), it can be a |
| 4179 | * macro. */ |
4180 | 4180 | #if SIZEOF_INT <= 2 |
4181 | | precision |
| 4181 | char *q = memchr(str_arg, '\0', precision); |
4182 | 4182 | #else |
4183 | | precision <= (size_t)0x7fffffffL ? precision |
4184 | | : (size_t)0x7fffffffL |
| 4183 | /* memchr on HP does not like n > 2^31 !!! */ |
| 4184 | char *q = memchr(str_arg, '\0', |
| 4185 | precision <= (size_t)0x7fffffffL ? precision |
| 4186 | : (size_t)0x7fffffffL); |
4185 | 4187 | #endif |
4186 | | ); |
4187 | 4188 | str_arg_l = (q == NULL) ? precision : q - str_arg; |
4188 | 4189 | } |
4189 | 4190 | break; |
-
diff -Naur vim70.orig/src/ops.c vim70/src/ops.c
old
|
new
|
|
2413 | 2413 | else |
2414 | 2414 | { |
2415 | 2415 | curwin->w_cursor = oap->end; |
| 2416 | check_cursor_col(); |
2416 | 2417 | |
2417 | 2418 | /* Works just like an 'i'nsert on the next character. */ |
2418 | 2419 | if (!lineempty(curwin->w_cursor.lnum) |
… |
… |
|
3492 | 3493 | # endif |
3493 | 3494 | if (flags & PUT_CURSEND) |
3494 | 3495 | { |
| 3496 | colnr_T len; |
| 3497 | |
3495 | 3498 | curwin->w_cursor = curbuf->b_op_end; |
3496 | 3499 | curwin->w_cursor.col++; |
| 3500 | |
| 3501 | /* in Insert mode we might be after the NUL, correct for that */ |
| 3502 | len = (colnr_T)STRLEN(ml_get_curline()); |
| 3503 | if (curwin->w_cursor.col > len) |
| 3504 | curwin->w_cursor.col = len; |
3497 | 3505 | } |
3498 | 3506 | else |
3499 | 3507 | curwin->w_cursor.lnum = lnum; |
-
diff -Naur vim70.orig/src/option.c vim70/src/option.c
old
|
new
|
|
2294 | 2294 | {(char_u *)0L, (char_u *)0L} |
2295 | 2295 | #endif |
2296 | 2296 | }, |
2297 | | {"spellsuggest", "sps", P_STRING|P_VI_DEF|P_EXPAND|P_SECURE, |
| 2297 | {"spellsuggest", "sps", P_STRING|P_VI_DEF|P_EXPAND|P_SECURE|P_COMMA, |
2298 | 2298 | #ifdef FEAT_SPELL |
2299 | 2299 | (char_u *)&p_sps, PV_NONE, |
2300 | 2300 | {(char_u *)"best", (char_u *)0L} |
… |
… |
|
5227 | 5227 | case PV_STL: return &curwin->w_p_stl_flags; |
5228 | 5228 | #endif |
5229 | 5229 | #ifdef FEAT_EVAL |
| 5230 | # ifdef FEAT_FOLDING |
5230 | 5231 | case PV_FDE: return &curwin->w_p_fde_flags; |
5231 | 5232 | case PV_FDT: return &curwin->w_p_fdt_flags; |
| 5233 | # endif |
5232 | 5234 | # ifdef FEAT_BEVAL |
5233 | 5235 | case PV_BEXPR: return &curbuf->b_p_bexpr_flags; |
5234 | 5236 | # endif |
5235 | | #endif |
5236 | | #if defined(FEAT_EVAL) |
5237 | 5237 | # if defined(FEAT_CINDENT) |
5238 | 5238 | case PV_INDE: return &curbuf->b_p_inde_flags; |
5239 | 5239 | # endif |
-
diff -Naur vim70.orig/src/os_unix.c vim70/src/os_unix.c
old
|
new
|
|
5757 | 5757 | int retval_int = 0; |
5758 | 5758 | int success = FALSE; |
5759 | 5759 | |
5760 | | /* Get a handle to the DLL module. */ |
| 5760 | /* |
| 5761 | * Get a handle to the DLL module. |
| 5762 | */ |
5761 | 5763 | # if defined(USE_DLOPEN) |
| 5764 | /* First clear any error, it's not cleared by the dlopen() call. */ |
| 5765 | (void)dlerror(); |
| 5766 | |
5762 | 5767 | hinstLib = dlopen((char *)libname, RTLD_LAZY |
5763 | 5768 | # ifdef RTLD_LOCAL |
5764 | 5769 | | RTLD_LOCAL |
-
diff -Naur vim70.orig/src/proto/undo.pro vim70/src/proto/undo.pro
old
|
new
|
|
4 | 4 | extern int u_savesub __ARGS((linenr_T lnum)); |
5 | 5 | extern int u_inssub __ARGS((linenr_T lnum)); |
6 | 6 | extern int u_savedel __ARGS((linenr_T lnum, long nlines)); |
| 7 | extern int undo_allowed __ARGS((void)); |
7 | 8 | extern void u_undo __ARGS((int count)); |
8 | 9 | extern void u_redo __ARGS((int count)); |
9 | 10 | extern void undo_time __ARGS((long step, int sec, int absolute)); |
-
diff -Naur vim70.orig/src/quickfix.c vim70/src/quickfix.c
old
|
new
|
|
602 | 602 | else |
603 | 603 | type = 0; |
604 | 604 | /* |
605 | | * Extract error message data from matched line |
| 605 | * Extract error message data from matched line. |
| 606 | * We check for an actual submatch, because "\[" and "\]" in |
| 607 | * the 'errorformat' may cause the wrong submatch to be used. |
606 | 608 | */ |
607 | 609 | if ((i = (int)fmt_ptr->addr[0]) > 0) /* %f */ |
608 | 610 | { |
609 | | int c = *regmatch.endp[i]; |
| 611 | int c; |
| 612 | |
| 613 | if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL) |
| 614 | continue; |
610 | 615 | |
611 | 616 | /* Expand ~/file and $HOME/file to full path. */ |
| 617 | c = *regmatch.endp[i]; |
612 | 618 | *regmatch.endp[i] = NUL; |
613 | 619 | expand_env(regmatch.startp[i], namebuf, CMDBUFFSIZE); |
614 | 620 | *regmatch.endp[i] = c; |
… |
… |
|
618 | 624 | continue; |
619 | 625 | } |
620 | 626 | if ((i = (int)fmt_ptr->addr[1]) > 0) /* %n */ |
| 627 | { |
| 628 | if (regmatch.startp[i] == NULL) |
| 629 | continue; |
621 | 630 | enr = (int)atol((char *)regmatch.startp[i]); |
| 631 | } |
622 | 632 | if ((i = (int)fmt_ptr->addr[2]) > 0) /* %l */ |
| 633 | { |
| 634 | if (regmatch.startp[i] == NULL) |
| 635 | continue; |
623 | 636 | lnum = atol((char *)regmatch.startp[i]); |
| 637 | } |
624 | 638 | if ((i = (int)fmt_ptr->addr[3]) > 0) /* %c */ |
| 639 | { |
| 640 | if (regmatch.startp[i] == NULL) |
| 641 | continue; |
625 | 642 | col = (int)atol((char *)regmatch.startp[i]); |
| 643 | } |
626 | 644 | if ((i = (int)fmt_ptr->addr[4]) > 0) /* %t */ |
| 645 | { |
| 646 | if (regmatch.startp[i] == NULL) |
| 647 | continue; |
627 | 648 | type = *regmatch.startp[i]; |
| 649 | } |
628 | 650 | if (fmt_ptr->flags == '+' && !multiscan) /* %+ */ |
629 | 651 | STRCPY(errmsg, IObuff); |
630 | 652 | else if ((i = (int)fmt_ptr->addr[5]) > 0) /* %m */ |
631 | 653 | { |
| 654 | if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL) |
| 655 | continue; |
632 | 656 | len = (int)(regmatch.endp[i] - regmatch.startp[i]); |
633 | 657 | vim_strncpy(errmsg, regmatch.startp[i], len); |
634 | 658 | } |
635 | 659 | if ((i = (int)fmt_ptr->addr[6]) > 0) /* %r */ |
| 660 | { |
| 661 | if (regmatch.startp[i] == NULL) |
| 662 | continue; |
636 | 663 | tail = regmatch.startp[i]; |
| 664 | } |
637 | 665 | if ((i = (int)fmt_ptr->addr[7]) > 0) /* %p */ |
638 | 666 | { |
| 667 | if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL) |
| 668 | continue; |
639 | 669 | col = (int)(regmatch.endp[i] - regmatch.startp[i] + 1); |
640 | 670 | if (*((char_u *)regmatch.startp[i]) != TAB) |
641 | 671 | use_viscol = TRUE; |
642 | 672 | } |
643 | 673 | if ((i = (int)fmt_ptr->addr[8]) > 0) /* %v */ |
644 | 674 | { |
| 675 | if (regmatch.startp[i] == NULL) |
| 676 | continue; |
645 | 677 | col = (int)atol((char *)regmatch.startp[i]); |
646 | 678 | use_viscol = TRUE; |
647 | 679 | } |
648 | 680 | if ((i = (int)fmt_ptr->addr[9]) > 0) /* %s */ |
649 | 681 | { |
| 682 | if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL) |
| 683 | continue; |
650 | 684 | len = (int)(regmatch.endp[i] - regmatch.startp[i]); |
651 | 685 | if (len > CMDBUFFSIZE - 5) |
652 | 686 | len = CMDBUFFSIZE - 5; |
-
diff -Naur vim70.orig/src/screen.c vim70/src/screen.c
old
|
new
|
|
2612 | 2612 | #ifdef FEAT_LINEBREAK |
2613 | 2613 | int need_showbreak = FALSE; |
2614 | 2614 | #endif |
2615 | | #if defined(FEAT_SIGNS) || (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) |
| 2615 | #if defined(FEAT_SIGNS) || (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \ |
| 2616 | || defined(FEAT_SYN_HL) || defined(FEAT_DIFF) |
2616 | 2617 | # define LINE_ATTR |
2617 | 2618 | int line_attr = 0; /* atrribute for the whole line */ |
2618 | 2619 | #endif |
… |
… |
|
2626 | 2627 | int prev_c = 0; /* previous Arabic character */ |
2627 | 2628 | int prev_c1 = 0; /* first composing char for prev_c */ |
2628 | 2629 | #endif |
2629 | | #if defined(FEAT_DIFF) || defined(LINE_ATTR) |
| 2630 | #if defined(LINE_ATTR) |
2630 | 2631 | int did_line_attr = 0; |
2631 | 2632 | #endif |
2632 | 2633 | |
… |
… |
|
4116 | 4117 | --ptr; /* put it back at the NUL */ |
4117 | 4118 | } |
4118 | 4119 | #endif |
4119 | | #if defined(FEAT_DIFF) || defined(LINE_ATTR) |
| 4120 | #if defined(LINE_ATTR) |
4120 | 4121 | else if (( |
4121 | 4122 | # ifdef FEAT_DIFF |
4122 | | diff_hlf != (hlf_T)0 |
4123 | | # ifdef LINE_ATTR |
4124 | | || |
4125 | | # endif |
| 4123 | diff_hlf != (hlf_T)0 || |
4126 | 4124 | # endif |
4127 | | # ifdef LINE_ATTR |
4128 | 4125 | line_attr != 0 |
4129 | | # endif |
4130 | 4126 | ) && ( |
4131 | 4127 | # ifdef FEAT_RIGHTLEFT |
4132 | 4128 | wp->w_p_rl ? (col >= 0) : |
… |
… |
|
4237 | 4233 | * At end of the text line or just after the last character. |
4238 | 4234 | */ |
4239 | 4235 | if (c == NUL |
4240 | | #if defined(FEAT_DIFF) || defined(LINE_ATTR) |
| 4236 | #if defined(LINE_ATTR) |
4241 | 4237 | || did_line_attr == 1 |
4242 | 4238 | #endif |
4243 | 4239 | ) |
… |
… |
|
4258 | 4254 | || prevcol == (long)match_hl[0].startcol |
4259 | 4255 | || prevcol == (long)match_hl[1].startcol |
4260 | 4256 | || prevcol == (long)match_hl[2].startcol) |
4261 | | # if defined(FEAT_DIFF) || defined(LINE_ATTR) |
| 4257 | # if defined(LINE_ATTR) |
4262 | 4258 | && did_line_attr <= 1 |
4263 | 4259 | # endif |
4264 | 4260 | ) |
… |
… |
|
7133 | 7129 | return; |
7134 | 7130 | entered = TRUE; |
7135 | 7131 | |
| 7132 | /* |
| 7133 | * Note that the window sizes are updated before reallocating the arrays, |
| 7134 | * thus we must not redraw here! |
| 7135 | */ |
| 7136 | ++RedrawingDisabled; |
| 7137 | |
7136 | 7138 | win_new_shellsize(); /* fit the windows in the new sized shell */ |
7137 | 7139 | |
7138 | 7140 | comp_col(); /* recompute columns for shown command and ruler */ |
… |
… |
|
7367 | 7369 | #endif |
7368 | 7370 | |
7369 | 7371 | entered = FALSE; |
| 7372 | --RedrawingDisabled; |
7370 | 7373 | |
7371 | 7374 | #ifdef FEAT_AUTOCMD |
7372 | 7375 | if (starting == 0) |
-
diff -Naur vim70.orig/src/spell.c vim70/src/spell.c
old
|
new
|
|
2108 | 2108 | * possible. */ |
2109 | 2109 | STRCPY(buf, line); |
2110 | 2110 | if (lnum < wp->w_buffer->b_ml.ml_line_count) |
2111 | | spell_cat_line(buf + STRLEN(buf), ml_get(lnum + 1), MAXWLEN); |
| 2111 | spell_cat_line(buf + STRLEN(buf), |
| 2112 | ml_get_buf(wp->w_buffer, lnum + 1, FALSE), MAXWLEN); |
2112 | 2113 | |
2113 | 2114 | p = buf + skip; |
2114 | 2115 | endp = buf + len; |
… |
… |
|
10070 | 10071 | |
10071 | 10072 | /* List the suggestions. */ |
10072 | 10073 | msg_start(); |
| 10074 | msg_row = Rows - 1; /* for when 'cmdheight' > 1 */ |
10073 | 10075 | lines_left = Rows; /* avoid more prompt */ |
10074 | 10076 | vim_snprintf((char *)IObuff, IOSIZE, _("Change \"%.*s\" to:"), |
10075 | 10077 | sug.su_badlen, sug.su_badptr); |
-
diff -Naur vim70.orig/src/undo.c vim70/src/undo.c
old
|
new
|
|
84 | 84 | static void u_unch_branch __ARGS((u_header_T *uhp)); |
85 | 85 | static u_entry_T *u_get_headentry __ARGS((void)); |
86 | 86 | static void u_getbot __ARGS((void)); |
87 | | static int undo_allowed __ARGS((void)); |
88 | 87 | static int u_savecommon __ARGS((linenr_T, linenr_T, linenr_T)); |
89 | 88 | static void u_doit __ARGS((int count)); |
90 | 89 | static void u_undoredo __ARGS((int undo)); |
… |
… |
|
196 | 195 | * Return TRUE when undo is allowed. Otherwise give an error message and |
197 | 196 | * return FALSE. |
198 | 197 | */ |
199 | | static int |
| 198 | int |
200 | 199 | undo_allowed() |
201 | 200 | { |
202 | 201 | /* Don't allow changes when 'modifiable' is off. */ |
-
diff -Naur vim70.orig/src/version.c vim70/src/version.c
old
|
new
|
|
667 | 667 | static int included_patches[] = |
668 | 668 | { /* Add new patch number below this line */ |
669 | 669 | /**/ |
| 670 | 42, |
| 671 | /**/ |
| 672 | 41, |
| 673 | /**/ |
| 674 | 40, |
| 675 | /**/ |
| 676 | 39, |
| 677 | /**/ |
| 678 | 38, |
| 679 | /**/ |
| 680 | 37, |
| 681 | /**/ |
| 682 | 36, |
| 683 | /**/ |
| 684 | 35, |
| 685 | /**/ |
| 686 | 34, |
| 687 | /**/ |
| 688 | 33, |
| 689 | /**/ |
| 690 | 31, |
| 691 | /**/ |
| 692 | 30, |
| 693 | /**/ |
| 694 | 29, |
| 695 | /**/ |
| 696 | 26, |
| 697 | /**/ |
| 698 | 25, |
| 699 | /**/ |
| 700 | 24, |
| 701 | /**/ |
| 702 | 23, |
| 703 | /**/ |
| 704 | 22, |
| 705 | /**/ |
| 706 | 21, |
| 707 | /**/ |
| 708 | 20, |
| 709 | /**/ |
| 710 | 19, |
| 711 | /**/ |
| 712 | 18, |
| 713 | /**/ |
| 714 | 17, |
| 715 | /**/ |
| 716 | 16, |
| 717 | /**/ |
| 718 | 15, |
| 719 | /**/ |
| 720 | 14, |
| 721 | /**/ |
| 722 | 13, |
| 723 | /**/ |
| 724 | 12, |
| 725 | /**/ |
| 726 | 11, |
| 727 | /**/ |
| 728 | 10, |
| 729 | /**/ |
| 730 | 9, |
| 731 | /**/ |
| 732 | 8, |
| 733 | /**/ |
| 734 | 7, |
| 735 | /**/ |
| 736 | 6, |
| 737 | /**/ |
| 738 | 4, |
| 739 | /**/ |
| 740 | 3, |
| 741 | /**/ |
| 742 | 2, |
| 743 | /**/ |
| 744 | 1, |
| 745 | /**/ |
670 | 746 | 0 |
671 | 747 | }; |
672 | 748 | |
-
diff -Naur vim70.orig/src/vim.h vim70/src/vim.h
old
|
new
|
|
585 | 585 | #define INSERT 0x10 /* Insert mode */ |
586 | 586 | #define LANGMAP 0x20 /* Language mapping, can be combined with |
587 | 587 | INSERT and CMDLINE */ |
588 | | #define MAP_ALL_MODES 0x3f /* all mode bits used for mapping */ |
589 | 588 | |
590 | 589 | #define REPLACE_FLAG 0x40 /* Replace mode flag */ |
591 | 590 | #define REPLACE (REPLACE_FLAG + INSERT) |
… |
… |
|
605 | 604 | #define CONFIRM 0x800 /* ":confirm" prompt */ |
606 | 605 | #define SELECTMODE 0x1000 /* Select mode, only for mappings */ |
607 | 606 | |
| 607 | #define MAP_ALL_MODES (0x3f | SELECTMODE) /* all mode bits used for |
| 608 | * mapping */ |
| 609 | |
608 | 610 | /* directions */ |
609 | 611 | #define FORWARD 1 |
610 | 612 | #define BACKWARD (-1) |