source:
patches/vim-7.2-branch_update-1.patch@
f5a13b5e
Last change on this file since f5a13b5e was e8e6c4e, checked in by , 16 years ago | |
---|---|
|
|
File size: 18.4 KB |
-
runtime/scripts.vim
Submitted By: Joe Ciccone <jciccone@gmail.com> Date: 2008-09-13 Initial Package Version: 7.2 Origin: Upstream Upstream Status: Applied Description: Contains all upstream patches up to 7.2.015 The following patches were skipped 007 diff -Naur vim72.orig/runtime/scripts.vim vim72/runtime/scripts.vim
old new 234 234 elseif s:line1 =~ '\<DTD\s\+XHTML\s' 235 235 set ft=xhtml 236 236 237 " HTML (e.g.: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN") 238 elseif s:line1 =~? '\<DOCTYPE\s\+html\>' 239 set ft=html 240 237 241 " PDF 238 242 elseif s:line1 =~ '^%PDF-' 239 243 set ft=pdf -
src/buffer.c
diff -Naur vim72.orig/src/buffer.c vim72/src/buffer.c
old new 1351 1351 } 1352 1352 } 1353 1353 #ifdef FEAT_AUTOCMD 1354 /* An autocommand may have deleted "buf", already entered it (e.g., when 1355 * it did ":bunload") or aborted the script processing! */ 1354 1356 # ifdef FEAT_EVAL 1355 /* An autocommand may have deleted buf or aborted the script processing! */ 1356 if (buf_valid(buf) && !aborting()) 1357 if (buf_valid(buf) && buf != curbuf && !aborting()) 1357 1358 # else 1358 if (buf_valid(buf) ) /* an autocommand may have deleted buf! */1359 if (buf_valid(buf) && buf != curbuf) 1359 1360 # endif 1360 1361 #endif 1361 1362 enter_buffer(buf); -
src/eval.c
diff -Naur vim72.orig/src/eval.c vim72/src/eval.c
old new 1256 1256 1257 1257 /* 1258 1258 * Top level evaluation function, returning a string. 1259 * When "convert" is TRUE convert a List into a sequence of lines and convert 1260 * a Float to a String. 1259 1261 * Return pointer to allocated memory, or NULL for failure. 1260 1262 */ 1261 1263 char_u * 1262 eval_to_string(arg, nextcmd, dolist)1264 eval_to_string(arg, nextcmd, convert) 1263 1265 char_u *arg; 1264 1266 char_u **nextcmd; 1265 int dolist; /* turn List into sequence of lines */1267 int convert; 1266 1268 { 1267 1269 typval_T tv; 1268 1270 char_u *retval; 1269 1271 garray_T ga; 1272 char_u numbuf[NUMBUFLEN]; 1270 1273 1271 1274 if (eval0(arg, &tv, nextcmd, TRUE) == FAIL) 1272 1275 retval = NULL; 1273 1276 else 1274 1277 { 1275 if ( dolist && tv.v_type == VAR_LIST)1278 if (convert && tv.v_type == VAR_LIST) 1276 1279 { 1277 1280 ga_init2(&ga, (int)sizeof(char), 80); 1278 1281 if (tv.vval.v_list != NULL) … … 1280 1283 ga_append(&ga, NUL); 1281 1284 retval = (char_u *)ga.ga_data; 1282 1285 } 1286 #ifdef FEAT_FLOAT 1287 else if (convert && tv.v_type == VAR_FLOAT) 1288 { 1289 vim_snprintf((char *)numbuf, NUMBUFLEN, "%g", tv.vval.v_float); 1290 retval = vim_strsave(numbuf); 1291 } 1292 #endif 1283 1293 else 1284 1294 retval = vim_strsave(get_tv_string(&tv)); 1285 1295 clear_tv(&tv); … … 3657 3667 } 3658 3668 3659 3669 /* 3660 * Return TRUE if typeval "tv" is locked: Either tha value is locked itself or3661 * it refers to a List or Dictionary that is locked.3670 * Return TRUE if typeval "tv" is locked: Either that value is locked itself 3671 * or it refers to a List or Dictionary that is locked. 3662 3672 */ 3663 3673 static int 3664 3674 tv_islocked(tv) … … 15838 15848 if (res == FAIL) 15839 15849 res = ITEM_COMPARE_FAIL; 15840 15850 else 15841 /* return value has wrong type */15842 15851 res = get_tv_number_chk(&rettv, &item_compare_func_err); 15843 15852 if (item_compare_func_err) 15844 res = ITEM_COMPARE_FAIL; 15853 res = ITEM_COMPARE_FAIL; /* return value has wrong type */ 15845 15854 clear_tv(&rettv); 15846 15855 return res; 15847 15856 } … … 16658 16667 col = get_tv_number(&argvars[1]) - 1; /* -1 on type error */ 16659 16668 16660 16669 if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count 16661 && col >= 0 && col < (long)STRLEN(ml_get(lnum))16670 && col >= 0 && (col == 0 || col < (long)STRLEN(ml_get(lnum))) 16662 16671 && rettv_list_alloc(rettv) != FAIL) 16663 16672 { 16664 16673 (void)syn_get_id(curwin, lnum, (colnr_T)col, FALSE, NULL, TRUE); … … 20590 20599 int st_len = 0; 20591 20600 20592 20601 todo = (int)func_hashtab.ht_used; 20602 if (todo == 0) 20603 return; /* nothing to dump */ 20604 20593 20605 sorttab = (ufunc_T **)alloc((unsigned)(sizeof(ufunc_T) * todo)); 20594 20606 20595 20607 for (hi = func_hashtab.ht_array; todo > 0; ++hi) … … 20638 20650 prof_self_cmp); 20639 20651 prof_sort_list(fd, sorttab, st_len, "SELF", TRUE); 20640 20652 } 20653 20654 vim_free(sorttab); 20641 20655 } 20642 20656 20643 20657 static void … … 21204 21218 if (!fp->uf_profiling && has_profiling(FALSE, fp->uf_name, NULL)) 21205 21219 func_do_profile(fp); 21206 21220 if (fp->uf_profiling 21207 || (fc.caller != NULL && &fc.caller->func->uf_profiling))21221 || (fc.caller != NULL && fc.caller->func->uf_profiling)) 21208 21222 { 21209 21223 ++fp->uf_tm_count; 21210 21224 profile_start(&call_start); … … 21235 21249 21236 21250 #ifdef FEAT_PROFILE 21237 21251 if (do_profiling == PROF_YES && (fp->uf_profiling 21238 || (fc.caller != NULL && &fc.caller->func->uf_profiling)))21252 || (fc.caller != NULL && fc.caller->func->uf_profiling))) 21239 21253 { 21240 21254 profile_end(&call_start); 21241 21255 profile_sub_wait(&wait_start, &call_start); 21242 21256 profile_add(&fp->uf_tm_total, &call_start); 21243 21257 profile_self(&fp->uf_tm_self, &call_start, &fp->uf_tm_children); 21244 if (fc.caller != NULL && &fc.caller->func->uf_profiling)21258 if (fc.caller != NULL && fc.caller->func->uf_profiling) 21245 21259 { 21246 21260 profile_add(&fc.caller->func->uf_tm_children, &call_start); 21247 21261 profile_add(&fc.caller->func->uf_tml_children, &call_start); -
src/ex_cmds2.c
diff -Naur vim72.orig/src/ex_cmds2.c vim72/src/ex_cmds2.c
old new 3145 3145 verbose_leave(); 3146 3146 } 3147 3147 #ifdef STARTUPTIME 3148 vim_snprintf( IObuff, IOSIZE, "sourcing %s", fname);3149 time_msg( IObuff, &tv_start);3148 vim_snprintf((char *)IObuff, IOSIZE, "sourcing %s", fname); 3149 time_msg((char *)IObuff, &tv_start); 3150 3150 time_pop(&tv_rel); 3151 3151 #endif 3152 3152 -
src/if_cscope.c
diff -Naur vim72.orig/src/if_cscope.c vim72/src/if_cscope.c
old new 74 74 { "add", cs_add, 75 75 N_("Add a new database"), "add file|dir [pre-path] [flags]", 0 }, 76 76 { "find", cs_find, 77 N_("Query for a pattern"), FIND_USAGE, 1 },77 N_("Query for a pattern"), "find c|d|e|f|g|i|s|t name", 1 }, 78 78 { "help", cs_help, 79 79 N_("Show this message"), "help", 0 }, 80 80 { "kill", cs_kill, … … 1180 1180 (void)smsg((char_u *)_("%-5s: %-30s (Usage: %s)"), 1181 1181 cmdp->name, _(cmdp->help), cmdp->usage); 1182 1182 if (strcmp(cmdp->name, "find") == 0) 1183 MSG_PUTS(FIND_HELP); 1183 MSG_PUTS(_("\n" 1184 " c: Find functions calling this function\n" 1185 " d: Find functions called by this function\n" 1186 " e: Find this egrep pattern\n" 1187 " f: Find this file\n" 1188 " g: Find this definition\n" 1189 " i: Find files #including this file\n" 1190 " s: Find this C symbol\n" 1191 " t: Find assignments to\n")); 1192 1184 1193 cmdp++; 1185 1194 } 1186 1195 -
src/if_cscope.h
diff -Naur vim72.orig/src/if_cscope.h vim72/src/if_cscope.h
old new 42 42 * f 7name Find this file 43 43 * i 8name Find files #including this file 44 44 */ 45 #define FIND_USAGE "find c|d|e|f|g|i|s|t name"46 #define FIND_HELP "\n\47 c: Find functions calling this function\n\48 d: Find functions called by this function\n\49 e: Find this egrep pattern\n\50 f: Find this file\n\51 g: Find this definition\n\52 i: Find files #including this file\n\53 s: Find this C symbol\n\54 t: Find assignments to\n"55 56 45 57 46 typedef struct { 58 47 char * name; -
src/if_perl.xs
diff -Naur vim72.orig/src/if_perl.xs vim72/src/if_perl.xs
old new 136 136 # define Perl_newXS_flags dll_Perl_newXS_flags 137 137 #endif 138 138 # define Perl_sv_free dll_Perl_sv_free 139 # if (PERL_REVISION == 5) && (PERL_VERSION >= 10) 140 # define Perl_sv_free2 dll_Perl_sv_free2 141 # endif 139 142 # define Perl_sv_isa dll_Perl_sv_isa 140 143 # define Perl_sv_magic dll_Perl_sv_magic 141 144 # define Perl_sv_setiv dll_Perl_sv_setiv … … 268 271 static void (*boot_DynaLoader)_((pTHX_ CV*)); 269 272 270 273 #if (PERL_REVISION == 5) && (PERL_VERSION >= 10) 274 static void (*Perl_sv_free2)(pTHX_ SV*); 271 275 static void (*Perl_sys_init3)(int* argc, char*** argv, char*** env); 272 276 static void (*Perl_sys_term)(void); 273 277 static SV** (*Perl_ISv_ptr)(register PerlInterpreter*); … … 367 371 {"Perl_TXpv_ptr", (PERL_PROC*)&Perl_TXpv_ptr}, 368 372 {"Perl_Tna_ptr", (PERL_PROC*)&Perl_Tna_ptr}, 369 373 #else 374 {"Perl_sv_free2", (PERL_PROC*)&Perl_sv_free2}, 370 375 {"Perl_sys_init3", (PERL_PROC*)&Perl_sys_init3}, 371 376 {"Perl_sys_term", (PERL_PROC*)&Perl_sys_term}, 372 377 {"Perl_ISv_ptr", (PERL_PROC*)&Perl_ISv_ptr}, -
src/mbyte.c
diff -Naur vim72.orig/src/mbyte.c vim72/src/mbyte.c
old new 2540 2540 return (int)(p - q); 2541 2541 } 2542 2542 2543 #if defined(FEAT_EVAL) || defined(PROTO)2544 2543 /* 2545 2544 * Copy a character from "*fp" to "*tp" and advance the pointers. 2546 2545 */ … … 2555 2554 *tp += l; 2556 2555 *fp += l; 2557 2556 } 2558 #endif2559 2557 2560 2558 /* 2561 2559 * Return the offset from "p" to the first byte of a character. When "p" is -
src/menu.c
diff -Naur vim72.orig/src/menu.c vim72/src/menu.c
old new 1120 1120 parent = menu; 1121 1121 menu = menu->children; 1122 1122 } 1123 vim_free(path_name); 1123 1124 1124 1125 /* Now we have found the matching menu, and we list the mappings */ 1125 1126 /* Highlight title */ -
src/misc2.c
diff -Naur vim72.orig/src/misc2.c vim72/src/misc2.c
old new 1257 1257 return escaped_string; 1258 1258 } 1259 1259 1260 #if !defined(BACKSLASH_IN_FILENAME) || defined(FEAT_EVAL) || defined(PROTO)1261 1260 /* 1262 1261 * Return TRUE when 'shell' has "csh" in the tail. 1263 1262 */ … … 1266 1265 { 1267 1266 return (strstr((char *)gettail(p_sh), "csh") != NULL); 1268 1267 } 1269 #endif1270 1268 1271 #if defined(FEAT_EVAL) || defined(PROTO)1272 1269 /* 1273 1270 * Escape "string" for use as a shell argument with system(). 1274 1271 * This uses single quotes, except when we know we need to use double qoutes … … 1391 1388 1392 1389 return escaped_string; 1393 1390 } 1394 #endif1395 1391 1396 1392 /* 1397 1393 * Like vim_strsave(), but make all characters uppercase. -
src/normal.c
diff -Naur vim72.orig/src/normal.c vim72/src/normal.c
old new 5469 5469 STRCPY(buf, "he! "); 5470 5470 else 5471 5471 { 5472 /* An external command will probably use an argument starting 5473 * with "-" as an option. To avoid trouble we skip the "-". */ 5474 while (*ptr == '-') 5475 ++ptr; 5476 5472 5477 /* When a count is given, turn it into a range. Is this 5473 5478 * really what we want? */ 5474 5479 isman = (STRCMP(kp, "man") == 0); … … 5511 5516 /* 5512 5517 * Now grab the chars in the identifier 5513 5518 */ 5514 if (cmdchar == '*') 5515 aux_ptr = (char_u *)(p_magic ? "/.*~[^$\\" : "/^$\\"); 5516 else if (cmdchar == '#') 5517 aux_ptr = (char_u *)(p_magic ? "/?.*~[^$\\" : "/?^$\\"); 5518 else if (cmdchar == 'K' && !kp_help) 5519 aux_ptr = (char_u *)" \t\\\"|!"; 5520 else 5521 /* Don't escape spaces and Tabs in a tag with a backslash */ 5522 aux_ptr = (char_u *)"\\|\""; 5523 5524 p = buf + STRLEN(buf); 5525 while (n-- > 0) 5526 { 5527 /* put a backslash before \ and some others */ 5528 if (vim_strchr(aux_ptr, *ptr) != NULL) 5529 *p++ = '\\'; 5530 #ifdef FEAT_MBYTE 5531 /* When current byte is a part of multibyte character, copy all bytes 5532 * of that character. */ 5533 if (has_mbyte) 5519 if (cmdchar == 'K' && !kp_help) 5520 { 5521 /* Escape the argument properly for a shell command */ 5522 p = vim_strsave_shellescape(ptr, TRUE); 5523 if (p == NULL) 5534 5524 { 5535 int i; 5536 int len = (*mb_ptr2len)(ptr) - 1; 5537 5538 for (i = 0; i < len && n >= 1; ++i, --n) 5539 *p++ = *ptr++; 5525 vim_free(buf); 5526 return; 5540 5527 } 5528 buf = (char_u *)vim_realloc(buf, STRLEN(buf) + STRLEN(p) + 1); 5529 if (buf == NULL) 5530 { 5531 vim_free(buf); 5532 vim_free(p); 5533 return; 5534 } 5535 STRCAT(buf, p); 5536 vim_free(p); 5537 } 5538 else 5539 { 5540 if (cmdchar == '*') 5541 aux_ptr = (char_u *)(p_magic ? "/.*~[^$\\" : "/^$\\"); 5542 else if (cmdchar == '#') 5543 aux_ptr = (char_u *)(p_magic ? "/?.*~[^$\\" : "/?^$\\"); 5544 else 5545 /* Don't escape spaces and Tabs in a tag with a backslash */ 5546 aux_ptr = (char_u *)"\\|\"\n*?["; 5547 5548 p = buf + STRLEN(buf); 5549 while (n-- > 0) 5550 { 5551 /* put a backslash before \ and some others */ 5552 if (vim_strchr(aux_ptr, *ptr) != NULL) 5553 *p++ = '\\'; 5554 #ifdef FEAT_MBYTE 5555 /* When current byte is a part of multibyte character, copy all 5556 * bytes of that character. */ 5557 if (has_mbyte) 5558 { 5559 int i; 5560 int len = (*mb_ptr2len)(ptr) - 1; 5561 5562 for (i = 0; i < len && n >= 1; ++i, --n) 5563 *p++ = *ptr++; 5564 } 5541 5565 #endif 5542 *p++ = *ptr++; 5566 *p++ = *ptr++; 5567 } 5568 *p = NUL; 5543 5569 } 5544 *p = NUL;5545 5570 5546 5571 /* 5547 5572 * Execute the command. -
src/pty.c
diff -Naur vim72.orig/src/pty.c vim72/src/pty.c
old new 270 270 } 271 271 #endif 272 272 273 #if defined(HAVE_SVR4_PTYS) && !defined(PTY_DONE) && !defined(hpux) 273 #if defined(HAVE_SVR4_PTYS) && !defined(PTY_DONE) && !defined(hpux) && !defined(MACOS_X) 274 274 275 /* NOTE: Even though HPUX can have /dev/ptmx, the code below doesn't work! */ 275 /* NOTE: Even though HPUX can have /dev/ptmx, the code below doesn't work! 276 * Same for Mac OS X Leopard. */ 276 277 #define PTY_DONE 277 278 int 278 279 OpenPTY(ttyn) -
src/spell.c
diff -Naur vim72.orig/src/spell.c vim72/src/spell.c
old new 77 77 78 78 /* 79 79 * Do the opposite: based on a maximum end score and a known sound score, 80 * compute the themaximum word score that can be used.80 * compute the maximum word score that can be used. 81 81 */ 82 82 #define MAXSCORE(word_score, sound_score) ((4 * word_score - sound_score) / 3) 83 83 … … 625 625 /* TRUE if a word appears in the list of banned words. */ 626 626 #define WAS_BANNED(su, word) (!HASHITEM_EMPTY(hash_find(&su->su_banned, word))) 627 627 628 /* Number of suggestions kept when cleaning up. we need to keep more than628 /* Number of suggestions kept when cleaning up. We need to keep more than 629 629 * what is displayed, because when rescore_suggestions() is called the score 630 630 * may change and wrong suggestions may be removed later. */ 631 631 #define SUG_CLEAN_COUNT(su) ((su)->su_maxcount < 130 ? 150 : (su)->su_maxcount + 20) … … 5980 5980 else if (spin->si_newprefID == 0 || spin->si_newprefID == 127) 5981 5981 MSG(_("Too many compound flags")); 5982 5982 else 5983 MSG(_("Too many pos poned prefixes and/or compound flags"));5983 MSG(_("Too many postponed prefixes and/or compound flags")); 5984 5984 } 5985 5985 5986 5986 if (syllable != NULL) -
src/testdir/Makefile
diff -Naur vim72.orig/src/testdir/Makefile vim72/src/testdir/Makefile
old new 26 26 27 27 .SUFFIXES: .in .out 28 28 29 nongui: nolog $(SCRIPTS) 30 @echo 31 @cat test.log 32 @echo ALL DONE 29 nongui: nolog $(SCRIPTS) report 30 31 gui: nolog $(SCRIPTS) $(SCRIPTS_GUI) report 33 32 34 gui: nolog $(SCRIPTS) $(SCRIPTS_GUI) 33 report: 35 34 @echo 36 @cat test.log 37 @echo ALL DONE 35 @echo 'Test results:' 36 @/bin/sh -c "if test -f test.log; \ 37 then cat test.log; echo TEST FAILURE; exit 1; \ 38 else echo ALL DONE; \ 39 fi" 38 40 39 41 $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG) 40 42 … … 71 73 test60.out: test60.vim 72 74 73 75 nolog: 74 - echo Test results: >test.log76 -rm -f test.log -
src/ui.c
diff -Naur vim72.orig/src/ui.c vim72/src/ui.c
old new 2110 2110 int i; 2111 2111 int nbytes = 0; 2112 2112 char_u *buffer; 2113 time_t start_time; 2114 int timed_out = FALSE; 2113 2115 2114 2116 for (i = 2115 2117 #ifdef FEAT_MBYTE … … 2129 2131 case 3: type = text_atom; break; 2130 2132 default: type = XA_STRING; 2131 2133 } 2134 success = FALSE; 2132 2135 XtGetSelectionValue(myShell, cbd->sel_atom, type, 2133 2136 clip_x11_request_selection_cb, (XtPointer)&success, CurrentTime); 2134 2137 … … 2141 2144 * characters, then they will appear before the one that requested the 2142 2145 * paste! Don't worry, we will catch up with any other events later. 2143 2146 */ 2147 start_time = time(NULL); 2144 2148 for (;;) 2145 2149 { 2146 2150 if (XCheckTypedEvent(dpy, SelectionNotify, &event)) 2151 { 2152 /* this is where clip_x11_request_selection_cb() is actually 2153 * called */ 2154 XtDispatchEvent(&event); 2147 2155 break; 2156 } 2148 2157 if (XCheckTypedEvent(dpy, SelectionRequest, &event)) 2149 2158 /* We may get a SelectionRequest here and if we don't handle 2150 2159 * it we hang. KDE klipper does this, for example. */ 2151 2160 XtDispatchEvent(&event); 2152 2161 2162 /* Time out after 2 to 3 seconds to avoid that we hang when the 2163 * other process doesn't respond. Note that the SelectionNotify 2164 * event may still come later when the selection owner comes back 2165 * to life and the text gets inserted unexpectedly (by xterm). 2166 * Don't know how to avoid that :-(. */ 2167 if (time(NULL) > start_time + 2) 2168 { 2169 timed_out = TRUE; 2170 break; 2171 } 2172 2153 2173 /* Do we need this? Probably not. */ 2154 2174 XSync(dpy, False); 2155 2175 2156 /* Bernhard Walle solved a slow paste response in an X terminal by2157 * adding: usleep(10000); here. */2176 /* Wait for 1 msec to avoid that we eat up all CPU time. */ 2177 ui_delay(1L, TRUE); 2158 2178 } 2159 2179 2160 /* this is where clip_x11_request_selection_cb() is actually called */2161 XtDispatchEvent(&event);2162 2163 2180 if (success) 2164 2181 return; 2182 2183 /* don't do a retry with another type after timing out, otherwise we 2184 * hang for 15 seconds. */ 2185 if (timed_out) 2186 break; 2165 2187 } 2166 2188 2167 2189 /* Final fallback position - use the X CUT_BUFFER0 store */ -
src/version.c
diff -Naur vim72.orig/src/version.c vim72/src/version.c
old new 677 677 static int included_patches[] = 678 678 { /* Add new patch number below this line */ 679 679 /**/ 680 15, 681 /**/ 682 14, 683 /**/ 684 13, 685 /**/ 686 12, 687 /**/ 688 11, 689 /**/ 690 10, 691 /**/ 692 9, 693 /**/ 694 8, 695 /**/ 696 6, 697 /**/ 698 5, 699 /**/ 700 4, 701 /**/ 702 3, 703 /**/ 704 2, 705 /**/ 706 1, 707 /**/ 680 708 0 681 709 }; 682 710 … … 786 814 MSG_PUTS(_("\nRISC OS version")); 787 815 #endif 788 816 #ifdef VMS 789 MSG_PUTS( "\nOpenVMS version");817 MSG_PUTS(_("\nOpenVMS version")); 790 818 # ifdef HAVE_PATHDEF 791 819 if (*compiled_arch != NUL) 792 820 {
Note:
See TracBrowser
for help on using the repository browser.