- Timestamp:
- Mar 15, 2009, 12:15:17 PM (16 years ago)
- Branches:
- master
- Children:
- 6f50e7b
- Parents:
- 35f9c2f
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
patches/vim-7.2-branch_update-11.patch
r35f9c2f r2893698 1 1 Submitted By: Jim Gifford (jim at cross-lfs dot org) 2 Date: 0 1-19-20092 Date: 03-12-2009 3 3 Initial Package Version: 7.2 4 4 Origin: Upstream 5 5 Upstream Status: Applied 6 Description: Contains all upstream patches up to 7.2. 0846 Description: Contains all upstream patches up to 7.2.141 7 7 The following patches were skipped 8 007 036 041 049 071 072 074 8 007 036 041 049 071 072 074 088 089 093 101 138 9 9 10 10 diff -Naur vim72.orig/Filelist vim72/Filelist 11 11 --- vim72.orig/Filelist 2008-07-06 11:02:23.000000000 -0700 12 +++ vim72/Filelist 2009-0 1-19 00:08:05.000000000 -080012 +++ vim72/Filelist 2009-03-12 11:54:40.397486521 -0700 13 13 @@ -285,6 +285,7 @@ 14 14 src/proto/os_win32.pro \ … … 21 21 diff -Naur vim72.orig/runtime/doc/cmdline.txt vim72/runtime/doc/cmdline.txt 22 22 --- vim72.orig/runtime/doc/cmdline.txt 2008-08-09 07:22:59.000000000 -0700 23 +++ vim72/runtime/doc/cmdline.txt 2009-0 1-19 00:08:30.000000000 -080023 +++ vim72/runtime/doc/cmdline.txt 2009-03-12 11:54:40.529493784 -0700 24 24 @@ -1,4 +1,4 @@ 25 25 -*cmdline.txt* For Vim version 7.2. Last change: 2008 Jul 29 … … 80 80 diff -Naur vim72.orig/runtime/doc/eval.txt vim72/runtime/doc/eval.txt 81 81 --- vim72.orig/runtime/doc/eval.txt 2008-08-09 07:22:59.000000000 -0700 82 +++ vim72/runtime/doc/eval.txt 2009-0 1-19 00:10:10.000000000 -080082 +++ vim72/runtime/doc/eval.txt 2009-03-12 11:54:50.318122364 -0700 83 83 @@ -1,4 +1,4 @@ 84 84 -*eval.txt* For Vim version 7.2. Last change: 2008 Aug 09 … … 200 200 diff -Naur vim72.orig/runtime/doc/netbeans.txt vim72/runtime/doc/netbeans.txt 201 201 --- vim72.orig/runtime/doc/netbeans.txt 2008-08-09 07:22:59.000000000 -0700 202 +++ vim72/runtime/doc/netbeans.txt 2009-0 1-19 00:10:45.000000000 -0800202 +++ vim72/runtime/doc/netbeans.txt 2009-03-12 11:54:59.850731108 -0700 203 203 @@ -1,4 +1,4 @@ 204 204 -*netbeans.txt* For Vim version 7.2. Last change: 2008 Jun 28 … … 222 222 diff -Naur vim72.orig/runtime/doc/options.txt vim72/runtime/doc/options.txt 223 223 --- vim72.orig/runtime/doc/options.txt 2008-08-09 07:22:59.000000000 -0700 224 +++ vim72/runtime/doc/options.txt 2009-0 1-19 00:09:28.000000000 -0800224 +++ vim72/runtime/doc/options.txt 2009-03-12 11:55:13.407601900 -0700 225 225 @@ -1,4 +1,4 @@ 226 226 -*options.txt* For Vim version 7.2. Last change: 2008 Aug 06 … … 229 229 230 230 VIM REFERENCE MANUAL by Bram Moolenaar 231 @@ -7472,7 +7472,9 @@ 231 @@ -4175,9 +4175,6 @@ 232 be able to execute Normal mode commands. 233 This is the opposite of the 'keymap' option, where characters are 234 mapped in Insert mode. 235 - This only works for 8-bit characters. The value of 'langmap' may be 236 - specified with multi-byte characters (e.g., UTF-8), but only the lower 237 - 8 bits of each character will be used. 238 239 Example (for Greek, in UTF-8): *greek* > 240 :set langmap=ÎA,ÎB,ΚC,ÎD,ÎE,ΊF,ÎG,ÎH,ÎI,ÎJ,ÎK,ÎL,ÎM,ÎN,ÎO,Î P,QQ,ΡR,ΣS,΀T,ÎU,ΩV,WW,ΧX,Î¥Y,ÎZ,αa,βb,Ïc,ÎŽd,εe,Ïf,γg,ηh,ιi,Οj,κk,λl,ÎŒm,Îœn,οo,Ïp,qq,Ïr,Ïs,Ït,Ξu,Ïv,Ïw,Ïx,Ï 241 y,ζz 242 @@ -7472,7 +7469,9 @@ 232 243 {not available when compiled without the |+wildignore| 233 244 feature} … … 242 253 diff -Naur vim72.orig/runtime/doc/spell.txt vim72/runtime/doc/spell.txt 243 254 --- vim72.orig/runtime/doc/spell.txt 2008-08-09 07:23:00.000000000 -0700 244 +++ vim72/runtime/doc/spell.txt 2009-0 1-19 00:09:54.000000000 -0800255 +++ vim72/runtime/doc/spell.txt 2009-03-12 11:54:50.218113983 -0700 245 256 @@ -1,4 +1,4 @@ 246 257 -*spell.txt* For Vim version 7.2. Last change: 2008 Jun 21 … … 372 383 diff -Naur vim72.orig/runtime/doc/starting.txt vim72/runtime/doc/starting.txt 373 384 --- vim72.orig/runtime/doc/starting.txt 2008-08-09 07:23:00.000000000 -0700 374 +++ vim72/runtime/doc/starting.txt 2009-0 1-19 00:08:31.000000000 -0800385 +++ vim72/runtime/doc/starting.txt 2009-03-12 11:54:40.533495740 -0700 375 386 @@ -1,4 +1,4 @@ 376 387 -*starting.txt* For Vim version 7.2. Last change: 2008 Jun 21 … … 434 445 diff -Naur vim72.orig/runtime/doc/usr_21.txt vim72/runtime/doc/usr_21.txt 435 446 --- vim72.orig/runtime/doc/usr_21.txt 2008-08-09 07:23:01.000000000 -0700 436 +++ vim72/runtime/doc/usr_21.txt 2009-0 1-19 00:08:31.000000000 -0800447 +++ vim72/runtime/doc/usr_21.txt 2009-03-12 11:54:40.533495740 -0700 437 448 @@ -1,4 +1,4 @@ 438 449 -*usr_21.txt* For Vim version 7.2. Last change: 2007 May 01 … … 501 512 diff -Naur vim72.orig/runtime/scripts.vim vim72/runtime/scripts.vim 502 513 --- vim72.orig/runtime/scripts.vim 2008-08-08 15:27:21.000000000 -0700 503 +++ vim72/runtime/scripts.vim 2009-0 1-19 00:07:18.000000000 -0800514 +++ vim72/runtime/scripts.vim 2009-03-12 11:54:28.900750105 -0700 504 515 @@ -234,6 +234,10 @@ 505 516 elseif s:line1 =~ '\<DTD\s\+XHTML\s' … … 515 526 diff -Naur vim72.orig/src/auto/configure vim72/src/auto/configure 516 527 --- vim72.orig/src/auto/configure 2008-07-24 05:40:36.000000000 -0700 517 +++ vim72/src/auto/configure 2009-01-19 00:09:07.000000000 -0800 518 @@ -16819,21 +16819,29 @@ 528 +++ vim72/src/auto/configure 2009-03-12 11:55:13.667618383 -0700 529 @@ -11565,6 +11565,67 @@ 530 531 fi 532 533 +{ $as_echo "$as_me:$LINENO: checking for working volatile" >&5 534 +$as_echo_n "checking for working volatile... " >&6; } 535 +if test "${ac_cv_c_volatile+set}" = set; then 536 + $as_echo_n "(cached) " >&6 537 +else 538 + cat >conftest.$ac_ext <<_ACEOF 539 +/* confdefs.h. */ 540 +_ACEOF 541 +cat confdefs.h >>conftest.$ac_ext 542 +cat >>conftest.$ac_ext <<_ACEOF 543 +/* end confdefs.h. */ 544 + 545 +int 546 +main () 547 +{ 548 + 549 +volatile int x; 550 +int * volatile y = (int *) 0; 551 +return !x && !y; 552 + ; 553 + return 0; 554 +} 555 +_ACEOF 556 +rm -f conftest.$ac_objext 557 +if { (ac_try="$ac_compile" 558 +case "(($ac_try" in 559 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 560 + *) ac_try_echo=$ac_try;; 561 +esac 562 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" 563 +$as_echo "$ac_try_echo") >&5 564 + (eval "$ac_compile") 2>conftest.er1 565 + ac_status=$? 566 + grep -v '^ *+' conftest.er1 >conftest.err 567 + rm -f conftest.er1 568 + cat conftest.err >&5 569 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 570 + (exit $ac_status); } && { 571 + test -z "$ac_c_werror_flag" || 572 + test ! -s conftest.err 573 + } && test -s conftest.$ac_objext; then 574 + ac_cv_c_volatile=yes 575 +else 576 + $as_echo "$as_me: failed program was:" >&5 577 +sed 's/^/| /' conftest.$ac_ext >&5 578 + 579 + ac_cv_c_volatile=no 580 +fi 581 + 582 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 583 +fi 584 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_volatile" >&5 585 +$as_echo "$ac_cv_c_volatile" >&6; } 586 +if test $ac_cv_c_volatile = no; then 587 + 588 +cat >>confdefs.h <<\_ACEOF 589 +#define volatile /**/ 590 +_ACEOF 591 + 592 +fi 593 + 594 { $as_echo "$as_me:$LINENO: checking for mode_t" >&5 595 $as_echo_n "checking for mode_t... " >&6; } 596 if test "${ac_cv_type_mode_t+set}" = set; then 597 @@ -16819,21 +16880,29 @@ 519 598 LDFLAGS="$LDFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc" 520 599 fi … … 556 635 diff -Naur vim72.orig/src/buffer.c vim72/src/buffer.c 557 636 --- vim72.orig/src/buffer.c 2008-08-06 04:00:48.000000000 -0700 558 +++ vim72/src/buffer.c 2009-0 1-19 00:10:45.000000000 -0800637 +++ vim72/src/buffer.c 2009-03-12 11:55:13.507605811 -0700 559 638 @@ -437,10 +437,6 @@ 560 639 return; … … 663 742 if (itemcnt == 0) 664 743 s = out; 665 @@ -5062,7 +5064,7 @@ 744 @@ -5048,7 +5050,8 @@ 745 */ 746 FOR_ALL_TAB_WINDOWS(tp, win) 747 if (win->w_buffer == buf) 748 - break; 749 + goto win_found; 750 +win_found: 751 if (win != NULL && win->w_llist_ref != NULL) 752 return _("[Location List]"); 753 else 754 @@ -5062,7 +5065,7 @@ 666 755 { 667 756 if (buf->b_sfname != NULL) … … 672 761 #endif 673 762 if (buf->b_fname == NULL) 763 diff -Naur vim72.orig/src/config.h.in vim72/src/config.h.in 764 --- vim72.orig/src/config.h.in 2008-06-21 08:01:41.000000000 -0700 765 +++ vim72/src/config.h.in 2009-03-12 11:55:13.667618383 -0700 766 @@ -50,6 +50,9 @@ 767 /* Define to empty if the keyword does not work. */ 768 #undef const 769 770 +/* Define to empty if the keyword does not work. */ 771 +#undef volatile 772 + 773 /* Define to `int' if <sys/types.h> doesn't define. */ 774 #undef mode_t 775 674 776 diff -Naur vim72.orig/src/configure.in vim72/src/configure.in 675 777 --- vim72.orig/src/configure.in 2008-07-24 05:40:26.000000000 -0700 676 +++ vim72/src/configure.in 2009-01-19 00:09:07.000000000 -0800 677 @@ -3152,18 +3152,25 @@ 778 +++ vim72/src/configure.in 2009-03-12 11:55:13.667618383 -0700 779 @@ -2148,6 +2148,7 @@ 780 dnl Checks for typedefs, structures, and compiler characteristics. 781 AC_PROG_GCC_TRADITIONAL 782 AC_C_CONST 783 +AC_C_VOLATILE 784 AC_TYPE_MODE_T 785 AC_TYPE_OFF_T 786 AC_TYPE_PID_T 787 @@ -3152,18 +3153,25 @@ 678 788 dnl But only when making dependencies, cproto and lint don't take "-isystem". 679 789 dnl Mac gcc returns "powerpc-apple-darwin8-gcc-4.0.1 (GCC)...", need to allow … … 709 819 diff -Naur vim72.orig/src/diff.c vim72/src/diff.c 710 820 --- vim72.orig/src/diff.c 2008-03-05 03:16:56.000000000 -0800 711 +++ vim72/src/diff.c 2009-01-19 00:09:50.000000000 -0800 821 +++ vim72/src/diff.c 2009-03-12 11:55:16.155775667 -0700 822 @@ -8,7 +8,7 @@ 823 */ 824 825 /* 826 - * diff.c: code for diff'ing two or three buffers. 827 + * diff.c: code for diff'ing two, three or four buffers. 828 */ 829 830 #include "vim.h" 712 831 @@ -73,6 +73,8 @@ 713 832 { … … 727 846 } 728 847 } 848 @@ -113,7 +116,7 @@ 849 * Add a buffer to make diffs for. 850 * Call this when a new buffer is being edited in the current window where 851 * 'diff' is set. 852 - * Marks the current buffer as being part of the diff and requireing updating. 853 + * Marks the current buffer as being part of the diff and requiring updating. 854 * This must be done before any autocmd, because a command may use info 855 * about the screen contents. 856 */ 729 857 @@ -131,6 +134,7 @@ 730 858 { … … 784 912 diff_a_works = MAYBE; 785 913 #if defined(MSWIN) || defined(MSDOS) 914 @@ -914,7 +929,7 @@ 915 goto theend; 916 917 #ifdef UNIX 918 - /* Temporaraly chdir to /tmp, to avoid patching files in the current 919 + /* Temporarily chdir to /tmp, to avoid patching files in the current 920 * directory when the patch file contains more than one patch. When we 921 * have our own temp dir use that instead, it will be cleaned up when we 922 * exit (any .rej files created). Don't change directory if we can't 786 923 @@ -925,10 +940,10 @@ 787 924 { … … 797 934 } 798 935 #endif 936 @@ -1138,7 +1153,7 @@ 937 938 for (wp = firstwin; wp != NULL; wp = wp->w_next) 939 { 940 - if (wp == curwin || eap->forceit) 941 + if (wp == curwin || (eap->forceit && wp->w_p_diff)) 942 { 943 /* Set 'diff', 'scrollbind' off and 'wrap' on. */ 944 wp->w_p_diff = FALSE; 945 @@ -2114,6 +2129,8 @@ 946 EMSG2(_("E102: Can't find buffer \"%s\""), eap->arg); 947 return; 948 } 949 + if (buf == curbuf) 950 + return; /* nothing to do */ 951 idx_other = diff_buf_idx(buf); 952 if (idx_other == DB_COUNT) 953 { 799 954 diff -Naur vim72.orig/src/edit.c vim72/src/edit.c 800 955 --- vim72.orig/src/edit.c 2008-08-06 05:51:17.000000000 -0700 801 +++ vim72/src/edit.c 2009-0 1-19 00:10:48.000000000 -0800956 +++ vim72/src/edit.c 2009-03-12 11:55:13.411601900 -0700 802 957 @@ -147,6 +147,7 @@ 803 958 static int ins_compl_bs __ARGS((void)); … … 827 982 void 828 983 backspace_until_column(col) 829 @@ -1942,13 +1946, 49@@984 @@ -1942,13 +1946,50 @@ 830 985 { 831 986 curwin->w_cursor.col--; … … 846 1001 + * Return TRUE when something was deleted. 847 1002 + */ 1003 +/*ARGSUSED*/ 848 1004 + static int 849 1005 +del_char_after_col(limit_col) … … 859 1015 + * composing character. */ 860 1016 + mb_adjust_cursor(); 861 + while (curwin->w_cursor.col < limit_col)1017 + while (curwin->w_cursor.col < (colnr_T)limit_col) 862 1018 + { 863 1019 + int l = utf_ptr2len(ml_get_cursor()); … … 880 1036 /* 881 1037 * CTRL-X pressed in Insert mode. 882 @@ -2418,7 +245 8,7 @@1038 @@ -2418,7 +2459,7 @@ 883 1039 { 884 1040 had_match = (curwin->w_cursor.col > compl_col); … … 889 1045 890 1046 /* When the match isn't there (to avoid matching itself) remove it 891 @@ -2470,7 +251 0,7 @@1047 @@ -2470,7 +2511,7 @@ 892 1048 *p = NUL; 893 1049 had_match = (curwin->w_cursor.col > compl_col); … … 898 1054 899 1055 /* When the match isn't there (to avoid matching itself) remove it 900 @@ -3209,7 +32 49,7 @@1056 @@ -3209,7 +3250,7 @@ 901 1057 { 902 1058 ins_compl_del_pum(); … … 907 1063 908 1064 if (compl_started) 909 @@ -3264,6 +330 4,20 @@1065 @@ -3264,6 +3305,20 @@ 910 1066 } 911 1067 … … 928 1084 * matches. 929 1085 */ 930 @@ -3621,10 +367 5,9 @@1086 @@ -3621,10 +3676,9 @@ 931 1087 { 932 1088 ins_compl_delete(); … … 941 1097 } 942 1098 943 @@ -4256,7 +4309,7 @@ 1099 @@ -4187,7 +4241,7 @@ 1100 } 1101 1102 /* check if compl_curr_match has changed, (e.g. other type of 1103 - * expansion added somenthing) */ 1104 + * expansion added something) */ 1105 if (type != 0 && compl_curr_match != old_match) 1106 found_new_match = OK; 1107 1108 @@ -4256,7 +4310,7 @@ 944 1109 static void 945 1110 ins_compl_insert() … … 950 1115 compl_used_match = FALSE; 951 1116 else 952 @@ -4425,7 +447 8,7 @@1117 @@ -4425,7 +4479,7 @@ 953 1118 if (!compl_get_longest || compl_used_match) 954 1119 ins_compl_insert(); … … 959 1124 else 960 1125 compl_used_match = FALSE; 961 @@ -7123,9 +7176,12 @@ 1126 @@ -4688,7 +4742,7 @@ 1127 } 1128 compl_length = curwin->w_cursor.col - (int)compl_col; 1129 /* IObuff is used to add a "word from the next line" would we 1130 - * have enough space? just being paranoic */ 1131 + * have enough space? just being paranoid */ 1132 #define MIN_SPACE 75 1133 if (compl_length > (IOSIZE - MIN_SPACE)) 1134 { 1135 @@ -7123,9 +7177,12 @@ 962 1136 * cc == 0: character was inserted, delete it 963 1137 * cc > 0: character was replaced, put cc (first byte of original char) back … … 973 1147 int cc; 974 1148 #ifdef FEAT_VREPLACE 975 @@ -7153,7 +72 09,7 @@1149 @@ -7153,7 +7210,7 @@ 976 1150 #ifdef FEAT_MBYTE 977 1151 if (has_mbyte) … … 982 1156 if (State & VREPLACE_FLAG) 983 1157 orig_len = (int)STRLEN(ml_get_cursor()); 984 @@ -7203,7 +72 59,7 @@1158 @@ -7203,7 +7260,7 @@ 985 1159 changed_bytes(curwin->w_cursor.lnum, curwin->w_cursor.col); 986 1160 } … … 991 1165 992 1166 #ifdef FEAT_CINDENT 993 @@ -8239,7 +8295,7 @@ 1167 @@ -7646,9 +7703,7 @@ 1168 */ 1169 ++no_mapping; 1170 regname = plain_vgetc(); 1171 -#ifdef FEAT_LANGMAP 1172 LANGMAP_ADJUST(regname, TRUE); 1173 -#endif 1174 if (regname == Ctrl_R || regname == Ctrl_O || regname == Ctrl_P) 1175 { 1176 /* Get a third key for literal register insertion */ 1177 @@ -7657,9 +7712,7 @@ 1178 add_to_showcmd_c(literally); 1179 #endif 1180 regname = plain_vgetc(); 1181 -#ifdef FEAT_LANGMAP 1182 LANGMAP_ADJUST(regname, TRUE); 1183 -#endif 1184 } 1185 --no_mapping; 1186 1187 @@ -8150,7 +8203,7 @@ 1188 /* 1189 * If the cursor is on an indent, ^T/^D insert/delete one 1190 * shiftwidth. Otherwise ^T/^D behave like a "<<" or ">>". 1191 - * Always round the indent to 'shiftwith', this is compatible 1192 + * Always round the indent to 'shiftwidth', this is compatible 1193 * with vi. But vi only supports ^T and ^D after an 1194 * autoindent, we support it everywhere. 1195 */ 1196 @@ -8239,7 +8292,7 @@ 994 1197 * Replace mode */ 995 1198 if (curwin->w_cursor.lnum != Insstart.lnum … … 1000 1203 else 1001 1204 (void)del_char(FALSE); 1002 @@ -8556,7 +86 12,7 @@1205 @@ -8556,7 +8609,7 @@ 1003 1206 break; 1004 1207 } … … 1011 1214 diff -Naur vim72.orig/src/eval.c vim72/src/eval.c 1012 1215 --- vim72.orig/src/eval.c 2008-08-07 12:37:22.000000000 -0700 1013 +++ vim72/src/eval.c 2009-0 1-19 00:10:21.000000000 -08001216 +++ vim72/src/eval.c 2009-03-12 11:55:08.231269731 -0700 1014 1217 @@ -32,6 +32,9 @@ 1015 1218 … … 1150 1353 static int 1151 1354 tv_islocked(tv) 1355 @@ -3902,7 +3928,7 @@ 1356 1357 /* 1358 * Handle top level expression: 1359 - * expr1 ? expr0 : expr0 1360 + * expr2 ? expr1 : expr1 1361 * 1362 * "arg" must point to the first non-white of the expression. 1363 * "arg" is advanced to the next non-white after the recognized expression. 1152 1364 @@ -6047,6 +6073,25 @@ 1153 1365 } … … 1254 1466 {"has_key", 2, 2, f_has_key}, 1255 1467 {"haslocaldir", 0, 0, f_haslocaldir}, 1256 @@ -9518,7 +9580,7 @@ 1468 @@ -7856,9 +7918,9 @@ 1469 else if (!aborting()) 1470 { 1471 if (argcount == MAX_FUNC_ARGS) 1472 - emsg_funcname("E740: Too many arguments for function %s", name); 1473 + emsg_funcname(N_("E740: Too many arguments for function %s"), name); 1474 else 1475 - emsg_funcname("E116: Invalid arguments for function %s", name); 1476 + emsg_funcname(N_("E116: Invalid arguments for function %s"), name); 1477 } 1478 1479 while (--argcount >= 0) 1480 @@ -8091,6 +8153,7 @@ 1481 1482 /* 1483 * Give an error message with a function name. Handle <SNR> things. 1484 + * "ermsg" is to be passed without translation, use N_() instead of _(). 1485 */ 1486 static void 1487 emsg_funcname(ermsg, name) 1488 @@ -9518,7 +9581,7 @@ 1257 1489 else 1258 1490 { … … 1263 1495 && get_tv_number_chk(&argvars[1], &error)) 1264 1496 flags |= WILD_KEEP_ALL; 1265 @@ -10300,7 +1036 2,8 @@1497 @@ -10300,7 +10363,8 @@ 1266 1498 s = get_tv_string(&argvars[0]); 1267 1499 if (s == NULL || *s == NUL || VIM_ISDIGIT(*s)) … … 1273 1505 else 1274 1506 { 1275 @@ -10602,7 +1066 5,7 @@1507 @@ -10602,7 +10666,7 @@ 1276 1508 # ifdef FEAT_WINDOWS 1277 1509 win_T *wp; … … 1282 1514 if (row >= 0 && col >= 0) 1283 1515 { 1284 @@ -10612,9 +1067 5,9 @@1516 @@ -10612,9 +10676,9 @@ 1285 1517 (void)mouse_comp_pos(win, &row, &col, &lnum); 1286 1518 # ifdef FEAT_WINDOWS … … 1294 1526 vimvars[VV_MOUSE_COL].vv_nr = col + 1; 1295 1527 } 1296 @@ -11284,13 +1134 7,25 @@1528 @@ -11284,13 +11348,25 @@ 1297 1529 typval_T *argvars; 1298 1530 typval_T *rettv; … … 1324 1556 1325 1557 /* 1326 @@ -11301,14 +1137 6,22 @@1558 @@ -11301,14 +11377,22 @@ 1327 1559 typval_T *argvars; 1328 1560 typval_T *rettv; … … 1349 1581 1350 1582 /* 1351 @@ -11782,6 +1186 5,10 @@1583 @@ -11782,6 +11866,10 @@ 1352 1584 n = has_patch(atoi((char *)name + 5)); 1353 1585 else if (STRICMP(name, "vim_starting") == 0) … … 1360 1592 else if (STRICMP(name, "balloon_multiline") == 0) 1361 1593 n = multiline_balloon_available(); 1362 @@ -15838,10 +1592 5,9 @@1594 @@ -15838,10 +15926,9 @@ 1363 1595 if (res == FAIL) 1364 1596 res = ITEM_COMPARE_FAIL; … … 1372 1604 return res; 1373 1605 } 1374 @@ -16590,8 +1667 6,11 @@1606 @@ -16590,8 +16677,11 @@ 1375 1607 p = highlight_has_attr(id, HL_INVERSE, modec); 1376 1608 break; … … 1386 1618 1387 1619 case 'u': 1388 @@ -16658,7 +1674 7,7 @@1620 @@ -16658,7 +16748,7 @@ 1389 1621 col = get_tv_number(&argvars[1]) - 1; /* -1 on type error */ 1390 1622 … … 1395 1627 { 1396 1628 (void)syn_get_id(curwin, lnum, (colnr_T)col, FALSE, NULL, TRUE); 1397 @@ -18097,14 +1818 6,28 @@1629 @@ -18097,14 +18187,28 @@ 1398 1630 } 1399 1631 … … 1427 1659 vimvars[VV_COUNT1].vv_nr = count1; 1428 1660 } 1429 @@ -18132,6 +1823 5,20 @@1661 @@ -18132,6 +18236,20 @@ 1430 1662 } 1431 1663 … … 1448 1680 */ 1449 1681 void 1450 @@ -18868,7 +1898 5,7 @@1682 @@ -18868,7 +18986,7 @@ 1451 1683 dictitem_T *dict_var; 1452 1684 { … … 1457 1689 dict_var->di_tv.v_type = VAR_DICT; 1458 1690 dict_var->di_tv.v_lock = VAR_FIXED; 1459 @@ -19205,6 +1932 2,8 @@1691 @@ -19205,6 +19323,8 @@ 1460 1692 * Copy the values from typval_T "from" to typval_T "to". 1461 1693 * When needed allocates string or increases reference count. … … 1466 1698 static void 1467 1699 copy_tv(from, to) 1468 @@ -20590,6 +20709,9 @@ 1700 @@ -19748,7 +19868,7 @@ 1701 } 1702 } 1703 else 1704 - emsg_funcname("E123: Undefined function: %s", name); 1705 + emsg_funcname(N_("E123: Undefined function: %s"), name); 1706 } 1707 goto ret_free; 1708 } 1709 @@ -19792,7 +19912,7 @@ 1710 : eval_isnamec(arg[j]))) 1711 ++j; 1712 if (arg[j] != NUL) 1713 - emsg_funcname(_(e_invarg2), arg); 1714 + emsg_funcname((char *)e_invarg2, arg); 1715 } 1716 } 1717 1718 @@ -20064,7 +20184,7 @@ 1719 v = find_var(name, &ht); 1720 if (v != NULL && v->di_tv.v_type == VAR_FUNC) 1721 { 1722 - emsg_funcname("E707: Function name conflicts with variable: %s", 1723 + emsg_funcname(N_("E707: Function name conflicts with variable: %s"), 1724 name); 1725 goto erret; 1726 } 1727 @@ -20079,7 +20199,7 @@ 1728 } 1729 if (fp->uf_calls > 0) 1730 { 1731 - emsg_funcname("E127: Cannot redefine function %s: It is in use", 1732 + emsg_funcname(N_("E127: Cannot redefine function %s: It is in use"), 1733 name); 1734 goto erret; 1735 } 1736 @@ -20590,6 +20710,9 @@ 1469 1737 int st_len = 0; 1470 1738 … … 1476 1744 1477 1745 for (hi = func_hashtab.ht_array; todo > 0; ++hi) 1478 @@ -20638,6 +2076 0,8 @@1746 @@ -20638,6 +20761,8 @@ 1479 1747 prof_self_cmp); 1480 1748 prof_sort_list(fd, sorttab, st_len, "SELF", TRUE); … … 1485 1753 1486 1754 static void 1487 @@ -21012,7 +2113 6,7 @@1755 @@ -21012,7 +21137,7 @@ 1488 1756 char_u *save_sourcing_name; 1489 1757 linenr_T save_sourcing_lnum; … … 1494 1762 static int depth = 0; 1495 1763 dictitem_T *v; 1496 @@ -21038,36 +2116 2,37 @@1764 @@ -21038,36 +21163,37 @@ 1497 1765 1498 1766 line_breakcheck(); /* check for CTRL-C hit */ … … 1545 1813 v->di_tv.v_lock = 0; 1546 1814 v->di_tv.vval.v_dict = selfdict; 1547 @@ -21079,28 +2120 4,31 @@1815 @@ -21079,28 +21205,31 @@ 1548 1816 * Set a:0 to "argcount". 1549 1817 * Set a:000 to a list with room for the "..." arguments. … … 1588 1856 for (i = 0; i < argcount; ++i) 1589 1857 { 1590 @@ -21116,7 +2124 4,7 @@1858 @@ -21116,7 +21245,7 @@ 1591 1859 } 1592 1860 if (fixvar_idx < FIXVAR_CNT && STRLEN(name) <= VAR_SHORT_LEN) … … 1597 1865 } 1598 1866 else 1599 @@ -21128,7 +2125 6,7 @@1867 @@ -21128,7 +21257,7 @@ 1600 1868 v->di_flags = DI_FLAGS_RO; 1601 1869 } … … 1606 1874 /* Note: the values are copied directly to avoid alloc/free. 1607 1875 * "argvars" must have VAR_FIXED for v_lock. */ 1608 @@ -21137,9 +2126 5,9 @@1876 @@ -21137,9 +21266,9 @@ 1609 1877 1610 1878 if (ai >= 0 && ai < MAX_FUNC_ARGS) … … 1619 1887 } 1620 1888 1621 @@ -21204,7 +2133 2,7 @@1889 @@ -21204,7 +21333,7 @@ 1622 1890 if (!fp->uf_profiling && has_profiling(FALSE, fp->uf_name, NULL)) 1623 1891 func_do_profile(fp); … … 1628 1896 ++fp->uf_tm_count; 1629 1897 profile_start(&call_start); 1630 @@ -21220,7 +2134 8,7 @@1898 @@ -21220,7 +21349,7 @@ 1631 1899 did_emsg = FALSE; 1632 1900 … … 1637 1905 1638 1906 --RedrawingDisabled; 1639 @@ -21235,16 +2136 3,16 @@1907 @@ -21235,16 +21364,16 @@ 1640 1908 1641 1909 #ifdef FEAT_PROFILE … … 1658 1926 } 1659 1927 #endif 1660 @@ -21257,9 +2138 5,9 @@1928 @@ -21257,9 +21386,9 @@ 1661 1929 1662 1930 if (aborting()) … … 1670 1938 { 1671 1939 char_u buf[MSG_BUF_LEN]; 1672 @@ -21270,7 +2139 8,7 @@1940 @@ -21270,7 +21399,7 @@ 1673 1941 /* The value may be very long. Skip the middle part, so that we 1674 1942 * have some idea how it starts and ends. smsg() would always … … 1679 1947 { 1680 1948 trunc_string(s, buf, MSG_BUF_CLEN); 1681 @@ -21306,14 +2143 4,84 @@1949 @@ -21306,14 +21435,84 @@ 1682 1950 } 1683 1951 … … 1732 2000 +/* 1733 2001 + * Return TRUE if items in "fc" do not have "copyID". That means they are not 1734 + * referenced from anyw yere.2002 + * referenced from anywhere. 1735 2003 + */ 1736 2004 + static int … … 1770 2038 1771 2039 /* 1772 @@ -21886,6 +2208 4,62 @@2040 @@ -21886,6 +22085,62 @@ 1773 2041 } 1774 2042 } … … 1833 2101 1834 2102 2103 diff -Naur vim72.orig/src/ex_cmds2.c vim72/src/ex_cmds2.c 2104 --- vim72.orig/src/ex_cmds2.c 2008-07-13 09:18:22.000000000 -0700 2105 +++ vim72/src/ex_cmds2.c 2009-03-12 11:55:13.311593519 -0700 2106 @@ -2842,6 +2842,7 @@ 2107 linenr_T save_sourcing_lnum; 2108 char_u *p; 2109 char_u *fname_exp; 2110 + char_u *firstline = NULL; 2111 int retval = FAIL; 2112 #ifdef FEAT_EVAL 2113 scid_T save_current_SID; 2114 @@ -2992,23 +2993,6 @@ 2115 2116 cookie.level = ex_nesting_level; 2117 #endif 2118 -#ifdef FEAT_MBYTE 2119 - cookie.conv.vc_type = CONV_NONE; /* no conversion */ 2120 - 2121 - /* Try reading the first few bytes to check for a UTF-8 BOM. */ 2122 - { 2123 - char_u buf[3]; 2124 - 2125 - if (fread((char *)buf, sizeof(char_u), (size_t)3, cookie.fp) 2126 - == (size_t)3 2127 - && buf[0] == 0xef && buf[1] == 0xbb && buf[2] == 0xbf) 2128 - /* Found BOM, setup conversion and skip over it. */ 2129 - convert_setup(&cookie.conv, (char_u *)"utf-8", p_enc); 2130 - else 2131 - /* No BOM found, rewind. */ 2132 - fseek(cookie.fp, 0L, SEEK_SET); 2133 - } 2134 -#endif 2135 2136 /* 2137 * Keep the sourcing name/lnum, for recursive calls. 2138 @@ -3018,6 +3002,27 @@ 2139 save_sourcing_lnum = sourcing_lnum; 2140 sourcing_lnum = 0; 2141 2142 +#ifdef FEAT_MBYTE 2143 + cookie.conv.vc_type = CONV_NONE; /* no conversion */ 2144 + 2145 + /* Read the first line so we can check for a UTF-8 BOM. */ 2146 + firstline = getsourceline(0, (void *)&cookie, 0); 2147 + if (firstline != NULL && STRLEN(firstline) >= 3 && firstline[0] == 0xef 2148 + && firstline[1] == 0xbb && firstline[2] == 0xbf) 2149 + { 2150 + /* Found BOM; setup conversion, skip over BOM and recode the line. */ 2151 + convert_setup(&cookie.conv, (char_u *)"utf-8", p_enc); 2152 + p = string_convert(&cookie.conv, firstline + 3, NULL); 2153 + if (p == NULL) 2154 + p = vim_strsave(firstline + 3); 2155 + if (p != NULL) 2156 + { 2157 + vim_free(firstline); 2158 + firstline = p; 2159 + } 2160 + } 2161 +#endif 2162 + 2163 #ifdef STARTUPTIME 2164 time_push(&tv_rel, &tv_start); 2165 #endif 2166 @@ -3111,9 +3116,8 @@ 2167 /* 2168 * Call do_cmdline, which will call getsourceline() to get the lines. 2169 */ 2170 - do_cmdline(NULL, getsourceline, (void *)&cookie, 2171 + do_cmdline(firstline, getsourceline, (void *)&cookie, 2172 DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_REPEAT); 2173 - 2174 retval = OK; 2175 2176 #ifdef FEAT_PROFILE 2177 @@ -3145,8 +3149,8 @@ 2178 verbose_leave(); 2179 } 2180 #ifdef STARTUPTIME 2181 - vim_snprintf(IObuff, IOSIZE, "sourcing %s", fname); 2182 - time_msg(IObuff, &tv_start); 2183 + vim_snprintf((char *)IObuff, IOSIZE, "sourcing %s", fname); 2184 + time_msg((char *)IObuff, &tv_start); 2185 time_pop(&tv_rel); 2186 #endif 2187 2188 @@ -3171,6 +3175,7 @@ 2189 #endif 2190 fclose(cookie.fp); 2191 vim_free(cookie.nextline); 2192 + vim_free(firstline); 2193 #ifdef FEAT_MBYTE 2194 convert_setup(&cookie.conv, NULL, NULL); 2195 #endif 1835 2196 diff -Naur vim72.orig/src/ex_cmds.c vim72/src/ex_cmds.c 1836 2197 --- vim72.orig/src/ex_cmds.c 2008-08-04 12:15:00.000000000 -0700 1837 +++ vim72/src/ex_cmds.c 2009-0 1-19 00:10:54.000000000 -08002198 +++ vim72/src/ex_cmds.c 2009-03-12 11:55:13.611614471 -0700 1838 2199 @@ -24,7 +24,7 @@ 1839 2200 static void do_filter __ARGS((linenr_T line1, linenr_T line2, exarg_T *eap, char_u *cmd, int do_in, int do_out)); … … 1982 2343 vim_free(vir.vir_line); 1983 2344 #ifdef FEAT_MBYTE 1984 @@ -5059,6 +5062,7 @@ 2345 @@ -2414,8 +2417,8 @@ 2346 cursor_on(); /* msg_start() switches it off */ 2347 out_flush(); 2348 silent_mode = save_silent; 2349 - info_message = FALSE; 2350 } 2351 + info_message = FALSE; 2352 } 2353 2354 /* 2355 @@ -2704,7 +2707,12 @@ 2356 if (eap->cmdidx == CMD_saveas) 2357 { 2358 if (retval == OK) 2359 + { 2360 curbuf->b_p_ro = FALSE; 2361 +#ifdef FEAT_WINDOWS 2362 + redraw_tabline = TRUE; 2363 +#endif 2364 + } 2365 /* Change directories when the 'acd' option is set. */ 2366 DO_AUTOCHDIR 2367 } 2368 @@ -5059,6 +5067,7 @@ 1985 2369 1986 2370 if (did_sub) … … 1990 2374 sub_firstline = NULL; 1991 2375 } 2376 @@ -6520,6 +6529,7 @@ 2377 static int last_sign_typenr = MAX_TYPENR; /* is decremented */ 2378 2379 static void sign_list_defined __ARGS((sign_T *sp)); 2380 +static void sign_undefine __ARGS((sign_T *sp, sign_T *sp_prev)); 2381 2382 /* 2383 * ":sign" command 2384 @@ -6728,24 +6738,8 @@ 2385 /* ":sign list {name}" */ 2386 sign_list_defined(sp); 2387 else 2388 - { 2389 /* ":sign undefine {name}" */ 2390 - vim_free(sp->sn_name); 2391 - vim_free(sp->sn_icon); 2392 -#ifdef FEAT_SIGN_ICONS 2393 - if (sp->sn_image != NULL) 2394 - { 2395 - out_flush(); 2396 - gui_mch_destroy_sign(sp->sn_image); 2397 - } 2398 -#endif 2399 - vim_free(sp->sn_text); 2400 - if (sp_prev == NULL) 2401 - first_sign = sp->sn_next; 2402 - else 2403 - sp_prev->sn_next = sp->sn_next; 2404 - vim_free(sp); 2405 - } 2406 + sign_undefine(sp, sp_prev); 2407 } 2408 } 2409 else 2410 @@ -6994,6 +6988,31 @@ 2411 } 2412 2413 /* 2414 + * Undefine a sign and free its memory. 2415 + */ 2416 + static void 2417 +sign_undefine(sp, sp_prev) 2418 + sign_T *sp; 2419 + sign_T *sp_prev; 2420 +{ 2421 + vim_free(sp->sn_name); 2422 + vim_free(sp->sn_icon); 2423 +#ifdef FEAT_SIGN_ICONS 2424 + if (sp->sn_image != NULL) 2425 + { 2426 + out_flush(); 2427 + gui_mch_destroy_sign(sp->sn_image); 2428 + } 2429 +#endif 2430 + vim_free(sp->sn_text); 2431 + if (sp_prev == NULL) 2432 + first_sign = sp->sn_next; 2433 + else 2434 + sp_prev->sn_next = sp->sn_next; 2435 + vim_free(sp); 2436 +} 2437 + 2438 +/* 2439 * Get highlighting attribute for sign "typenr". 2440 * If "line" is TRUE: line highl, if FALSE: text highl. 2441 */ 2442 @@ -7067,6 +7086,18 @@ 2443 return (char_u *)_("[Deleted]"); 2444 } 2445 2446 +#if defined(EXITFREE) || defined(PROTO) 2447 +/* 2448 + * Undefine/free all signs. 2449 + */ 2450 + void 2451 +free_signs() 2452 +{ 2453 + while (first_sign != NULL) 2454 + sign_undefine(first_sign, NULL); 2455 +} 2456 +#endif 2457 + 2458 #endif 2459 2460 #if defined(FEAT_GUI) || defined(FEAT_CLIENTSERVER) || defined(PROTO) 1992 2461 diff -Naur vim72.orig/src/ex_cmds.h vim72/src/ex_cmds.h 1993 2462 --- vim72.orig/src/ex_cmds.h 2008-06-21 11:47:57.000000000 -0700 1994 +++ vim72/src/ex_cmds.h 2009-0 1-19 00:08:31.000000000 -08002463 +++ vim72/src/ex_cmds.h 2009-03-12 11:54:40.541495740 -0700 1995 2464 @@ -278,7 +278,7 @@ 1996 2465 EX(CMD_crewind, "crewind", ex_cc, … … 2038 2507 TRLBAR|EXTRA|CMDWIN|SBOXOK), 2039 2508 EX(CMD_setfiletype, "setfiletype", ex_setfiletype, 2040 diff -Naur vim72.orig/src/ex_cmds2.c vim72/src/ex_cmds2.c2041 --- vim72.orig/src/ex_cmds2.c 2008-07-13 09:18:22.000000000 -07002042 +++ vim72/src/ex_cmds2.c 2009-01-19 00:07:35.000000000 -08002043 @@ -3145,8 +3145,8 @@2044 verbose_leave();2045 }2046 #ifdef STARTUPTIME2047 - vim_snprintf(IObuff, IOSIZE, "sourcing %s", fname);2048 - time_msg(IObuff, &tv_start);2049 + vim_snprintf((char *)IObuff, IOSIZE, "sourcing %s", fname);2050 + time_msg((char *)IObuff, &tv_start);2051 time_pop(&tv_rel);2052 #endif2053 2054 2509 diff -Naur vim72.orig/src/ex_docmd.c vim72/src/ex_docmd.c 2055 2510 --- vim72.orig/src/ex_docmd.c 2008-07-26 04:51:05.000000000 -0700 2056 +++ vim72/src/ex_docmd.c 2009-0 1-19 00:10:13.000000000 -08002511 +++ vim72/src/ex_docmd.c 2009-03-12 11:55:24.900337757 -0700 2057 2512 @@ -364,6 +364,7 @@ 2058 2513 # define ex_function ex_ni … … 2088 2543 #endif 2089 2544 case CMD_set: 2090 @@ -8749,8 +8752,8 @@ 2545 @@ -5121,7 +5124,11 @@ 2546 } 2547 2548 vim_free(cmd->uc_rep); 2549 - cmd->uc_rep = 0; 2550 + cmd->uc_rep = NULL; 2551 +#if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL) 2552 + vim_free(cmd->uc_compl_arg); 2553 + cmd->uc_compl_arg = NULL; 2554 +#endif 2555 break; 2556 } 2557 2558 @@ -5479,6 +5486,9 @@ 2559 return OK; 2560 } 2561 2562 +/* 2563 + * ":command ..." 2564 + */ 2565 static void 2566 ex_command(eap) 2567 exarg_T *eap; 2568 @@ -5910,7 +5920,8 @@ 2569 char_u *q; 2570 2571 char_u *start; 2572 - char_u *end; 2573 + char_u *end = NULL; 2574 + char_u *ksp; 2575 size_t len, totlen; 2576 2577 size_t split_len = 0; 2578 @@ -5927,16 +5938,51 @@ 2579 2580 /* 2581 * Replace <> in the command by the arguments. 2582 + * First round: "buf" is NULL, compute length, allocate "buf". 2583 + * Second round: copy result into "buf". 2584 */ 2585 buf = NULL; 2586 for (;;) 2587 { 2588 - p = cmd->uc_rep; 2589 - q = buf; 2590 + p = cmd->uc_rep; /* source */ 2591 + q = buf; /* destination */ 2592 totlen = 0; 2593 - while ((start = vim_strchr(p, '<')) != NULL 2594 - && (end = vim_strchr(start + 1, '>')) != NULL) 2595 + 2596 + for (;;) 2597 { 2598 + start = vim_strchr(p, '<'); 2599 + if (start != NULL) 2600 + end = vim_strchr(start + 1, '>'); 2601 + if (buf != NULL) 2602 + { 2603 + ksp = vim_strchr(p, K_SPECIAL); 2604 + if (ksp != NULL && (start == NULL || ksp < start || end == NULL) 2605 + && ((ksp[1] == KS_SPECIAL && ksp[2] == KE_FILLER) 2606 +# ifdef FEAT_GUI 2607 + || (ksp[1] == KS_EXTRA && ksp[2] == (int)KE_CSI) 2608 +# endif 2609 + )) 2610 + { 2611 + /* K_SPECIAL han been put in the buffer as K_SPECIAL 2612 + * KS_SPECIAL KE_FILLER, like for mappings, but 2613 + * do_cmdline() doesn't handle that, so convert it back. 2614 + * Also change K_SPECIAL KS_EXTRA KE_CSI into CSI. */ 2615 + len = ksp - p; 2616 + if (len > 0) 2617 + { 2618 + mch_memmove(q, p, len); 2619 + q += len; 2620 + } 2621 + *q++ = ksp[1] == KS_SPECIAL ? K_SPECIAL : CSI; 2622 + p = ksp + 3; 2623 + continue; 2624 + } 2625 + } 2626 + 2627 + /* break if there no <item> is found */ 2628 + if (start == NULL || end == NULL) 2629 + break; 2630 + 2631 /* Include the '>' */ 2632 ++end; 2633 2634 @@ -7803,6 +7849,9 @@ 2635 { 2636 vim_free(prev_dir); 2637 prev_dir = NULL; 2638 + 2639 + vim_free(globaldir); 2640 + globaldir = NULL; 2641 } 2642 #endif 2643 2644 @@ -7825,6 +7874,10 @@ 2645 else 2646 #endif 2647 { 2648 +#ifdef FEAT_AUTOCMD 2649 + if (allbuf_locked()) 2650 + return; 2651 +#endif 2652 if (vim_strchr(p_cpo, CPO_CHDIR) != NULL && curbufIsChanged() 2653 && !eap->forceit) 2654 { 2655 @@ -8749,8 +8802,8 @@ 2091 2656 else if (*dirnow != NUL 2092 2657 && (ssop_flags & SSOP_CURDIR) && globaldir != NULL) … … 2094 2659 - (void)mch_chdir((char *)globaldir); 2095 2660 - shorten_fnames(TRUE); 2096 + if (mch_chdir((char *)globaldir) == OK)2661 + if (mch_chdir((char *)globaldir) == 0) 2097 2662 + shorten_fnames(TRUE); 2098 2663 } 2099 2664 2100 2665 failed |= (makeopens(fd, dirnow) == FAIL); 2101 @@ -9506,24 +95 09,50 @@2666 @@ -9506,24 +9559,50 @@ 2102 2667 break; 2103 2668 } … … 2160 2725 2161 2726 #ifdef FEAT_SEARCHPATH 2162 @@ -9541,6 +9 570,15 @@2727 @@ -9541,6 +9620,15 @@ 2163 2728 #ifdef FEAT_AUTOCMD 2164 2729 case SPEC_AFILE: /* file name for autocommand */ … … 2176 2741 { 2177 2742 *errormsg = (char_u *)_("E495: no autocommand file name to substitute for \"<afile>\""); 2178 @@ -10067,7 +101 05,7 @@2743 @@ -10067,7 +10155,7 @@ 2179 2744 */ 2180 2745 if (put_line(fd, "let s:sx = expand(\"<sfile>:p:r\").\"x.vim\"") == FAIL … … 2185 2750 return FAIL; 2186 2751 2187 @@ -10689,7 +107 27,8 @@2752 @@ -10689,7 +10777,8 @@ 2188 2753 p_viminfo = (char_u *)"'100"; 2189 2754 if (eap->cmdidx == CMD_rviminfo) … … 2197 2762 diff -Naur vim72.orig/src/ex_getln.c vim72/src/ex_getln.c 2198 2763 --- vim72.orig/src/ex_getln.c 2008-08-08 02:31:33.000000000 -0700 2199 +++ vim72/src/ex_getln.c 2009-0 1-19 00:09:28.000000000 -08002764 +++ vim72/src/ex_getln.c 2009-03-12 11:55:13.699620338 -0700 2200 2765 @@ -31,6 +31,8 @@ 2201 2766 int cmdattr; /* attributes for prompt */ … … 2257 2822 #ifdef FEAT_SEARCH_EXTRA 2258 2823 if (did_incsearch) 2259 @@ -2508,6 +2518,20 @@ 2824 @@ -1990,8 +2000,8 @@ 2825 2826 #if defined(FEAT_AUTOCMD) || defined(PROTO) 2827 /* 2828 - * Check if "curbuf_lock" is set and return TRUE when it is and give an error 2829 - * message. 2830 + * Check if "curbuf_lock" or "allbuf_lock" is set and return TRUE when it is 2831 + * and give an error message. 2832 */ 2833 int 2834 curbuf_locked() 2835 @@ -2001,6 +2011,21 @@ 2836 EMSG(_("E788: Not allowed to edit another buffer now")); 2837 return TRUE; 2838 } 2839 + return allbuf_locked(); 2840 +} 2841 + 2842 +/* 2843 + * Check if "allbuf_lock" is set and return TRUE when it is and give an error 2844 + * message. 2845 + */ 2846 + int 2847 +allbuf_locked() 2848 +{ 2849 + if (allbuf_lock > 0) 2850 + { 2851 + EMSG(_("E811: Not allowed to change buffer information now")); 2852 + return TRUE; 2853 + } 2854 return FALSE; 2855 } 2856 #endif 2857 @@ -2508,6 +2533,20 @@ 2260 2858 } 2261 2859 mch_memmove(ccline.cmdbuff, p, (size_t)ccline.cmdlen + 1); … … 2278 2876 } 2279 2877 2280 @@ -2875,6 +2 899,7 @@2878 @@ -2875,6 +2914,7 @@ 2281 2879 prev_ccline = ccline; 2282 2880 ccline.cmdbuff = NULL; … … 2286 2884 2287 2885 /* 2288 @@ -3582,6 +36 07,7 @@2886 @@ -3582,6 +3622,7 @@ 2289 2887 ExpandInit(xp) 2290 2888 expand_T *xp; … … 2294 2892 #ifndef BACKSLASH_IN_FILENAME 2295 2893 xp->xp_shell = FALSE; 2296 @@ -4871,7 +4 897,7 @@2894 @@ -4871,7 +4912,7 @@ 2297 2895 if (s == NULL) 2298 2896 return FAIL; … … 2303 2901 if (all == NULL) 2304 2902 return FAIL; 2305 @@ -4912,9 +49 38,10 @@2903 @@ -4912,9 +4953,10 @@ 2306 2904 * newlines. Returns NULL for an error or no matches. 2307 2905 */ … … 2315 2913 expand_T xpc; 2316 2914 char_u *buf; 2317 @@ -4943,10 +49 70,10 @@2915 @@ -4943,10 +4985,10 @@ 2318 2916 { 2319 2917 add_pathsep(buf); … … 2329 2927 len += (int)STRLEN(p[i]) + 1; 2330 2928 2929 @@ -6020,9 +6062,7 @@ 2930 # endif 2931 return K_IGNORE; 2932 } 2933 - cmdwin_type = ccline.cmdfirstc; 2934 - if (cmdwin_type == NUL) 2935 - cmdwin_type = '-'; 2936 + cmdwin_type = get_cmdline_type(); 2937 2938 /* Create the command-line buffer empty. */ 2939 (void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE); 2940 @@ -6046,7 +6086,7 @@ 2941 /* Showing the prompt may have set need_wait_return, reset it. */ 2942 need_wait_return = FALSE; 2943 2944 - histtype = hist_char2type(ccline.cmdfirstc); 2945 + histtype = hist_char2type(cmdwin_type); 2946 if (histtype == HIST_CMD || histtype == HIST_DEBUG) 2947 { 2948 if (p_wc == TAB) 2331 2949 diff -Naur vim72.orig/src/feature.h vim72/src/feature.h 2332 2950 --- vim72.orig/src/feature.h 2008-08-06 04:00:39.000000000 -0700 2333 +++ vim72/src/feature.h 2009-0 1-19 00:08:31.000000000 -08002951 +++ vim72/src/feature.h 2009-03-12 11:54:40.545495740 -0700 2334 2952 @@ -767,9 +767,13 @@ 2335 2953 … … 2350 2968 diff -Naur vim72.orig/src/fileio.c vim72/src/fileio.c 2351 2969 --- vim72.orig/src/fileio.c 2008-08-06 04:01:03.000000000 -0700 2352 +++ vim72/src/fileio.c 2009-01-19 00:10:40.000000000 -0800 2353 @@ -932,7 +932,10 @@ 2970 +++ vim72/src/fileio.c 2009-03-12 11:55:18.711941333 -0700 2971 @@ -69,7 +69,7 @@ 2972 static int au_find_group __ARGS((char_u *name)); 2973 2974 # define AUGROUP_DEFAULT -1 /* default autocmd group */ 2975 -# define AUGROUP_ERROR -2 /* errornouse autocmd group */ 2976 +# define AUGROUP_ERROR -2 /* erroneous autocmd group */ 2977 # define AUGROUP_ALL -3 /* all autocmd groups */ 2978 #endif 2979 2980 @@ -144,7 +144,9 @@ 2981 # endif 2982 #endif 2983 static int move_lines __ARGS((buf_T *frombuf, buf_T *tobuf)); 2984 - 2985 +#ifdef FEAT_AUTOCMD 2986 +static char *e_auchangedbuf = N_("E812: Autocommands changed buffer or buffer name"); 2987 +#endif 2988 2989 void 2990 filemess(buf, name, s, attr) 2991 @@ -295,6 +297,19 @@ 2992 int conv_restlen = 0; /* nr of bytes in conv_rest[] */ 2993 #endif 2994 2995 +#ifdef FEAT_AUTOCMD 2996 + /* Remember the initial values of curbuf, curbuf->b_ffname and 2997 + * curbuf->b_fname to detect whether they are altered as a result of 2998 + * executing nasty autocommands. Also check if "fname" and "sfname" 2999 + * point to one of these values. */ 3000 + buf_T *old_curbuf = curbuf; 3001 + char_u *old_b_ffname = curbuf->b_ffname; 3002 + char_u *old_b_fname = curbuf->b_fname; 3003 + int using_b_ffname = (fname == curbuf->b_ffname) 3004 + || (sfname == curbuf->b_ffname); 3005 + int using_b_fname = (fname == curbuf->b_fname) 3006 + || (sfname == curbuf->b_fname); 3007 +#endif 3008 write_no_eol_lnum = 0; /* in case it was set by the previous read */ 3009 3010 /* 3011 @@ -589,7 +604,21 @@ 3012 #ifdef FEAT_QUICKFIX 3013 if (!bt_dontwrite(curbuf)) 3014 #endif 3015 + { 3016 check_need_swap(newfile); 3017 +#ifdef FEAT_AUTOCMD 3018 + /* SwapExists autocommand may mess things up */ 3019 + if (curbuf != old_curbuf 3020 + || (using_b_ffname 3021 + && (old_b_ffname != curbuf->b_ffname)) 3022 + || (using_b_fname 3023 + && (old_b_fname != curbuf->b_fname))) 3024 + { 3025 + EMSG(_(e_auchangedbuf)); 3026 + return FAIL; 3027 + } 3028 +#endif 3029 + } 3030 if (dir_of_file_exists(fname)) 3031 filemess(curbuf, sfname, (char_u *)_("[New File]"), 0); 3032 else 3033 @@ -668,6 +697,17 @@ 3034 #endif 3035 { 3036 check_need_swap(newfile); 3037 +#ifdef FEAT_AUTOCMD 3038 + if (!read_stdin && (curbuf != old_curbuf 3039 + || (using_b_ffname && (old_b_ffname != curbuf->b_ffname)) 3040 + || (using_b_fname && (old_b_fname != curbuf->b_fname)))) 3041 + { 3042 + EMSG(_(e_auchangedbuf)); 3043 + if (!read_buffer) 3044 + close(fd); 3045 + return FAIL; 3046 + } 3047 +#endif 3048 #ifdef UNIX 3049 /* Set swap file protection bits after creating it. */ 3050 if (swap_mode > 0 && curbuf->b_ml.ml_mfp->mf_fname != NULL) 3051 @@ -698,7 +738,6 @@ 3052 { 3053 int m = msg_scroll; 3054 int n = msg_scrolled; 3055 - buf_T *old_curbuf = curbuf; 3056 3057 /* 3058 * The file must be closed again, the autocommands may want to change 3059 @@ -740,8 +779,13 @@ 3060 /* 3061 * Don't allow the autocommands to change the current buffer. 3062 * Try to re-open the file. 3063 + * 3064 + * Don't allow the autocommands to change the buffer name either 3065 + * (cd for example) if it invalidates fname or sfname. 3066 */ 3067 if (!read_stdin && (curbuf != old_curbuf 3068 + || (using_b_ffname && (old_b_ffname != curbuf->b_ffname)) 3069 + || (using_b_fname && (old_b_fname != curbuf->b_fname)) 3070 || (fd = mch_open((char *)fname, O_RDONLY | O_EXTRA, 0)) < 0)) 3071 { 3072 --no_wait_return; 3073 @@ -932,7 +976,10 @@ 2354 3074 else 2355 3075 { … … 2362 3082 fileformat = EOL_UNIX; /* binary: use Unix format */ 2363 3083 else if (*p_ffs == NUL) 2364 @@ -2211,7 +22 14,7 @@3084 @@ -2211,7 +2258,7 @@ 2365 3085 { 2366 3086 /* Use stderr for stdin, makes shell commands work. */ … … 2371 3091 #endif 2372 3092 2373 @@ -2341,11 +23 44,6 @@3093 @@ -2341,11 +2388,6 @@ 2374 3094 STRCAT(IObuff, _("[CR missing]")); 2375 3095 c = TRUE; … … 2383 3103 { 2384 3104 STRCAT(IObuff, _("[long lines split]")); 2385 @@ -2711,7 +27 09,7 @@3105 @@ -2711,7 +2753,7 @@ 2386 3106 { 2387 3107 if (!curbuf->b_marks_read && get_viminfo_parameter('\'') > 0 … … 2392 3112 /* Always set b_marks_read; needed when 'viminfo' is changed to include 2393 3113 * the ' parameter after opening a buffer. */ 2394 @@ -3451,7 +34 49,7 @@3114 @@ -3451,7 +3493,7 @@ 2395 3115 { 2396 3116 # ifdef UNIX … … 2401 3121 if (mch_stat((char *)IObuff, &st) < 0 2402 3122 || st.st_uid != st_old.st_uid 2403 @@ -4367,7 +4 365,7 @@3123 @@ -4367,7 +4409,7 @@ 2404 3124 || st.st_uid != st_old.st_uid 2405 3125 || st.st_gid != st_old.st_gid) … … 2410 3130 (void)mch_setperm(wfname, perm); 2411 3131 } 2412 @@ -5550,9 +5548,10 @@ 3132 @@ -5246,13 +5288,16 @@ 3133 /* Convert with iconv(). */ 3134 if (ip->bw_restlen > 0) 3135 { 3136 + char *fp; 3137 + 3138 /* Need to concatenate the remainder of the previous call and 3139 * the bytes of the current call. Use the end of the 3140 * conversion buffer for this. */ 3141 fromlen = len + ip->bw_restlen; 3142 - from = (char *)ip->bw_conv_buf + ip->bw_conv_buflen - fromlen; 3143 - mch_memmove((void *)from, ip->bw_rest, (size_t)ip->bw_restlen); 3144 - mch_memmove((void *)(from + ip->bw_restlen), buf, (size_t)len); 3145 + fp = (char *)ip->bw_conv_buf + ip->bw_conv_buflen - fromlen; 3146 + mch_memmove(fp, ip->bw_rest, (size_t)ip->bw_restlen); 3147 + mch_memmove(fp + ip->bw_restlen, buf, (size_t)len); 3148 + from = fp; 3149 tolen = ip->bw_conv_buflen - fromlen; 3150 } 3151 else 3152 @@ -5550,9 +5595,10 @@ 2413 3153 name = "ucs-4le"; /* FF FE 00 00 */ 2414 3154 len = 4; … … 2423 3163 } 2424 3164 else if (p[0] == 0xfe && p[1] == 0xff 2425 @@ -6031,9 +60 30,9 @@3165 @@ -6031,9 +6077,9 @@ 2426 3166 { 2427 3167 tbuf[FGETS_SIZE - 2] = NUL; … … 2435 3175 } while (tbuf[FGETS_SIZE - 2] != NUL && tbuf[FGETS_SIZE - 2] != '\n'); 2436 3176 } 2437 @@ -6107,12 +61 06,24 @@3177 @@ -6107,12 +6153,24 @@ 2438 3178 #ifdef HAVE_ACL 2439 3179 vim_acl_T acl; /* ACL from original file */ … … 2462 3202 /* 2463 3203 * Fail if the "from" file doesn't exist. Avoids that "to" is deleted. 2464 @@ -6120,6 +61 31,55 @@3204 @@ -6120,6 +6178,55 @@ 2465 3205 if (mch_stat((char *)from, &st) < 0) 2466 3206 return -1; … … 2518 3258 * Delete the "to" file, this is required on some systems to make the 2519 3259 * mch_rename() work, on other systems it makes sure that we don't have 2520 @@ -8523,6 +8583,7 @@ 3260 @@ -6260,7 +6367,7 @@ 3261 3262 if (!stuff_empty() || global_busy || !typebuf_typed() 3263 #ifdef FEAT_AUTOCMD 3264 - || autocmd_busy || curbuf_lock > 0 3265 + || autocmd_busy || curbuf_lock > 0 || allbuf_lock > 0 3266 #endif 3267 ) 3268 need_check_timestamps = TRUE; /* check later */ 3269 @@ -6462,8 +6569,10 @@ 3270 set_vim_var_string(VV_FCS_REASON, (char_u *)reason, -1); 3271 set_vim_var_string(VV_FCS_CHOICE, (char_u *)"", -1); 3272 # endif 3273 + ++allbuf_lock; 3274 n = apply_autocmds(EVENT_FILECHANGEDSHELL, 3275 buf->b_fname, buf->b_fname, FALSE, buf); 3276 + --allbuf_lock; 3277 busy = FALSE; 3278 if (n) 3279 { 3280 @@ -8523,6 +8632,7 @@ 2521 3281 char_u *save_sourcing_name; 2522 3282 linenr_T save_sourcing_lnum; … … 2526 3286 char_u *save_autocmd_match; 2527 3287 int save_autocmd_busy; 2528 @@ -8601,6 +8 662,7 @@3288 @@ -8601,6 +8711,7 @@ 2529 3289 * Save the autocmd_* variables and info about the current buffer. 2530 3290 */ … … 2534 3294 save_autocmd_match = autocmd_match; 2535 3295 save_autocmd_busy = autocmd_busy; 2536 @@ -8618,14 +8 680,15 @@3296 @@ -8618,14 +8729,15 @@ 2537 3297 if (fname != NULL && *fname != NUL) 2538 3298 autocmd_fname = fname; … … 2552 3312 /* 2553 3313 * Set the buffer number to be used for <abuf>. 2554 @@ -8810,6 +8 873,7 @@3314 @@ -8810,6 +8922,7 @@ 2555 3315 sourcing_lnum = save_sourcing_lnum; 2556 3316 vim_free(autocmd_fname); … … 2560 3320 autocmd_match = save_autocmd_match; 2561 3321 #ifdef FEAT_EVAL 2562 @@ -8918,7 + 8982,7 @@3322 @@ -8918,7 +9031,7 @@ 2563 3323 { 2564 3324 apc->curpat = NULL; … … 2569 3329 * buffer number. */ 2570 3330 if (ap->pat != NULL && ap->cmds != NULL 2571 @@ -9104,7 +9 168,7 @@3331 @@ -9104,7 +9217,7 @@ 2572 3332 set_context_in_autocmd(xp, arg, doautocmd) 2573 3333 expand_T *xp; … … 2580 3340 diff -Naur vim72.orig/src/fold.c vim72/src/fold.c 2581 3341 --- vim72.orig/src/fold.c 2008-08-06 04:01:12.000000000 -0700 2582 +++ vim72/src/fold.c 2009-0 1-19 00:10:42.000000000 -08003342 +++ vim72/src/fold.c 2009-03-12 11:54:59.842732505 -0700 2583 3343 @@ -48,7 +48,7 @@ 2584 3344 static int foldFind __ARGS((garray_T *gap, linenr_T lnum, fold_T **fpp)); … … 2669 3429 diff -Naur vim72.orig/src/getchar.c vim72/src/getchar.c 2670 3430 --- vim72.orig/src/getchar.c 2008-07-22 09:57:48.000000000 -0700 2671 +++ vim72/src/getchar.c 2009-01-19 00:09:36.000000000 -0800 2672 @@ -4702,7 +4702,7 @@ 3431 +++ vim72/src/getchar.c 2009-03-12 11:55:13.579612236 -0700 3432 @@ -3816,7 +3816,11 @@ 3433 int len = 1; 3434 3435 if (msg_didout || msg_silent != 0) 3436 + { 3437 msg_putchar('\n'); 3438 + if (got_int) /* 'q' typed at MORE prompt */ 3439 + return; 3440 + } 3441 if ((mp->m_mode & (INSERT + CMDLINE)) == INSERT + CMDLINE) 3442 msg_putchar('!'); /* :map! */ 3443 else if (mp->m_mode & INSERT) 3444 @@ -4702,7 +4706,7 @@ 2673 3445 return FAIL; 2674 3446 if (mp->m_noremap != REMAP_YES && fprintf(fd, "nore") < 0) … … 2679 3451 if (buf != NULL && fputs(" <buffer>", fd) < 0) 2680 3452 return FAIL; 2681 @@ -4801,7 +480 1,7 @@3453 @@ -4801,7 +4805,7 @@ 2682 3454 } 2683 3455 if (IS_SPECIAL(c) || modifiers) /* special key */ … … 2690 3462 diff -Naur vim72.orig/src/globals.h vim72/src/globals.h 2691 3463 --- vim72.orig/src/globals.h 2008-07-26 04:53:29.000000000 -0700 2692 +++ vim72/src/globals.h 2009-01-19 00:10:45.000000000 -0800 2693 @@ -1022,6 +1022,7 @@ 3464 +++ vim72/src/globals.h 2009-03-12 11:55:13.699620338 -0700 3465 @@ -482,8 +482,10 @@ 3466 /* 3467 * While executing external commands or in Ex mode, should not insert GUI 3468 * events in the input buffer: Set hold_gui_events to non-zero. 3469 + * 3470 + * volatile because it is used in signal handler sig_sysmouse(). 3471 */ 3472 -EXTERN int hold_gui_events INIT(= 0); 3473 +EXTERN volatile int hold_gui_events INIT(= 0); 3474 3475 /* 3476 * When resizing the shell is postponed, remember the new size, and call 3477 @@ -597,7 +599,8 @@ 3478 EXTERN int really_exiting INIT(= FALSE); 3479 /* TRUE when we are sure to exit, e.g., after 3480 * a deadly signal */ 3481 -EXTERN int full_screen INIT(= FALSE); 3482 +/* volatile because it is used in signal handler deathtrap(). */ 3483 +EXTERN volatile int full_screen INIT(= FALSE); 3484 /* TRUE when doing full-screen output 3485 * otherwise only writing some messages */ 3486 3487 @@ -616,6 +619,11 @@ 3488 EXTERN int curbuf_lock INIT(= 0); 3489 /* non-zero when the current buffer can't be 3490 * changed. Used for FileChangedRO. */ 3491 +EXTERN int allbuf_lock INIT(= 0); 3492 + /* non-zero when no buffer name can be 3493 + * changed, no buffer can be deleted and 3494 + * current directory can't be changed. 3495 + * Used for SwapExists et al. */ 3496 #endif 3497 #ifdef FEAT_EVAL 3498 # define HAVE_SANDBOX 3499 @@ -739,10 +747,12 @@ 3500 */ 3501 EXTERN JMP_BUF lc_jump_env; /* argument to SETJMP() */ 3502 # ifdef SIGHASARG 3503 -EXTERN int lc_signal; /* catched signal number, 0 when no was signal 3504 - catched; used for mch_libcall() */ 3505 +/* volatile because it is used in signal handlers. */ 3506 +EXTERN volatile int lc_signal; /* caught signal number, 0 when no was signal 3507 + caught; used for mch_libcall() */ 3508 # endif 3509 -EXTERN int lc_active INIT(= FALSE); /* TRUE when lc_jump_env is valid. */ 3510 +/* volatile because it is used in signal handler deathtrap(). */ 3511 +EXTERN volatile int lc_active INIT(= FALSE); /* TRUE when lc_jump_env is valid. */ 3512 #endif 3513 3514 #if defined(FEAT_MBYTE) || defined(FEAT_POSTSCRIPT) 3515 @@ -986,7 +996,8 @@ 3516 EXTERN FILE *scriptout INIT(= NULL); /* stream to write script to */ 3517 EXTERN int read_cmd_fd INIT(= 0); /* fd to read commands from */ 3518 3519 -EXTERN int got_int INIT(= FALSE); /* set to TRUE when interrupt 3520 +/* volatile because it is used in signal handler catch_sigint(). */ 3521 +EXTERN volatile int got_int INIT(= FALSE); /* set to TRUE when interrupt 3522 signal occurred */ 3523 #ifdef USE_TERM_CONSOLE 3524 EXTERN int term_console INIT(= FALSE); /* set to TRUE when console used */ 3525 @@ -1022,6 +1033,7 @@ 2694 3526 #endif 2695 3527 #ifdef FEAT_AUTOCMD … … 2699 3531 EXTERN char_u *autocmd_match INIT(= NULL); /* name for <amatch> on cmdline */ 2700 3532 EXTERN int did_cursorhold INIT(= FALSE); /* set when CursorHold t'gerd */ 2701 @@ -1339,7 +13 40,6 @@3533 @@ -1339,7 +1351,6 @@ 2702 3534 2703 3535 #ifdef FEAT_NETBEANS_INTG … … 2707 3539 EXTERN int netbeansForcedQuit INIT(= 0);/* don't write modified files */ 2708 3540 EXTERN int netbeansReadFile INIT(= 1); /* OK to read from disk if != 0 */ 2709 @@ -1548,6 +15 48,14 @@3541 @@ -1548,6 +1559,14 @@ 2710 3542 EXTERN time_t starttime; 2711 3543 … … 2722 3554 */ 2723 3555 #ifdef FEAT_FKMAP 3556 diff -Naur vim72.orig/src/gui_at_sb.c vim72/src/gui_at_sb.c 3557 --- vim72.orig/src/gui_at_sb.c 2004-06-07 07:32:25.000000000 -0700 3558 +++ vim72/src/gui_at_sb.c 2009-03-12 11:54:50.138110630 -0700 3559 @@ -1078,6 +1078,12 @@ 3560 Cardinal *num_params; /* unused */ 3561 { 3562 ScrollbarWidget sbw = (ScrollbarWidget)w; 3563 + /* Use a union to avoid a warning for the weird conversion from float to 3564 + * XtPointer. Comes from Xaw/Scrollbar.c. */ 3565 + union { 3566 + XtPointer xtp; 3567 + float xtf; 3568 + } xtpf; 3569 3570 if (LookAhead(w, event)) 3571 return; 3572 @@ -1085,7 +1091,8 @@ 3573 /* thumbProc is not pretty, but is necessary for backwards 3574 compatibility on those architectures for which it work{s,ed}; 3575 the intent is to pass a (truncated) float by value. */ 3576 - XtCallCallbacks(w, XtNthumbProc, *(XtPointer*)&sbw->scrollbar.top); 3577 + xtpf.xtf = sbw->scrollbar.top; 3578 + XtCallCallbacks(w, XtNthumbProc, xtpf.xtp); 3579 XtCallCallbacks(w, XtNjumpProc, (XtPointer)&sbw->scrollbar.top); 3580 } 3581 2724 3582 diff -Naur vim72.orig/src/gui.c vim72/src/gui.c 2725 3583 --- vim72.orig/src/gui.c 2008-07-27 12:32:14.000000000 -0700 2726 +++ vim72/src/gui.c 2009-0 1-19 00:10:07.000000000 -08003584 +++ vim72/src/gui.c 2009-03-12 11:54:50.298121805 -0700 2727 3585 @@ -139,7 +139,7 @@ 2728 3586 /* The read returns when the child closes the pipe (or when … … 2815 3673 } 2816 3674 #ifdef FEAT_WINDOWS 2817 diff -Naur vim72.orig/src/gui_at_sb.c vim72/src/gui_at_sb.c2818 --- vim72.orig/src/gui_at_sb.c 2004-06-07 07:32:25.000000000 -07002819 +++ vim72/src/gui_at_sb.c 2009-01-19 00:09:39.000000000 -08002820 @@ -1078,6 +1078,12 @@2821 Cardinal *num_params; /* unused */2822 {2823 ScrollbarWidget sbw = (ScrollbarWidget)w;2824 + /* Use a union to avoid a warning for the weird conversion from float to2825 + * XtPointer. Comes from Xaw/Scrollbar.c. */2826 + union {2827 + XtPointer xtp;2828 + float xtf;2829 + } xtpf;2830 2831 if (LookAhead(w, event))2832 return;2833 @@ -1085,7 +1091,8 @@2834 /* thumbProc is not pretty, but is necessary for backwards2835 compatibility on those architectures for which it work{s,ed};2836 the intent is to pass a (truncated) float by value. */2837 - XtCallCallbacks(w, XtNthumbProc, *(XtPointer*)&sbw->scrollbar.top);2838 + xtpf.xtf = sbw->scrollbar.top;2839 + XtCallCallbacks(w, XtNthumbProc, xtpf.xtp);2840 XtCallCallbacks(w, XtNjumpProc, (XtPointer)&sbw->scrollbar.top);2841 }2842 2843 3675 diff -Naur vim72.orig/src/gui_gtk_x11.c vim72/src/gui_gtk_x11.c 2844 3676 --- vim72.orig/src/gui_gtk_x11.c 2008-07-04 03:46:24.000000000 -0700 2845 +++ vim72/src/gui_gtk_x11.c 2009-0 1-19 00:09:39.000000000 -08003677 +++ vim72/src/gui_gtk_x11.c 2009-03-12 11:54:50.138110630 -0700 2846 3678 @@ -4070,14 +4070,14 @@ 2847 3679 … … 2867 3699 diff -Naur vim72.orig/src/gui_x11.c vim72/src/gui_x11.c 2868 3700 --- vim72.orig/src/gui_x11.c 2008-06-08 08:13:45.000000000 -0700 2869 +++ vim72/src/gui_x11.c 2009-01-19 00:08:42.000000000 -0800 2870 @@ -2450,7 +2450,7 @@ 3701 +++ vim72/src/gui_x11.c 2009-03-12 11:55:13.599613075 -0700 3702 @@ -1587,6 +1587,8 @@ 3703 XtCloseDisplay(gui.dpy); 3704 gui.dpy = NULL; 3705 vimShell = (Widget)0; 3706 + vim_free(gui_argv); 3707 + gui_argv = NULL; 3708 } 3709 3710 /* 3711 @@ -1761,6 +1763,8 @@ 3712 * says that this isn't needed when exiting, so just skip it. */ 3713 XtCloseDisplay(gui.dpy); 3714 #endif 3715 + vim_free(gui_argv); 3716 + gui_argv = NULL; 3717 } 3718 3719 /* 3720 @@ -2450,7 +2454,7 @@ 2871 3721 *colorPtr = colortable[closest]; 2872 3722 } … … 2877 3727 } 2878 3728 3729 @@ -3439,47 +3443,37 @@ 3730 char_u *signfile; 3731 { 3732 XpmAttributes attrs; 3733 - XImage *sign; 3734 + XImage *sign = NULL; 3735 int status; 3736 3737 /* 3738 * Setup the color substitution table. 3739 */ 3740 - sign = NULL; 3741 if (signfile[0] != NUL && signfile[0] != '-') 3742 { 3743 - sign = (XImage *)alloc(sizeof(XImage)); 3744 - if (sign != NULL) 3745 + XpmColorSymbol color[5] = 3746 { 3747 - XpmColorSymbol color[5] = 3748 - { 3749 - {"none", NULL, 0}, 3750 - {"iconColor1", NULL, 0}, 3751 - {"bottomShadowColor", NULL, 0}, 3752 - {"topShadowColor", NULL, 0}, 3753 - {"selectColor", NULL, 0} 3754 - }; 3755 - attrs.valuemask = XpmColorSymbols; 3756 - attrs.numsymbols = 2; 3757 - attrs.colorsymbols = color; 3758 - attrs.colorsymbols[0].pixel = gui.back_pixel; 3759 - attrs.colorsymbols[1].pixel = gui.norm_pixel; 3760 - status = XpmReadFileToImage(gui.dpy, (char *)signfile, 3761 + {"none", NULL, 0}, 3762 + {"iconColor1", NULL, 0}, 3763 + {"bottomShadowColor", NULL, 0}, 3764 + {"topShadowColor", NULL, 0}, 3765 + {"selectColor", NULL, 0} 3766 + }; 3767 + attrs.valuemask = XpmColorSymbols; 3768 + attrs.numsymbols = 2; 3769 + attrs.colorsymbols = color; 3770 + attrs.colorsymbols[0].pixel = gui.back_pixel; 3771 + attrs.colorsymbols[1].pixel = gui.norm_pixel; 3772 + status = XpmReadFileToImage(gui.dpy, (char *)signfile, 3773 &sign, NULL, &attrs); 3774 - 3775 - if (status == 0) 3776 - { 3777 - /* Sign width is fixed at two columns now. 3778 - if (sign->width > gui.sign_width) 3779 - gui.sign_width = sign->width + 8; */ 3780 - } 3781 - else 3782 - { 3783 - vim_free(sign); 3784 - sign = NULL; 3785 - EMSG(_(e_signdata)); 3786 - } 3787 + if (status == 0) 3788 + { 3789 + /* Sign width is fixed at two columns now. 3790 + if (sign->width > gui.sign_width) 3791 + gui.sign_width = sign->width + 8; */ 3792 } 3793 + else 3794 + EMSG(_(e_signdata)); 3795 } 3796 3797 return (void *)sign; 3798 @@ -3489,8 +3483,7 @@ 3799 gui_mch_destroy_sign(sign) 3800 void *sign; 3801 { 3802 - XFree(((XImage *)sign)->data); 3803 - vim_free(sign); 3804 + XDestroyImage((XImage*)sign); 3805 } 3806 #endif 3807 2879 3808 diff -Naur vim72.orig/src/gui_xmdlg.c vim72/src/gui_xmdlg.c 2880 3809 --- vim72.orig/src/gui_xmdlg.c 2008-06-21 09:05:32.000000000 -0700 2881 +++ vim72/src/gui_xmdlg.c 2009-0 1-19 00:09:39.000000000 -08003810 +++ vim72/src/gui_xmdlg.c 2009-03-12 11:54:50.142110910 -0700 2882 3811 @@ -369,10 +369,10 @@ 2883 3812 char buf[TEMP_BUF_SIZE]; … … 3035 3964 diff -Naur vim72.orig/src/gui_xmebw.c vim72/src/gui_xmebw.c 3036 3965 --- vim72.orig/src/gui_xmebw.c 2007-09-06 03:57:51.000000000 -0700 3037 +++ vim72/src/gui_xmebw.c 2009-0 1-19 00:09:39.000000000 -08003966 +++ vim72/src/gui_xmebw.c 2009-03-12 11:54:50.142110910 -0700 3038 3967 @@ -1256,7 +1256,7 @@ 3039 3968 } … … 3062 3991 diff -Naur vim72.orig/src/if_cscope.c vim72/src/if_cscope.c 3063 3992 --- vim72.orig/src/if_cscope.c 2008-06-24 09:32:34.000000000 -0700 3064 +++ vim72/src/if_cscope.c 2009-0 1-19 00:07:11.000000000 -08003993 +++ vim72/src/if_cscope.c 2009-03-12 11:55:05.383086185 -0700 3065 3994 @@ -74,7 +74,7 @@ 3066 3995 { "add", cs_add, … … 3072 4001 N_("Show this message"), "help", 0 }, 3073 4002 { "kill", cs_kill, 3074 @@ -1180,7 +1180,16 @@ 3075 (void)smsg((char_u *)_("%-5s: %-30s (Usage: %s)"), 3076 cmdp->name, _(cmdp->help), cmdp->usage); 4003 @@ -1177,10 +1177,27 @@ 4004 (void)MSG_PUTS(_("cscope commands:\n")); 4005 while (cmdp->name != NULL) 4006 { 4007 - (void)smsg((char_u *)_("%-5s: %-30s (Usage: %s)"), 4008 - cmdp->name, _(cmdp->help), cmdp->usage); 4009 + char *help = _(cmdp->help); 4010 + int space_cnt = 30 - vim_strsize((char_u *)help); 4011 + 4012 + /* Use %*s rather than %30s to ensure proper alignment in utf-8 */ 4013 + if (space_cnt < 0) 4014 + space_cnt = 0; 4015 + (void)smsg((char_u *)_("%-5s: %s%*s (Usage: %s)"), 4016 + cmdp->name, 4017 + help, space_cnt, " ", 4018 + cmdp->usage); 3077 4019 if (strcmp(cmdp->name, "find") == 0) 3078 4020 - MSG_PUTS(FIND_HELP); … … 3092 4034 diff -Naur vim72.orig/src/if_cscope.h vim72/src/if_cscope.h 3093 4035 --- vim72.orig/src/if_cscope.h 2007-09-02 07:51:08.000000000 -0700 3094 +++ vim72/src/if_cscope.h 2009-0 1-19 00:07:11.000000000 -08004036 +++ vim72/src/if_cscope.h 2009-03-12 11:54:28.876748429 -0700 3095 4037 @@ -42,17 +42,6 @@ 3096 4038 * f 7name Find this file … … 3113 4055 diff -Naur vim72.orig/src/if_perl.xs vim72/src/if_perl.xs 3114 4056 --- vim72.orig/src/if_perl.xs 2008-07-17 13:55:09.000000000 -0700 3115 +++ vim72/src/if_perl.xs 2009-0 1-19 00:10:02.000000000 -08004057 +++ vim72/src/if_perl.xs 2009-03-12 11:54:50.278119291 -0700 3116 4058 @@ -136,6 +136,9 @@ 3117 4059 # define Perl_newXS_flags dll_Perl_newXS_flags … … 3164 4106 diff -Naur vim72.orig/src/if_python.c vim72/src/if_python.c 3165 4107 --- vim72.orig/src/if_python.c 2008-07-17 14:09:32.000000000 -0700 3166 +++ vim72/src/if_python.c 2009-0 1-19 00:10:59.000000000 -08004108 +++ vim72/src/if_python.c 2009-03-12 11:54:59.902735857 -0700 3167 4109 @@ -531,6 +531,12 @@ 3168 4110 if (PythonMod_Init()) … … 3266 4208 diff -Naur vim72.orig/src/if_xcmdsrv.c vim72/src/if_xcmdsrv.c 3267 4209 --- vim72.orig/src/if_xcmdsrv.c 2008-07-18 06:05:03.000000000 -0700 3268 +++ vim72/src/if_xcmdsrv.c 2009-0 1-19 00:08:50.000000000 -08004210 +++ vim72/src/if_xcmdsrv.c 2009-03-12 11:54:43.269670345 -0700 3269 4211 @@ -736,7 +736,7 @@ 3270 4212 + serverReply.ga_len; … … 3294 4236 p = entry; 3295 4237 continue; 4238 diff -Naur vim72.orig/src/macros.h vim72/src/macros.h 4239 --- vim72.orig/src/macros.h 2007-08-04 04:44:18.000000000 -0700 4240 +++ vim72/src/macros.h 2009-03-12 11:55:13.411601900 -0700 4241 @@ -127,15 +127,31 @@ 4242 #ifdef FEAT_LANGMAP 4243 /* 4244 * Adjust chars in a language according to 'langmap' option. 4245 - * NOTE that there is NO overhead if 'langmap' is not set; but even 4246 - * when set we only have to do 2 ifs and an array lookup. 4247 + * NOTE that there is no noticeable overhead if 'langmap' is not set. 4248 + * When set the overhead for characters < 256 is small. 4249 * Don't apply 'langmap' if the character comes from the Stuff buffer. 4250 * The do-while is just to ignore a ';' after the macro. 4251 */ 4252 -# define LANGMAP_ADJUST(c, condition) do { \ 4253 - if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0 && (c) < 256) \ 4254 - c = langmap_mapchar[c]; \ 4255 +# ifdef FEAT_MBYTE 4256 +# define LANGMAP_ADJUST(c, condition) \ 4257 + do { \ 4258 + if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0) \ 4259 + { \ 4260 + if ((c) < 256) \ 4261 + c = langmap_mapchar[c]; \ 4262 + else \ 4263 + c = langmap_adjust_mb(c); \ 4264 + } \ 4265 } while (0) 4266 +# else 4267 +# define LANGMAP_ADJUST(c, condition) \ 4268 + do { \ 4269 + if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0 && (c) < 256) \ 4270 + c = langmap_mapchar[c]; \ 4271 + } while (0) 4272 +# endif 4273 +#else 4274 +# define LANGMAP_ADJUST(c, condition) /* nop */ 4275 #endif 4276 4277 /* 3296 4278 diff -Naur vim72.orig/src/main.c vim72/src/main.c 3297 4279 --- vim72.orig/src/main.c 2008-07-24 01:40:56.000000000 -0700 3298 +++ vim72/src/main.c 2009-0 1-19 00:09:39.000000000 -08004280 +++ vim72/src/main.c 2009-03-12 11:54:50.142110910 -0700 3299 4281 @@ -645,11 +645,12 @@ 3300 4282 … … 3358 4340 diff -Naur vim72.orig/src/mark.c vim72/src/mark.c 3359 4341 --- vim72.orig/src/mark.c 2008-08-08 15:06:49.000000000 -0700 3360 +++ vim72/src/mark.c 2009-0 1-19 00:08:31.000000000 -08004342 +++ vim72/src/mark.c 2009-03-12 11:54:40.549496299 -0700 3361 4343 @@ -1627,15 +1627,17 @@ 3362 4344 … … 3427 4409 diff -Naur vim72.orig/src/mbyte.c vim72/src/mbyte.c 3428 4410 --- vim72.orig/src/mbyte.c 2008-07-14 05:38:05.000000000 -0700 3429 +++ vim72/src/mbyte.c 2009-0 1-19 00:09:39.000000000 -08004411 +++ vim72/src/mbyte.c 2009-03-12 11:54:50.142110910 -0700 3430 4412 @@ -717,7 +717,7 @@ 3431 4413 * where mblen() returns 0 for invalid character. … … 3509 4491 diff -Naur vim72.orig/src/menu.c vim72/src/menu.c 3510 4492 --- vim72.orig/src/menu.c 2008-06-21 12:53:43.000000000 -0700 3511 +++ vim72/src/menu.c 2009-0 1-19 00:07:05.000000000 -08004493 +++ vim72/src/menu.c 2009-03-12 11:54:28.852745635 -0700 3512 4494 @@ -1120,6 +1120,7 @@ 3513 4495 parent = menu; … … 3520 4502 diff -Naur vim72.orig/src/message.c vim72/src/message.c 3521 4503 --- vim72.orig/src/message.c 2008-07-09 11:24:55.000000000 -0700 3522 +++ vim72/src/message.c 2009-01-19 00:10:51.000000000 -0800 3523 @@ -4556,7 +4556,13 @@ 4504 +++ vim72/src/message.c 2009-03-12 11:55:13.623615309 -0700 4505 @@ -976,7 +976,7 @@ 4506 } 4507 } 4508 else if (msg_scrolled > Rows - 2 4509 - && (c == 'j' || c == K_DOWN || c == 'd')) 4510 + && (c == 'j' || c == K_DOWN || c == 'd' || c == 'f')) 4511 c = K_IGNORE; 4512 } 4513 } while ((had_got_int && c == Ctrl_C) 4514 @@ -2504,7 +2504,6 @@ 4515 break; 4516 4517 case 'u': /* Up half a page */ 4518 - case K_PAGEUP: 4519 scroll = -(Rows / 2); 4520 break; 4521 4522 @@ -2513,10 +2512,12 @@ 4523 break; 4524 4525 case 'b': /* one page back */ 4526 + case K_PAGEUP: 4527 scroll = -(Rows - 1); 4528 break; 4529 4530 case ' ': /* one extra page */ 4531 + case 'f': 4532 case K_PAGEDOWN: 4533 case K_LEFTMOUSE: 4534 scroll = Rows - 1; 4535 @@ -2552,7 +2553,6 @@ 4536 { 4537 /* Jump to the choices of the dialog. */ 4538 retval = TRUE; 4539 - lines_left = Rows - 1; 4540 } 4541 else 4542 #endif 4543 @@ -2560,6 +2560,9 @@ 4544 got_int = TRUE; 4545 quit_more = TRUE; 4546 } 4547 + /* When there is some more output (wrapping line) display that 4548 + * without another prompt. */ 4549 + lines_left = Rows - 1; 4550 break; 4551 4552 #ifdef FEAT_CLIPBOARD 4553 @@ -3309,7 +3312,10 @@ 4554 { 4555 c = gui_mch_dialog(type, title, message, buttons, dfltbutton, 4556 textfield); 4557 - msg_end_prompt(); 4558 + /* avoid a hit-enter prompt without clearing the cmdline */ 4559 + need_wait_return = FALSE; 4560 + emsg_on_display = FALSE; 4561 + cmdline_row = msg_row; 4562 4563 /* Flush output to avoid that further messages and redrawing is done 4564 * in the wrong order. */ 4565 @@ -4556,7 +4562,13 @@ 3524 4566 remove_trailing_zeroes = TRUE; 3525 4567 } … … 3536 4578 /* Avoid a buffer overflow */ 3537 4579 strcpy(tmp, "inf"); 3538 @@ -4585,61 +459 1,62 @@4580 @@ -4585,61 +4597,62 @@ 3539 4581 if (remove_trailing_zeroes) 3540 4582 { … … 3622 4664 diff -Naur vim72.orig/src/misc1.c vim72/src/misc1.c 3623 4665 --- vim72.orig/src/misc1.c 2008-07-12 12:20:53.000000000 -0700 3624 +++ vim72/src/misc1.c 2009-0 1-19 00:08:31.000000000 -08004666 +++ vim72/src/misc1.c 2009-03-12 11:54:40.553496578 -0700 3625 4667 @@ -3245,9 +3245,9 @@ 3626 4668 … … 3637 4679 diff -Naur vim72.orig/src/misc2.c vim72/src/misc2.c 3638 4680 --- vim72.orig/src/misc2.c 2008-07-23 12:12:56.000000000 -0700 3639 +++ vim72/src/misc2.c 2009-01-19 00:10:29.000000000 -0800 3640 @@ -873,7 +873,7 @@ 4681 +++ vim72/src/misc2.c 2009-03-12 11:55:33.688900964 -0700 4682 @@ -496,7 +496,8 @@ 4683 { 4684 colnr_T len; 4685 #ifdef FEAT_VIRTUALEDIT 4686 - colnr_T oldcol = curwin->w_cursor.col + curwin->w_cursor.coladd; 4687 + colnr_T oldcol = curwin->w_cursor.col; 4688 + colnr_T oldcoladd = curwin->w_cursor.col + curwin->w_cursor.coladd; 4689 #endif 4690 4691 len = (colnr_T)STRLEN(ml_get_curline()); 4692 @@ -535,7 +536,13 @@ 4693 if (oldcol == MAXCOL) 4694 curwin->w_cursor.coladd = 0; 4695 else if (ve_flags == VE_ALL) 4696 - curwin->w_cursor.coladd = oldcol - curwin->w_cursor.col; 4697 + { 4698 + if (oldcoladd > curwin->w_cursor.col) 4699 + curwin->w_cursor.coladd = oldcoladd - curwin->w_cursor.col; 4700 + else 4701 + /* avoid weird number when there is a miscalculation or overflow */ 4702 + curwin->w_cursor.coladd = 0; 4703 + } 4704 #endif 4705 } 4706 4707 @@ -873,7 +880,7 @@ 3641 4708 /* 3. check for available memory: call mch_avail_mem() */ 3642 4709 if (mch_avail_mem(TRUE) < KEEP_ROOM && !releasing) … … 3647 4714 } 3648 4715 else 3649 @@ -1257,7 +1257,6 @@ 4716 @@ -1010,6 +1017,9 @@ 4717 # if defined(FEAT_PROFILE) 4718 do_cmdline_cmd((char_u *)"profdel *"); 4719 # endif 4720 +# if defined(FEAT_KEYMAP) 4721 + do_cmdline_cmd((char_u *)"set keymap="); 4722 +#endif 4723 4724 # ifdef FEAT_TITLE 4725 free_titles(); 4726 @@ -1034,6 +1044,9 @@ 4727 free_regexp_stuff(); 4728 free_tag_stuff(); 4729 free_cd_dir(); 4730 +# ifdef FEAT_SIGNS 4731 + free_signs(); 4732 +# endif 4733 # ifdef FEAT_EVAL 4734 set_expr_line(NULL); 4735 # endif 4736 @@ -1257,7 +1270,6 @@ 3650 4737 return escaped_string; 3651 4738 } … … 3655 4742 * Return TRUE when 'shell' has "csh" in the tail. 3656 4743 */ 3657 @@ -1266,9 +12 65,7 @@4744 @@ -1266,9 +1278,7 @@ 3658 4745 { 3659 4746 return (strstr((char *)gettail(p_sh), "csh") != NULL); … … 3665 4752 * Escape "string" for use as a shell argument with system(). 3666 4753 * This uses single quotes, except when we know we need to use double qoutes 3667 @@ -1391,7 +1 388,6 @@4754 @@ -1391,7 +1401,6 @@ 3668 4755 3669 4756 return escaped_string; … … 3673 4760 /* 3674 4761 * Like vim_strsave(), but make all characters uppercase. 3675 @@ -2565,7 +25 61,7 @@4762 @@ -2565,7 +2574,7 @@ 3676 4763 int key; 3677 4764 int dlen = 0; … … 3682 4769 return 0; 3683 4770 3684 @@ -2601,10 +2 597,11 @@4771 @@ -2601,10 +2610,11 @@ 3685 4772 * returns 0 if there is no match. 3686 4773 */ … … 3696 4783 char_u *last_dash; 3697 4784 char_u *end_of_name; 3698 @@ -2672,7 +26 69,8 @@4785 @@ -2672,7 +2682,8 @@ 3699 4786 else 3700 4787 { … … 3706 4793 3707 4794 /* 4795 @@ -4698,7 +4709,8 @@ 4796 stackp->ffs_filearray_cur = i + 1; 4797 ff_push(search_ctx, stackp); 4798 4799 - simplify_filename(file_path); 4800 + if (!path_with_url(file_path)) 4801 + simplify_filename(file_path); 4802 if (mch_dirname(ff_expand_buffer, MAXPATHL) 4803 == OK) 4804 { 3708 4805 diff -Naur vim72.orig/src/move.c vim72/src/move.c 3709 4806 --- vim72.orig/src/move.c 2008-07-12 09:26:47.000000000 -0700 3710 +++ vim72/src/move.c 2009-0 1-19 00:09:02.000000000 -08004807 +++ vim72/src/move.c 2009-03-12 11:54:46.913903059 -0700 3711 4808 @@ -280,18 +280,20 @@ 3712 4809 … … 3756 4853 wp->w_topfill = 0; 3757 4854 #endif 4855 diff -Naur vim72.orig/src/nbdebug.c vim72/src/nbdebug.c 4856 --- vim72.orig/src/nbdebug.c 2008-06-22 08:38:58.000000000 -0700 4857 +++ vim72/src/nbdebug.c 2009-03-12 11:55:13.487606370 -0700 4858 @@ -33,7 +33,6 @@ 4859 u_int nb_dlevel = 0; /* nb_debug verbosity level */ 4860 4861 void nbdb(char *, ...); 4862 -void nbtrace(char *, ...); 4863 4864 static int lookup(char *); 4865 #ifdef USE_NB_ERRORHANDLER 4866 @@ -100,25 +99,6 @@ 4867 } /* end nbdebug_log_init */ 4868 4869 4870 - 4871 - 4872 -void 4873 -nbtrace( 4874 - char *fmt, 4875 - ...) 4876 -{ 4877 - va_list ap; 4878 - 4879 - if (nb_debug!= NULL && (nb_dlevel & (NB_TRACE | NB_TRACE_VERBOSE))) { 4880 - va_start(ap, fmt); 4881 - vfprintf(nb_debug, fmt, ap); 4882 - va_end(ap); 4883 - fflush(nb_debug); 4884 - } 4885 - 4886 -} /* end nbtrace */ 4887 - 4888 - 4889 void 4890 nbdbg( 4891 char *fmt, 4892 @@ -136,23 +116,6 @@ 4893 } /* end nbdbg */ 4894 4895 4896 -void 4897 -nbprt( 4898 - char *fmt, 4899 - ...) 4900 -{ 4901 - va_list ap; 4902 - 4903 - if (nb_debug != NULL && nb_dlevel & NB_PRINT) { 4904 - va_start(ap, fmt); 4905 - vfprintf(nb_debug, fmt, ap); 4906 - va_end(ap); 4907 - fflush(nb_debug); 4908 - } 4909 - 4910 -} /* end nbprt */ 4911 - 4912 - 4913 static int 4914 lookup( 4915 char *file) 4916 diff -Naur vim72.orig/src/nbdebug.h vim72/src/nbdebug.h 4917 --- vim72.orig/src/nbdebug.h 2008-06-22 07:31:50.000000000 -0700 4918 +++ vim72/src/nbdebug.h 2009-03-12 11:55:13.487606370 -0700 4919 @@ -43,8 +43,6 @@ 4920 4921 4922 void nbdbg(char *, ...); 4923 -void nbprt(char *, ...); 4924 -void nbtrace(char *, ...); 4925 4926 void nbdebug_wait __ARGS((u_int wait_flags, char *wait_var, u_int wait_secs)); 4927 void nbdebug_log_init __ARGS((char *log_var, char *level_var)); 4928 @@ -70,19 +68,5 @@ 4929 { 4930 } 4931 4932 -void 4933 -nbprt( 4934 - char *fmt, 4935 - ...) 4936 -{ 4937 -} 4938 - 4939 -void 4940 -nbtrace( 4941 - char *fmt, 4942 - ...) 4943 -{ 4944 -} 4945 - 4946 #endif /* NBDEBUG */ 4947 #endif /* NBDEBUG_H */ 3758 4948 diff -Naur vim72.orig/src/netbeans.c vim72/src/netbeans.c 3759 4949 --- vim72.orig/src/netbeans.c 2008-07-13 09:19:54.000000000 -0700 3760 +++ vim72/src/netbeans.c 2009-0 1-19 00:10:45.000000000 -08004950 +++ vim72/src/netbeans.c 2009-03-12 11:55:13.479606090 -0700 3761 4951 @@ -1043,7 +1043,7 @@ 3762 4952 nbdebug(("EVT: %s", buf)); … … 3768 4958 } 3769 4959 4960 @@ -1921,7 +1921,7 @@ 4961 vim_free(path); 4962 if (bufp == NULL) 4963 { 4964 - nbdebug((" File %s not found in setBufferNumber\n", args)); 4965 + nbdebug((" File %s not found in setBufferNumber\n", args)); 4966 EMSG2("E642: File %s not found in setBufferNumber", args); 4967 return FAIL; 4968 } 3770 4969 @@ -2277,9 +2277,6 @@ 3771 4970 int serNum; … … 3794 4993 nbdebug((" partial line annotation -- Not Yet Implemented!\n")); 3795 4994 } 4995 @@ -2321,7 +2315,7 @@ 4996 } 4997 if (pos) 4998 { 4999 - coloncmd(":sign place %d line=%d name=%d buffer=%d", 5000 + coloncmd(":sign place %d line=%ld name=%d buffer=%d", 5001 serNum, pos->lnum, typeNum, buf->bufp->b_fnum); 5002 if (typeNum == curPCtype) 5003 coloncmd(":sign jump %d buffer=%d", serNum, 5004 @@ -2425,7 +2419,7 @@ 5005 GUARDED) == 0) 5006 { 5007 coloncmd( 5008 - ":sign place %d line=%d name=%d buffer=%d", 5009 + ":sign place %d line=%ld name=%d buffer=%d", 5010 guardId++, lnum, GUARDED, 5011 buf->bufp->b_fnum); 5012 } 3796 5013 @@ -2924,44 +2918,26 @@ 3797 5014 } … … 3847 5064 diff -Naur vim72.orig/src/normal.c vim72/src/normal.c 3848 5065 --- vim72.orig/src/normal.c 2008-07-31 13:03:08.000000000 -0700 3849 +++ vim72/src/normal.c 2009-0 1-19 00:09:18.000000000 -08005066 +++ vim72/src/normal.c 2009-03-12 11:55:13.415602459 -0700 3850 5067 @@ -183,6 +183,8 @@ 3851 5068 static void nv_cursorhold __ARGS((cmdarg_T *cap)); … … 3880 5097 #ifdef FEAT_AUTOCMD 3881 5098 /* Restore counts from before receiving K_CURSORHOLD. This means after 3882 @@ -717,7 +727,15 @@ 5099 @@ -641,10 +651,7 @@ 5100 * Get the command character from the user. 5101 */ 5102 c = safe_vgetc(); 5103 - 5104 -#ifdef FEAT_LANGMAP 5105 LANGMAP_ADJUST(c, TRUE); 5106 -#endif 5107 5108 #ifdef FEAT_VISUAL 5109 /* 5110 @@ -717,7 +724,15 @@ 3883 5111 * command, so that v:count can be used in an expression mapping 3884 5112 * right after the count. */ … … 3897 5125 if (ctrl_w) 3898 5126 { 3899 @@ -804,7 +822,7 @@ 5127 @@ -726,9 +741,7 @@ 5128 } 5129 ++no_zero_mapping; /* don't map zero here */ 5130 c = plain_vgetc(); 5131 -#ifdef FEAT_LANGMAP 5132 LANGMAP_ADJUST(c, TRUE); 5133 -#endif 5134 --no_zero_mapping; 5135 if (ctrl_w) 5136 { 5137 @@ -751,9 +764,7 @@ 5138 ++no_mapping; 5139 ++allow_keys; /* no mapping for nchar, but keys */ 5140 c = plain_vgetc(); /* get next character */ 5141 -#ifdef FEAT_LANGMAP 5142 LANGMAP_ADJUST(c, TRUE); 5143 -#endif 5144 --no_mapping; 5145 --allow_keys; 5146 #ifdef FEAT_CMDL_INFO 5147 @@ -804,7 +815,7 @@ 3900 5148 * Only set v:count when called from main() and not a stuffed command. 3901 5149 */ … … 3906 5154 3907 5155 /* 3908 @@ -1132,7 +1150,8 @@ 5156 @@ -941,9 +952,7 @@ 5157 * "gr", "g'" and "g`". 5158 */ 5159 ca.nchar = plain_vgetc(); 5160 -#ifdef FEAT_LANGMAP 5161 LANGMAP_ADJUST(ca.nchar, TRUE); 5162 -#endif 5163 #ifdef FEAT_CMDL_INFO 5164 need_flushbuf |= add_to_showcmd(ca.nchar); 5165 #endif 5166 @@ -1044,10 +1053,8 @@ 5167 } 5168 #endif 5169 5170 -#ifdef FEAT_LANGMAP 5171 /* adjust chars > 127, except after "tTfFr" commands */ 5172 LANGMAP_ADJUST(*cp, !lang); 5173 -#endif 5174 #ifdef FEAT_RIGHTLEFT 5175 /* adjust Hebrew mapped char */ 5176 if (p_hkmap && lang && KeyTyped) 5177 @@ -1132,7 +1139,8 @@ 3909 5178 out_flush(); 3910 5179 #endif … … 3916 5185 3917 5186 State = NORMAL; 3918 @@ -3509,7 +35 28,7 @@5187 @@ -3509,7 +3517,7 @@ 3919 5188 if (find_type & FIND_STRING) 3920 5189 EMSG(_("E348: No string under cursor")); … … 3925 5194 } 3926 5195 ptr += col; 3927 @@ -5469,6 +5488,20 @@ 5196 @@ -4611,9 +4619,7 @@ 5197 ++no_mapping; 5198 ++allow_keys; /* no mapping for nchar, but allow key codes */ 5199 nchar = plain_vgetc(); 5200 -#ifdef FEAT_LANGMAP 5201 LANGMAP_ADJUST(nchar, TRUE); 5202 -#endif 5203 --no_mapping; 5204 --allow_keys; 5205 #ifdef FEAT_CMDL_INFO 5206 @@ -4969,9 +4975,7 @@ 5207 ++no_mapping; 5208 ++allow_keys; /* no mapping for nchar, but allow key codes */ 5209 nchar = plain_vgetc(); 5210 -#ifdef FEAT_LANGMAP 5211 LANGMAP_ADJUST(nchar, TRUE); 5212 -#endif 5213 --no_mapping; 5214 --allow_keys; 5215 #ifdef FEAT_CMDL_INFO 5216 @@ -5469,6 +5473,20 @@ 3928 5217 STRCPY(buf, "he! "); 3929 5218 else … … 3946 5235 * really what we want? */ 3947 5236 isman = (STRCMP(kp, "man") == 0); 3948 @@ -5511,37 +55 44,59 @@5237 @@ -5511,37 +5529,59 @@ 3949 5238 /* 3950 5239 * Now grab the chars in the identifier … … 3985 5274 + vim_free(buf); 3986 5275 + return; 3987 5276 + } 3988 5277 + buf = (char_u *)vim_realloc(buf, STRLEN(buf) + STRLEN(p) + 1); 3989 5278 + if (buf == NULL) … … 3992 5281 + vim_free(p); 3993 5282 + return; 3994 +}5283 } 3995 5284 + STRCAT(buf, p); 3996 5285 + vim_free(p); … … 4033 5322 /* 4034 5323 * Execute the command. 5324 @@ -6728,6 +6768,8 @@ 5325 /* Visual mode "r" */ 5326 if (VIsual_active) 5327 { 5328 + if (got_int) 5329 + reset_VIsual(); 5330 nv_operator(cap); 5331 return; 5332 } 5333 @@ -7784,7 +7826,7 @@ 5334 else 5335 i = curwin->w_leftcol; 5336 /* Go to the middle of the screen line. When 'number' is on and lines 5337 - * are wrapping the middle can be more to the left.*/ 5338 + * are wrapping the middle can be more to the left. */ 5339 if (cap->nchar == 'm') 5340 i += (W_WIDTH(curwin) - curwin_col_off() 5341 + ((curwin->w_p_wrap && i > 0) 4035 5342 diff -Naur vim72.orig/src/ops.c vim72/src/ops.c 4036 5343 --- vim72.orig/src/ops.c 2008-06-21 13:08:59.000000000 -0700 4037 +++ vim72/src/ops.c 2009-01-19 00:10:04.000000000 -0800 4038 @@ -2209,12 +2209,15 @@ 5344 +++ vim72/src/ops.c 2009-03-12 11:55:27.544506216 -0700 5345 @@ -72,11 +72,11 @@ 5346 */ 5347 struct block_def 5348 { 5349 - int startspaces; /* 'extra' cols of first char */ 5350 - int endspaces; /* 'extra' cols of first char */ 5351 + int startspaces; /* 'extra' cols before first char */ 5352 + int endspaces; /* 'extra' cols after last char */ 5353 int textlen; /* chars in block */ 5354 - char_u *textstart; /* pointer to 1st char in block */ 5355 - colnr_T textcol; /* cols of chars (at least part.) in block */ 5356 + char_u *textstart; /* pointer to 1st char (partially) in block */ 5357 + colnr_T textcol; /* index of chars (partially) in block */ 5358 colnr_T start_vcol; /* start col of 1st char wholly inside block */ 5359 colnr_T end_vcol; /* start col of 1st char wholly after block */ 5360 #ifdef FEAT_VISUALEXTRA 5361 @@ -382,15 +382,14 @@ 5362 { 5363 int left = (oap->op_type == OP_LSHIFT); 5364 int oldstate = State; 5365 - int total, split; 5366 - char_u *newp, *oldp, *midp, *ptr; 5367 + int total; 5368 + char_u *newp, *oldp; 5369 int oldcol = curwin->w_cursor.col; 5370 int p_sw = (int)curbuf->b_p_sw; 5371 int p_ts = (int)curbuf->b_p_ts; 5372 struct block_def bd; 5373 - int internal = 0; 5374 int incr; 5375 - colnr_T vcol, col = 0, ws_vcol; 5376 + colnr_T ws_vcol; 5377 int i = 0, j = 0; 5378 int len; 5379 5380 @@ -456,67 +455,89 @@ 5381 } 5382 else /* left */ 5383 { 5384 - vcol = oap->start_vcol; 5385 - /* walk vcol past ws to be removed */ 5386 - for (midp = oldp + bd.textcol; 5387 - vcol < (oap->start_vcol + total) && vim_iswhite(*midp); ) 5388 - { 5389 - incr = lbr_chartabsize_adv(&midp, (colnr_T)vcol); 5390 - vcol += incr; 5391 - } 5392 - /* internal is the block-internal ws replacing a split TAB */ 5393 - if (vcol > (oap->start_vcol + total)) 5394 - { 5395 - /* we have to split the TAB *(midp-1) */ 5396 - internal = vcol - (oap->start_vcol + total); 5397 - } 5398 - /* if 'expandtab' is not set, use TABs */ 5399 + colnr_T destination_col; /* column to which text in block will 5400 + be shifted */ 5401 + char_u *verbatim_copy_end; /* end of the part of the line which is 5402 + copied verbatim */ 5403 + colnr_T verbatim_copy_width;/* the (displayed) width of this part 5404 + of line */ 5405 + unsigned fill; /* nr of spaces that replace a TAB */ 5406 + unsigned new_line_len; /* the length of the line after the 5407 + block shift */ 5408 + size_t block_space_width; 5409 + size_t shift_amount; 5410 + char_u *non_white = bd.textstart; 5411 + colnr_T non_white_col; 5412 5413 - split = bd.startspaces + internal; 5414 - if (split > 0) 5415 - { 5416 - if (!curbuf->b_p_et) 5417 - { 5418 - for (ptr = oldp, col = 0; ptr < oldp+bd.textcol; ) 5419 - col += lbr_chartabsize_adv(&ptr, (colnr_T)col); 5420 + /* 5421 + * Firstly, let's find the first non-whitespace character that is 5422 + * displayed after the block's start column and the character's column 5423 + * number. Also, let's calculate the width of all the whitespace 5424 + * characters that are displayed in the block and precede the searched 5425 + * non-whitespace character. 5426 + */ 5427 5428 - /* col+1 now equals the start col of the first char of the 5429 - * block (may be < oap.start_vcol if we're splitting a TAB) */ 5430 - i = ((col % p_ts) + split) / p_ts; /* number of tabs */ 5431 - } 5432 - if (i) 5433 - j = ((col % p_ts) + split) % p_ts; /* number of spp */ 5434 - else 5435 - j = split; 5436 - } 5437 + /* If "bd.startspaces" is set, "bd.textstart" points to the character, 5438 + * the part of which is displayed at the block's beginning. Let's start 5439 + * searching from the next character. */ 5440 + if (bd.startspaces) 5441 + mb_ptr_adv(non_white); 5442 5443 - newp = alloc_check(bd.textcol + i + j + (unsigned)STRLEN(midp) + 1); 5444 - if (newp == NULL) 5445 - return; 5446 - vim_memset(newp, NUL, (size_t)(bd.textcol + i + j + STRLEN(midp) + 1)); 5447 + /* The character's column is in "bd.start_vcol". */ 5448 + non_white_col = bd.start_vcol; 5449 5450 - /* copy first part we want to keep */ 5451 - mch_memmove(newp, oldp, (size_t)bd.textcol); 5452 - /* Now copy any TABS and spp to ensure correct alignment! */ 5453 - while (vim_iswhite(*midp)) 5454 + while (vim_iswhite(*non_white)) 5455 { 5456 - if (*midp == TAB) 5457 - i++; 5458 - else /*space */ 5459 - j++; 5460 - midp++; 5461 + incr = lbr_chartabsize_adv(&non_white, non_white_col); 5462 + non_white_col += incr; 5463 } 5464 - /* We might have an extra TAB worth of spp now! */ 5465 - if (j / p_ts && !curbuf->b_p_et) 5466 + 5467 + block_space_width = non_white_col - oap->start_vcol; 5468 + /* We will shift by "total" or "block_space_width", whichever is less. 5469 + */ 5470 + shift_amount = (block_space_width < total? block_space_width: total); 5471 + 5472 + /* The column to which we will shift the text. */ 5473 + destination_col = non_white_col - shift_amount; 5474 + 5475 + /* Now let's find out how much of the beginning of the line we can 5476 + * reuse without modification. */ 5477 + verbatim_copy_end = bd.textstart; 5478 + verbatim_copy_width = bd.start_vcol; 5479 + 5480 + /* If "bd.startspaces" is set, "bd.textstart" points to the character 5481 + * preceding the block. We have to subtract its width to obtain its 5482 + * column number. */ 5483 + if (bd.startspaces) 5484 + verbatim_copy_width -= bd.start_char_vcols; 5485 + while (verbatim_copy_width < destination_col) 5486 { 5487 - i++; 5488 - j -= p_ts; 5489 + incr = lbr_chartabsize(verbatim_copy_end, verbatim_copy_width); 5490 + if (verbatim_copy_width + incr > destination_col) 5491 + break; 5492 + verbatim_copy_width += incr; 5493 + mb_ptr_adv(verbatim_copy_end); 5494 } 5495 - copy_chars(newp + bd.textcol, (size_t)i, TAB); 5496 - copy_spaces(newp + bd.textcol + i, (size_t)j); 5497 5498 - /* the end */ 5499 - STRMOVE(newp + STRLEN(newp), midp); 5500 + /* If "destination_col" is different from the width of the initial 5501 + * part of the line that will be copied, it means we encountered a tab 5502 + * character, which we will have to partly replace with spaces. */ 5503 + fill = destination_col - verbatim_copy_width; 5504 + 5505 + /* The replacement line will consist of: 5506 + * - the beginning of the original line up to "verbatim_copy_end", 5507 + * - "fill" number of spaces, 5508 + * - the rest of the line, pointed to by non_white. */ 5509 + new_line_len = (unsigned)(verbatim_copy_end - oldp) 5510 + + fill 5511 + + (unsigned)STRLEN(non_white) + 1; 5512 + 5513 + newp = alloc_check(new_line_len); 5514 + if (newp == NULL) 5515 + return; 5516 + mch_memmove(newp, oldp, (size_t)(verbatim_copy_end - oldp)); 5517 + copy_spaces(newp + (verbatim_copy_end - oldp), (size_t)fill); 5518 + STRMOVE(newp + (verbatim_copy_end - oldp) + fill, non_white); 5519 } 5520 /* replace the line */ 5521 ml_replace(curwin->w_cursor.lnum, newp, FALSE); 5522 @@ -2209,12 +2230,15 @@ 4039 5523 { 4040 5524 for (; pos.lnum <= oap->end.lnum; ++pos.lnum) … … 4054 5538 char_u *ptr = ml_get_buf(curbuf, pos.lnum, FALSE); 4055 5539 5540 @@ -4848,7 +4872,8 @@ 5541 * - textlen includes the first/last char to be (partly) deleted 5542 * - start/endspaces is the number of columns that are taken by the 5543 * first/last deleted char minus the number of columns that have to be 5544 - * deleted. for yank and tilde: 5545 + * deleted. 5546 + * for yank and tilde: 5547 * - textlen includes the first/last char to be wholly yanked 5548 * - start/endspaces is the number of columns of the first/last yanked char 5549 * that are to be yanked. 4056 5550 diff -Naur vim72.orig/src/option.c vim72/src/option.c 4057 5551 --- vim72.orig/src/option.c 2008-07-18 06:05:33.000000000 -0700 4058 +++ vim72/src/option.c 2009-0 1-19 00:10:29.000000000 -08005552 +++ vim72/src/option.c 2009-03-12 11:55:13.683619779 -0700 4059 5553 @@ -2593,13 +2593,13 @@ 4060 5554 #ifdef FEAT_VIMINFO … … 4074 5568 #endif 4075 5569 #else 4076 @@ -7974,6 +7974,11 @@ 5570 @@ -4119,11 +4119,23 @@ 5571 && options[opt_idx].var == VAR_WIN) 5572 goto skip; 5573 5574 - /* Disallow changing some options from modelines */ 5575 - if ((opt_flags & OPT_MODELINE) && (flags & P_SECURE)) 5576 + /* Disallow changing some options from modelines. */ 5577 + if (opt_flags & OPT_MODELINE) 5578 { 5579 - errmsg = (char_u *)_("E520: Not allowed in a modeline"); 5580 - goto skip; 5581 + if (flags & P_SECURE) 5582 + { 5583 + errmsg = (char_u *)_("E520: Not allowed in a modeline"); 5584 + goto skip; 5585 + } 5586 +#ifdef FEAT_DIFF 5587 + /* In diff mode some options are overruled. This avoids that 5588 + * 'foldmethod' becomes "marker" instead of "diff" and that 5589 + * "wrap" gets set. */ 5590 + if (curwin->w_p_diff 5591 + && (options[opt_idx].indir == PV_FDM 5592 + || options[opt_idx].indir == PV_WRAP)) 5593 + goto skip; 5594 +#endif 5595 } 5596 5597 #ifdef HAVE_SANDBOX 5598 @@ -5268,6 +5280,21 @@ 5599 } 5600 #endif 5601 5602 +#ifdef FEAT_TITLE 5603 +static void redraw_titles __ARGS((void)); 5604 + 5605 +/* 5606 + * Redraw the window title and/or tab page text later. 5607 + */ 5608 +static void redraw_titles() 5609 +{ 5610 + need_maketitle = TRUE; 5611 +# ifdef FEAT_WINDOWS 5612 + redraw_tabline = TRUE; 5613 +# endif 5614 +} 5615 +#endif 5616 + 5617 /* 5618 * Set a string option to a new value (without checking the effect). 5619 * The string is copied into allocated memory. 5620 @@ -5407,6 +5434,10 @@ 5621 int did_chartab = FALSE; 5622 char_u **gvarp; 5623 long_u free_oldval = (options[opt_idx].flags & P_ALLOCED); 5624 +#ifdef FEAT_GUI 5625 + /* set when changing an option that only requires a redraw in the GUI */ 5626 + int redraw_gui_only = FALSE; 5627 +#endif 5628 5629 /* Get the global option to compare with, otherwise we would have to check 5630 * two values for all local options. */ 5631 @@ -5668,7 +5699,7 @@ 5632 { 5633 # ifdef FEAT_TITLE 5634 /* May show a "+" in the title now. */ 5635 - need_maketitle = TRUE; 5636 + redraw_titles(); 5637 # endif 5638 /* Add 'fileencoding' to the swap file. */ 5639 ml_setflags(curbuf); 5640 @@ -5687,7 +5718,7 @@ 5641 { 5642 errmsg = mb_init(); 5643 # ifdef FEAT_TITLE 5644 - need_maketitle = TRUE; 5645 + redraw_titles(); 5646 # endif 5647 } 5648 } 5649 @@ -5766,14 +5797,28 @@ 5650 /* load or unload key mapping tables */ 5651 errmsg = keymap_init(); 5652 5653 - /* When successfully installed a new keymap switch on using it. */ 5654 - if (*curbuf->b_p_keymap != NUL && errmsg == NULL) 5655 + if (errmsg == NULL) 5656 { 5657 - curbuf->b_p_iminsert = B_IMODE_LMAP; 5658 - if (curbuf->b_p_imsearch != B_IMODE_USE_INSERT) 5659 - curbuf->b_p_imsearch = B_IMODE_LMAP; 5660 - set_iminsert_global(); 5661 - set_imsearch_global(); 5662 + if (*curbuf->b_p_keymap != NUL) 5663 + { 5664 + /* Installed a new keymap, switch on using it. */ 5665 + curbuf->b_p_iminsert = B_IMODE_LMAP; 5666 + if (curbuf->b_p_imsearch != B_IMODE_USE_INSERT) 5667 + curbuf->b_p_imsearch = B_IMODE_LMAP; 5668 + } 5669 + else 5670 + { 5671 + /* Cleared the keymap, may reset 'iminsert' and 'imsearch'. */ 5672 + if (curbuf->b_p_iminsert == B_IMODE_LMAP) 5673 + curbuf->b_p_iminsert = B_IMODE_NONE; 5674 + if (curbuf->b_p_imsearch == B_IMODE_LMAP) 5675 + curbuf->b_p_imsearch = B_IMODE_USE_INSERT; 5676 + } 5677 + if ((opt_flags & OPT_LOCAL) == 0) 5678 + { 5679 + set_iminsert_global(); 5680 + set_imsearch_global(); 5681 + } 5682 # ifdef FEAT_WINDOWS 5683 status_redraw_curbuf(); 5684 # endif 5685 @@ -5796,7 +5841,7 @@ 5686 else 5687 curbuf->b_p_tx = FALSE; 5688 #ifdef FEAT_TITLE 5689 - need_maketitle = TRUE; 5690 + redraw_titles(); 5691 #endif 5692 /* update flag in swap file */ 5693 ml_setflags(curbuf); 5694 @@ -6055,6 +6100,7 @@ 5695 errmsg = (char_u *)N_("E596: Invalid font(s)"); 5696 } 5697 } 5698 + redraw_gui_only = TRUE; 5699 } 5700 # ifdef FEAT_XFONTSET 5701 else if (varp == &p_guifontset) 5702 @@ -6063,6 +6109,7 @@ 5703 errmsg = (char_u *)N_("E597: can't select fontset"); 5704 else if (gui.in_use && gui_init_font(p_guifontset, TRUE) != OK) 5705 errmsg = (char_u *)N_("E598: Invalid fontset"); 5706 + redraw_gui_only = TRUE; 5707 } 5708 # endif 5709 # ifdef FEAT_MBYTE 5710 @@ -6072,6 +6119,7 @@ 5711 errmsg = (char_u *)N_("E533: can't select wide font"); 5712 else if (gui_get_wide_font() == FAIL) 5713 errmsg = (char_u *)N_("E534: Invalid wide font"); 5714 + redraw_gui_only = TRUE; 5715 } 5716 # endif 5717 #endif 5718 @@ -6133,13 +6181,24 @@ 5719 #ifdef FEAT_GUI 5720 /* 'guioptions' */ 5721 else if (varp == &p_go) 5722 + { 5723 gui_init_which_components(oldval); 5724 + redraw_gui_only = TRUE; 5725 + } 5726 #endif 5727 5728 #if defined(FEAT_GUI_TABLINE) 5729 /* 'guitablabel' */ 5730 else if (varp == &p_gtl) 5731 + { 5732 redraw_tabline = TRUE; 5733 + redraw_gui_only = TRUE; 5734 + } 5735 + /* 'guitabtooltip' */ 5736 + else if (varp == &p_gtt) 5737 + { 5738 + redraw_gui_only = TRUE; 5739 + } 5740 #endif 5741 5742 #if defined(FEAT_MOUSE_TTY) && (defined(UNIX) || defined(VMS)) 5743 @@ -6717,7 +6776,11 @@ 5744 5745 if (curwin->w_curswant != MAXCOL) 5746 curwin->w_set_curswant = TRUE; /* in case 'showbreak' changed */ 5747 - check_redraw(options[opt_idx].flags); 5748 +#ifdef FEAT_GUI 5749 + /* check redraw when it's not a GUI option or the GUI is active. */ 5750 + if (!redraw_gui_only || gui.in_use) 5751 +#endif 5752 + check_redraw(options[opt_idx].flags); 5753 5754 return errmsg; 5755 } 5756 @@ -7105,22 +7168,28 @@ 5757 curbuf->b_did_warn = FALSE; 5758 5759 #ifdef FEAT_TITLE 5760 - need_maketitle = TRUE; 5761 + redraw_titles(); 5762 #endif 5763 } 5764 5765 #ifdef FEAT_TITLE 5766 /* when 'modifiable' is changed, redraw the window title */ 5767 else if ((int *)varp == &curbuf->b_p_ma) 5768 - need_maketitle = TRUE; 5769 + { 5770 + redraw_titles(); 5771 + } 5772 /* when 'endofline' is changed, redraw the window title */ 5773 else if ((int *)varp == &curbuf->b_p_eol) 5774 - need_maketitle = TRUE; 5775 -#ifdef FEAT_MBYTE 5776 - /* when 'bomb' is changed, redraw the window title */ 5777 + { 5778 + redraw_titles(); 5779 + } 5780 +# ifdef FEAT_MBYTE 5781 + /* when 'bomb' is changed, redraw the window title and tab page text */ 5782 else if ((int *)varp == &curbuf->b_p_bomb) 5783 - need_maketitle = TRUE; 5784 -#endif 5785 + { 5786 + redraw_titles(); 5787 + } 5788 +# endif 5789 #endif 5790 5791 /* when 'bin' is set also set some other options */ 5792 @@ -7128,7 +7197,7 @@ 5793 { 5794 set_options_bin(old_value, curbuf->b_p_bin, opt_flags); 5795 #ifdef FEAT_TITLE 5796 - need_maketitle = TRUE; 5797 + redraw_titles(); 5798 #endif 5799 } 5800 5801 @@ -7279,7 +7348,7 @@ 5802 if (!value) 5803 save_file_ff(curbuf); /* Buffer is unchanged */ 5804 #ifdef FEAT_TITLE 5805 - need_maketitle = TRUE; 5806 + redraw_titles(); 5807 #endif 5808 #ifdef FEAT_AUTOCMD 5809 modified_was_set = value; 5810 @@ -7714,7 +7783,7 @@ 5811 newFoldLevel(); 5812 } 5813 5814 - /* 'foldminlevel' */ 5815 + /* 'foldminlines' */ 5816 else if (pp == &curwin->w_p_fml) 5817 { 5818 foldUpdateAll(curwin); 5819 @@ -7974,6 +8043,11 @@ 4077 5820 else /* curwin->w_p_scr > curwin->w_height */ 4078 5821 curwin->w_p_scr = curwin->w_height; … … 4086 5829 { 4087 5830 errmsg = e_positive; 4088 @@ -8227,13 +8 232,13 @@5831 @@ -8227,13 +8301,13 @@ 4089 5832 { 4090 5833 if (number == 0 && string != NULL) … … 4103 5846 /* There's another character after zeros or the string 4104 5847 * is empty. In both cases, we are trying to set a 4105 @@ -8323,7 +83 28,7 @@5848 @@ -8323,7 +8397,7 @@ 4106 5849 { 4107 5850 --arg; /* put arg at the '<' */ … … 4112 5855 key = 0; 4113 5856 } 5857 @@ -10093,25 +10167,110 @@ 5858 5859 #ifdef FEAT_LANGMAP 5860 /* 5861 - * Any character has an equivalent character. This is used for keyboards that 5862 - * have a special language mode that sends characters above 128 (although 5863 - * other characters can be translated too). 5864 + * Any character has an equivalent 'langmap' character. This is used for 5865 + * keyboards that have a special language mode that sends characters above 5866 + * 128 (although other characters can be translated too). The "to" field is a 5867 + * Vim command character. This avoids having to switch the keyboard back to 5868 + * ASCII mode when leaving Insert mode. 5869 + * 5870 + * langmap_mapchar[] maps any of 256 chars to an ASCII char used for Vim 5871 + * commands. 5872 + * When FEAT_MBYTE is defined langmap_mapga.ga_data is a sorted table of 5873 + * langmap_entry_T. This does the same as langmap_mapchar[] for characters >= 5874 + * 256. 5875 */ 5876 +# ifdef FEAT_MBYTE 5877 +/* 5878 + * With multi-byte support use growarray for 'langmap' chars >= 256 5879 + */ 5880 +typedef struct 5881 +{ 5882 + int from; 5883 + int to; 5884 +} langmap_entry_T; 5885 + 5886 +static garray_T langmap_mapga; 5887 +static void langmap_set_entry __ARGS((int from, int to)); 5888 5889 /* 5890 - * char_u langmap_mapchar[256]; 5891 - * Normally maps each of the 128 upper chars to an <128 ascii char; used to 5892 - * "translate" native lang chars in normal mode or some cases of 5893 - * insert mode without having to tediously switch lang mode back&forth. 5894 + * Search for an entry in "langmap_mapga" for "from". If found set the "to" 5895 + * field. If not found insert a new entry at the appropriate location. 5896 */ 5897 + static void 5898 +langmap_set_entry(from, to) 5899 + int from; 5900 + int to; 5901 +{ 5902 + langmap_entry_T *entries = (langmap_entry_T *)(langmap_mapga.ga_data); 5903 + int a = 0; 5904 + int b = langmap_mapga.ga_len; 5905 + 5906 + /* Do a binary search for an existing entry. */ 5907 + while (a != b) 5908 + { 5909 + int i = (a + b) / 2; 5910 + int d = entries[i].from - from; 5911 + 5912 + if (d == 0) 5913 + { 5914 + entries[i].to = to; 5915 + return; 5916 + } 5917 + if (d < 0) 5918 + a = i + 1; 5919 + else 5920 + b = i; 5921 + } 5922 + 5923 + if (ga_grow(&langmap_mapga, 1) != OK) 5924 + return; /* out of memory */ 5925 + 5926 + /* insert new entry at position "a" */ 5927 + entries = (langmap_entry_T *)(langmap_mapga.ga_data) + a; 5928 + mch_memmove(entries + 1, entries, 5929 + (langmap_mapga.ga_len - a) * sizeof(langmap_entry_T)); 5930 + ++langmap_mapga.ga_len; 5931 + entries[0].from = from; 5932 + entries[0].to = to; 5933 +} 5934 + 5935 +/* 5936 + * Apply 'langmap' to multi-byte character "c" and return the result. 5937 + */ 5938 + int 5939 +langmap_adjust_mb(c) 5940 + int c; 5941 +{ 5942 + langmap_entry_T *entries = (langmap_entry_T *)(langmap_mapga.ga_data); 5943 + int a = 0; 5944 + int b = langmap_mapga.ga_len; 5945 + 5946 + while (a != b) 5947 + { 5948 + int i = (a + b) / 2; 5949 + int d = entries[i].from - c; 5950 + 5951 + if (d == 0) 5952 + return entries[i].to; /* found matching entry */ 5953 + if (d < 0) 5954 + a = i + 1; 5955 + else 5956 + b = i; 5957 + } 5958 + return c; /* no entry found, return "c" unmodified */ 5959 +} 5960 +# endif 5961 5962 static void 5963 langmap_init() 5964 { 5965 int i; 5966 5967 - for (i = 0; i < 256; i++) /* we init with a-one-to one map */ 5968 - langmap_mapchar[i] = i; 5969 + for (i = 0; i < 256; i++) 5970 + langmap_mapchar[i] = i; /* we init with a one-to-one map */ 5971 +# ifdef FEAT_MBYTE 5972 + ga_init2(&langmap_mapga, sizeof(langmap_entry_T), 8); 5973 +# endif 5974 } 5975 5976 /* 5977 @@ -10125,7 +10284,10 @@ 5978 char_u *p2; 5979 int from, to; 5980 5981 - langmap_init(); /* back to one-to-one map first */ 5982 +#ifdef FEAT_MBYTE 5983 + ga_clear(&langmap_mapga); /* clear the previous map first */ 5984 +#endif 5985 + langmap_init(); /* back to one-to-one map */ 5986 5987 for (p = p_langmap; p[0] != NUL; ) 5988 { 5989 @@ -10175,7 +10337,13 @@ 5990 transchar(from)); 5991 return; 5992 } 5993 - langmap_mapchar[from & 255] = to; 5994 + 5995 +#ifdef FEAT_MBYTE 5996 + if (from >= 256) 5997 + langmap_set_entry(from, to); 5998 + else 5999 +#endif 6000 + langmap_mapchar[from & 255] = to; 6001 6002 /* Advance to next pair */ 6003 mb_ptr_adv(p); 4114 6004 diff -Naur vim72.orig/src/os_unix.c vim72/src/os_unix.c 4115 6005 --- vim72.orig/src/os_unix.c 2008-08-06 04:01:40.000000000 -0700 4116 +++ vim72/src/os_unix.c 2009-01-19 00:09:40.000000000 -0800 4117 @@ -315,12 +315,15 @@ 6006 +++ vim72/src/os_unix.c 2009-03-12 11:55:13.671618662 -0700 6007 @@ -181,7 +181,8 @@ 6008 && defined(FEAT_TITLE) && !defined(FEAT_GUI_GTK) 6009 # define SET_SIG_ALARM 6010 static RETSIGTYPE sig_alarm __ARGS(SIGPROTOARG); 6011 -static int sig_alarm_called; 6012 +/* volatile because it is used in signal handler sig_alarm(). */ 6013 +static volatile int sig_alarm_called; 6014 #endif 6015 static RETSIGTYPE deathtrap __ARGS(SIGPROTOARG); 6016 6017 @@ -201,13 +202,16 @@ 6018 # define SIG_ERR ((RETSIGTYPE (*)())-1) 6019 #endif 6020 6021 -static int do_resize = FALSE; 6022 +/* volatile because it is used in signal handler sig_winch(). */ 6023 +static volatile int do_resize = FALSE; 6024 #ifndef __EMX__ 6025 static char_u *extra_shell_arg = NULL; 6026 static int show_shell_mess = TRUE; 6027 #endif 6028 -static int deadly_signal = 0; /* The signal we caught */ 6029 -static int in_mch_delay = FALSE; /* sleeping in mch_delay() */ 6030 +/* volatile because it is used in signal handler deathtrap(). */ 6031 +static volatile int deadly_signal = 0; /* The signal we caught */ 6032 +/* volatile because it is used in signal handler deathtrap(). */ 6033 +static volatile int in_mch_delay = FALSE; /* sleeping in mch_delay() */ 6034 6035 static int curr_tmode = TMODE_COOK; /* contains current terminal mode */ 6036 6037 @@ -315,12 +319,15 @@ 4118 6038 {-1, "Unknown!", FALSE} 4119 6039 }; … … 4132 6052 RealWaitForChar(read_cmd_fd, p_wd, NULL); 4133 6053 } 4134 @@ -2905,7 +2908,7 @@ 6054 @@ -799,7 +806,7 @@ 6055 #endif 6056 6057 /* 6058 - * We need correct potatotypes for a signal function, otherwise mean compilers 6059 + * We need correct prototypes for a signal function, otherwise mean compilers 6060 * will barf when the second argument to signal() is ``wrong''. 6061 * Let me try it with a few tricky defines from my own osdef.h (jw). 6062 */ 6063 @@ -1065,13 +1072,18 @@ 6064 SIGRETURN; 6065 } 6066 6067 -#ifdef _REENTRANT 6068 +#if defined(_REENTRANT) && defined(SIGCONT) 6069 /* 6070 * On Solaris with multi-threading, suspending might not work immediately. 6071 * Catch the SIGCONT signal, which will be used as an indication whether the 6072 * suspending has been done or not. 6073 + * 6074 + * On Linux, signal is not always handled immediately either. 6075 + * See https://bugs.launchpad.net/bugs/291373 6076 + * 6077 + * volatile because it is used in in signal handler sigcont_handler(). 6078 */ 6079 -static int sigcont_received; 6080 +static volatile int sigcont_received; 6081 static RETSIGTYPE sigcont_handler __ARGS(SIGPROTOARG); 6082 6083 /* 6084 @@ -1115,15 +1127,28 @@ 6085 } 6086 # endif 6087 6088 -# ifdef _REENTRANT 6089 +# if defined(_REENTRANT) && defined(SIGCONT) 6090 sigcont_received = FALSE; 6091 # endif 6092 kill(0, SIGTSTP); /* send ourselves a STOP signal */ 6093 -# ifdef _REENTRANT 6094 - /* When we didn't suspend immediately in the kill(), do it now. Happens 6095 - * on multi-threaded Solaris. */ 6096 - if (!sigcont_received) 6097 - pause(); 6098 +# if defined(_REENTRANT) && defined(SIGCONT) 6099 + /* 6100 + * Wait for the SIGCONT signal to be handled. It generally happens 6101 + * immediately, but somehow not all the time. Do not call pause() 6102 + * because there would be race condition which would hang Vim if 6103 + * signal happened in between the test of sigcont_received and the 6104 + * call to pause(). If signal is not yet received, call sleep(0) 6105 + * to just yield CPU. Signal should then be received. If somehow 6106 + * it's still not received, sleep 1, 2, 3 ms. Don't bother waiting 6107 + * further if signal is not received after 1+2+3+4 ms (not expected 6108 + * to happen). 6109 + */ 6110 + { 6111 + long wait; 6112 + for (wait = 0; !sigcont_received && wait <= 3L; wait++) 6113 + /* Loop is not entered most of the time */ 6114 + mch_delay(wait, FALSE); 6115 + } 6116 # endif 6117 6118 # ifdef FEAT_TITLE 6119 @@ -1172,7 +1197,7 @@ 6120 #ifdef SIGTSTP 6121 signal(SIGTSTP, restricted ? SIG_IGN : SIG_DFL); 6122 #endif 6123 -#ifdef _REENTRANT 6124 +#if defined(_REENTRANT) && defined(SIGCONT) 6125 signal(SIGCONT, sigcont_handler); 6126 #endif 6127 6128 @@ -1231,7 +1256,7 @@ 6129 reset_signals() 6130 { 6131 catch_signals(SIG_DFL, SIG_DFL); 6132 -#ifdef _REENTRANT 6133 +#if defined(_REENTRANT) && defined(SIGCONT) 6134 /* SIGCONT isn't in the list, because its default action is ignore */ 6135 signal(SIGCONT, SIG_DFL); 6136 #endif 6137 @@ -2905,7 +2930,7 @@ 4135 6138 * Ignore any errors. 4136 6139 */ … … 4141 6144 #endif 4142 6145 } 4143 @@ -2936,7 +29 39,8 @@6146 @@ -2936,7 +2961,8 @@ 4144 6147 } 4145 6148 # endif … … 4151 6154 # ifdef FEAT_XCLIPBOARD 4152 6155 && x11_display != xterm_dpy 4153 @@ -3926,9 +39 30,9 @@6156 @@ -3926,9 +3952,9 @@ 4154 6157 */ 4155 6158 if (fd >= 0) … … 4164 6167 /* Don't need this now that we've duplicated it */ 4165 6168 close(fd); 4166 @@ -3996,13 +4000,13 @@ 6169 @@ -3946,7 +3972,17 @@ 6170 * children can be kill()ed. Don't do this when using pipes, 6171 * because stdin is not a tty, we would lose /dev/tty. */ 6172 if (p_stmp) 6173 + { 6174 (void)setsid(); 6175 +# if defined(SIGHUP) 6176 + /* When doing "!xterm&" and 'shell' is bash: the shell 6177 + * will exit and send SIGHUP to all processes in its 6178 + * group, killing the just started process. Ignore SIGHUP 6179 + * to avoid that. (suggested by Simon Schubert) 6180 + */ 6181 + signal(SIGHUP, SIG_IGN); 6182 +# endif 6183 + } 6184 # endif 6185 # ifdef FEAT_GUI 6186 if (pty_slave_fd >= 0) 6187 @@ -3996,13 +4032,13 @@ 4167 6188 4168 6189 /* set up stdin/stdout/stderr for the child */ … … 4181 6202 4182 6203 close(pty_slave_fd); /* has been dupped, close it now */ 4183 @@ -4013,13 +40 17,13 @@6204 @@ -4013,13 +4049,13 @@ 4184 6205 /* set up stdin for the child */ 4185 6206 close(fd_toshell[1]); … … 4197 6218 4198 6219 # ifdef FEAT_GUI 4199 @@ -4027,7 +40 31,7 @@6220 @@ -4027,7 +4063,7 @@ 4200 6221 { 4201 6222 /* set up stderr for the child */ … … 4206 6227 # endif 4207 6228 } 4208 @@ -4158,7 +4162,8 @@ 6229 @@ -4078,6 +4114,9 @@ 6230 int fromshell_fd; 6231 garray_T ga; 6232 int noread_cnt; 6233 +# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H) 6234 + struct timeval start_tv; 6235 +# endif 6236 6237 # ifdef FEAT_GUI 6238 if (pty_master_fd >= 0) 6239 @@ -4158,7 +4197,8 @@ 4209 6240 && (lnum != 4210 6241 curbuf->b_ml.ml_line_count … … 4216 6247 if (lnum > curbuf->b_op_end.lnum) 4217 6248 { 4218 @@ -6814,7 +6819,8 @@ 6249 @@ -4186,7 +4226,9 @@ 6250 ga_init2(&ga, 1, BUFLEN); 6251 6252 noread_cnt = 0; 6253 - 6254 +# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H) 6255 + gettimeofday(&start_tv, NULL); 6256 +# endif 6257 for (;;) 6258 { 6259 /* 6260 @@ -4199,25 +4241,34 @@ 6261 * that a typed password is echoed for ssh or gpg command. 6262 * Don't get characters when the child has already 6263 * finished (wait_pid == 0). 6264 - * Don't get extra characters when we already have one. 6265 * Don't read characters unless we didn't get output for a 6266 - * while, avoids that ":r !ls" eats typeahead. 6267 + * while (noread_cnt > 4), avoids that ":r !ls" eats 6268 + * typeahead. 6269 */ 6270 len = 0; 6271 if (!(options & SHELL_EXPAND) 6272 && ((options & 6273 (SHELL_READ|SHELL_WRITE|SHELL_COOKED)) 6274 != (SHELL_READ|SHELL_WRITE|SHELL_COOKED) 6275 -#ifdef FEAT_GUI 6276 +# ifdef FEAT_GUI 6277 || gui.in_use 6278 -#endif 6279 +# endif 6280 ) 6281 && wait_pid == 0 6282 - && (ta_len > 0 6283 - || (noread_cnt > 4 6284 - && (len = ui_inchar(ta_buf, 6285 - BUFLEN, 10L, 0)) > 0))) 6286 + && (ta_len > 0 || noread_cnt > 4)) 6287 { 6288 + if (ta_len == 0) 6289 + { 6290 + /* Get extra characters when we don't have any. 6291 + * Reset the counter and timer. */ 6292 + noread_cnt = 0; 6293 +# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H) 6294 + gettimeofday(&start_tv, NULL); 6295 +# endif 6296 + len = ui_inchar(ta_buf, BUFLEN, 10L, 0); 6297 + } 6298 + if (ta_len > 0 || len > 0) 6299 + { 6300 /* 6301 * For pipes: 6302 * Check for CTRL-C: send interrupt signal to child. 6303 @@ -4319,9 +4370,9 @@ 6304 { 6305 ta_len -= len; 6306 mch_memmove(ta_buf, ta_buf + len, ta_len); 6307 - noread_cnt = 0; 6308 } 6309 } 6310 + } 6311 } 6312 6313 if (got_int) 6314 @@ -4429,6 +4480,25 @@ 6315 out_flush(); 6316 if (got_int) 6317 break; 6318 + 6319 +# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H) 6320 + { 6321 + struct timeval now_tv; 6322 + long msec; 6323 + 6324 + /* Avoid that we keep looping here without 6325 + * checking for a CTRL-C for a long time. Don't 6326 + * break out too often to avoid losing typeahead. */ 6327 + gettimeofday(&now_tv, NULL); 6328 + msec = (now_tv.tv_sec - start_tv.tv_sec) * 1000L 6329 + + (now_tv.tv_usec - start_tv.tv_usec) / 1000L; 6330 + if (msec > 2000) 6331 + { 6332 + noread_cnt = 5; 6333 + break; 6334 + } 6335 + } 6336 +# endif 6337 } 6338 6339 /* If we already detected the child has finished break the 6340 @@ -5851,7 +5921,9 @@ 6341 * we are going to suspend or starting an external process 6342 * so we shouldn't have problem with this 6343 */ 6344 +# ifdef SIGTSTP 6345 signal(SIGTSTP, restricted ? SIG_IGN : SIG_DFL); 6346 +# endif 6347 return 1; /* succeed */ 6348 } 6349 if (gpm_fd == -2) 6350 @@ -6814,7 +6886,8 @@ 4219 6351 if (xsmp_icefd != -1) 4220 6352 { … … 4228 6360 diff -Naur vim72.orig/src/proto/eval.pro vim72/src/proto/eval.pro 4229 6361 --- vim72.orig/src/proto/eval.pro 2008-08-09 07:31:25.000000000 -0700 4230 +++ vim72/src/proto/eval.pro 2009-0 1-19 00:09:18.000000000 -08006362 +++ vim72/src/proto/eval.pro 2009-03-12 11:54:47.005909205 -0700 4231 6363 @@ -17,7 +17,7 @@ 4232 6364 int eval_to_bool __ARGS((char_u *arg, int *error, char_u **nextcmd, int skip)); … … 4270 6402 diff -Naur vim72.orig/src/proto/ex_cmds.pro vim72/src/proto/ex_cmds.pro 4271 6403 --- vim72.orig/src/proto/ex_cmds.pro 2008-08-09 07:31:25.000000000 -0700 4272 +++ vim72/src/proto/ex_cmds.pro 2009-0 1-19 00:08:31.000000000 -08006404 +++ vim72/src/proto/ex_cmds.pro 2009-03-12 11:55:13.611614471 -0700 4273 6405 @@ -11,7 +11,7 @@ 4274 6406 char_u *make_filter_cmd __ARGS((char_u *cmd, char_u *itmp, char_u *otmp)); … … 4280 6412 int viminfo_readline __ARGS((vir_T *virp)); 4281 6413 char_u *viminfo_readstring __ARGS((vir_T *virp, int off, int convert)); 6414 @@ -40,6 +40,7 @@ 6415 int read_viminfo_sub_string __ARGS((vir_T *virp, int force)); 6416 void write_viminfo_sub_string __ARGS((FILE *fp)); 6417 void free_old_sub __ARGS((void)); 6418 +void free_signs __ARGS((void)); 6419 int prepare_tagpreview __ARGS((int undo_sync)); 6420 void ex_help __ARGS((exarg_T *eap)); 6421 char_u *check_help_lang __ARGS((char_u *arg)); 4282 6422 diff -Naur vim72.orig/src/proto/ex_getln.pro vim72/src/proto/ex_getln.pro 4283 6423 --- vim72.orig/src/proto/ex_getln.pro 2008-08-09 07:31:28.000000000 -0700 4284 +++ vim72/src/proto/ex_getln.pro 2009-01-19 00:09:28.000000000 -0800 4285 @@ -31,7 +31,7 @@ 6424 +++ vim72/src/proto/ex_getln.pro 2009-03-12 11:55:13.703620617 -0700 6425 @@ -4,6 +4,7 @@ 6426 int text_locked __ARGS((void)); 6427 void text_locked_msg __ARGS((void)); 6428 int curbuf_locked __ARGS((void)); 6429 +int allbuf_locked __ARGS((void)); 6430 char_u *getexline __ARGS((int c, void *dummy, int indent)); 6431 char_u *getexmodeline __ARGS((int promptc, void *dummy, int indent)); 6432 int cmdline_overstrike __ARGS((void)); 6433 @@ -31,7 +32,7 @@ 4286 6434 void set_cmd_context __ARGS((expand_T *xp, char_u *str, int len, int col)); 4287 6435 int expand_cmdline __ARGS((expand_T *xp, char_u *str, int col, int *matchcount, char_u ***matches)); … … 4294 6442 diff -Naur vim72.orig/src/proto/mark.pro vim72/src/proto/mark.pro 4295 6443 --- vim72.orig/src/proto/mark.pro 2008-08-09 07:31:36.000000000 -0700 4296 +++ vim72/src/proto/mark.pro 2009-0 1-19 00:08:31.000000000 -08006444 +++ vim72/src/proto/mark.pro 2009-03-12 11:54:40.553496578 -0700 4297 6445 @@ -26,5 +26,5 @@ 4298 6446 void write_viminfo_filemarks __ARGS((FILE *fp)); … … 4304 6452 diff -Naur vim72.orig/src/proto/misc2.pro vim72/src/proto/misc2.pro 4305 6453 --- vim72.orig/src/proto/misc2.pro 2008-08-09 07:31:40.000000000 -0700 4306 +++ vim72/src/proto/misc2.pro 2009-0 1-19 00:10:29.000000000 -08006454 +++ vim72/src/proto/misc2.pro 2009-03-12 11:54:56.454515435 -0700 4307 6455 @@ -59,7 +59,7 @@ 4308 6456 int handle_x_keys __ARGS((int key)); … … 4316 6464 diff -Naur vim72.orig/src/proto/netbeans.pro vim72/src/proto/netbeans.pro 4317 6465 --- vim72.orig/src/proto/netbeans.pro 2008-08-09 07:31:56.000000000 -0700 4318 +++ vim72/src/proto/netbeans.pro 2009-0 1-19 00:10:45.000000000 -08006466 +++ vim72/src/proto/netbeans.pro 2009-03-12 11:54:59.854733063 -0700 4319 6467 @@ -11,7 +11,7 @@ 4320 6468 void netbeans_frame_moved __ARGS((int new_x, int new_y)); … … 4326 6474 void netbeans_removed __ARGS((buf_T *bufp, linenr_T linenr, colnr_T col, long len)); 4327 6475 void netbeans_unmodified __ARGS((buf_T *bufp)); 6476 diff -Naur vim72.orig/src/proto/option.pro vim72/src/proto/option.pro 6477 --- vim72.orig/src/proto/option.pro 2008-08-09 07:31:43.000000000 -0700 6478 +++ vim72/src/proto/option.pro 2009-03-12 11:55:13.419602459 -0700 6479 @@ -44,6 +44,7 @@ 6480 void set_context_in_set_cmd __ARGS((expand_T *xp, char_u *arg, int opt_flags)); 6481 int ExpandSettings __ARGS((expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file)); 6482 int ExpandOldSetting __ARGS((int *num_file, char_u ***file)); 6483 +int langmap_adjust_mb __ARGS((int c)); 6484 int has_format_option __ARGS((int x)); 6485 int shortmess __ARGS((int x)); 6486 void vimrc_found __ARGS((char_u *fname, char_u *envname)); 4328 6487 diff -Naur vim72.orig/src/pty.c vim72/src/pty.c 4329 6488 --- vim72.orig/src/pty.c 2008-06-21 11:52:58.000000000 -0700 4330 +++ vim72/src/pty.c 2009-0 1-19 00:07:02.000000000 -08006489 +++ vim72/src/pty.c 2009-03-12 11:54:28.844744238 -0700 4331 6490 @@ -270,9 +270,10 @@ 4332 6491 } … … 4342 6501 int 4343 6502 OpenPTY(ttyn) 6503 diff -Naur vim72.orig/src/quickfix.c vim72/src/quickfix.c 6504 --- vim72.orig/src/quickfix.c 2008-07-18 05:53:02.000000000 -0700 6505 +++ vim72/src/quickfix.c 2009-03-12 11:55:13.547610560 -0700 6506 @@ -1419,6 +1419,7 @@ 6507 int opened_window = FALSE; 6508 win_T *win; 6509 win_T *altwin; 6510 + int flags; 6511 #endif 6512 int print_message = TRUE; 6513 int len; 6514 @@ -1530,7 +1531,6 @@ 6515 if (qf_ptr->qf_type == 1 && (!curwin->w_buffer->b_help || cmdmod.tab != 0)) 6516 { 6517 win_T *wp; 6518 - int n; 6519 6520 if (cmdmod.tab != 0) 6521 wp = NULL; 6522 @@ -1546,13 +1546,16 @@ 6523 * Split off help window; put it at far top if no position 6524 * specified, the current window is vertically split and narrow. 6525 */ 6526 - n = WSP_HELP; 6527 + flags = WSP_HELP; 6528 # ifdef FEAT_VERTSPLIT 6529 if (cmdmod.split == 0 && curwin->w_width != Columns 6530 && curwin->w_width < 80) 6531 - n |= WSP_TOP; 6532 + flags |= WSP_TOP; 6533 # endif 6534 - if (win_split(0, n) == FAIL) 6535 + if (qi != &ql_info) 6536 + flags |= WSP_NEWLOC; /* don't copy the location list */ 6537 + 6538 + if (win_split(0, flags) == FAIL) 6539 goto theend; 6540 opened_window = TRUE; /* close it when fail */ 6541 6542 @@ -1562,7 +1565,6 @@ 6543 if (qi != &ql_info) /* not a quickfix list */ 6544 { 6545 /* The new window should use the supplied location list */ 6546 - qf_free_all(curwin); 6547 curwin->w_llist = qi; 6548 qi->qf_refcount++; 6549 } 6550 @@ -1609,10 +1611,11 @@ 6551 { 6552 goto_tabpage_win(tp, wp); 6553 usable_win = 1; 6554 - break; 6555 + goto win_found; 6556 } 6557 } 6558 } 6559 +win_found: 6560 6561 /* 6562 * If there is only one window and it is the quickfix window, create a 6563 @@ -1622,7 +1625,10 @@ 6564 { 6565 ll_ref = curwin->w_llist_ref; 6566 6567 - if (win_split(0, WSP_ABOVE) == FAIL) 6568 + flags = WSP_ABOVE; 6569 + if (ll_ref != NULL) 6570 + flags |= WSP_NEWLOC; 6571 + if (win_split(0, flags) == FAIL) 6572 goto failed; /* not enough room for window */ 6573 opened_window = TRUE; /* close it when fail */ 6574 p_swb = empty_option; /* don't split again */ 6575 @@ -1634,7 +1640,6 @@ 6576 { 6577 /* The new window should use the location list from the 6578 * location list window */ 6579 - qf_free_all(curwin); 6580 curwin->w_llist = ll_ref; 6581 ll_ref->qf_refcount++; 6582 } 6583 @@ -2307,15 +2312,12 @@ 6584 if (eap->cmdidx == CMD_copen || eap->cmdidx == CMD_cwindow) 6585 /* Create the new window at the very bottom. */ 6586 win_goto(lastwin); 6587 - if (win_split(height, WSP_BELOW) == FAIL) 6588 + if (win_split(height, WSP_BELOW | WSP_NEWLOC) == FAIL) 6589 return; /* not enough room for window */ 6590 #ifdef FEAT_SCROLLBIND 6591 curwin->w_p_scb = FALSE; 6592 #endif 6593 6594 - /* Remove the location list for the quickfix window */ 6595 - qf_free_all(curwin); 6596 - 6597 if (eap->cmdidx == CMD_lopen || eap->cmdidx == CMD_lwindow) 6598 { 6599 /* 6600 diff -Naur vim72.orig/src/regexp.c vim72/src/regexp.c 6601 --- vim72.orig/src/regexp.c 2008-08-07 12:58:50.000000000 -0700 6602 +++ vim72/src/regexp.c 2009-03-12 11:55:13.471605532 -0700 6603 @@ -4532,7 +4532,7 @@ 6604 cleanup_subexpr(); 6605 if (!REG_MULTI) /* Single-line regexp */ 6606 { 6607 - if (reg_endp[no] == NULL) 6608 + if (reg_startp[no] == NULL || reg_endp[no] == NULL) 6609 { 6610 /* Backref was not set: Match an empty string. */ 6611 len = 0; 6612 @@ -4548,7 +4548,7 @@ 6613 } 6614 else /* Multi-line regexp */ 6615 { 6616 - if (reg_endpos[no].lnum < 0) 6617 + if (reg_startpos[no].lnum < 0 || reg_endpos[no].lnum < 0) 6618 { 6619 /* Backref was not set: Match an empty string. */ 6620 len = 0; 6621 @@ -7279,13 +7279,11 @@ 6622 } 6623 else 6624 { 6625 - if (submatch_match->endp[no] == NULL) 6626 + s = submatch_match->startp[no]; 6627 + if (s == NULL || submatch_match->endp[no] == NULL) 6628 retval = NULL; 6629 else 6630 - { 6631 - s = submatch_match->startp[no]; 6632 retval = vim_strnsave(s, (int)(submatch_match->endp[no] - s)); 6633 - } 6634 } 6635 6636 return retval; 4344 6637 diff -Naur vim72.orig/src/screen.c vim72/src/screen.c 4345 6638 --- vim72.orig/src/screen.c 2008-07-24 07:45:07.000000000 -0700 4346 +++ vim72/src/screen.c 2009-0 1-19 00:08:07.000000000 -08006639 +++ vim72/src/screen.c 2009-03-12 11:55:39.893297947 -0700 4347 6640 @@ -2439,9 +2439,17 @@ 4348 6641 … … 4366 6659 4367 6660 SCREEN_LINE(row + W_WINROW(wp), W_WINCOL(wp), (int)W_WIDTH(wp), 6661 @@ -2588,6 +2596,7 @@ 6662 int noinvcur = FALSE; /* don't invert the cursor */ 6663 #ifdef FEAT_VISUAL 6664 pos_T *top, *bot; 6665 + int lnum_in_visual_area = FALSE; 6666 #endif 6667 pos_T pos; 6668 long v; 6669 @@ -2784,9 +2793,10 @@ 6670 top = &VIsual; 6671 bot = &curwin->w_cursor; 6672 } 6673 + lnum_in_visual_area = (lnum >= top->lnum && lnum <= bot->lnum); 6674 if (VIsual_mode == Ctrl_V) /* block mode */ 6675 { 6676 - if (lnum >= top->lnum && lnum <= bot->lnum) 6677 + if (lnum_in_visual_area) 6678 { 6679 fromcol = wp->w_old_cursor_fcol; 6680 tocol = wp->w_old_cursor_lcol; 6681 @@ -3412,6 +3422,7 @@ 6682 && (*mb_ptr2cells)(ptr) > 1) 6683 #endif 6684 || ((int)vcol_prev == fromcol_prev 6685 + && vcol_prev < vcol /* not at margin */ 6686 && vcol < tocol)) 6687 area_attr = attr; /* start highlighting */ 6688 else if (area_attr != 0 6689 @@ -3544,7 +3555,8 @@ 6690 /* Use line_attr when not in the Visual or 'incsearch' area 6691 * (area_attr may be 0 when "noinvcur" is set). */ 6692 else if (line_attr != 0 && ((fromcol == -10 && tocol == MAXCOL) 6693 - || (vcol < fromcol || vcol >= tocol))) 6694 + || vcol < fromcol || vcol_prev < fromcol_prev 6695 + || vcol >= tocol)) 6696 char_attr = line_attr; 6697 #endif 6698 else 6699 @@ -4549,7 +4561,8 @@ 6700 * highlight the cursor position itself. */ 6701 if (wp->w_p_cuc && vcol == (long)wp->w_virtcol 6702 && lnum != wp->w_cursor.lnum 6703 - && draw_state == WL_LINE) 6704 + && draw_state == WL_LINE 6705 + && !lnum_in_visual_area) 6706 { 6707 vcol_save_attr = char_attr; 6708 char_attr = hl_combine_attr(char_attr, hl_attr(HLF_CUC)); 6709 @@ -5119,8 +5132,8 @@ 6710 #endif 6711 6712 #if defined(FEAT_GUI) || defined(UNIX) 6713 - /* The bold trick makes a single row of pixels appear in the next 6714 - * character. When a bold character is removed, the next 6715 + /* The bold trick makes a single column of pixels appear in the 6716 + * next character. When a bold character is removed, the next 6717 * character should be redrawn too. This happens for our own GUI 6718 * and for some xterms. */ 6719 if ( 6720 @@ -6263,9 +6276,15 @@ 6721 int pcc[MAX_MCO]; 6722 # endif 6723 #endif 6724 +#if defined(FEAT_MBYTE) || defined(FEAT_GUI) || defined(UNIX) 6725 + int force_redraw_this; 6726 + int force_redraw_next = FALSE; 6727 +#endif 6728 + int need_redraw; 6729 6730 if (ScreenLines == NULL || row >= screen_Rows) /* safety check */ 6731 return; 6732 + off = LineOffset[row] + col; 6733 6734 #ifdef FEAT_MBYTE 6735 /* When drawing over the right halve of a double-wide char clear out the 6736 @@ -6275,10 +6294,21 @@ 6737 && !gui.in_use 6738 # endif 6739 && mb_fix_col(col, row) != col) 6740 - screen_puts_len((char_u *)" ", 1, row, col - 1, 0); 6741 + { 6742 + ScreenLines[off - 1] = ' '; 6743 + ScreenAttrs[off - 1] = 0; 6744 + if (enc_utf8) 6745 + { 6746 + ScreenLinesUC[off - 1] = 0; 6747 + ScreenLinesC[0][off - 1] = 0; 6748 + } 6749 + /* redraw the previous cell, make it empty */ 6750 + screen_char(off - 1, row, col - 1); 6751 + /* force the cell at "col" to be redrawn */ 6752 + force_redraw_next = TRUE; 6753 + } 6754 #endif 6755 6756 - off = LineOffset[row] + col; 6757 #ifdef FEAT_MBYTE 6758 max_off = LineOffset[row] + screen_Columns; 6759 #endif 6760 @@ -6342,7 +6372,12 @@ 6761 } 6762 #endif 6763 6764 - if (ScreenLines[off] != c 6765 +#if defined(FEAT_MBYTE) || defined(FEAT_GUI) || defined(UNIX) 6766 + force_redraw_this = force_redraw_next; 6767 + force_redraw_next = FALSE; 6768 +#endif 6769 + 6770 + need_redraw = ScreenLines[off] != c 6771 #ifdef FEAT_MBYTE 6772 || (mbyte_cells == 2 6773 && ScreenLines[off + 1] != (enc_dbcs ? ptr[1] : 0)) 6774 @@ -6350,24 +6385,24 @@ 6775 && c == 0x8e 6776 && ScreenLines2[off] != ptr[1]) 6777 || (enc_utf8 6778 - && (ScreenLinesUC[off] != (u8char_T)u8c 6779 + && (ScreenLinesUC[off] != (u8char_T)(c >= 0x80 ? u8c : 0) 6780 || screen_comp_differs(off, u8cc))) 6781 #endif 6782 || ScreenAttrs[off] != attr 6783 - || exmode_active 6784 + || exmode_active; 6785 + 6786 + if (need_redraw 6787 +#if defined(FEAT_MBYTE) || defined(FEAT_GUI) || defined(UNIX) 6788 + || force_redraw_this 6789 +#endif 6790 ) 6791 { 6792 #if defined(FEAT_GUI) || defined(UNIX) 6793 /* The bold trick makes a single row of pixels appear in the next 6794 * character. When a bold character is removed, the next 6795 * character should be redrawn too. This happens for our own GUI 6796 - * and for some xterms. 6797 - * Force the redraw by setting the attribute to a different value 6798 - * than "attr", the contents of ScreenLines[] may be needed by 6799 - * mb_off2cells() further on. 6800 - * Don't do this for the last drawn character, because the next 6801 - * character may not be redrawn. */ 6802 - if ( 6803 + * and for some xterms. */ 6804 + if (need_redraw && ScreenLines[off] != ' ' && ( 6805 # ifdef FEAT_GUI 6806 gui.in_use 6807 # endif 6808 @@ -6377,23 +6412,14 @@ 6809 # ifdef UNIX 6810 term_is_xterm 6811 # endif 6812 - ) 6813 + )) 6814 { 6815 - int n; 6816 + int n = ScreenAttrs[off]; 6817 6818 - n = ScreenAttrs[off]; 6819 -# ifdef FEAT_MBYTE 6820 - if (col + mbyte_cells < screen_Columns 6821 - && (n > HL_ALL || (n & HL_BOLD)) 6822 - && (len < 0 ? ptr[mbyte_blen] != NUL 6823 - : ptr + mbyte_blen < text + len)) 6824 - ScreenAttrs[off + mbyte_cells] = attr + 1; 6825 -# else 6826 - if (col + 1 < screen_Columns 6827 - && (n > HL_ALL || (n & HL_BOLD)) 6828 - && (len < 0 ? ptr[1] != NUL : ptr + 1 < text + len)) 6829 - ScreenLines[off + 1] = 0; 6830 -# endif 6831 + if (n > HL_ALL) 6832 + n = syn_attr2attr(n); 6833 + if (n & HL_BOLD) 6834 + force_redraw_next = TRUE; 6835 } 6836 #endif 6837 #ifdef FEAT_MBYTE 6838 @@ -6480,6 +6506,20 @@ 6839 ++ptr; 6840 } 6841 } 6842 + 6843 +#if defined(FEAT_MBYTE) || defined(FEAT_GUI) || defined(UNIX) 6844 + /* If we detected the next character needs to be redrawn, but the text 6845 + * doesn't extend up to there, update the character here. */ 6846 + if (force_redraw_next && col < screen_Columns) 6847 + { 6848 +# ifdef FEAT_MBYTE 6849 + if (enc_dbcs != 0 && dbcs_off2cells(off, max_off) > 1) 6850 + screen_char_2(off, row, col); 6851 + else 6852 +# endif 6853 + screen_char(off, row, col); 6854 + } 6855 +#endif 6856 } 6857 6858 #ifdef FEAT_SEARCH_EXTRA 6859 @@ -7356,7 +7396,11 @@ 6860 #endif 6861 static int entered = FALSE; /* avoid recursiveness */ 6862 static int done_outofmem_msg = FALSE; /* did outofmem message */ 6863 +#ifdef FEAT_AUTOCMD 6864 + int retry_count = 0; 6865 6866 +retry: 6867 +#endif 6868 /* 6869 * Allocation of the screen buffers is done only when the size changes and 6870 * when Rows and Columns have been set and we have started doing full 6871 @@ -7440,10 +7484,13 @@ 6872 { 6873 outofmem = TRUE; 6874 #ifdef FEAT_WINDOWS 6875 - break; 6876 + goto give_up; 6877 #endif 6878 } 6879 } 6880 +#ifdef FEAT_WINDOWS 6881 +give_up: 6882 +#endif 6883 6884 #ifdef FEAT_MBYTE 6885 for (i = 0; i < p_mco; ++i) 6886 @@ -7628,8 +7675,17 @@ 6887 --RedrawingDisabled; 6888 6889 #ifdef FEAT_AUTOCMD 6890 - if (starting == 0) 6891 + /* 6892 + * Do not apply autocommands more than 3 times to avoid an endless loop 6893 + * in case applying autocommands always changes Rows or Columns. 6894 + */ 6895 + if (starting == 0 && ++retry_count <= 3) 6896 + { 6897 apply_autocmds(EVENT_VIMRESIZED, NULL, NULL, FALSE, curbuf); 6898 + /* In rare cases, autocommands may have altered Rows or Columns, 6899 + * jump back to check if we need to allocate the screen again. */ 6900 + goto retry; 6901 + } 6902 #endif 6903 } 6904 4368 6905 diff -Naur vim72.orig/src/spell.c vim72/src/spell.c 4369 6906 --- vim72.orig/src/spell.c 2008-07-12 12:20:55.000000000 -0700 4370 +++ vim72/src/spell.c 2009-0 1-19 00:10:18.000000000 -08006907 +++ vim72/src/spell.c 2009-03-12 11:55:13.363596871 -0700 4371 6908 @@ -77,7 +77,7 @@ 4372 6909 … … 4569 7106 * ID in "flags" for the word "word". 4570 7107 * The WF_RAREPFX flag is included in the return value for a rare prefix. 7108 @@ -2237,7 +2376,7 @@ 7109 7110 /* If we are back at the starting line and there is no match then 7111 * give up. */ 7112 - if (lnum == wp->w_cursor.lnum && !found_one) 7113 + if (lnum == wp->w_cursor.lnum && (!found_one || wrapped)) 7114 break; 7115 7116 /* Skip the characters at the start of the next line that were 4571 7117 @@ -2513,9 +2652,11 @@ 4572 7118 lp->sl_midword = NULL; … … 4633 7179 vim_free(pat); 4634 7180 if (slang->sl_compprog == NULL) 4635 @@ -4915,6 +5080,7 @@ 7181 @@ -4791,13 +4956,16 @@ 7182 * Structure that is used to store the items in the word tree. This avoids 7183 * the need to keep track of each allocated thing, everything is freed all at 7184 * once after ":mkspell" is done. 7185 + * Note: "sb_next" must be just before "sb_data" to make sure the alignment of 7186 + * "sb_data" is correct for systems where pointers must be aligned on 7187 + * pointer-size boundaries and sizeof(pointer) > sizeof(int) (e.g., Sparc). 7188 */ 7189 #define SBLOCKSIZE 16000 /* size of sb_data */ 7190 typedef struct sblock_S sblock_T; 7191 struct sblock_S 7192 { 7193 - sblock_T *sb_next; /* next block in list */ 7194 int sb_used; /* nr of bytes already in use */ 7195 + sblock_T *sb_next; /* next block in list */ 7196 char_u sb_data[1]; /* data, actually longer */ 7197 }; 7198 7199 @@ -4915,6 +5083,7 @@ 4636 7200 } spellinfo_T; 4637 7201 … … 4641 7205 static int spell_info_item __ARGS((char_u *s)); 4642 7206 static unsigned affitem2flag __ARGS((int flagtype, char_u *item, char_u *fname, int lnum)); 4643 @@ -4950,7 +511 6,7 @@7207 @@ -4950,7 +5119,7 @@ 4644 7208 static void put_sugtime __ARGS((spellinfo_T *spin, FILE *fd)); 4645 7209 static int write_vim_spell __ARGS((spellinfo_T *spin, char_u *fname)); … … 4650 7214 static int sug_filltree __ARGS((spellinfo_T *spin, slang_T *slang)); 4651 7215 static int sug_maketable __ARGS((spellinfo_T *spin)); 4652 @@ -5223,8 +53 89,7 @@7216 @@ -5223,8 +5392,7 @@ 4653 7217 /* Handle non-empty lines. */ 4654 7218 if (itemcnt > 0) … … 4660 7224 #ifdef FEAT_MBYTE 4661 7225 /* Setup for conversion from "ENC" to 'encoding'. */ 4662 @@ -5239,7 +540 4,7 @@7226 @@ -5239,7 +5407,7 @@ 4663 7227 smsg((char_u *)_("Conversion in %s not supported"), fname); 4664 7228 #endif … … 4669 7233 { 4670 7234 if (STRCMP(items[1], "long") == 0) 4671 @@ -5284,69 +54 49,71 @@7235 @@ -5284,69 +5452,71 @@ 4672 7236 spin->si_info = p; 4673 7237 } … … 4757 7321 aff->af_compforbid = affitem2flag(aff->af_flagtype, items[1], 4758 7322 fname, lnum); 4759 @@ -5354,8 +552 1,8 @@7323 @@ -5354,8 +5524,8 @@ 4760 7324 smsg((char_u *)_("Defining COMPOUNDFORBIDFLAG after PFX item may give wrong results in %s line %d"), 4761 7325 fname, lnum); … … 4768 7332 aff->af_comppermit = affitem2flag(aff->af_flagtype, items[1], 4769 7333 fname, lnum); 4770 @@ -5363,7 +553 0,7 @@7334 @@ -5363,7 +5533,7 @@ 4771 7335 smsg((char_u *)_("Defining COMPOUNDPERMITFLAG after PFX item may give wrong results in %s line %d"), 4772 7336 fname, lnum); … … 4777 7341 { 4778 7342 /* Turn flag "c" into COMPOUNDRULE compatible string "c+", 4779 @@ -5376,7 +554 3,15 @@7343 @@ -5376,7 +5546,15 @@ 4780 7344 compflags = p; 4781 7345 } … … 4794 7358 /* Concatenate this string to previously defined ones, using a 4795 7359 * slash to separate them. */ 4796 @@ -5395,7 +557 0,7 @@7360 @@ -5395,7 +5573,7 @@ 4797 7361 compflags = p; 4798 7362 } … … 4803 7367 { 4804 7368 compmax = atoi((char *)items[1]); 4805 @@ -5403,7 +55 78,7 @@7369 @@ -5403,7 +5581,7 @@ 4806 7370 smsg((char_u *)_("Wrong COMPOUNDWORDMAX value in %s line %d: %s"), 4807 7371 fname, lnum, items[1]); … … 4812 7376 { 4813 7377 compminlen = atoi((char *)items[1]); 4814 @@ -5411,7 +558 6,7 @@7378 @@ -5411,7 +5589,7 @@ 4815 7379 smsg((char_u *)_("Wrong COMPOUNDMIN value in %s line %d: %s"), 4816 7380 fname, lnum, items[1]); … … 4821 7385 { 4822 7386 compsylmax = atoi((char *)items[1]); 4823 @@ -5419,32 +559 4,29 @@7387 @@ -5419,32 +5597,29 @@ 4824 7388 smsg((char_u *)_("Wrong COMPOUNDSYLMAX value in %s line %d: %s"), 4825 7389 fname, lnum, items[1]); … … 4860 7424 garray_T *gap = &spin->si_comppat; 4861 7425 int i; 4862 @@ -5463,24 +563 5,24 @@7426 @@ -5463,24 +5638,24 @@ 4863 7427 = getroom_save(spin, items[2]); 4864 7428 } … … 4890 7454 aff->af_pfxpostpone = TRUE; 4891 7455 } 4892 @@ -5771,24 +594 3,20 @@7456 @@ -5771,24 +5946,20 @@ 4893 7457 } 4894 7458 } … … 4920 7484 /* Ignore REP/REPSAL count */; 4921 7485 if (!isdigit(*items[1])) 4922 @@ -5819,7 +59 87,7 @@7486 @@ -5819,7 +5990,7 @@ 4923 7487 : &spin->si_rep, items[1], items[2]); 4924 7488 } … … 4929 7493 /* MAP item or count */ 4930 7494 if (!found_map) 4931 @@ -5856,9 +602 4,8 @@7495 @@ -5856,9 +6027,8 @@ 4932 7496 ga_append(&spin->si_map, '/'); 4933 7497 } … … 4941 7505 if (do_sal) 4942 7506 { 4943 @@ -5877,12 +604 4,12 @@7507 @@ -5877,12 +6047,12 @@ 4944 7508 : items[2]); 4945 7509 } … … 4956 7520 { 4957 7521 sofoto = getroom_save(spin, items[1]); 4958 @@ -5980,7 +61 47,7 @@7522 @@ -5980,7 +6150,7 @@ 4959 7523 else if (spin->si_newprefID == 0 || spin->si_newprefID == 127) 4960 7524 MSG(_("Too many compound flags")); … … 4965 7529 4966 7530 if (syllable != NULL) 4967 @@ -6017,6 +618 4,22 @@7531 @@ -6017,6 +6187,22 @@ 4968 7532 } 4969 7533 … … 4988 7552 * ae_flags to ae_comppermit and ae_compforbid. 4989 7553 */ 4990 @@ -7926,6 +81 09,8 @@7554 @@ -7926,6 +8112,8 @@ 4991 7555 char_u *p; 4992 7556 int rr; … … 4997 7561 fd = mch_fopen((char *)fname, "w"); 4998 7562 if (fd == NULL) 4999 @@ -7936,11 +812 1,11 @@7563 @@ -7936,11 +8124,11 @@ 5000 7564 5001 7565 /* <HEADER>: <fileID> <versionnr> */ … … 5014 7578 5015 7579 /* 5016 @@ -7955,7 +814 0,7 @@7580 @@ -7955,7 +8143,7 @@ 5017 7581 5018 7582 i = (int)STRLEN(spin->si_info); … … 5023 7587 5024 7588 /* SN_REGION: <regionname> ... 5025 @@ -7966,7 +815 1,7 @@7589 @@ -7966,7 +8154,7 @@ 5026 7590 putc(SNF_REQUIRED, fd); /* <sectionflags> */ 5027 7591 l = spin->si_region_count * 2; … … 5032 7596 regionmask = (1 << spin->si_region_count) - 1; 5033 7597 } 5034 @@ -8016,7 +820 1,7 @@7598 @@ -8016,7 +8204,7 @@ 5035 7599 } 5036 7600 … … 5041 7605 5042 7606 /* SN_MIDWORD: <midword> */ 5043 @@ -8027,7 +821 2,8 @@7607 @@ -8027,7 +8215,8 @@ 5044 7608 5045 7609 i = (int)STRLEN(spin->si_midword); … … 5051 7615 5052 7616 /* SN_PREFCOND: <prefcondcnt> <prefcond> ... */ 5053 @@ -8113,7 +8 299,8 @@7617 @@ -8113,7 +8302,8 @@ 5054 7618 p = rr == 1 ? ftp->ft_from : ftp->ft_to; 5055 7619 l = (int)STRLEN(p); … … 5061 7625 } 5062 7626 5063 @@ -8131,11 +83 18,11 @@7627 @@ -8131,11 +8321,11 @@ 5064 7628 /* <sectionlen> */ 5065 7629 … … 5075 7639 5076 7640 /* SN_WORDS: <word> ... 5077 @@ -8160,7 +83 47,7 @@7641 @@ -8160,7 +8350,7 @@ 5078 7642 l = (int)STRLEN(hi->hi_key) + 1; 5079 7643 len += l; … … 5084 7648 } 5085 7649 if (round == 1) 5086 @@ -8176,7 +836 3,7 @@7650 @@ -8176,7 +8366,7 @@ 5087 7651 putc(0, fd); /* <sectionflags> */ 5088 7652 l = spin->si_map.ga_len; … … 5093 7657 } 5094 7658 5095 @@ -8232,10 +84 19,11 @@7659 @@ -8232,10 +8422,11 @@ 5096 7660 { 5097 7661 p = ((char_u **)(spin->si_comppat.ga_data))[i]; … … 5107 7671 } 5108 7672 5109 @@ -8259,7 +84 47,8 @@7673 @@ -8259,7 +8450,8 @@ 5110 7674 5111 7675 l = (int)STRLEN(spin->si_syllable); … … 5117 7681 5118 7682 /* end of <SECTIONS> */ 5119 @@ -8295,13 +848 4,18 @@7683 @@ -8295,13 +8487,18 @@ 5120 7684 (void)put_node(fd, tree, 0, regionmask, round == 3); 5121 7685 } … … 5138 7702 } 5139 7703 5140 @@ -9890,6 +1008 4,7 @@7704 @@ -9890,6 +10087,7 @@ 5141 7705 char_u *p; 5142 7706 int len; … … 5146 7710 if (fd != NULL) 5147 7711 put_bytes(fd, (long_u)gap->ga_len, 2); /* <prefcondcnt> */ 5148 @@ -9906,7 +1010 1,7 @@7712 @@ -9906,7 +10104,7 @@ 5149 7713 if (fd != NULL) 5150 7714 { … … 5155 7719 totlen += len; 5156 7720 } 5157 @@ -11480,15 +1167 5,24 @@7721 @@ -11480,15 +11678,24 @@ 5158 7722 vim_strncpy(preword + sp->ts_prewordlen, 5159 7723 tword + sp->ts_splitoff, … … 5187 7751 p = preword + sp->ts_prewordlen; 5188 7752 mb_ptr_back(preword, p); 5189 @@ -11685,10 +118 89,9 @@7753 @@ -11685,10 +11892,9 @@ 5190 7754 && (slang->sl_compsylmax < MAXWLEN 5191 7755 || sp->ts_complen + 1 - sp->ts_compsplit … … 5201 7765 try_compound = TRUE; 5202 7766 compflags[sp->ts_complen] = ((unsigned)flags >> 24); 7767 @@ -14808,7 +15014,7 @@ 7768 7769 case 0: 7770 /* 7771 - * Lenghts are equal, thus changes must result in same length: An 7772 + * Lengths are equal, thus changes must result in same length: An 7773 * insert is only possible in combination with a delete. 7774 * 1: check if for identical strings 7775 */ 5203 7776 diff -Naur vim72.orig/src/structs.h vim72/src/structs.h 5204 7777 --- vim72.orig/src/structs.h 2008-07-30 13:02:50.000000000 -0700 5205 +++ vim72/src/structs.h 2009-0 1-19 00:09:02.000000000 -08007778 +++ vim72/src/structs.h 2009-03-12 11:54:46.913903059 -0700 5206 7779 @@ -459,7 +459,7 @@ 5207 7780 typedef struct … … 5232 7805 diff -Naur vim72.orig/src/tag.c vim72/src/tag.c 5233 7806 --- vim72.orig/src/tag.c 2008-07-16 14:31:30.000000000 -0700 5234 +++ vim72/src/tag.c 2009-0 1-19 00:10:57.000000000 -08007807 +++ vim72/src/tag.c 2009-03-12 11:55:13.591613075 -0700 5235 7808 @@ -515,7 +515,7 @@ 5236 7809 * If a count is supplied to the ":tag <name>" command, then … … 5242 7815 5243 7816 if (type == DT_SELECT || type == DT_JUMP 5244 @@ -2725,7 +2725,24 @@ 7817 @@ -618,7 +618,7 @@ 7818 taglen_advance(taglen); 7819 MSG_PUTS_ATTR(_("file\n"), hl_attr(HLF_T)); 7820 7821 - for (i = 0; i < num_matches; ++i) 7822 + for (i = 0; i < num_matches && !got_int; ++i) 7823 { 7824 parse_match(matches[i], &tagp); 7825 if (!new_tag && ( 7826 @@ -655,6 +655,8 @@ 7827 } 7828 if (msg_col > 0) 7829 msg_putchar('\n'); 7830 + if (got_int) 7831 + break; 7832 msg_advance(15); 7833 7834 /* print any extra fields */ 7835 @@ -689,6 +691,8 @@ 7836 if (msg_col + ptr2cells(p) >= Columns) 7837 { 7838 msg_putchar('\n'); 7839 + if (got_int) 7840 + break; 7841 msg_advance(15); 7842 } 7843 p = msg_outtrans_one(p, attr); 7844 @@ -704,6 +708,8 @@ 7845 if (msg_col > 15) 7846 { 7847 msg_putchar('\n'); 7848 + if (got_int) 7849 + break; 7850 msg_advance(15); 7851 } 7852 } 7853 @@ -734,6 +740,8 @@ 7854 { 7855 if (msg_col + (*p == TAB ? 1 : ptr2cells(p)) > Columns) 7856 msg_putchar('\n'); 7857 + if (got_int) 7858 + break; 7859 msg_advance(15); 7860 7861 /* skip backslash used for escaping command char */ 7862 @@ -760,12 +768,9 @@ 7863 if (msg_col) 7864 msg_putchar('\n'); 7865 ui_breakcheck(); 7866 - if (got_int) 7867 - { 7868 - got_int = FALSE; /* only stop the listing */ 7869 - break; 7870 - } 7871 } 7872 + if (got_int) 7873 + got_int = FALSE; /* only stop the listing */ 7874 ask_for_selection = TRUE; 7875 } 7876 #if defined(FEAT_QUICKFIX) && defined(FEAT_EVAL) 7877 @@ -2542,6 +2547,15 @@ 7878 { 7879 ga_clear_strings(&tag_fnames); 7880 do_tag(NULL, DT_FREE, 0, 0, 0); 7881 + tag_freematch(); 7882 + 7883 +# if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) 7884 + if (ptag_entry.tagname) 7885 + { 7886 + vim_free(ptag_entry.tagname); 7887 + ptag_entry.tagname = NULL; 7888 + } 7889 +# endif 7890 } 7891 #endif 7892 7893 @@ -2725,7 +2739,24 @@ 5245 7894 */ 5246 7895 p_7f = vim_strchr(lbuf, 0x7f); … … 5267 7916 /* Find ^A. If not found the line number is after the 0x7f */ 5268 7917 p = vim_strchr(p_7f, Ctrl_A); 5269 @@ -2735,7 +27 52,7 @@7918 @@ -2735,7 +2766,7 @@ 5270 7919 ++p; 5271 7920 … … 5276 7925 5277 7926 5278 @@ -2749,7 +27 66,7 @@7927 @@ -2749,7 +2780,7 @@ 5279 7928 /* find end of tagname */ 5280 7929 for (p = p_7f - 1; !vim_iswordc(*p); --p) … … 5285 7934 while (p >= lbuf && vim_iswordc(*p)) 5286 7935 --p; 7936 diff -Naur vim72.orig/src/term.c vim72/src/term.c 7937 --- vim72.orig/src/term.c 2008-07-27 04:48:06.000000000 -0700 7938 +++ vim72/src/term.c 2009-03-12 11:54:59.914737254 -0700 7939 @@ -4920,7 +4920,15 @@ 7940 key_name[0] = KEY2TERMCAP0(key); 7941 key_name[1] = KEY2TERMCAP1(key); 7942 if (key_name[0] == KS_KEY) 7943 - string[new_slen++] = key_name[1]; /* from ":set <M-b>=xx" */ 7944 + { 7945 + /* from ":set <M-b>=xx" */ 7946 +#ifdef FEAT_MBYTE 7947 + if (has_mbyte) 7948 + new_slen += (*mb_char2bytes)(key_name[1], string + new_slen); 7949 + else 7950 +#endif 7951 + string[new_slen++] = key_name[1]; 7952 + } 7953 else 7954 { 7955 string[new_slen++] = K_SPECIAL; 7956 diff -Naur vim72.orig/src/testdir/Makefile vim72/src/testdir/Makefile 7957 --- vim72.orig/src/testdir/Makefile 2008-06-19 13:29:46.000000000 -0700 7958 +++ vim72/src/testdir/Makefile 2009-03-12 11:55:27.544506216 -0700 7959 @@ -20,21 +20,23 @@ 7960 test48.out test49.out test51.out test52.out test53.out \ 7961 test54.out test55.out test56.out test57.out test58.out \ 7962 test59.out test60.out test61.out test62.out test63.out \ 7963 - test64.out test65.out 7964 + test64.out test65.out test66.out 7965 7966 SCRIPTS_GUI = test16.out 7967 7968 .SUFFIXES: .in .out 7969 7970 -nongui: nolog $(SCRIPTS) 7971 - @echo 7972 - @cat test.log 7973 - @echo ALL DONE 7974 +nongui: nolog $(SCRIPTS) report 7975 + 7976 +gui: nolog $(SCRIPTS) $(SCRIPTS_GUI) report 7977 7978 -gui: nolog $(SCRIPTS) $(SCRIPTS_GUI) 7979 +report: 7980 @echo 7981 - @cat test.log 7982 - @echo ALL DONE 7983 + @echo 'Test results:' 7984 + @/bin/sh -c "if test -f test.log; \ 7985 + then cat test.log; echo TEST FAILURE; exit 1; \ 7986 + else echo ALL DONE; \ 7987 + fi" 7988 7989 $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG) 7990 7991 @@ -71,4 +73,4 @@ 7992 test60.out: test60.vim 7993 7994 nolog: 7995 - -echo Test results: >test.log 7996 + -rm -f test.log 5287 7997 diff -Naur vim72.orig/src/testdir/Make_ming.mak vim72/src/testdir/Make_ming.mak 5288 7998 --- vim72.orig/src/testdir/Make_ming.mak 1969-12-31 16:00:00.000000000 -0800 5289 +++ vim72/src/testdir/Make_ming.mak 2009-0 1-19 00:08:05.000000000 -08007999 +++ vim72/src/testdir/Make_ming.mak 2009-03-12 11:54:40.397486521 -0700 5290 8000 @@ -0,0 +1,91 @@ 5291 8001 +# Makefile to run tests for Vim, on Dos-like machines … … 5380 8090 + -$(DEL) test.ok 5381 8091 + -$(DEL) viminfo 5382 diff -Naur vim72.orig/src/testdir/Makefile vim72/src/testdir/Makefile5383 --- vim72.orig/src/testdir/Makefile 2008-06-19 13:29:46.000000000 -07005384 +++ vim72/src/testdir/Makefile 2009-01-19 00:07:44.000000000 -08005385 @@ -26,15 +26,17 @@5386 5387 .SUFFIXES: .in .out5388 5389 -nongui: nolog $(SCRIPTS)5390 - @echo5391 - @cat test.log5392 - @echo ALL DONE5393 +nongui: nolog $(SCRIPTS) report5394 +5395 +gui: nolog $(SCRIPTS) $(SCRIPTS_GUI) report5396 5397 -gui: nolog $(SCRIPTS) $(SCRIPTS_GUI)5398 +report:5399 @echo5400 - @cat test.log5401 - @echo ALL DONE5402 + @echo 'Test results:'5403 + @/bin/sh -c "if test -f test.log; \5404 + then cat test.log; echo TEST FAILURE; exit 1; \5405 + else echo ALL DONE; \5406 + fi"5407 5408 $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG)5409 5410 @@ -71,4 +73,4 @@5411 test60.out: test60.vim5412 5413 nolog:5414 - -echo Test results: >test.log5415 + -rm -f test.log5416 8092 diff -Naur vim72.orig/src/testdir/test42.ok vim72/src/testdir/test42.ok 5417 8093 --- vim72.orig/src/testdir/test42.ok 2008-02-20 04:27:37.000000000 -0800 5418 +++ vim72/src/testdir/test42.ok 2009-0 1-19 00:08:36.000000000 -08008094 +++ vim72/src/testdir/test42.ok 2009-03-12 11:54:40.601499372 -0700 5419 8095 @@ -20,7 +20,7 @@ 5420 8096 ucs-2 … … 5426 8102 ucs-2le 5427 8103 8104 diff -Naur vim72.orig/src/testdir/test66.in vim72/src/testdir/test66.in 8105 --- vim72.orig/src/testdir/test66.in 1969-12-31 16:00:00.000000000 -0800 8106 +++ vim72/src/testdir/test66.in 2009-03-12 11:55:27.544506216 -0700 8107 @@ -0,0 +1,25 @@ 8108 + 8109 +Test for visual block shift and tab characters. 8110 + 8111 +STARTTEST 8112 +:so small.vim 8113 +/^abcdefgh 8114 +4jI j<<11|D 8115 +7|a 8116 +7|a 8117 +7|a 4k13|4j< 8118 +:$-4,$w! test.out 8119 +:$-4,$s/\s\+//g 8120 +4kI j<< 8121 +7|a 8122 +7|a 8123 +7|a 4k13|4j3< 8124 +:$-4,$w >> test.out 8125 +:qa! 8126 +ENDTEST 8127 + 8128 +abcdefghijklmnopqrstuvwxyz 8129 +abcdefghijklmnopqrstuvwxyz 8130 +abcdefghijklmnopqrstuvwxyz 8131 +abcdefghijklmnopqrstuvwxyz 8132 +abcdefghijklmnopqrstuvwxyz 8133 diff -Naur vim72.orig/src/testdir/test66.ok vim72/src/testdir/test66.ok 8134 --- vim72.orig/src/testdir/test66.ok 1969-12-31 16:00:00.000000000 -0800 8135 +++ vim72/src/testdir/test66.ok 2009-03-12 11:55:27.544506216 -0700 8136 @@ -0,0 +1,10 @@ 8137 + abcdefghijklmnopqrstuvwxyz 8138 +abcdefghij 8139 + abc defghijklmnopqrstuvwxyz 8140 + abc defghijklmnopqrstuvwxyz 8141 + abc defghijklmnopqrstuvwxyz 8142 + abcdefghijklmnopqrstuvwxyz 8143 +abcdefghij 8144 + abc defghijklmnopqrstuvwxyz 8145 + abc defghijklmnopqrstuvwxyz 8146 + abc defghijklmnopqrstuvwxyz 5428 8147 diff -Naur vim72.orig/src/ui.c vim72/src/ui.c 5429 8148 --- vim72.orig/src/ui.c 2008-07-14 11:14:56.000000000 -0700 5430 +++ vim72/src/ui.c 2009-0 1-19 00:09:40.000000000 -08008149 +++ vim72/src/ui.c 2009-03-12 11:54:50.158111748 -0700 5431 8150 @@ -1820,7 +1820,7 @@ 5432 8151 #ifdef HAVE_DUP … … 5536 8255 diff -Naur vim72.orig/src/version.c vim72/src/version.c 5537 8256 --- vim72.orig/src/version.c 2008-08-09 07:24:52.000000000 -0700 5538 +++ vim72/src/version.c 2009-0 1-19 00:10:59.000000000 -08005539 @@ -677,9 +677, 176@@8257 +++ vim72/src/version.c 2009-03-12 11:55:39.893297947 -0700 8258 @@ -677,9 +677,280 @@ 5540 8259 static int included_patches[] = 5541 8260 { /* Add new patch number below this line */ 5542 8261 /**/ 8262 + 141, 8263 +/**/ 8264 + 140, 8265 +/**/ 8266 + 139, 8267 +/**/ 8268 + 137, 8269 +/**/ 8270 + 136, 8271 +/**/ 8272 + 135, 8273 +/**/ 8274 + 134, 8275 +/**/ 8276 + 133, 8277 +/**/ 8278 + 132, 8279 +/**/ 8280 + 131, 8281 +/**/ 8282 + 130, 8283 +/**/ 8284 + 129, 8285 +/**/ 8286 + 128, 8287 +/**/ 8288 + 127, 8289 +/**/ 8290 + 126, 8291 +/**/ 8292 + 125, 8293 +/**/ 8294 + 124, 8295 +/**/ 8296 + 123, 8297 +/**/ 8298 + 122, 8299 +/**/ 8300 + 121, 8301 +/**/ 8302 + 120, 8303 +/**/ 8304 + 119, 8305 +/**/ 8306 + 118, 8307 +/**/ 8308 + 117, 8309 +/**/ 8310 + 116, 8311 +/**/ 8312 + 115, 8313 +/**/ 8314 + 114, 8315 +/**/ 8316 + 113, 8317 +/**/ 8318 + 112, 8319 +/**/ 8320 + 111, 8321 +/**/ 8322 + 110, 8323 +/**/ 8324 + 109, 8325 +/**/ 8326 + 108, 8327 +/**/ 8328 + 107, 8329 +/**/ 8330 + 106, 8331 +/**/ 8332 + 105, 8333 +/**/ 8334 + 104, 8335 +/**/ 8336 + 103, 8337 +/**/ 8338 + 102, 8339 +/**/ 8340 + 100, 8341 +/**/ 8342 + 99, 8343 +/**/ 8344 + 98, 8345 +/**/ 8346 + 97, 8347 +/**/ 8348 + 96, 8349 +/**/ 8350 + 95, 8351 +/**/ 8352 + 94, 8353 +/**/ 8354 + 92, 8355 +/**/ 8356 + 91, 8357 +/**/ 8358 + 90, 8359 +/**/ 8360 + 87, 8361 +/**/ 8362 + 86, 8363 +/**/ 8364 + 85, 8365 +/**/ 5543 8366 + 84, 5544 8367 +/**/ … … 5714 8537 highest_patch() 5715 8538 { 5716 @@ -786,7 + 953,7 @@8539 @@ -786,7 +1057,7 @@ 5717 8540 MSG_PUTS(_("\nRISC OS version")); 5718 8541 #endif … … 5723 8546 if (*compiled_arch != NUL) 5724 8547 { 5725 @@ -825,6 + 992,19 @@8548 @@ -825,6 +1096,19 @@ 5726 8549 } 5727 8550 } … … 5745 8568 diff -Naur vim72.orig/src/vim.h vim72/src/vim.h 5746 8569 --- vim72.orig/src/vim.h 2008-08-09 09:03:38.000000000 -0700 5747 +++ vim72/src/vim.h 2009-0 1-19 00:09:15.000000000 -08008570 +++ vim72/src/vim.h 2009-03-12 11:55:13.547610560 -0700 5748 8571 @@ -341,8 +341,14 @@ 5749 8572 #ifdef BACKSLASH_IN_FILENAME … … 5772 8595 typedef unsigned long __w64 long_u; 5773 8596 typedef long __w64 long_i; 5774 @@ -1728,7 +1734,8 @@ 8597 @@ -1051,6 +1057,7 @@ 8598 #define WSP_HELP 16 /* creating the help window */ 8599 #define WSP_BELOW 32 /* put new window below/right */ 8600 #define WSP_ABOVE 64 /* put new window above/left */ 8601 +#define WSP_NEWLOC 128 /* don't copy location list */ 8602 8603 /* 8604 * arguments for gui_set_shellsize() 8605 @@ -1728,7 +1735,8 @@ 5775 8606 #define VV_MOUSE_COL 51 5776 8607 #define VV_OP 52 … … 5782 8613 #ifdef FEAT_CLIPBOARD 5783 8614 5784 @@ -1979,6 +198 6,9 @@8615 @@ -1979,6 +1987,9 @@ 5785 8616 # endif 5786 8617 #endif … … 5792 8623 # include "nbdebug.h" 5793 8624 #else 5794 @@ -2054,4 +206 4,10 @@8625 @@ -2054,4 +2065,10 @@ 5795 8626 #define DOSO_VIMRC 1 /* loading vimrc file */ 5796 8627 #define DOSO_GVIMRC 2 /* loading gvimrc file */ … … 5805 8636 diff -Naur vim72.orig/src/window.c vim72/src/window.c 5806 8637 --- vim72.orig/src/window.c 2008-08-06 04:00:30.000000000 -0700 5807 +++ vim72/src/window.c 2009-01-19 00:09:40.000000000 -0800 5808 @@ -4028,14 +4028,14 @@ 8638 +++ vim72/src/window.c 2009-03-12 11:55:13.547610560 -0700 8639 @@ -12,7 +12,7 @@ 8640 static int path_is_url __ARGS((char_u *p)); 8641 #if defined(FEAT_WINDOWS) || defined(PROTO) 8642 static int win_split_ins __ARGS((int size, int flags, win_T *newwin, int dir)); 8643 -static void win_init __ARGS((win_T *newp, win_T *oldp)); 8644 +static void win_init __ARGS((win_T *newp, win_T *oldp, int flags)); 8645 static void frame_comp_pos __ARGS((frame_T *topfrp, int *row, int *col)); 8646 static void frame_setheight __ARGS((frame_T *curfrp, int height)); 8647 #ifdef FEAT_VERTSPLIT 8648 @@ -593,9 +593,7 @@ 8649 ++allow_keys; /* no mapping for xchar, but allow key codes */ 8650 if (xchar == NUL) 8651 xchar = plain_vgetc(); 8652 -#ifdef FEAT_LANGMAP 8653 LANGMAP_ADJUST(xchar, TRUE); 8654 -#endif 8655 --no_mapping; 8656 --allow_keys; 8657 #ifdef FEAT_CMDL_INFO 8658 @@ -912,7 +910,7 @@ 8659 return FAIL; 8660 8661 /* make the contents of the new window the same as the current one */ 8662 - win_init(wp, curwin); 8663 + win_init(wp, curwin, flags); 8664 } 8665 8666 /* 8667 @@ -1161,11 +1159,15 @@ 8668 * Initialize window "newp" from window "oldp". 8669 * Used when splitting a window and when creating a new tab page. 8670 * The windows will both edit the same buffer. 8671 + * WSP_NEWLOC may be specified in flags to prevent the location list from 8672 + * being copied. 8673 */ 8674 +/*ARGSUSED*/ 8675 static void 8676 -win_init(newp, oldp) 8677 +win_init(newp, oldp, flags) 8678 win_T *newp; 8679 win_T *oldp; 8680 + int flags; 8681 { 8682 int i; 8683 8684 @@ -1190,7 +1192,14 @@ 8685 copy_jumplist(oldp, newp); 8686 #endif 8687 #ifdef FEAT_QUICKFIX 8688 - copy_loclist(oldp, newp); 8689 + if (flags & WSP_NEWLOC) 8690 + { 8691 + /* Don't copy the location list. */ 8692 + newp->w_llist = NULL; 8693 + newp->w_llist_ref = NULL; 8694 + } 8695 + else 8696 + copy_loclist(oldp, newp); 8697 #endif 8698 if (oldp->w_localdir != NULL) 8699 newp->w_localdir = vim_strsave(oldp->w_localdir); 8700 @@ -3220,7 +3229,7 @@ 8701 else 8702 { 8703 /* First window in new tab page, initialize it from "oldwin". */ 8704 - win_init(curwin, oldwin); 8705 + win_init(curwin, oldwin, 0); 8706 8707 # ifdef FEAT_SCROLLBIND 8708 /* We don't want scroll-binding in the first window. */ 8709 @@ -4028,14 +4037,14 @@ 5809 8710 if (mch_dirname(cwd, MAXPATHL) == OK) 5810 8711 globaldir = vim_strsave(cwd); … … 5826 8727 diff -Naur vim72.orig/src/workshop.c vim72/src/workshop.c 5827 8728 --- vim72.orig/src/workshop.c 2008-06-21 11:53:26.000000000 -0700 5828 +++ vim72/src/workshop.c 2009-0 1-19 00:09:33.000000000 -08008729 +++ vim72/src/workshop.c 2009-03-12 11:54:50.062104763 -0700 5829 8730 @@ -1121,8 +1121,12 @@ 5830 8731 ? (char *)curbuf->b_sfname : "<None>");
Note:
See TracChangeset
for help on using the changeset viewer.