source:
patches/vim-7.0-fixes-10.patch@
a3b6c75
Last change on this file since a3b6c75 was f74ae22, checked in by , 18 years ago | |
---|---|
|
|
File size: 63.8 KB |
-
configure
Submitted By: Jim Gifford (jim at linuxfromscratch dot org) Date: 2006-08-27 Initial Package Version: 7.0 Origin: Upstream Upstream Status: Applied Description: Contains Patch 001-004, 006-026, 028-031, 033-044, 036-056, 058-064, and 066 from Upstream 005, 027, 032, 045, 057, and 066 is for the extras, Mac, or Windows 32 only diff -Naur vim70.orig/configure vim70/configure
old new 3 3 # This is just a stub for the Unix configure script, to provide support for 4 4 # doing "./configure" in the top Vim directory. 5 5 6 cd src && ./configure "$@"6 cd src && exec ./configure "$@" -
runtime/autoload/ccomplete.vim
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 0 34 " 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 -
runtime/autoload/gzip.vim
diff -Naur vim70.orig/runtime/autoload/gzip.vim vim70/runtime/autoload/gzip.vim
old new 1 1 " Vim autoload file for editing compressed files. 2 2 " Maintainer: Bram Moolenaar <Bram@vim.org> 3 " Last Change: 2006 Mar 313 " Last Change: 2006 Jul 19 4 4 5 5 " These functions are used by the gzip plugin. 6 6 … … 127 127 let nmt = s:tempname(nm) 128 128 if rename(nm, nmt) == 0 129 129 if exists("b:gzip_comp_arg") 130 call system(a:cmd . " " . b:gzip_comp_arg . " " . nmt)130 call system(a:cmd . " " . b:gzip_comp_arg . " '" . nmt . "'") 131 131 else 132 call system(a:cmd . " " . nmt)132 call system(a:cmd . " '" . nmt . "'") 133 133 endif 134 134 call rename(nmt . "." . expand("<afile>:e"), nm) 135 135 endif -
runtime/autoload/paste.vim
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 213 " 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 -
runtime/autoload/spellfile.vim
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 013 " 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 . '/' . fname64 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 . '/' . fname70 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 . '/' . fname98 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 ftp server. 114 function! spellfile#Nread(fname) 115 let machine = substitute(g:spellfile_URL, 'ftp://\([^/]*\).*', '\1', '') 116 let dir = substitute(g:spellfile_URL, 'ftp://[^/]*/\(.*\)', '\1', '') 117 exe 'Nread "' . machine . ' anonymous vim7user ' . dir . '/' . a:fname . '"' 118 endfunc -
runtime/plugin/matchparen.vim
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 273 " Last Change: 2006 Jun 26 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 97 97 " When not in a string or comment ignore matches inside them. 98 98 let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' . 99 \ '=~? "string\\|c omment"'99 \ '=~? "string\\|character\\|singlequote\\|comment"' 100 100 execute 'if' s_skip '| let s_skip = 0 | endif' 101 101 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. -
runtime/scripts.vim
diff -Naur vim70.orig/runtime/scripts.vim vim70/runtime/scripts.vim
old new 1 1 " Vim support file to detect file types in scripts 2 2 " 3 3 " Maintainer: Bram Moolenaar <Bram@vim.org> 4 " Last change: 2006 Mar 284 " Last change: 2006 Jul 08 5 5 6 6 " This file is called by an autocommand for every file that has just been 7 7 " loaded into a buffer. It checks if the type of file can be recognized by … … 54 54 let s:name = substitute(s:line1, '^#!\s*\S*[/\\]\(\i\+\).*', '\1', '') 55 55 endif 56 56 57 " tcl scripts may have #!/bin/sh in the first line and "exec wish" in the 58 " third line. Suggested by Steven Atkinson. 59 if getline(3) =~ '^exec wish' 60 let s:name = 'wish' 61 endif 62 57 63 " Bourne-like shell scripts: bash bash2 ksh ksh93 sh 58 64 if s:name =~ '^\(bash\d*\|\|ksh\d*\|sh\)\>' 59 65 call SetFileTypeSH(s:line1) " defined in filetype.vim -
src/buffer.c
diff -Naur vim70.orig/src/buffer.c vim70/src/buffer.c
old new 5420 5420 buf_T *newbuf; 5421 5421 int differ = TRUE; 5422 5422 linenr_T lnum; 5423 #ifdef FEAT_AUTOCMD5424 5423 aco_save_T aco; 5425 #else5426 buf_T *old_curbuf = curbuf;5427 #endif5428 5424 exarg_T ea; 5429 5425 5430 5426 /* Allocate a buffer without putting it in the buffer list. */ … … 5439 5435 return TRUE; 5440 5436 } 5441 5437 5442 #ifdef FEAT_AUTOCMD5443 5438 /* set curwin/curbuf to buf and save a few things */ 5444 5439 aucmd_prepbuf(&aco, newbuf); 5445 #else5446 curbuf = newbuf;5447 curwin->w_buffer = newbuf;5448 #endif5449 5440 5450 5441 if (ml_open(curbuf) == OK 5451 5442 && readfile(buf->b_ffname, buf->b_fname, … … 5466 5457 } 5467 5458 vim_free(ea.cmd); 5468 5459 5469 #ifdef FEAT_AUTOCMD5470 5460 /* restore curwin/curbuf and a few other things */ 5471 5461 aucmd_restbuf(&aco); 5472 #else5473 curbuf = old_curbuf;5474 curwin->w_buffer = old_curbuf;5475 #endif5476 5462 5477 5463 if (curbuf != newbuf) /* safety check */ 5478 5464 wipe_buffer(newbuf, FALSE); -
src/configure
diff -Naur vim70.orig/src/configure vim70/src/configure
old new 2 2 # run the automatically generated configure script 3 3 CONFIG_STATUS=auto/config.status \ 4 4 auto/configure "$@" --srcdir="${srcdir:-.}" --cache-file=auto/config.cache 5 result=$? 6 5 7 # Stupid autoconf 2.5x causes this file to be left behind. 6 8 if test -f configure.lineno; then rm -f configure.lineno; fi 9 10 exit $result -
src/edit.c
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. Shen759 /* 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))) … … 877 882 /* Close the cmdline window. */ 878 883 cmdwin_result = K_IGNORE; 879 884 got_int = FALSE; /* don't stop executing autocommands et al. */ 885 nomove = TRUE; 880 886 goto doESCkey; 881 887 } 882 888 #endif … … 2409 2415 compl_matches = ins_compl_make_cyclic(); 2410 2416 compl_started = TRUE; 2411 2417 compl_used_match = TRUE; 2418 compl_cont_status = 0; 2412 2419 2413 2420 compl_curr_match = compl_first_match; 2414 2421 ins_complete(Ctrl_N); … … 2753 2760 } 2754 2761 else 2755 2762 # endif 2763 if (count > 0) /* avoid warning for using "files" uninit */ 2756 2764 { 2757 2765 ins_compl_files(count, files, thesaurus, flags, 2758 2766 ®match, buf, &dir); … … 3015 3023 if ((int)(p - line) - (int)compl_col <= 0) 3016 3024 return K_BS; 3017 3025 3018 /* For redo we need to repeat this backspace. */3019 AppendCharToRedobuff(K_BS);3020 3021 3026 /* Deleted more than what was used to find matches or didn't finish 3022 3027 * finding all matches: need to look for matches all over again. */ 3023 3028 if (curwin->w_cursor.col <= compl_col + compl_length … … 3046 3051 ins_compl_delete(); 3047 3052 ins_bytes(compl_leader + curwin->w_cursor.col - compl_col); 3048 3053 compl_used_match = FALSE; 3049 compl_enter_selects = FALSE;3050 3054 3051 3055 if (compl_started) 3052 3056 ins_compl_set_original_text(compl_leader); … … 3076 3080 compl_restarting = FALSE; 3077 3081 } 3078 3082 3083 #if 0 /* disabled, made CTRL-L, BS and typing char jump to original text. */ 3079 3084 if (!compl_used_match) 3080 3085 { 3081 3086 /* Go to the original text, since none of the matches is inserted. */ … … 3087 3092 compl_curr_match = compl_shown_match; 3088 3093 compl_shows_dir = compl_direction; 3089 3094 } 3095 #endif 3096 compl_enter_selects = !compl_used_match; 3090 3097 3091 3098 /* Show the popup menu with a different set of matches. */ 3092 3099 ins_compl_show_pum(); … … 3115 3122 #endif 3116 3123 ins_char(c); 3117 3124 3118 /* For redo we need to count this character so that the number of3119 * backspaces is correct. */3120 AppendCharToRedobuff(c);3121 3122 3125 /* If we didn't complete finding matches we must search again. */ 3123 3126 if (compl_was_interrupted) 3124 3127 ins_compl_restart(); … … 3175 3178 char_u *p; 3176 3179 int len = curwin->w_cursor.col - compl_col; 3177 3180 int c; 3181 compl_T *cp; 3178 3182 3179 3183 p = compl_shown_match->cp_str; 3180 3184 if ((int)STRLEN(p) <= len) /* the match is too short */ 3181 return; 3185 { 3186 /* When still at the original match use the first entry that matches 3187 * the leader. */ 3188 if (compl_shown_match->cp_flags & ORIGINAL_TEXT) 3189 { 3190 p = NULL; 3191 for (cp = compl_shown_match->cp_next; cp != NULL 3192 && cp != compl_first_match; cp = cp->cp_next) 3193 { 3194 if (ins_compl_equal(cp, compl_leader, 3195 (int)STRLEN(compl_leader))) 3196 { 3197 p = cp->cp_str; 3198 break; 3199 } 3200 } 3201 if (p == NULL || (int)STRLEN(p) <= len) 3202 return; 3203 } 3204 else 3205 return; 3206 } 3182 3207 p += len; 3183 3208 #ifdef FEAT_MBYTE 3184 3209 c = mb_ptr2char(p); … … 3198 3223 int c; 3199 3224 { 3200 3225 char_u *ptr; 3201 int temp;3202 3226 int want_cindent; 3203 3227 int retval = FALSE; 3204 3228 … … 3354 3378 if (compl_curr_match != NULL || compl_leader != NULL || c == Ctrl_E) 3355 3379 { 3356 3380 char_u *p; 3381 int temp = 0; 3357 3382 3358 3383 /* 3359 3384 * If any of the original typed text has been changed, eg when … … 3369 3394 ptr = compl_leader; 3370 3395 else 3371 3396 ptr = compl_orig_text; 3372 p = compl_orig_text; 3373 for (temp = 0; p[temp] != NUL && p[temp] == ptr[temp]; ++temp) 3374 ; 3397 if (compl_orig_text != NULL) 3398 { 3399 p = compl_orig_text; 3400 for (temp = 0; p[temp] != NUL && p[temp] == ptr[temp]; 3401 ++temp) 3402 ; 3375 3403 #ifdef FEAT_MBYTE 3376 if (temp > 0)3377 3404 if (temp > 0) 3405 temp -= (*mb_head_off)(compl_orig_text, p + temp); 3378 3406 #endif 3379 for (p += temp; *p != NUL; mb_ptr_adv(p)) 3380 AppendCharToRedobuff(K_BS); 3381 AppendToRedobuffLit(ptr + temp, -1); 3407 for (p += temp; *p != NUL; mb_ptr_adv(p)) 3408 AppendCharToRedobuff(K_BS); 3409 } 3410 if (ptr != NULL) 3411 AppendToRedobuffLit(ptr + temp, -1); 3382 3412 } 3383 3413 3384 3414 #ifdef FEAT_CINDENT … … 4100 4130 && compl_shown_match->cp_next != NULL 4101 4131 && compl_shown_match->cp_next != compl_first_match) 4102 4132 compl_shown_match = compl_shown_match->cp_next; 4133 4134 /* If we didn't find it searching forward, and compl_shows_dir is 4135 * backward, find the last match. */ 4136 if (compl_shows_dir == BACKWARD 4137 && !ins_compl_equal(compl_shown_match, 4138 compl_leader, (int)STRLEN(compl_leader)) 4139 && (compl_shown_match->cp_next == NULL 4140 || compl_shown_match->cp_next == compl_first_match)) 4141 { 4142 while (!ins_compl_equal(compl_shown_match, 4143 compl_leader, (int)STRLEN(compl_leader)) 4144 && compl_shown_match->cp_prev != NULL 4145 && compl_shown_match->cp_prev != compl_first_match) 4146 compl_shown_match = compl_shown_match->cp_prev; 4147 } 4103 4148 } 4104 4149 4105 4150 if (allow_get_expansion && insert_match … … 4124 4169 { 4125 4170 if (compl_shows_dir == FORWARD && compl_shown_match->cp_next != NULL) 4126 4171 { 4127 if (compl_pending != 0)4128 --compl_pending;4129 4172 compl_shown_match = compl_shown_match->cp_next; 4130 4173 found_end = (compl_first_match != NULL 4131 4174 && (compl_shown_match->cp_next == compl_first_match … … 4134 4177 else if (compl_shows_dir == BACKWARD 4135 4178 && compl_shown_match->cp_prev != NULL) 4136 4179 { 4137 if (compl_pending != 0)4138 ++compl_pending;4139 4180 found_end = (compl_shown_match == compl_first_match); 4140 4181 compl_shown_match = compl_shown_match->cp_prev; 4141 4182 found_end |= (compl_shown_match == compl_first_match); 4142 4183 } 4143 4184 else 4144 4185 { 4186 if (!allow_get_expansion) 4187 { 4188 if (advance) 4189 { 4190 if (compl_shows_dir == BACKWARD) 4191 compl_pending -= todo + 1; 4192 else 4193 compl_pending += todo + 1; 4194 } 4195 return -1; 4196 } 4197 4145 4198 if (advance) 4146 4199 { 4147 4200 if (compl_shows_dir == BACKWARD) … … 4149 4202 else 4150 4203 ++compl_pending; 4151 4204 } 4152 if (!allow_get_expansion)4153 return -1;4154 4205 4155 4206 /* Find matches. */ 4156 4207 num_matches = ins_compl_get_exp(&compl_startpos); 4157 if (compl_pending != 0 && compl_direction == compl_shows_dir 4208 4209 /* handle any pending completions */ 4210 while (compl_pending != 0 && compl_direction == compl_shows_dir 4158 4211 && advance) 4159 compl_shown_match = compl_curr_match; 4212 { 4213 if (compl_pending > 0 && compl_shown_match->cp_next != NULL) 4214 { 4215 compl_shown_match = compl_shown_match->cp_next; 4216 --compl_pending; 4217 } 4218 if (compl_pending < 0 && compl_shown_match->cp_prev != NULL) 4219 { 4220 compl_shown_match = compl_shown_match->cp_prev; 4221 ++compl_pending; 4222 } 4223 else 4224 break; 4225 } 4160 4226 found_end = FALSE; 4161 4227 } 4162 4228 if ((compl_shown_match->cp_flags & ORIGINAL_TEXT) == 0 … … 4265 4331 return; 4266 4332 count = 0; 4267 4333 4268 ++no_mapping; 4334 /* Check for a typed key. Do use mappings, otherwise vim_is_ctrl_x_key() 4335 * can't do its work correctly. */ 4269 4336 c = vpeekc_any(); 4270 --no_mapping;4271 4337 if (c != NUL) 4272 4338 { 4273 4339 if (vim_is_ctrl_x_key(c) && c != Ctrl_X && c != Ctrl_R) … … 4277 4343 (void)ins_compl_next(FALSE, ins_compl_key2count(c), 4278 4344 c != K_UP && c != K_DOWN); 4279 4345 } 4280 else if (c != Ctrl_R) 4281 compl_interrupted = TRUE; 4346 else 4347 { 4348 /* Need to get the character to have KeyTyped set. We'll put it 4349 * back with vungetc() below. */ 4350 c = safe_vgetc(); 4351 4352 /* Don't interrupt completion when the character wasn't typed, 4353 * e.g., when doing @q to replay keys. */ 4354 if (c != Ctrl_R && KeyTyped) 4355 compl_interrupted = TRUE; 4356 4357 vungetc(c); 4358 } 4282 4359 } 4283 4360 if (compl_pending != 0 && !got_int) 4284 (void)ins_compl_next(FALSE, compl_pending > 0 4285 ? compl_pending : -compl_pending, TRUE); 4361 { 4362 int todo = compl_pending > 0 ? compl_pending : -compl_pending; 4363 4364 compl_pending = 0; 4365 (void)ins_compl_next(FALSE, todo, TRUE); 4366 } 4286 4367 } 4287 4368 4288 4369 /* … … 4611 4692 (int)STRLEN(compl_pattern), curs_col); 4612 4693 if (compl_xp.xp_context == EXPAND_UNSUCCESSFUL 4613 4694 || 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; 4695 /* No completion possible, use an empty pattern to get a 4696 * "pattern not found" message. */ 4697 compl_col = curs_col; 4698 else 4699 compl_col = (int)(compl_xp.xp_pattern - compl_pattern); 4700 compl_length = curs_col - compl_col; 4618 4701 } 4619 4702 else if (ctrl_x_mode == CTRL_X_FUNCTION || ctrl_x_mode == CTRL_X_OMNI) 4620 4703 { … … 4668 4751 else 4669 4752 compl_col = spell_word_start(startcol); 4670 4753 if (compl_col >= (colnr_T)startcol) 4671 return FAIL; 4672 spell_expand_check_cap(compl_col); 4754 { 4755 compl_length = 0; 4756 compl_col = curs_col; 4757 } 4758 else 4759 { 4760 spell_expand_check_cap(compl_col); 4761 compl_length = (int)curs_col - compl_col; 4762 } 4673 4763 /* Need to obtain "line" again, it may have become invalid. */ 4674 4764 line = ml_get(curwin->w_cursor.lnum); 4675 compl_length = (int)curs_col - compl_col;4676 4765 compl_pattern = vim_strnsave(line + compl_col, compl_length); 4677 4766 if (compl_pattern == NULL) 4678 4767 #endif -
src/eval.c
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 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 … … 14157 14184 typval_T *rettv; 14158 14185 { 14159 14186 buf_T *buf; 14160 #ifdef FEAT_AUTOCMD14161 14187 aco_save_T aco; 14162 #else14163 buf_T *save_curbuf;14164 #endif14165 14188 char_u *varname, *bufvarname; 14166 14189 typval_T *varp; 14167 14190 char_u nbuf[NUMBUFLEN]; … … 14178 14201 if (buf != NULL && varname != NULL && varp != NULL) 14179 14202 { 14180 14203 /* set curbuf to be our buf, temporarily */ 14181 #ifdef FEAT_AUTOCMD14182 14204 aucmd_prepbuf(&aco, buf); 14183 #else14184 save_curbuf = curbuf;14185 curbuf = buf;14186 #endif14187 14205 14188 14206 if (*varname == '&') 14189 14207 { … … 14210 14228 } 14211 14229 14212 14230 /* reset notion of buffer */ 14213 #ifdef FEAT_AUTOCMD14214 14231 aucmd_restbuf(&aco); 14215 #else14216 curbuf = save_curbuf;14217 #endif14218 14232 } 14219 14233 } 14220 14234 … … 16438 16452 long i = 0; 16439 16453 long n; 16440 16454 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)) 16455 /* List must be: [fnum, lnum, col, coladd], where "fnum" is only there 16456 * when "fnump" isn't NULL and "coladd" is optional. */ 16457 if (arg->v_type != VAR_LIST 16458 || l == NULL 16459 || l->lv_len < (fnump == NULL ? 2 : 3) 16460 || l->lv_len > (fnump == NULL ? 3 : 4)) 16444 16461 return FAIL; 16445 16462 16446 16463 if (fnump != NULL) … … 16466 16483 #ifdef FEAT_VIRTUALEDIT 16467 16484 n = list_find_nr(l, i, NULL); 16468 16485 if (n < 0) 16469 return FAIL; 16470 posp->coladd = n; 16486 posp->coladd = 0; 16487 else 16488 posp->coladd = n; 16471 16489 #endif 16472 16490 16473 16491 return OK; … … 17759 17777 } 17760 17778 else /* add a new variable */ 17761 17779 { 17780 /* Can't add "v:" variable. */ 17781 if (ht == &vimvarht) 17782 { 17783 EMSG2(_(e_illvar), name); 17784 return; 17785 } 17786 17762 17787 /* Make sure the variable name is valid. */ 17763 17788 for (p = varname; *p != NUL; ++p) 17764 17789 if (!eval_isnamec1(*p) && (p == varname || !VIM_ISDIGIT(*p)) … … 18786 18811 if (dict_add(fudi.fd_dict, fudi.fd_di) == FAIL) 18787 18812 { 18788 18813 vim_free(fudi.fd_di); 18814 vim_free(fp); 18789 18815 goto erret; 18790 18816 } 18791 18817 } … … 18963 18989 else if (lead > 0) 18964 18990 { 18965 18991 lead = 3; 18966 if (eval_fname_sid(lv.ll_exp_name != NULL ? lv.ll_exp_name : *pp)) 18992 if ((lv.ll_exp_name != NULL && eval_fname_sid(lv.ll_exp_name)) 18993 || eval_fname_sid(*pp)) 18967 18994 { 18968 18995 /* It's "s:" or "<SID>" */ 18969 18996 if (current_SID <= 0) … … 19685 19712 v->di_tv.vval.v_list = &fc.l_varlist; 19686 19713 vim_memset(&fc.l_varlist, 0, sizeof(list_T)); 19687 19714 fc.l_varlist.lv_refcount = 99999; 19715 fc.l_varlist.lv_lock = VAR_FIXED; 19688 19716 19689 19717 /* 19690 19718 * Set a:firstline to "firstline" and a:lastline to "lastline". -
src/ex_cmds.h
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, -
src/ex_docmd.c
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 elseif (flags & DOCMD_EXCRESET)836 if (flags & DOCMD_EXCRESET) 837 837 save_dbg_stuff(&debug_saved); 838 838 839 839 initial_trylevel = trylevel; … … 1710 1710 save_cmdmod = cmdmod; 1711 1711 vim_memset(&cmdmod, 0, sizeof(cmdmod)); 1712 1712 1713 /* "#!anything" is handled like a comment. */ 1714 if ((*cmdlinep)[0] == '#' && (*cmdlinep)[1] == '!') 1715 goto doend; 1716 1713 1717 /* 1714 1718 * Repeat until no more command modifiers are found. 1715 1719 */ -
src/ex_getln.c
diff -Naur vim70.orig/src/ex_getln.c vim70/src/ex_getln.c
old new 5982 5982 typestr[0] = cmdwin_type; 5983 5983 typestr[1] = NUL; 5984 5984 apply_autocmds(EVENT_CMDWINENTER, typestr, typestr, FALSE, curbuf); 5985 if (restart_edit != 0) /* autocmd with ":startinsert" */ 5986 stuffcharReadbuff(K_NOP); 5985 5987 # endif 5986 5988 5987 5989 i = RedrawingDisabled; -
src/fileio.c
diff -Naur vim70.orig/src/fileio.c vim70/src/fileio.c
old new 6450 6450 int old_ro = buf->b_p_ro; 6451 6451 buf_T *savebuf; 6452 6452 int saved = OK; 6453 #ifdef FEAT_AUTOCMD6454 6453 aco_save_T aco; 6455 6454 6456 6455 /* set curwin/curbuf for "buf" and save some things */ 6457 6456 aucmd_prepbuf(&aco, buf); 6458 #else6459 buf_T *save_curbuf = curbuf;6460 6461 curbuf = buf;6462 curwin->w_buffer = buf;6463 #endif6464 6457 6465 6458 /* We only want to read the text from the file, not reset the syntax 6466 6459 * highlighting, clear marks, diff status, etc. Force the fileformat … … 6573 6566 curbuf->b_p_ro |= old_ro; 6574 6567 } 6575 6568 6576 #ifdef FEAT_AUTOCMD6577 6569 /* restore curwin/curbuf and a few other things */ 6578 6570 aucmd_restbuf(&aco); 6579 6571 /* Careful: autocommands may have made "buf" invalid! */ 6580 #else6581 curwin->w_buffer = save_curbuf;6582 curbuf = save_curbuf;6583 #endif6584 6572 } 6585 6573 6586 6574 /*ARGSUSED*/ … … 8088 8076 * Search a window for the current buffer. Save the cursor position and 8089 8077 * screen offset. 8090 8078 * Set "curbuf" and "curwin" to match "buf". 8079 * When FEAT_AUTOCMD is not defined another version is used, see below. 8091 8080 */ 8092 8081 void 8093 8082 aucmd_prepbuf(aco, buf) … … 8151 8140 /* 8152 8141 * Cleanup after executing autocommands for a (hidden) buffer. 8153 8142 * Restore the window as it was (if possible). 8143 * When FEAT_AUTOCMD is not defined another version is used, see below. 8154 8144 */ 8155 8145 void 8156 8146 aucmd_restbuf(aco) … … 9063 9053 return retval; 9064 9054 } 9065 9055 9056 #else /* FEAT_AUTOCMD */ 9057 9058 /* 9059 * Prepare for executing commands for (hidden) buffer "buf". 9060 * This is the non-autocommand version, it simply saves "curbuf" and sets 9061 * "curbuf" and "curwin" to match "buf". 9062 */ 9063 void 9064 aucmd_prepbuf(aco, buf) 9065 aco_save_T *aco; /* structure to save values in */ 9066 buf_T *buf; /* new curbuf */ 9067 { 9068 aco->save_buf = buf; 9069 curbuf = buf; 9070 curwin->w_buffer = buf; 9071 } 9072 9073 /* 9074 * Restore after executing commands for a (hidden) buffer. 9075 * This is the non-autocommand version. 9076 */ 9077 void 9078 aucmd_restbuf(aco) 9079 aco_save_T *aco; /* structure holding saved values */ 9080 { 9081 curbuf = aco->save_buf; 9082 curwin->w_buffer = curbuf; 9083 } 9084 9066 9085 #endif /* FEAT_AUTOCMD */ 9067 9086 9087 9068 9088 #if defined(FEAT_AUTOCMD) || defined(FEAT_WILDIGN) || defined(PROTO) 9069 9089 /* 9070 9090 * Try matching a filename with a "pattern" ("prog" is NULL), or use the -
src/gui_at_fs.c
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; -
src/gui.c
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 { -
src/gui_xmebw.c
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 #if def LESSTIF_VERSION56 #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 #if ndef LESSTIF_VERSION483 #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 #if ndef LESSTIF_VERSION644 #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 #if ndef LESSTIF_VERSION729 #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 #if ndef LESSTIF_VERSION813 #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 #if ndef LESSTIF_VERSION1153 #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 #if ndef LESSTIF_VERSION1165 #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 #if ndef LESSTIF_VERSION1244 #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 #if ndef LESSTIF_VERSION1292 #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 #if ndef LESSTIF_VERSION1368 #if !defined(LESSTIF_VERSION) && (XmVersion > 1002) 1369 1369 /* 1370 1370 * Compute location of bounding box to contain the 1371 1371 * defaultButtonShadow. -
src/if_perl.xs
diff -Naur vim70.orig/src/if_perl.xs vim70/src/if_perl.xs
old new 155 155 static int (*perl_run)(PerlInterpreter*); 156 156 static int (*perl_parse)(PerlInterpreter*, XSINIT_t, int, char**, char**); 157 157 static void* (*Perl_get_context)(void); 158 static void (*Perl_croak)(pTHX_ const char*, ...) __attribute__((noreturn));159 static void (*Perl_croak_nocontext)(const char*, ...) __attribute__((noreturn));158 static void (*Perl_croak)(pTHX_ const char*, ...); 159 static void (*Perl_croak_nocontext)(const char*, ...); 160 160 static I32 (*Perl_dowantarray)(pTHX); 161 161 static void (*Perl_free_tmps)(pTHX); 162 162 static HV* (*Perl_gv_stashpv)(pTHX_ const char*, I32); … … 1056 1056 int i; 1057 1057 long lnum; 1058 1058 char *line; 1059 buf_T *savebuf;1060 1059 PPCODE: 1061 1060 if (buf_valid(vimbuf)) 1062 1061 { … … 1069 1068 line = SvPV(ST(i),PL_na); 1070 1069 if (lnum > 0 && lnum <= vimbuf->b_ml.ml_line_count && line != NULL) 1071 1070 { 1072 savebuf = curbuf; 1073 curbuf = vimbuf; 1071 aco_save_T aco; 1072 1073 /* set curwin/curbuf for "vimbuf" and save some things */ 1074 aucmd_prepbuf(&aco, vimbuf); 1075 1074 1076 if (u_savesub(lnum) == OK) 1075 1077 { 1076 1078 ml_replace(lnum, (char_u *)line, TRUE); 1077 1079 changed_bytes(lnum, 0); 1078 1080 } 1079 curbuf = savebuf; 1081 1082 /* restore curwin/curbuf and a few other things */ 1083 aucmd_restbuf(&aco); 1084 /* Careful: autocommands may have made "vimbuf" invalid! */ 1080 1085 } 1081 1086 } 1082 1087 } … … 1087 1092 1088 1093 PREINIT: 1089 1094 long i, lnum = 0, count = 0; 1090 buf_T *savebuf;1091 1095 PPCODE: 1092 1096 if (buf_valid(vimbuf)) 1093 1097 { … … 1114 1118 { 1115 1119 if (lnum > 0 && lnum <= vimbuf->b_ml.ml_line_count) 1116 1120 { 1117 savebuf = curbuf; 1118 curbuf = vimbuf; 1121 aco_save_T aco; 1122 1123 /* set curwin/curbuf for "vimbuf" and save some things */ 1124 aucmd_prepbuf(&aco, vimbuf); 1125 1119 1126 if (u_savedel(lnum, 1) == OK) 1120 1127 { 1121 1128 ml_delete(lnum, 0); 1122 1129 deleted_lines_mark(lnum, 1L); 1123 if ( savebuf == curbuf)1130 if (aco.save_buf == curbuf) 1124 1131 check_cursor(); 1125 1132 } 1126 curbuf = savebuf; 1133 1134 /* restore curwin/curbuf and a few other things */ 1135 aucmd_restbuf(&aco); 1136 /* Careful: autocommands may have made "vimbuf" invalid! */ 1137 1127 1138 update_curbuf(VALID); 1128 1139 } 1129 1140 } … … 1138 1149 int i; 1139 1150 long lnum; 1140 1151 char *line; 1141 buf_T *savebuf;1142 1152 PPCODE: 1143 1153 if (buf_valid(vimbuf)) 1144 1154 { … … 1151 1161 line = SvPV(ST(i),PL_na); 1152 1162 if (lnum >= 0 && lnum <= vimbuf->b_ml.ml_line_count && line != NULL) 1153 1163 { 1154 savebuf = curbuf; 1155 curbuf = vimbuf; 1164 aco_save_T aco; 1165 1166 /* set curwin/curbuf for "vimbuf" and save some things */ 1167 aucmd_prepbuf(&aco, vimbuf); 1168 1156 1169 if (u_inssub(lnum + 1) == OK) 1157 1170 { 1158 1171 ml_append(lnum, (char_u *)line, (colnr_T)0, FALSE); 1159 1172 appended_lines_mark(lnum, 1L); 1160 1173 } 1161 curbuf = savebuf; 1174 1175 /* restore curwin/curbuf and a few other things */ 1176 aucmd_restbuf(&aco); 1177 /* Careful: autocommands may have made "vimbuf" invalid! */ 1178 1162 1179 update_curbuf(VALID); 1163 1180 } 1164 1181 } -
src/if_ruby.c
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 aco_save_T aco; 648 649 if (n > 0 && n <= buf->b_ml.ml_line_count && line != NULL) 650 { 651 /* set curwin/curbuf for "buf" and save some things */ 652 aucmd_prepbuf(&aco, buf); 648 653 649 if (n > 0 && n <= buf->b_ml.ml_line_count && line != NULL) {650 curbuf = buf;651 654 if (u_savesub(n) == OK) { 652 655 ml_replace(n, (char_u *)line, TRUE); 653 656 changed(); … … 655 658 syn_changed(n); /* recompute syntax hl. for this line */ 656 659 #endif 657 660 } 658 curbuf = savebuf; 661 662 /* restore curwin/curbuf and a few other things */ 663 aucmd_restbuf(&aco); 664 /* Careful: autocommands may have made "buf" invalid! */ 665 659 666 update_curbuf(NOT_VALID); 660 667 } 661 else { 668 else 669 { 662 670 rb_raise(rb_eIndexError, "index %d out of buffer", n); 663 671 return Qnil; /* For stop warning */ 664 672 } … … 676 684 677 685 static VALUE buffer_delete(VALUE self, VALUE num) 678 686 { 679 buf_T *buf = get_buf(self); 680 buf_T *savebuf = curbuf; 681 long n = NUM2LONG(num); 687 buf_T *buf = get_buf(self); 688 long n = NUM2LONG(num); 689 aco_save_T aco; 690 691 if (n > 0 && n <= buf->b_ml.ml_line_count) 692 { 693 /* set curwin/curbuf for "buf" and save some things */ 694 aucmd_prepbuf(&aco, buf); 682 695 683 if (n > 0 && n <= buf->b_ml.ml_line_count) {684 curbuf = buf;685 696 if (u_savedel(n, 1) == OK) { 686 697 ml_delete(n, 0); 687 698 … … 691 702 692 703 changed(); 693 704 } 694 curbuf = savebuf; 705 706 /* restore curwin/curbuf and a few other things */ 707 aucmd_restbuf(&aco); 708 /* Careful: autocommands may have made "buf" invalid! */ 709 695 710 update_curbuf(NOT_VALID); 696 711 } 697 else { 712 else 713 { 698 714 rb_raise(rb_eIndexError, "index %d out of buffer", n); 699 715 } 700 716 return Qnil; … … 702 718 703 719 static VALUE buffer_append(VALUE self, VALUE num, VALUE str) 704 720 { 705 buf_T *buf = get_buf(self); 706 buf_T *savebuf = curbuf; 707 char *line = STR2CSTR(str); 708 long n = NUM2LONG(num); 721 buf_T *buf = get_buf(self); 722 char *line = STR2CSTR(str); 723 long n = NUM2LONG(num); 724 aco_save_T aco; 725 726 if (n >= 0 && n <= buf->b_ml.ml_line_count && line != NULL) 727 { 728 /* set curwin/curbuf for "buf" and save some things */ 729 aucmd_prepbuf(&aco, buf); 709 730 710 if (n >= 0 && n <= buf->b_ml.ml_line_count && line != NULL) {711 curbuf = buf;712 731 if (u_inssub(n + 1) == OK) { 713 732 ml_append(n, (char_u *) line, (colnr_T) 0, FALSE); 714 733 … … 718 737 719 738 changed(); 720 739 } 721 curbuf = savebuf; 740 741 /* restore curwin/curbuf and a few other things */ 742 aucmd_restbuf(&aco); 743 /* Careful: autocommands may have made "buf" invalid! */ 744 722 745 update_curbuf(NOT_VALID); 723 746 } 724 747 else { -
src/main.c
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 … … 3208 3212 * Register for remote command execution with :serversend and --remote 3209 3213 * unless there was a -X or a --servername '' on the command line. 3210 3214 * Only register nongui-vim's with an explicit --servername argument. 3215 * When running as root --servername is also required. 3211 3216 */ 3212 3217 if (X_DISPLAY != NULL && parmp->servername != NULL && ( 3213 3218 # ifdef FEAT_GUI 3214 gui.in_use || 3219 (gui.in_use 3220 # ifdef UNIX 3221 && getuid() != 0 3222 # endif 3223 ) || 3215 3224 # endif 3216 3225 parmp->serverName_arg != NULL)) 3217 3226 { -
src/Makefile
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 -
src/mbyte.c
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 /* … … 359 363 {"932", IDX_CP932}, 360 364 {"949", IDX_CP949}, 361 365 {"936", IDX_CP936}, 366 {"gbk", IDX_CP936}, 367 {"gb18030", IDX_CP936}, /* only 99% the same */ 362 368 {"950", IDX_CP950}, 363 369 {"eucjp", IDX_EUC_JP}, 364 370 {"unix-jis", IDX_EUC_JP}, … … 386 392 {"950", IDX_BIG5}, 387 393 #endif 388 394 {"mac", IDX_MACROMAN}, 395 {"mac-roman", IDX_MACROMAN}, 389 396 {NULL, 0} 390 397 }; 391 398 -
src/menu.c
diff -Naur vim70.orig/src/menu.c vim70/src/menu.c
old new 511 511 * name (without mnemonic and accelerator text). */ 512 512 next_name = menu_name_skip(name); 513 513 dname = menu_text(name, NULL, NULL); 514 if (dname == NULL) 515 goto erret; 516 if (*dname == NUL) 517 { 518 /* Only a mnemonic or accelerator is not valid. */ 519 EMSG(_("E792: Empty menu name")); 520 goto erret; 521 } 514 522 515 523 /* See if it's already there */ 516 524 lower_pri = menup; … … 704 712 parent = menu; 705 713 name = next_name; 706 714 vim_free(dname); 715 dname = NULL; 707 716 if (pri_tab[pri_idx + 1] != -1) 708 717 ++pri_idx; 709 718 } … … 793 802 erret: 794 803 vim_free(path_name); 795 804 vim_free(dname); 805 806 /* Delete any empty submenu we added before discovering the error. Repeat 807 * for higher levels. */ 808 while (parent != NULL && parent->children == NULL) 809 { 810 if (parent->parent == NULL) 811 menup = &root_menu; 812 else 813 menup = &parent->parent->children; 814 for ( ; *menup != NULL && *menup != parent; menup = &((*menup)->next)) 815 ; 816 if (*menup == NULL) /* safety check */ 817 break; 818 parent = parent->parent; 819 free_menu(menup); 820 } 796 821 return FAIL; 797 822 } 798 823 … … 1753 1778 } 1754 1779 1755 1780 /* 1781 * Check that a pointer appears in the menu tree. Used to protect from using 1782 * a menu that was deleted after it was selected but before the event was 1783 * handled. 1784 * Return OK or FAIL. Used recursively. 1785 */ 1786 int 1787 check_menu_pointer(root, menu_to_check) 1788 vimmenu_T *root; 1789 vimmenu_T *menu_to_check; 1790 { 1791 vimmenu_T *p; 1792 1793 for (p = root; p != NULL; p = p->next) 1794 if (p == menu_to_check 1795 || (p->children != NULL 1796 && check_menu_pointer(p->children, menu_to_check) == OK)) 1797 return OK; 1798 return FAIL; 1799 } 1800 1801 /* 1756 1802 * After we have started the GUI, then we can create any menus that have been 1757 1803 * defined. This is done once here. add_menu_path() may have already been 1758 1804 * called to define these menus, and may be called again. This function calls -
src/message.c
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 precision4181 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; -
src/misc1.c
diff -Naur vim70.orig/src/misc1.c vim70/src/misc1.c
old new 4492 4492 int l = mb_ptr2len(s); 4493 4493 4494 4494 while (--l > 0) 4495 *d++ = * s++;4495 *d++ = *++s; 4496 4496 } 4497 4497 # endif 4498 4498 } -
src/netbeans.c
diff -Naur vim70.orig/src/netbeans.c vim70/src/netbeans.c
old new 1986 1986 if (buf->bufp != NULL) 1987 1987 do_buffer(DOBUF_WIPE, DOBUF_FIRST, FORWARD, 1988 1988 buf->bufp->b_fnum, TRUE); 1989 buf->bufp = NULL; 1990 buf->initDone = FALSE; 1989 1991 doupdate = 1; 1990 1992 /* =====================================================================*/ 1991 1993 } -
src/normal.c
diff -Naur vim70.orig/src/normal.c vim70/src/normal.c
old new 2504 2504 * NOTE: Ignore right button down and drag mouse events. 2505 2505 * Windows only shows the popup menu on the button up event. 2506 2506 */ 2507 #if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) 2507 #if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_GTK) \ 2508 || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC) 2508 2509 if (!is_click) 2509 2510 return FALSE; 2510 2511 #endif -
src/ops.c
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; -
src/option.c
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 #endif5236 #if defined(FEAT_EVAL)5237 5237 # if defined(FEAT_CINDENT) 5238 5238 case PV_INDE: return &curbuf->b_p_inde_flags; 5239 5239 # endif … … 6325 6325 else 6326 6326 errmsg = check_stl_option(p_ruf); 6327 6327 } 6328 else 6328 /* check 'statusline' only if it doesn't start with "%!" */ 6329 else if (varp != &p_stl || s[0] != '%' || s[1] != '!') 6329 6330 errmsg = check_stl_option(s); 6330 6331 if (varp == &p_ruf && errmsg == NULL) 6331 6332 comp_col(); -
src/os_unix.c
diff -Naur vim70.orig/src/os_unix.c vim70/src/os_unix.c
old new 4971 4971 if (((*file)[*num_file] = alloc(len + 2)) != NULL) 4972 4972 { 4973 4973 STRCPY((*file)[*num_file], p); 4974 if (!after_pathsep((*file)[*num_file] + len)) 4974 if (!after_pathsep((*file)[*num_file], 4975 (*file)[*num_file] + len)) 4975 4976 { 4976 4977 (*file)[*num_file][len] = psepc; 4977 4978 (*file)[*num_file][len + 1] = NUL; … … 5757 5758 int retval_int = 0; 5758 5759 int success = FALSE; 5759 5760 5760 /* Get a handle to the DLL module. */ 5761 /* 5762 * Get a handle to the DLL module. 5763 */ 5761 5764 # if defined(USE_DLOPEN) 5765 /* First clear any error, it's not cleared by the dlopen() call. */ 5766 (void)dlerror(); 5767 5762 5768 hinstLib = dlopen((char *)libname, RTLD_LAZY 5763 5769 # ifdef RTLD_LOCAL 5764 5770 | RTLD_LOCAL -
src/popupmnu.c
diff -Naur vim70.orig/src/popupmnu.c vim70/src/popupmnu.c
old new 552 552 { 553 553 pum_array = NULL; 554 554 redraw_all_later(SOME_VALID); 555 #ifdef FEAT_WINDOWS 556 redraw_tabline = TRUE; 557 #endif 555 558 status_redraw_all(); 556 559 } 557 560 -
src/proto/menu.pro
diff -Naur vim70.orig/src/proto/menu.pro vim70/src/proto/menu.pro
old new 10 10 extern int menu_is_child_of_popup __ARGS((vimmenu_T *menu)); 11 11 extern int menu_is_toolbar __ARGS((char_u *name)); 12 12 extern int menu_is_separator __ARGS((char_u *name)); 13 extern int check_menu_pointer __ARGS((vimmenu_T *root, vimmenu_T *menu_to_check)); 13 14 extern void gui_create_initial_menus __ARGS((vimmenu_T *menu)); 14 15 extern void gui_update_menus __ARGS((int modes)); 15 16 extern int gui_is_menu_shortcut __ARGS((int key)); -
src/proto/undo.pro
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)); -
src/quickfix.c
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; … … 2429 2463 qf_info_T *qi; 2430 2464 { 2431 2465 buf_T *buf; 2432 #ifdef FEAT_AUTOCMD2433 2466 aco_save_T aco; 2434 #else2435 buf_T *save_curbuf;2436 #endif2437 2467 2438 2468 /* Check if a buffer for the quickfix list exists. Update it. */ 2439 2469 buf = qf_find_buf(qi); 2440 2470 if (buf != NULL) 2441 2471 { 2442 #ifdef FEAT_AUTOCMD2443 2472 /* set curwin/curbuf to buf and save a few things */ 2444 2473 aucmd_prepbuf(&aco, buf); 2445 #else2446 save_curbuf = curbuf;2447 curbuf = buf;2448 #endif2449 2474 2450 2475 qf_fill_buffer(qi); 2451 2476 2452 #ifdef FEAT_AUTOCMD2453 2477 /* restore curwin/curbuf and a few other things */ 2454 2478 aucmd_restbuf(&aco); 2455 #else2456 curbuf = save_curbuf;2457 #endif2458 2479 2459 2480 (void)qf_win_pos_update(qi, 0); 2460 2481 } … … 2943 2964 #if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL) 2944 2965 char_u *save_ei = NULL; 2945 2966 #endif 2946 #ifndef FEAT_AUTOCMD2947 buf_T *save_curbuf;2948 #else2949 2967 aco_save_T aco; 2968 #ifdef FEAT_AUTOCMD 2950 2969 char_u *au_name = NULL; 2951 2970 int flags = 0; 2952 2971 colnr_T col; … … 3167 3186 * need to be done now, in that buffer. And the modelines 3168 3187 * need to be done (again). But not the window-local 3169 3188 * options! */ 3170 #if defined(FEAT_AUTOCMD)3171 3189 aucmd_prepbuf(&aco, buf); 3172 #else3173 save_curbuf = curbuf;3174 curbuf = buf;3175 curwin->w_buffer = curbuf;3176 #endif3177 3190 #if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL) 3178 3191 apply_autocmds(EVENT_FILETYPE, buf->b_p_ft, 3179 3192 buf->b_fname, TRUE, buf); 3180 3193 #endif 3181 3194 do_modelines(OPT_NOWIN); 3182 #if defined(FEAT_AUTOCMD)3183 3195 aucmd_restbuf(&aco); 3184 #else3185 curbuf = save_curbuf;3186 curwin->w_buffer = curbuf;3187 #endif3188 3196 } 3189 3197 } 3190 3198 } … … 3285 3293 { 3286 3294 buf_T *newbuf; 3287 3295 int failed = TRUE; 3288 #ifdef FEAT_AUTOCMD3289 3296 aco_save_T aco; 3290 #else3291 buf_T *old_curbuf = curbuf;3292 #endif3293 3297 3294 3298 /* Allocate a buffer without putting it in the buffer list. */ 3295 3299 newbuf = buflist_new(NULL, NULL, (linenr_T)1, BLN_DUMMY); … … 3299 3303 /* Init the options. */ 3300 3304 buf_copy_options(newbuf, BCO_ENTER | BCO_NOHELP); 3301 3305 3302 #ifdef FEAT_AUTOCMD3303 3306 /* set curwin/curbuf to buf and save a few things */ 3304 3307 aucmd_prepbuf(&aco, newbuf); 3305 #else3306 curbuf = newbuf;3307 curwin->w_buffer = newbuf;3308 #endif3309 3308 3310 3309 /* Need to set the filename for autocommands. */ 3311 3310 (void)setfname(curbuf, fname, NULL, FALSE); … … 3336 3335 } 3337 3336 } 3338 3337 3339 #ifdef FEAT_AUTOCMD3340 3338 /* restore curwin/curbuf and a few other things */ 3341 3339 aucmd_restbuf(&aco); 3342 #else3343 curbuf = old_curbuf;3344 curwin->w_buffer = old_curbuf;3345 #endif3346 3340 3347 3341 if (!buf_valid(newbuf)) 3348 3342 return NULL; -
src/screen.c
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_ATTR4128 4125 line_attr != 0 4129 # endif4130 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) -
src/spell.c
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); -
src/structs.h
diff -Naur vim70.orig/src/structs.h vim70/src/structs.h
old new 2213 2213 2214 2214 /* 2215 2215 * Struct to save values in before executing autocommands for a buffer that is 2216 * not the current buffer. 2216 * not the current buffer. Without FEAT_AUTOCMD only "curbuf" is remembered. 2217 2217 */ 2218 2218 typedef struct 2219 2219 { 2220 2220 buf_T *save_buf; /* saved curbuf */ 2221 #ifdef FEAT_AUTOCMD 2221 2222 buf_T *new_curbuf; /* buffer to be used */ 2222 2223 win_T *save_curwin; /* saved curwin, NULL if it didn't change */ 2223 2224 win_T *new_curwin; /* new curwin if save_curwin != NULL */ 2224 2225 pos_T save_cursor; /* saved cursor pos of save_curwin */ 2225 2226 linenr_T save_topline; /* saved topline of save_curwin */ 2226 # ifdef FEAT_DIFF2227 # ifdef FEAT_DIFF 2227 2228 int save_topfill; /* saved topfill of save_curwin */ 2229 # endif 2228 2230 #endif 2229 2231 } aco_save_T; 2230 2232 -
src/term.c
diff -Naur vim70.orig/src/term.c vim70/src/term.c
old new 4783 4783 return -1; 4784 4784 current_menu = (vimmenu_T *)val; 4785 4785 slen += num_bytes; 4786 4787 /* The menu may have been deleted right after it was used, check 4788 * for that. */ 4789 if (check_menu_pointer(root_menu, current_menu) == FAIL) 4790 { 4791 key_name[0] = KS_EXTRA; 4792 key_name[1] = (int)KE_IGNORE; 4793 } 4786 4794 } 4787 4795 # endif 4788 4796 # ifdef FEAT_GUI_TABLINE -
src/undo.c
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 staticint198 int 200 199 undo_allowed() 201 200 { 202 201 /* Don't allow changes when 'modifiable' is off. */ -
src/version.c
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 66, 671 /**/ 672 64, 673 /**/ 674 63, 675 /**/ 676 62, 677 /**/ 678 61, 679 /**/ 680 60, 681 /**/ 682 59, 683 /**/ 684 58, 685 /**/ 686 56, 687 /**/ 688 55, 689 /**/ 690 54, 691 /**/ 692 53, 693 /**/ 694 52, 695 /**/ 696 51, 697 /**/ 698 50, 699 /**/ 700 49, 701 /**/ 702 48, 703 /**/ 704 47, 705 /**/ 706 46, 707 /**/ 708 44, 709 /**/ 710 43, 711 /**/ 712 42, 713 /**/ 714 41, 715 /**/ 716 40, 717 /**/ 718 39, 719 /**/ 720 38, 721 /**/ 722 37, 723 /**/ 724 36, 725 /**/ 726 35, 727 /**/ 728 34, 729 /**/ 730 33, 731 /**/ 732 31, 733 /**/ 734 30, 735 /**/ 736 29, 737 /**/ 738 28, 739 /**/ 740 26, 741 /**/ 742 25, 743 /**/ 744 24, 745 /**/ 746 23, 747 /**/ 748 22, 749 /**/ 750 21, 751 /**/ 752 20, 753 /**/ 754 19, 755 /**/ 756 18, 757 /**/ 758 17, 759 /**/ 760 16, 761 /**/ 762 15, 763 /**/ 764 14, 765 /**/ 766 13, 767 /**/ 768 12, 769 /**/ 770 11, 771 /**/ 772 10, 773 /**/ 774 9, 775 /**/ 776 8, 777 /**/ 778 7, 779 /**/ 780 6, 781 /**/ 782 4, 783 /**/ 784 3, 785 /**/ 786 2, 787 /**/ 788 1, 789 /**/ 670 790 0 671 791 }; 672 792 -
src/vim.h
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) … … 1983 1985 /* values for vim_handle_signal() that are not a signal */ 1984 1986 #define SIGNAL_BLOCK -1 1985 1987 #define SIGNAL_UNBLOCK -2 1986 #if !defined(UNIX) && !defined(VMS) 1988 #if !defined(UNIX) && !defined(VMS) && !defined(OS2) 1987 1989 # define vim_handle_signal(x) 0 1988 1990 #endif 1989 1991
Note:
See TracBrowser
for help on using the repository browser.