Changeset 734faf3 in clfs-sysroot
- Timestamp:
- Jul 26, 2009, 11:16:51 AM (15 years ago)
- Branches:
- master
- Children:
- 63c7a69
- Parents:
- c6124b0
- Files:
-
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
BOOK/introduction/common/changelog.xml
rc6124b0 r734faf3 40 40 <para>July 26, 2009</para> 41 41 <itemizedlist> 42 <listitem> 43 <para>[jciccone] - Updated the Vim Branch Update Patch to -19.</para> 44 </listitem> 42 45 <listitem> 43 46 <para>[jciccone] - Updated the Ncurses Branch Update Patch to -
BOOK/patches.ent
rc6124b0 r734faf3 93 93 <!ENTITY texinfo-new_compressors-patch-size "2 KB"> 94 94 95 <!ENTITY vim-branch_update-patch "vim-&vim-version;-branch_update-1 5.patch">96 <!ENTITY vim-branch_update-patch-md5 " ac3194162931d0f4e38db05da9933377">97 <!ENTITY vim-branch_update-patch-size " 636KB">95 <!ENTITY vim-branch_update-patch "vim-&vim-version;-branch_update-19.patch"> 96 <!ENTITY vim-branch_update-patch-md5 "6b17e03f6191a79f90666c25af0d758b"> 97 <!ENTITY vim-branch_update-patch-size "1,822 KB"> 98 98 99 99 <!ENTITY zlib-fpic-patch "zlib-&zlib-version;-fPIC-2.patch"> -
patches/vim-7.2-branch_update-19.patch
rc6124b0 r734faf3 1 1 Submitted By: Jim Gifford (jim at cross-lfs dot org) 2 Date: 0 6-05-20092 Date: 07-19-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. 1966 Description: Contains all upstream patches up to 7.2.234 7 7 The following patches were skipped 8 007 036 041 049 071 072 074 088 089 093 101 138 150 172 173 191 194 8 007 036 041 049 071 072 074 088 089 093 101 138 150 172 173 191 194 204 205 212 216 219 233 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 6-05 14:26:12.000000000 -070012 +++ vim72/Filelist 2009-07-19 15:17:20.000000000 -0700 13 13 @@ -285,6 +285,7 @@ 14 14 src/proto/os_win32.pro \ … … 31 31 diff -Naur vim72.orig/runtime/doc/cmdline.txt vim72/runtime/doc/cmdline.txt 32 32 --- vim72.orig/runtime/doc/cmdline.txt 2008-08-09 07:22:59.000000000 -0700 33 +++ vim72/runtime/doc/cmdline.txt 2009-0 6-05 14:16:09.000000000 -070033 +++ vim72/runtime/doc/cmdline.txt 2009-07-19 15:19:00.000000000 -0700 34 34 @@ -1,4 +1,4 @@ 35 35 -*cmdline.txt* For Vim version 7.2. Last change: 2008 Jul 29 … … 50 50 Implementation detail: When using the |expression| register 51 51 and invoking setcmdpos(), this sets the position before 52 @@ -730,19 +735,29 @@ 52 @@ -436,13 +441,20 @@ 53 those files with an extension that is in the 'suffixes' option are ignored. 54 The default is ".bak,~,.o,.h,.info,.swp,.obj", which means that files ending 55 in ".bak", "~", ".o", ".h", ".info", ".swp" and ".obj" are sometimes ignored. 56 -It is impossible to ignore suffixes with two dots. Examples: 57 + 58 +An empty entry, two consecutive commas, match a file name that does not 59 +contain a ".", thus has no suffix. This is useful to ignore "prog" and prefer 60 +"prog.c". 61 + 62 +Examples: 63 64 pattern: files: match: ~ 65 test* test.c test.h test.o test.c 66 test* test.h test.o test.h and test.o 67 test* test.i test.h test.c test.i and test.c 68 69 +It is impossible to ignore suffixes with two dots. 70 + 71 If there is more than one matching file (after ignoring the ones matching 72 the 'suffixes' option) the first file name is inserted. You can see that 73 there is only one match when you type 'wildchar' twice and the completed 74 @@ -730,19 +742,29 @@ 53 75 In Ex commands, at places where a file name can be used, the following 54 76 characters have a special meaning. These can also be used in the expression … … 90 112 diff -Naur vim72.orig/runtime/doc/eval.txt vim72/runtime/doc/eval.txt 91 113 --- vim72.orig/runtime/doc/eval.txt 2008-08-09 07:22:59.000000000 -0700 92 +++ vim72/runtime/doc/eval.txt 2009-0 6-05 14:23:32.000000000 -0700114 +++ vim72/runtime/doc/eval.txt 2009-07-19 15:15:05.000000000 -0700 93 115 @@ -1,4 +1,4 @@ 94 116 -*eval.txt* For Vim version 7.2. Last change: 2008 Aug 09 … … 226 248 diff -Naur vim72.orig/runtime/doc/if_cscop.txt vim72/runtime/doc/if_cscop.txt 227 249 --- vim72.orig/runtime/doc/if_cscop.txt 2008-08-09 07:22:59.000000000 -0700 228 +++ vim72/runtime/doc/if_cscop.txt 2009-0 6-05 14:23:20.000000000 -0700250 +++ vim72/runtime/doc/if_cscop.txt 2009-07-19 15:18:44.000000000 -0700 229 251 @@ -1,4 +1,4 @@ 230 252 -*if_cscop.txt* For Vim version 7.2. Last change: 2005 Mar 29 … … 258 280 :cscope find 0 DEFAULT_TERM 259 281 < 282 @@ -344,13 +355,8 @@ 283 The DJGPP-built version from http://cscope.sourceforge.net is known to not 284 work with Vim. 285 286 -There are a couple of hard-coded limitations: 287 - 288 - 1. The maximum number of cscope connections allowed is 8. Do you 289 - really need more? 290 - 291 - 2. Doing a |:tjump| when |:cstag| searches the tag files is not 292 - configurable (e.g., you can't do a tselect instead). 293 +Hard-coded limitation: doing a |:tjump| when |:cstag| searches the tag files 294 +is not configurable (e.g., you can't do a tselect instead). 295 296 ============================================================================== 297 6. Suggested usage *cscope-suggestions* 260 298 diff -Naur vim72.orig/runtime/doc/netbeans.txt vim72/runtime/doc/netbeans.txt 261 299 --- vim72.orig/runtime/doc/netbeans.txt 2008-08-09 07:22:59.000000000 -0700 262 +++ vim72/runtime/doc/netbeans.txt 2009-0 6-05 14:19:24.000000000 -0700300 +++ vim72/runtime/doc/netbeans.txt 2009-07-19 15:12:02.000000000 -0700 263 301 @@ -1,4 +1,4 @@ 264 302 -*netbeans.txt* For Vim version 7.2. Last change: 2008 Jun 28 … … 282 320 diff -Naur vim72.orig/runtime/doc/options.txt vim72/runtime/doc/options.txt 283 321 --- vim72.orig/runtime/doc/options.txt 2008-08-09 07:22:59.000000000 -0700 284 +++ vim72/runtime/doc/options.txt 2009-0 6-05 14:21:21.000000000 -0700322 +++ vim72/runtime/doc/options.txt 2009-07-19 15:17:33.000000000 -0700 285 323 @@ -1,4 +1,4 @@ 286 324 -*options.txt* For Vim version 7.2. Last change: 2008 Aug 06 … … 289 327 290 328 VIM REFERENCE MANUAL by Bram Moolenaar 291 @@ -4175,9 +4175,6 @@ 329 @@ -1443,6 +1443,14 @@ 330 autoselectml Like "autoselect", but for the modeless selection 331 only. Compare to the 'A' flag in 'guioptions'. 332 333 + html When the clipboard contains HTML, use this when 334 + pasting. When putting text on the clipboard, mark it 335 + as HTML. This works to copy rendered HTML from 336 + Firefox, paste it as raw HTML in Vim, select the HTML 337 + in Vim and paste it in a rich edit box in Firefox. 338 + Only supported for GTK version 2 and later. 339 + Only available with the |+multi_byte| feature. 340 + 341 exclude:{pattern} 342 Defines a pattern that is matched against the name of 343 the terminal 'term'. If there is a match, no 344 @@ -4175,9 +4183,6 @@ 292 345 be able to execute Normal mode commands. 293 346 This is the opposite of the 'keymap' option, where characters are … … 300 353 :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,Ï 301 354 y,ζz 302 @@ -7472,7 +74 69,9 @@355 @@ -7472,7 +7477,9 @@ 303 356 {not available when compiled without the |+wildignore| 304 357 feature} … … 313 366 diff -Naur vim72.orig/runtime/doc/spell.txt vim72/runtime/doc/spell.txt 314 367 --- vim72.orig/runtime/doc/spell.txt 2008-08-09 07:23:00.000000000 -0700 315 +++ vim72/runtime/doc/spell.txt 2009-0 6-05 14:18:12.000000000 -0700368 +++ vim72/runtime/doc/spell.txt 2009-07-19 15:11:11.000000000 -0700 316 369 @@ -1,4 +1,4 @@ 317 370 -*spell.txt* For Vim version 7.2. Last change: 2008 Jun 21 … … 443 496 diff -Naur vim72.orig/runtime/doc/starting.txt vim72/runtime/doc/starting.txt 444 497 --- vim72.orig/runtime/doc/starting.txt 2008-08-09 07:23:00.000000000 -0700 445 +++ vim72/runtime/doc/starting.txt 2009-0 6-05 14:16:09.000000000 -0700498 +++ vim72/runtime/doc/starting.txt 2009-07-19 15:09:53.000000000 -0700 446 499 @@ -1,4 +1,4 @@ 447 500 -*starting.txt* For Vim version 7.2. Last change: 2008 Jun 21 … … 505 558 diff -Naur vim72.orig/runtime/doc/usr_21.txt vim72/runtime/doc/usr_21.txt 506 559 --- vim72.orig/runtime/doc/usr_21.txt 2008-08-09 07:23:01.000000000 -0700 507 +++ vim72/runtime/doc/usr_21.txt 2009-0 6-05 14:16:09.000000000 -0700560 +++ vim72/runtime/doc/usr_21.txt 2009-07-19 15:09:53.000000000 -0700 508 561 @@ -1,4 +1,4 @@ 509 562 -*usr_21.txt* For Vim version 7.2. Last change: 2007 May 01 … … 570 623 571 624 You can use the ":wviminfo" and ":rviminfo" commands to save and restore the 625 diff -Naur vim72.orig/runtime/doc/various.txt vim72/runtime/doc/various.txt 626 --- vim72.orig/runtime/doc/various.txt 2008-08-09 07:23:01.000000000 -0700 627 +++ vim72/runtime/doc/various.txt 2009-07-19 15:18:31.000000000 -0700 628 @@ -508,6 +508,17 @@ 629 messages though. Use ":silent" in the command itself 630 to avoid that: ":silent menu .... :silent command". 631 632 + *:uns* *:unsilent* 633 +:uns[ilent] {command} Execute {command} not silently. Only makes a 634 + difference when |:silent| was used to get to this 635 + command. 636 + Use this for giving a message even when |:silent| was 637 + used. In this example |:silent| is used to avoid the 638 + message about reading the file and |:unsilent| to be 639 + able to list the first line of each file. > 640 + :silent argdo unsilent echo expand('%') . ": " . getline(1) 641 +< 642 + 643 *:verb* *:verbose* 644 :[count]verb[ose] {command} 645 Execute {command} with 'verbose' set to [count]. If 572 646 diff -Naur vim72.orig/runtime/scripts.vim vim72/runtime/scripts.vim 573 647 --- vim72.orig/runtime/scripts.vim 2008-08-08 15:27:21.000000000 -0700 574 +++ vim72/runtime/scripts.vim 2009-0 6-05 14:14:19.000000000 -0700648 +++ vim72/runtime/scripts.vim 2009-07-19 15:08:47.000000000 -0700 575 649 @@ -234,6 +234,10 @@ 576 650 elseif s:line1 =~ '\<DTD\s\+XHTML\s' … … 586 660 diff -Naur vim72.orig/src/auto/configure vim72/src/auto/configure 587 661 --- vim72.orig/src/auto/configure 2008-07-24 05:40:36.000000000 -0700 588 +++ vim72/src/auto/configure 2009-0 6-05 14:25:31.000000000 -0700662 +++ vim72/src/auto/configure 2009-07-19 15:16:46.000000000 -0700 589 663 @@ -1,6 +1,6 @@ 590 664 #! /bin/sh … … 1946 2020 diff -Naur vim72.orig/src/buffer.c vim72/src/buffer.c 1947 2021 --- vim72.orig/src/buffer.c 2008-08-06 04:00:48.000000000 -0700 1948 +++ vim72/src/buffer.c 2009-0 6-05 14:25:15.000000000 -07002022 +++ vim72/src/buffer.c 2009-07-19 15:16:33.000000000 -0700 1949 2023 @@ -44,6 +44,7 @@ 1950 2024 #ifdef FEAT_TITLE … … 2473 2547 diff -Naur vim72.orig/src/charset.c vim72/src/charset.c 2474 2548 --- vim72.orig/src/charset.c 2008-07-24 07:59:44.000000000 -0700 2475 +++ vim72/src/charset.c 2009-0 6-05 14:24:27.000000000 -07002549 +++ vim72/src/charset.c 2009-07-19 15:15:54.000000000 -0700 2476 2550 @@ -17,7 +17,7 @@ 2477 2551 static int win_nolbr_chartabsize __ARGS((win_T *wp, char_u *s, colnr_T col, int *headp)); … … 2562 2636 diff -Naur vim72.orig/src/config.h.in vim72/src/config.h.in 2563 2637 --- vim72.orig/src/config.h.in 2008-06-21 08:01:41.000000000 -0700 2564 +++ vim72/src/config.h.in 2009-0 6-05 14:25:31.000000000 -07002638 +++ vim72/src/config.h.in 2009-07-19 15:16:46.000000000 -0700 2565 2639 @@ -36,6 +36,9 @@ 2566 2640 /* Defined to the size of an int */ … … 2585 2659 diff -Naur vim72.orig/src/configure.in vim72/src/configure.in 2586 2660 --- vim72.orig/src/configure.in 2008-07-24 05:40:26.000000000 -0700 2587 +++ vim72/src/configure.in 2009-0 6-05 14:25:31.000000000 -07002661 +++ vim72/src/configure.in 2009-07-19 15:16:46.000000000 -0700 2588 2662 @@ -1193,6 +1193,28 @@ 2589 2663 … … 2713 2787 diff -Naur vim72.orig/src/diff.c vim72/src/diff.c 2714 2788 --- vim72.orig/src/diff.c 2008-03-05 03:16:56.000000000 -0800 2715 +++ vim72/src/diff.c 2009-0 6-05 14:24:34.000000000 -07002789 +++ vim72/src/diff.c 2009-07-19 15:16:00.000000000 -0700 2716 2790 @@ -8,7 +8,7 @@ 2717 2791 */ … … 2916 2990 diff -Naur vim72.orig/src/digraph.c vim72/src/digraph.c 2917 2991 --- vim72.orig/src/digraph.c 2008-06-23 14:12:51.000000000 -0700 2918 +++ vim72/src/digraph.c 2009-0 6-05 14:24:27.000000000 -07002992 +++ vim72/src/digraph.c 2009-07-19 15:15:54.000000000 -0700 2919 2993 @@ -32,7 +32,7 @@ 2920 2994 static void printdigraph __ARGS((digr_T *)); … … 2988 3062 diff -Naur vim72.orig/src/edit.c vim72/src/edit.c 2989 3063 --- vim72.orig/src/edit.c 2008-08-06 05:51:17.000000000 -0700 2990 +++ vim72/src/edit.c 2009-0 6-05 14:25:48.000000000 -07003064 +++ vim72/src/edit.c 2009-07-19 15:18:33.000000000 -0700 2991 3065 @@ -57,7 +57,7 @@ 2992 3066 N_(" Keyword Local completion (^N^P)"), … … 2998 3072 /* 2999 3073 * Structure used to store one match for insert completion. 3000 @@ -147,6 +147,7 @@ 3074 @@ -114,6 +114,10 @@ 3075 * FALSE the word to be completed must be located. */ 3076 static int compl_started = FALSE; 3077 3078 +/* Set when doing something for completion that may call edit() recursively, 3079 + * which is not allowed. */ 3080 +static int compl_busy = FALSE; 3081 + 3082 static int compl_matches = 0; 3083 static char_u *compl_pattern = NULL; 3084 static int compl_direction = FORWARD; 3085 @@ -147,6 +151,7 @@ 3001 3086 static int ins_compl_bs __ARGS((void)); 3002 3087 static void ins_compl_new_leader __ARGS((void)); … … 3006 3091 static void ins_compl_set_original_text __ARGS((char_u *str)); 3007 3092 static void ins_compl_addfrommatch __ARGS((void)); 3008 @@ -164,7 +16 5,7 @@3093 @@ -164,7 +169,7 @@ 3009 3094 static int ins_compl_key2count __ARGS((int c)); 3010 3095 static int ins_compl_use_match __ARGS((int c)); … … 3015 3100 3016 3101 #define BACKSPACE_CHAR 1 3017 @@ -197,7 + 198,8 @@3102 @@ -197,7 +202,8 @@ 3018 3103 static void mb_replace_pop_ins __ARGS((int cc)); 3019 3104 #endif … … 3025 3110 static int cindent_on __ARGS((void)); 3026 3111 #endif 3027 @@ -304,7 +3 06,7 @@3112 @@ -304,7 +310,7 @@ 3028 3113 int c = 0; 3029 3114 char_u *ptr; … … 3034 3119 int i; 3035 3120 int did_backspace = TRUE; /* previous char was backspace */ 3036 @@ -385,7 +387,7 @@ 3121 @@ -344,7 +350,7 @@ 3122 3123 #ifdef FEAT_INS_EXPAND 3124 /* Don't allow recursive insert mode when busy with completion. */ 3125 - if (compl_started || pum_visible()) 3126 + if (compl_started || compl_busy || pum_visible()) 3127 { 3128 EMSG(_(e_secure)); 3129 return FALSE; 3130 @@ -385,7 +391,7 @@ 3037 3131 if (startln) 3038 3132 Insstart.col = 0; … … 3043 3137 if (!did_ai) 3044 3138 ai_col = 0; 3045 @@ -651,7 +65 3,7 @@3139 @@ -651,7 +657,7 @@ 3046 3140 mincol = curwin->w_wcol; 3047 3141 validate_cursor_col(); … … 3052 3146 + curwin->w_height - 1 - p_so 3053 3147 && (curwin->w_cursor.lnum != curwin->w_topline 3054 @@ -751,7 +75 3,7 @@3148 @@ -751,7 +757,7 @@ 3055 3149 * there is nothing to add, CTRL-L works like CTRL-P then. */ 3056 3150 if (c == Ctrl_L … … 3061 3155 { 3062 3156 ins_compl_addfrommatch(); 3063 @@ -1771,7 +1773,7 @@ 3157 @@ -1338,8 +1344,10 @@ 3158 goto normalchar; 3159 3160 docomplete: 3161 + compl_busy = TRUE; 3162 if (ins_complete(c) == FAIL) 3163 compl_cont_status = 0; 3164 + compl_busy = FALSE; 3165 break; 3166 #endif /* FEAT_INS_EXPAND */ 3167 3168 @@ -1771,7 +1779,7 @@ 3064 3169 * Compute the screen column where the cursor should be. 3065 3170 */ … … 3070 3175 /* 3071 3176 * Advance the cursor until we reach the right screen column. 3072 @@ -1798,9 +180 0,9 @@3177 @@ -1798,9 +1806,9 @@ 3073 3178 */ 3074 3179 if (vcol != (int)curwin->w_virtcol) … … 3082 3187 { 3083 3188 new_cursor_col += i; 3084 @@ -1824,7 +18 26,7 @@3189 @@ -1824,7 +1832,7 @@ 3085 3190 if (new_cursor_col <= 0) 3086 3191 curwin->w_cursor.col = 0; … … 3091 3196 changed_cline_bef_curs(); 3092 3197 3093 @@ -1933,6 +19 35,8 @@3198 @@ -1933,6 +1941,8 @@ 3094 3199 /* 3095 3200 * Backspace the cursor until the given column. Handles REPLACE and VREPLACE … … 3100 3205 void 3101 3206 backspace_until_column(col) 3102 @@ -1942,13 +19 46,50 @@3207 @@ -1942,13 +1952,50 @@ 3103 3208 { 3104 3209 curwin->w_cursor.col--; … … 3154 3259 /* 3155 3260 * CTRL-X pressed in Insert mode. 3156 @@ -2160,7 +220 1,7 @@3261 @@ -2160,7 +2207,7 @@ 3157 3262 actual_compl_length = compl_length; 3158 3263 … … 3163 3268 { 3164 3269 p = str; 3165 @@ -2418,7 +24 59,7 @@3270 @@ -2418,7 +2465,7 @@ 3166 3271 { 3167 3272 had_match = (curwin->w_cursor.col > compl_col); … … 3172 3277 3173 3278 /* When the match isn't there (to avoid matching itself) remove it 3174 @@ -2470,7 +251 1,7 @@3279 @@ -2470,7 +2517,7 @@ 3175 3280 *p = NUL; 3176 3281 had_match = (curwin->w_cursor.col > compl_col); … … 3181 3286 3182 3287 /* When the match isn't there (to avoid matching itself) remove it 3183 @@ -2539,7 +258 0,7 @@3288 @@ -2539,7 +2586,7 @@ 3184 3289 */ 3185 3290 void … … 3190 3295 { 3191 3296 /* If already doing completions stop it. */ 3192 @@ -2550,10 +259 1,10 @@3297 @@ -2550,10 +2597,10 @@ 3193 3298 if (stop_arrow() == FAIL) 3194 3299 return; … … 3203 3308 compl_orig_text = vim_strnsave(ml_get_curline() + compl_col, compl_length); 3204 3309 if (compl_orig_text == NULL || ins_compl_add(compl_orig_text, 3205 @@ -2819,7 +286 0,6 @@3310 @@ -2819,7 +2866,6 @@ 3206 3311 regmatch_T regmatch; 3207 3312 char_u **files; … … 3211 3316 int dir = compl_direction; 3212 3317 3213 @@ -2851,17 +289 1,18 @@3318 @@ -2851,17 +2897,18 @@ 3214 3319 if (ctrl_x_mode == CTRL_X_WHOLE_LINE) 3215 3320 { … … 3233 3338 vim_free(pat_esc); 3234 3339 vim_free(ptr); 3235 @@ -2952,7 +299 3,7 @@3340 @@ -2952,7 +2999,7 @@ 3236 3341 { 3237 3342 vim_snprintf((char *)IObuff, IOSIZE, … … 3242 3347 3243 3348 if (fp != NULL) 3244 @@ -3209,7 +3250,7 @@ 3349 @@ -3133,6 +3180,7 @@ 3350 vim_free(match); 3351 } while (compl_curr_match != NULL && compl_curr_match != compl_first_match); 3352 compl_first_match = compl_curr_match = NULL; 3353 + compl_shown_match = NULL; 3354 } 3355 3356 static void 3357 @@ -3209,7 +3257,7 @@ 3245 3358 { 3246 3359 ins_compl_del_pum(); … … 3251 3364 3252 3365 if (compl_started) 3253 @@ -3264,6 +33 05,20 @@3366 @@ -3264,6 +3312,20 @@ 3254 3367 } 3255 3368 … … 3272 3385 * matches. 3273 3386 */ 3274 @@ -3292,7 +33 47,7 @@3387 @@ -3292,7 +3354,7 @@ 3275 3388 3276 3389 vim_free(compl_leader); … … 3281 3394 ins_compl_new_leader(); 3282 3395 } 3283 @@ -3340,7 +3 395,7 @@3396 @@ -3340,7 +3402,7 @@ 3284 3397 ins_compl_addfrommatch() 3285 3398 { … … 3290 3403 compl_T *cp; 3291 3404 3292 @@ -3621,10 +36 76,9 @@3405 @@ -3621,10 +3683,9 @@ 3293 3406 { 3294 3407 ins_compl_delete(); … … 3303 3416 } 3304 3417 3305 @@ -3907,7 +396 1,7 @@3418 @@ -3907,7 +3968,7 @@ 3306 3419 : ins_buf->b_sfname == NULL 3307 3420 ? (char *)ins_buf->b_fname … … 3312 3425 else if (*e_cpt == NUL) 3313 3426 break; 3314 @@ -3936,8 +399 0,8 @@3427 @@ -3936,8 +3997,8 @@ 3315 3428 else if (*e_cpt == ']' || *e_cpt == 't') 3316 3429 { … … 3323 3436 else 3324 3437 type = -1; 3325 @@ -4035,7 +40 89,7 @@3438 @@ -4035,7 +4096,7 @@ 3326 3439 case CTRL_X_SPELL: 3327 3440 #ifdef FEAT_SPELL … … 3332 3445 ins_compl_add_matches(num_matches, matches, p_ic); 3333 3446 #endif 3334 @@ -4187,7 +424 1,7 @@3447 @@ -4187,7 +4248,7 @@ 3335 3448 } 3336 3449 … … 3341 3454 found_new_match = OK; 3342 3455 3343 @@ -4256,7 +431 0,7 @@3456 @@ -4256,7 +4317,7 @@ 3344 3457 static void 3345 3458 ins_compl_insert() … … 3350 3463 compl_used_match = FALSE; 3351 3464 else 3352 @@ -4425,7 +44 79,7 @@3465 @@ -4425,7 +4486,7 @@ 3353 3466 if (!compl_get_longest || compl_used_match) 3354 3467 ins_compl_insert(); … … 3359 3472 else 3360 3473 compl_used_match = FALSE; 3361 @@ -4688,7 +474 2,7 @@3474 @@ -4688,7 +4749,7 @@ 3362 3475 } 3363 3476 compl_length = curwin->w_cursor.col - (int)compl_col; … … 3368 3481 if (compl_length > (IOSIZE - MIN_SPACE)) 3369 3482 { 3370 @@ -4745,10 +4 799,9 @@3483 @@ -4745,10 +4806,9 @@ 3371 3484 { 3372 3485 char_u *prefix = (char_u *)"\\<"; … … 3381 3494 return FAIL; 3382 3495 if (!vim_iswordp(line + compl_col) 3383 @@ -4823,7 +48 76,7 @@3496 @@ -4823,7 +4883,7 @@ 3384 3497 else 3385 3498 { … … 3390 3503 return FAIL; 3391 3504 STRCPY((char *)compl_pattern, "\\<"); 3392 @@ -4905,7 +49 58,7 @@3505 @@ -4905,7 +4965,7 @@ 3393 3506 if (col < 0) 3394 3507 col = curs_col; … … 3399 3512 3400 3513 /* Setup variables for completion. Need to obtain "line" again, 3401 @@ -5178,15 +523 1,15 @@3514 @@ -5178,15 +5238,15 @@ 3402 3515 * a backslash) the metachars, and dest would be NUL terminated. 3403 3516 * Returns the length (needed) of dest … … 3418 3531 switch (*src) 3419 3532 { 3420 @@ -6015,7 +60 68,7 @@3533 @@ -6015,7 +6075,7 @@ 3421 3534 * in 'formatoptions' and there is a single character before the cursor. 3422 3535 * Otherwise the line would be broken and when typing another non-white … … 3427 3540 { 3428 3541 dec_cursor(); 3429 @@ -6192,7 +62 45,7 @@3542 @@ -6192,7 +6252,7 @@ 3430 3543 * three digits. */ 3431 3544 if (VIM_ISDIGIT(c)) … … 3436 3549 } 3437 3550 else 3438 @@ -6266,7 +63 19,7 @@3551 @@ -6266,7 +6326,7 @@ 3439 3552 ins_need_undo = FALSE; 3440 3553 } … … 3445 3558 #ifdef FEAT_VREPLACE 3446 3559 if (State & VREPLACE_FLAG) 3447 @@ -6369,13 +642 2,17 @@3560 @@ -6369,13 +6429,17 @@ 3448 3561 3449 3562 /* If we just did an auto-indent, remove the white space from the end … … 3465 3578 { 3466 3579 if (gchar_cursor() == NUL && curwin->w_cursor.col > 0) 3467 @@ -6383,7 +644 0,8 @@3580 @@ -6383,7 +6447,8 @@ 3468 3581 cc = gchar_cursor(); 3469 3582 if (!vim_iswhite(cc)) … … 3475 3588 if (curwin->w_cursor.lnum != tpos.lnum) 3476 3589 curwin->w_cursor = tpos; 3477 @@ -6395,10 +64 53,11 @@3590 @@ -6395,10 +6460,11 @@ 3478 3591 * deleted characters. */ 3479 3592 if (VIsual_active && VIsual.lnum == curwin->w_cursor.lnum) … … 3490 3603 VIsual.coladd = 0; 3491 3604 # endif 3492 @@ -7123,9 +718 2,12 @@3605 @@ -7123,9 +7189,12 @@ 3493 3606 * cc == 0: character was inserted, delete it 3494 3607 * cc > 0: character was replaced, put cc (first byte of original char) back … … 3504 3617 int cc; 3505 3618 #ifdef FEAT_VREPLACE 3506 @@ -7153,7 +72 15,7 @@3619 @@ -7153,7 +7222,7 @@ 3507 3620 #ifdef FEAT_MBYTE 3508 3621 if (has_mbyte) … … 3513 3626 if (State & VREPLACE_FLAG) 3514 3627 orig_len = (int)STRLEN(ml_get_cursor()); 3515 @@ -7203,7 +72 65,7 @@3628 @@ -7203,7 +7272,7 @@ 3516 3629 changed_bytes(curwin->w_cursor.lnum, curwin->w_cursor.col); 3517 3630 } … … 3522 3635 3523 3636 #ifdef FEAT_CINDENT 3524 @@ -7646,9 +77 08,7 @@3637 @@ -7646,9 +7715,7 @@ 3525 3638 */ 3526 3639 ++no_mapping; … … 3532 3645 { 3533 3646 /* Get a third key for literal register insertion */ 3534 @@ -7657,9 +77 17,7 @@3647 @@ -7657,9 +7724,7 @@ 3535 3648 add_to_showcmd_c(literally); 3536 3649 #endif … … 3542 3655 --no_mapping; 3543 3656 3544 @@ -8150,7 +82 08,7 @@3657 @@ -8150,7 +8215,7 @@ 3545 3658 /* 3546 3659 * If the cursor is on an indent, ^T/^D insert/delete one … … 3551 3664 * autoindent, we support it everywhere. 3552 3665 */ 3553 @@ -8239,7 +8 297,7 @@3666 @@ -8239,7 +8304,7 @@ 3554 3667 * Replace mode */ 3555 3668 if (curwin->w_cursor.lnum != Insstart.lnum … … 3560 3673 else 3561 3674 (void)del_char(FALSE); 3562 @@ -8258,6 +83 16,7 @@3675 @@ -8258,6 +8323,7 @@ 3563 3676 linenr_T lnum; 3564 3677 int cc; … … 3568 3681 int did_backspace = FALSE; 3569 3682 int in_indent; 3570 @@ -8415,13 +84 74,13 @@3683 @@ -8415,13 +8481,13 @@ 3571 3684 */ 3572 3685 while (cc > 0) … … 3584 3697 } 3585 3698 /* restore the characters that NL replaced */ 3586 @@ -8453,11 +851 2,11 @@3699 @@ -8453,11 +8519,11 @@ 3587 3700 #endif 3588 3701 ) … … 3598 3711 3599 3712 /* 3600 @@ -8556,7 +86 15,7 @@3713 @@ -8556,7 +8622,7 @@ 3601 3714 break; 3602 3715 } … … 3607 3720 { 3608 3721 #ifdef FEAT_MBYTE 3609 @@ -8931,7 +899 0,10 @@3722 @@ -8931,7 +8997,10 @@ 3610 3723 foldOpenCursor(); 3611 3724 #endif … … 3621 3734 diff -Naur vim72.orig/src/eval.c vim72/src/eval.c 3622 3735 --- vim72.orig/src/eval.c 2008-08-07 12:37:22.000000000 -0700 3623 +++ vim72/src/eval.c 2009-0 6-05 14:26:02.000000000 -07003736 +++ vim72/src/eval.c 2009-07-19 15:17:12.000000000 -0700 3624 3737 @@ -32,6 +32,9 @@ 3625 3738 … … 6058 6171 diff -Naur vim72.orig/src/ex_cmds2.c vim72/src/ex_cmds2.c 6059 6172 --- vim72.orig/src/ex_cmds2.c 2008-07-13 09:18:22.000000000 -0700 6060 +++ vim72/src/ex_cmds2.c 2009-0 6-05 14:25:09.000000000 -07006173 +++ vim72/src/ex_cmds2.c 2009-07-19 15:16:28.000000000 -0700 6061 6174 @@ -28,7 +28,8 @@ 6062 6175 { … … 6193 6306 diff -Naur vim72.orig/src/ex_cmds.c vim72/src/ex_cmds.c 6194 6307 --- vim72.orig/src/ex_cmds.c 2008-08-04 12:15:00.000000000 -0700 6195 +++ vim72/src/ex_cmds.c 2009-0 6-05 14:25:15.000000000 -07006308 +++ vim72/src/ex_cmds.c 2009-07-19 15:18:39.000000000 -0700 6196 6309 @@ -24,7 +24,7 @@ 6197 6310 static void do_filter __ARGS((linenr_T line1, linenr_T line2, exarg_T *eap, char_u *cmd, int do_in, int do_out)); … … 6513 6626 6514 6627 --RedrawingDisabled; 6515 @@ -4022,8 +4034,10 @@ 6628 @@ -3997,6 +4009,9 @@ 6629 break; 6630 ml_delete(eap->line1, FALSE); 6631 } 6632 + 6633 + /* make sure the cursor is not beyond the end of the file now */ 6634 + check_cursor_lnum(); 6635 deleted_lines_mark(eap->line1, (long)(eap->line2 - lnum)); 6636 6637 /* ":append" on the line above the deleted lines. */ 6638 @@ -4022,8 +4037,10 @@ 6516 6639 bigness = curwin->w_height; 6517 6640 else if (firstwin == lastwin) … … 6524 6647 bigness = 1; 6525 6648 6526 @@ -4472,7 +448 6,7 @@6649 @@ -4472,7 +4489,7 @@ 6527 6650 char_u *p1; 6528 6651 int did_sub = FALSE; … … 6533 6656 int do_again; /* do it again after joining lines */ 6534 6657 int skip_match = FALSE; 6535 @@ -4617,6 +463 1,8 @@6658 @@ -4617,6 +4634,8 @@ 6536 6659 6537 6660 if (do_ask) … … 6542 6665 * properly */ 6543 6666 save_State = State; 6544 @@ -4655,7 +467 1,7 @@6667 @@ -4655,7 +4674,7 @@ 6545 6668 resp = getexmodeline('?', NULL, 0); 6546 6669 if (resp != NULL) … … 6551 6674 } 6552 6675 } 6553 @@ -4707,7 +472 3,7 @@6676 @@ -4707,7 +4726,7 @@ 6554 6677 #endif 6555 6678 ++no_mapping; /* don't map this key */ … … 6560 6683 --no_mapping; 6561 6684 6562 @@ -4718,35 +473 4,35 @@6685 @@ -4718,35 +4737,35 @@ 6563 6686 } 6564 6687 … … 6604 6727 #endif 6605 6728 } 6606 @@ -4757,7 +477 3,7 @@6729 @@ -4757,7 +4776,7 @@ 6607 6730 if (vim_strchr(p_cpo, CPO_UNDO) != NULL) 6608 6731 --no_u_sync; … … 6613 6736 /* For a multi-line match, put matchcol at the NUL at 6614 6737 * the end of the line and set nmatch to one, so that 6615 @@ -4808,9 +482 4,9 @@6738 @@ -4808,9 +4827,9 @@ 6616 6739 p1 = ml_get(sub_firstlnum + nmatch - 1); 6617 6740 nmatch_tl += nmatch - 1; … … 6626 6749 { 6627 6750 /* 6628 @@ -4833,7 +48 49,7 @@6751 @@ -4833,7 +4852,7 @@ 6629 6752 */ 6630 6753 len = (unsigned)STRLEN(new_start); … … 6635 6758 new_start_len = needed_len + 50; 6636 6759 if ((p1 = alloc_check(new_start_len)) == NULL) 6637 @@ -4851,8 +48 67,8 @@6760 @@ -4851,8 +4870,8 @@ 6638 6761 /* 6639 6762 * copy the text up to the part that matched … … 6646 6769 (void)vim_regsub_multi(®match, 6647 6770 sub_firstlnum - regmatch.startpos[0].lnum, 6648 @@ -5059,6 +507 5,7 @@6771 @@ -5059,6 +5078,7 @@ 6649 6772 6650 6773 if (did_sub) … … 6654 6777 sub_firstline = NULL; 6655 6778 } 6656 @@ -5769,7 +578 6,7 @@6779 @@ -5769,7 +5789,7 @@ 6657 6780 * Recognize a few exceptions to the rule. Some strings that contain '*' 6658 6781 * with "star". Otherwise '*' is recognized as a wildcard. … … 6663 6786 { 6664 6787 STRCPY(d, rtable[i]); 6665 @@ -6519,22 +653 6,11 @@6788 @@ -6519,22 +6539,11 @@ 6666 6789 static sign_T *first_sign = NULL; 6667 6790 static int last_sign_typenr = MAX_TYPENR; /* is decremented */ … … 6689 6812 #define SIGNCMD_DEFINE 0 6690 6813 "undefine", 6691 @@ -6547,22 +655 3,51 @@6814 @@ -6547,22 +6556,51 @@ 6692 6815 #define SIGNCMD_UNPLACE 4 6693 6816 "jump", … … 6752 6875 arg = skipwhite(p); 6753 6876 6754 @@ -6728,24 +676 3,8 @@6877 @@ -6728,24 +6766,8 @@ 6755 6878 /* ":sign list {name}" */ 6756 6879 sign_list_defined(sp); … … 6778 6901 } 6779 6902 else 6780 @@ -6994,6 +701 3,31 @@6903 @@ -6994,6 +7016,31 @@ 6781 6904 } 6782 6905 … … 6810 6933 * If "line" is TRUE: line highl, if FALSE: text highl. 6811 6934 */ 6812 @@ -7067,6 +711 1,198 @@6935 @@ -7067,6 +7114,198 @@ 6813 6936 return (char_u *)_("[Deleted]"); 6814 6937 } … … 7011 7134 diff -Naur vim72.orig/src/ex_cmds.h vim72/src/ex_cmds.h 7012 7135 --- vim72.orig/src/ex_cmds.h 2008-06-21 11:47:57.000000000 -0700 7013 +++ vim72/src/ex_cmds.h 2009-0 6-05 14:16:09.000000000 -07007136 +++ vim72/src/ex_cmds.h 2009-07-19 15:18:31.000000000 -0700 7014 7137 @@ -278,7 +278,7 @@ 7015 7138 EX(CMD_crewind, "crewind", ex_cc, … … 7057 7180 TRLBAR|EXTRA|CMDWIN|SBOXOK), 7058 7181 EX(CMD_setfiletype, "setfiletype", ex_setfiletype, 7182 @@ -987,6 +991,8 @@ 7183 BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN), 7184 EX(CMD_unmenu, "unmenu", ex_menu, 7185 BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN), 7186 +EX(CMD_unsilent, "unsilent", ex_wrongmodifier, 7187 + NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN), 7188 EX(CMD_update, "update", ex_update, 7189 RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR), 7190 EX(CMD_vglobal, "vglobal", ex_global, 7059 7191 diff -Naur vim72.orig/src/ex_docmd.c vim72/src/ex_docmd.c 7060 7192 --- vim72.orig/src/ex_docmd.c 2008-07-26 04:51:05.000000000 -0700 7061 +++ vim72/src/ex_docmd.c 2009-0 6-05 14:25:02.000000000 -07007193 +++ vim72/src/ex_docmd.c 2009-07-19 15:18:41.000000000 -0700 7062 7194 @@ -364,6 +364,7 @@ 7063 7195 # define ex_function ex_ni … … 7093 7225 { 7094 7226 # ifdef FEAT_EVAL 7227 @@ -1678,8 +1677,8 @@ 7228 char_u *errormsg = NULL; /* error message */ 7229 exarg_T ea; /* Ex command arguments */ 7230 long verbose_save = -1; 7231 - int save_msg_scroll = 0; 7232 - int did_silent = 0; 7233 + int save_msg_scroll = msg_scroll; 7234 + int save_msg_silent = -1; 7235 int did_esilent = 0; 7236 #ifdef HAVE_SANDBOX 7237 int did_sandbox = FALSE; 7095 7238 @@ -1770,7 +1769,7 @@ 7096 7239 } … … 7102 7245 #endif 7103 7246 continue; 7104 @@ -2698,6 +2697,11 @@ 7247 @@ -1857,9 +1856,9 @@ 7248 } 7249 if (!checkforcmd(&ea.cmd, "silent", 3)) 7250 break; 7251 - ++did_silent; 7252 + if (save_msg_silent == -1) 7253 + save_msg_silent = msg_silent; 7254 ++msg_silent; 7255 - save_msg_scroll = msg_scroll; 7256 if (*ea.cmd == '!' && !vim_iswhite(ea.cmd[-1])) 7257 { 7258 /* ":silent!", but not "silent !cmd" */ 7259 @@ -1887,6 +1886,13 @@ 7260 #endif 7261 continue; 7262 7263 + case 'u': if (!checkforcmd(&ea.cmd, "unsilent", 3)) 7264 + break; 7265 + if (save_msg_silent == -1) 7266 + save_msg_silent = msg_silent; 7267 + msg_silent = 0; 7268 + continue; 7269 + 7270 case 'v': if (checkforcmd(&ea.cmd, "vertical", 4)) 7271 { 7272 #ifdef FEAT_VERTSPLIT 7273 @@ -2685,19 +2691,23 @@ 7274 7275 cmdmod = save_cmdmod; 7276 7277 - if (did_silent > 0) 7278 + if (save_msg_silent != -1) 7279 { 7280 /* messages could be enabled for a serious error, need to check if the 7281 * counters don't become negative */ 7282 - msg_silent -= did_silent; 7283 - if (msg_silent < 0) 7284 - msg_silent = 0; 7285 + if (!did_emsg) 7286 + msg_silent = save_msg_silent; 7287 emsg_silent -= did_esilent; 7288 if (emsg_silent < 0) 7289 emsg_silent = 0; 7105 7290 /* Restore msg_scroll, it's set by file I/O commands, even when no 7106 7291 * message is actually displayed. */ … … 7114 7299 7115 7300 #ifdef HAVE_SANDBOX 7116 @@ -2731,7 +27 35,7 @@7301 @@ -2731,7 +2741,7 @@ 7117 7302 int i; 7118 7303 … … 7123 7308 if (i >= len && !isalpha((*pp)[i])) 7124 7309 { 7125 @@ -2748,11 +275 2,10 @@7310 @@ -2748,11 +2758,10 @@ 7126 7311 * "full" is set to TRUE if the whole command name matched. 7127 7312 * Returns NULL for an ambiguous user command. … … 7136 7321 int len; 7137 7322 char_u *p; 7138 @@ -2797,7 +280 0,7 @@7323 @@ -2797,7 +2806,7 @@ 7139 7324 /* Check for ":dl", ":dell", etc. to ":deletel": that's 7140 7325 * :delete with the 'l' flag. Same for 'p'. */ … … 7145 7330 if (i == len - 1) 7146 7331 { 7147 @@ -2978, 6 +2981,7@@7332 @@ -2978,11 +2987,13 @@ 7148 7333 {"keepmarks", 3, FALSE}, 7149 7334 {"leftabove", 5, FALSE}, … … 7153 7338 {"sandbox", 3, FALSE}, 7154 7339 {"silent", 3, FALSE}, 7155 @@ -3000,7 +3004,7 @@ 7340 {"tab", 3, TRUE}, 7341 {"topleft", 2, FALSE}, 7342 + {"unsilent", 3, FALSE}, 7343 {"verbose", 4, TRUE}, 7344 {"vertical", 4, FALSE}, 7345 }; 7346 @@ -3000,7 +3011,7 @@ 7156 7347 7157 7348 if (VIM_ISDIGIT(*cmd)) … … 7162 7353 for (j = 0; p[j] != NUL; ++j) 7163 7354 if (p[j] != cmdmods[i].name[j]) 7164 @@ -3028,7 +303 2,7 @@7355 @@ -3028,7 +3039,7 @@ 7165 7356 char_u *p; 7166 7357 … … 7171 7362 for (j = 0; name[j] != NUL; ++j) 7172 7363 if (name[j] != cmdmods[i].name[j]) 7173 @@ -3608,6 +361 2,7 @@7364 @@ -3608,6 +3619,7 @@ 7174 7365 return set_context_in_autocmd(xp, arg, FALSE); 7175 7366 … … 7179 7370 #endif 7180 7371 case CMD_set: 7181 @@ -3680,6 +36 85,18 @@7372 @@ -3680,6 +3692,18 @@ 7182 7373 case CMD_highlight: 7183 7374 set_context_in_highlight_cmd(xp, arg); … … 7198 7389 case CMD_bdelete: 7199 7390 case CMD_bwipeout: 7200 @@ -3803,7 +382 0,7 @@7391 @@ -3803,7 +3827,7 @@ 7201 7392 char_u *cmd; 7202 7393 int *ctx; /* pointer to xp_context or NULL */ … … 7207 7398 while (vim_strchr((char_u *)" \t0123456789.$%'/?-+,;", *cmd) != NULL) 7208 7399 { 7209 @@ -5033,10 +505 0,9 @@7400 @@ -5033,10 +5057,9 @@ 7210 7401 /* 7211 7402 * Function given to ExpandGeneric() to obtain the list of command names. … … 7219 7410 { 7220 7411 if (idx >= (int)CMD_SIZE) 7221 @@ -5121,7 +51 37,11 @@7412 @@ -5121,7 +5144,11 @@ 7222 7413 } 7223 7414 … … 7232 7423 } 7233 7424 7234 @@ -5180,6 +520 0,9 @@7425 @@ -5180,6 +5207,9 @@ 7235 7426 {EXPAND_AUGROUP, "augroup"}, 7236 7427 {EXPAND_BUFFERS, "buffer"}, … … 7242 7433 {EXPAND_USER_DEFINED, "custom"}, 7243 7434 {EXPAND_USER_LIST, "customlist"}, 7244 @@ -5196,6 +52 19,9 @@7435 @@ -5196,6 +5226,9 @@ 7245 7436 {EXPAND_MENUS, "menu"}, 7246 7437 {EXPAND_SETTINGS, "option"}, … … 7252 7443 {EXPAND_TAGS_LISTFILES, "tag_listfiles"}, 7253 7444 {EXPAND_USER_VARS, "var"}, 7254 @@ -5479,6 +55 05,9 @@7445 @@ -5479,6 +5512,9 @@ 7255 7446 return OK; 7256 7447 } … … 7262 7453 ex_command(eap) 7263 7454 exarg_T *eap; 7264 @@ -5540,10 +55 69,9 @@7455 @@ -5540,10 +5576,9 @@ 7265 7456 * ":comclear" 7266 7457 * Clear all user commands, global and for current buffer. … … 7274 7465 uc_clear(&ucmds); 7275 7466 uc_clear(&curbuf->b_ucmds); 7276 @@ -5910,7 +59 38,8 @@7467 @@ -5910,7 +5945,8 @@ 7277 7468 char_u *q; 7278 7469 … … 7284 7475 7285 7476 size_t split_len = 0; 7286 @@ -5927,16 +59 56,51 @@7477 @@ -5927,16 +5963,51 @@ 7287 7478 7288 7479 /* … … 7340 7531 ++end; 7341 7532 7342 @@ -6003,10 +60 67,9 @@7533 @@ -6003,10 +6074,9 @@ 7343 7534 /* 7344 7535 * Function given to ExpandGeneric() to obtain the list of user command names. … … 7352 7543 { 7353 7544 if (idx < curbuf->b_ucmds.ga_len) 7354 @@ -6021,17 +60 84,16 @@7545 @@ -6021,17 +6091,16 @@ 7355 7546 * Function given to ExpandGeneric() to obtain the list of user command 7356 7547 * attributes. … … 7372 7563 return (char_u *)user_cmd_flags[idx]; 7373 7564 } 7374 @@ -6039,15 +610 1,14 @@7565 @@ -6039,15 +6108,14 @@ 7375 7566 /* 7376 7567 * Function given to ExpandGeneric() to obtain the list of values for -nargs. … … 7390 7581 return (char_u *)user_cmd_nargs[idx]; 7391 7582 } 7392 @@ -6055,10 +61 16,9 @@7583 @@ -6055,10 +6123,9 @@ 7393 7584 /* 7394 7585 * Function given to ExpandGeneric() to obtain the list of values for -complete. … … 7402 7593 { 7403 7594 return (char_u *)command_complete[idx].name; 7404 @@ -6236,10 +6 296,9 @@7595 @@ -6236,10 +6303,9 @@ 7405 7596 /* 7406 7597 * ":cquit". … … 7414 7605 getout(1); /* this does not always pass on the exit code to the Manx 7415 7606 compiler. why? */ 7416 @@ -6681,10 +674 0,9 @@7607 @@ -6681,10 +6747,9 @@ 7417 7608 /* 7418 7609 * ":shell". … … 7426 7617 do_shell(NULL, 0); 7427 7618 } 7428 @@ -6988,10 +70 46,9 @@7619 @@ -6988,10 +7053,9 @@ 7429 7620 /* 7430 7621 * ":preserve". … … 7438 7629 curbuf->b_flags |= BF_PRESERVED; 7439 7630 ml_preserve(curbuf, TRUE); 7440 @@ -7223,10 +728 0,9 @@7631 @@ -7223,10 +7287,9 @@ 7441 7632 /* 7442 7633 * :tabs command: List tabs and their contents. … … 7450 7641 tabpage_T *tp; 7451 7642 win_T *wp; 7452 @@ -7413,7 +74 69,6 @@7643 @@ -7413,7 +7476,6 @@ 7453 7644 /* 7454 7645 * ":edit <file>" command and alikes. … … 7458 7649 do_exedit(eap, old_curwin) 7459 7650 exarg_T *eap; 7460 @@ -7624,10 +76 79,9 @@7651 @@ -7624,10 +7686,9 @@ 7461 7652 } 7462 7653 #endif … … 7470 7661 if (curbuf->b_ml.ml_mfp == NULL || curbuf->b_ml.ml_mfp->mf_fname == NULL) 7471 7662 MSG(_("No swap file")); 7472 @@ -7640,10 +7 694,9 @@7663 @@ -7640,10 +7701,9 @@ 7473 7664 * offset. 7474 7665 * (1998-11-02 16:21:01 R. Edward Ralston <eralston@computer.org>) … … 7482 7673 #ifdef FEAT_SCROLLBIND 7483 7674 win_T *wp; 7484 @@ -7803,6 +7856,9 @@ 7675 @@ -7784,10 +7844,10 @@ 7676 if (*ml_get(lnum) == NUL && u_savedel(lnum, 1L) == OK) 7677 { 7678 ml_delete(lnum, FALSE); 7679 - deleted_lines_mark(lnum, 1L); 7680 if (curwin->w_cursor.lnum > 1 7681 && curwin->w_cursor.lnum >= lnum) 7682 --curwin->w_cursor.lnum; 7683 + deleted_lines_mark(lnum, 1L); 7684 } 7685 } 7686 redraw_curbuf_later(VALID); 7687 @@ -7803,6 +7863,9 @@ 7485 7688 { 7486 7689 vim_free(prev_dir); … … 7492 7695 #endif 7493 7696 7494 @@ -7825,6 +788 1,10 @@7697 @@ -7825,6 +7888,10 @@ 7495 7698 else 7496 7699 #endif … … 7503 7706 && !eap->forceit) 7504 7707 { 7505 @@ -7906,10 +7966,9 @@ 7708 @@ -7896,7 +7963,7 @@ 7709 shorten_fnames(TRUE); 7710 7711 /* Echo the new current directory if the command was typed. */ 7712 - if (KeyTyped) 7713 + if (KeyTyped || p_verbose >= 5) 7714 ex_pwd(eap); 7715 } 7716 vim_free(tofree); 7717 @@ -7906,10 +7973,9 @@ 7506 7718 /* 7507 7719 * ":pwd". … … 7515 7727 if (mch_dirname(NameBuff, MAXPATHL) == OK) 7516 7728 { 7517 @@ -8340,10 +8 399,9 @@7729 @@ -8340,10 +8406,9 @@ 7518 7730 /* 7519 7731 * ":undo". … … 7527 7739 if (eap->addr_count == 1) /* :undo 123 */ 7528 7740 undo_time(eap->line2, FALSE, TRUE); 7529 @@ -8354,10 +841 2,9 @@7741 @@ -8354,10 +8419,9 @@ 7530 7742 /* 7531 7743 * ":redo". … … 7539 7751 u_redo(1); 7540 7752 } 7541 @@ -8365,7 +842 2,6 @@7753 @@ -8365,7 +8429,6 @@ 7542 7754 /* 7543 7755 * ":earlier" and ":later". … … 7547 7759 ex_later(eap) 7548 7760 exarg_T *eap; 7549 @@ -8550,10 +86 06,9 @@7761 @@ -8550,10 +8613,9 @@ 7550 7762 /* 7551 7763 * ":redrawstatus": force redraw of status line(s) … … 7559 7771 #if defined(FEAT_WINDOWS) 7560 7772 int r = RedrawingDisabled; 7561 @@ -8749,8 +8804,8 @@ 7773 @@ -8630,6 +8692,8 @@ 7774 } 7775 7776 #ifdef FEAT_SESSION 7777 + /* Use the short file name until ":lcd" is used. We also don't use the 7778 + * short file name when 'acd' is set, that is checked later. */ 7779 did_lcd = FALSE; 7780 7781 /* ":mkview" or ":mkview 9": generate file name with 'viewdir' */ 7782 @@ -8749,8 +8813,8 @@ 7562 7783 else if (*dirnow != NUL 7563 7784 && (ssop_flags & SSOP_CURDIR) && globaldir != NULL) … … 7570 7791 7571 7792 failed |= (makeopens(fd, dirnow) == FAIL); 7572 @@ -8814,11 +88 69,10 @@7793 @@ -8814,11 +8878,10 @@ 7573 7794 7574 7795 #if ((defined(FEAT_SESSION) || defined(FEAT_EVAL)) && defined(vim_mkdir)) \ … … 7583 7804 if (vim_mkdir(name, prot) != 0) 7584 7805 { 7585 @@ -9089,10 +91 43,9 @@7806 @@ -9089,10 +9152,9 @@ 7586 7807 /* 7587 7808 * ":stopinsert" … … 7595 7816 restart_edit = 0; 7596 7817 stop_insert_mode = TRUE; 7597 @@ -9366,9 +94 19,8 @@7818 @@ -9366,9 +9428,8 @@ 7598 7819 # define SPEC_CLIENT 9 7599 7820 #endif … … 7606 7827 len = (int)STRLEN(spec_str[i]); 7607 7828 if (STRNCMP(src, spec_str[i], len) == 0) 7608 @@ -9506,24 +95 58,50 @@7829 @@ -9506,24 +9567,50 @@ 7609 7830 break; 7610 7831 } … … 7667 7888 7668 7889 #ifdef FEAT_SEARCHPATH 7669 @@ -9541,6 +96 19,15 @@7890 @@ -9541,6 +9628,15 @@ 7670 7891 #ifdef FEAT_AUTOCMD 7671 7892 case SPEC_AFILE: /* file name for autocommand */ … … 7683 7904 { 7684 7905 *errormsg = (char_u *)_("E495: no autocommand file name to substitute for \"<afile>\""); 7685 @@ -9684,7 +97 71,7 @@7906 @@ -9684,7 +9780,7 @@ 7686 7907 } 7687 7908 … … 7692 7913 break; 7693 7914 } 7694 @@ -10067,7 +101 54,7 @@7915 @@ -10067,7 +10163,7 @@ 7695 7916 */ 7696 7917 if (put_line(fd, "let s:sx = expand(\"<sfile>:p:r\").\"x.vim\"") == FAIL … … 7701 7922 return FAIL; 7702 7923 7703 @@ -10689,7 +10776,8 @@ 7924 @@ -10485,6 +10581,9 @@ 7925 if (buf->b_sfname != NULL 7926 && flagp == &ssop_flags 7927 && (ssop_flags & (SSOP_CURDIR | SSOP_SESDIR)) 7928 +#ifdef FEAT_AUTOCHDIR 7929 + && !p_acd 7930 +#endif 7931 && !did_lcd) 7932 name = buf->b_sfname; 7933 else 7934 @@ -10689,7 +10788,8 @@ 7704 7935 p_viminfo = (char_u *)"'100"; 7705 7936 if (eap->cmdidx == CMD_rviminfo) … … 7711 7942 } 7712 7943 else 7713 @@ -10850,10 +109 38,9 @@7944 @@ -10850,10 +10950,9 @@ 7714 7945 } 7715 7946 #endif … … 7723 7954 #ifdef FEAT_DIGRAPHS 7724 7955 if (*eap->arg != NUL) 7725 @@ -10887,10 +109 74,9 @@7956 @@ -10887,10 +10986,9 @@ 7726 7957 /* 7727 7958 * ":nohlsearch" … … 7735 7966 no_hlsearch = TRUE; 7736 7967 redraw_all_later(SOME_VALID); 7737 @@ -10969,10 +110 55,9 @@7968 @@ -10969,10 +11067,9 @@ 7738 7969 /* 7739 7970 * ":X": Get crypt key … … 7749 7980 diff -Naur vim72.orig/src/ex_eval.c vim72/src/ex_eval.c 7750 7981 --- vim72.orig/src/ex_eval.c 2007-11-24 07:34:09.000000000 -0800 7751 +++ vim72/src/ex_eval.c 2009-0 6-05 14:25:02.000000000 -07007982 +++ vim72/src/ex_eval.c 2009-07-19 15:16:23.000000000 -0700 7752 7983 @@ -60,7 +60,9 @@ 7753 7984 #else … … 7795 8026 diff -Naur vim72.orig/src/ex_getln.c vim72/src/ex_getln.c 7796 8027 --- vim72.orig/src/ex_getln.c 2008-08-08 02:31:33.000000000 -0700 7797 +++ vim72/src/ex_getln.c 2009-0 6-05 14:25:02.000000000 -07008028 +++ vim72/src/ex_getln.c 2009-07-19 15:18:07.000000000 -0700 7798 8029 @@ -31,6 +31,8 @@ 7799 8030 int cmdattr; /* attributes for prompt */ … … 8011 8242 { 8012 8243 if (tab[i].ic) 8244 @@ -4831,14 +4874,14 @@ 8245 /* Loop over the items in the list. */ 8246 for (li = retlist->lv_first; li != NULL; li = li->li_next) 8247 { 8248 - if (li->li_tv.v_type != VAR_STRING) 8249 - continue; /* Skip non-string items */ 8250 + if (li->li_tv.v_type != VAR_STRING || li->li_tv.vval.v_string == NULL) 8251 + continue; /* Skip non-string items and empty strings */ 8252 8253 if (ga_grow(&ga, 1) == FAIL) 8254 break; 8255 8256 ((char_u **)ga.ga_data)[ga.ga_len] = 8257 - vim_strsave(li->li_tv.vval.v_string); 8258 + vim_strsave(li->li_tv.vval.v_string); 8259 ++ga.ga_len; 8260 } 8261 list_unref(retlist); 8013 8262 @@ -4871,7 +4914,7 @@ 8014 8263 if (s == NULL) … … 8087 8336 diff -Naur vim72.orig/src/farsi.c vim72/src/farsi.c 8088 8337 --- vim72.orig/src/farsi.c 2007-12-31 08:28:10.000000000 -0800 8089 +++ vim72/src/farsi.c 2009-0 6-05 14:25:02.000000000 -07008338 +++ vim72/src/farsi.c 2009-07-19 15:16:23.000000000 -0700 8090 8339 @@ -103,7 +103,8 @@ 8091 8340 case F_HE: … … 8140 8389 diff -Naur vim72.orig/src/feature.h vim72/src/feature.h 8141 8390 --- vim72.orig/src/feature.h 2008-08-06 04:00:39.000000000 -0700 8142 +++ vim72/src/feature.h 2009-0 6-05 14:16:09.000000000 -07008391 +++ vim72/src/feature.h 2009-07-19 15:09:53.000000000 -0700 8143 8392 @@ -767,9 +767,13 @@ 8144 8393 … … 8159 8408 diff -Naur vim72.orig/src/fileio.c vim72/src/fileio.c 8160 8409 --- vim72.orig/src/fileio.c 2008-08-06 04:01:03.000000000 -0700 8161 +++ vim72/src/fileio.c 2009-0 6-05 14:25:02.000000000 -07008410 +++ vim72/src/fileio.c 2009-07-19 15:18:23.000000000 -0700 8162 8411 @@ -69,7 +69,7 @@ 8163 8412 static int au_find_group __ARGS((char_u *name)); … … 8222 8471 filemess(curbuf, sfname, (char_u *)_("[New File]"), 0); 8223 8472 else 8224 @@ -668, 6 +697,17@@8473 @@ -668,9 +697,21 @@ 8225 8474 #endif 8226 8475 { … … 8239 8488 #ifdef UNIX 8240 8489 /* Set swap file protection bits after creating it. */ 8241 if (swap_mode > 0 && curbuf->b_ml.ml_mfp->mf_fname != NULL) 8242 @@ -698,7 +738,6 @@ 8490 - if (swap_mode > 0 && curbuf->b_ml.ml_mfp->mf_fname != NULL) 8491 + if (swap_mode > 0 && curbuf->b_ml.ml_mfp != NULL 8492 + && curbuf->b_ml.ml_mfp->mf_fname != NULL) 8493 (void)mch_setperm(curbuf->b_ml.ml_mfp->mf_fname, (long)swap_mode); 8494 #endif 8495 } 8496 @@ -698,7 +739,6 @@ 8243 8497 { 8244 8498 int m = msg_scroll; … … 8248 8502 /* 8249 8503 * The file must be closed again, the autocommands may want to change 8250 @@ -740,8 +7 79,13 @@8504 @@ -740,8 +780,13 @@ 8251 8505 /* 8252 8506 * Don't allow the autocommands to change the current buffer. … … 8262 8516 { 8263 8517 --no_wait_return; 8264 @@ -932,7 +97 6,10 @@8518 @@ -932,7 +977,10 @@ 8265 8519 else 8266 8520 { … … 8273 8527 fileformat = EOL_UNIX; /* binary: use Unix format */ 8274 8528 else if (*p_ffs == NUL) 8275 @@ -2211,7 +225 8,7 @@8529 @@ -2211,7 +2259,7 @@ 8276 8530 { 8277 8531 /* Use stderr for stdin, makes shell commands work. */ … … 8282 8536 #endif 8283 8537 8284 @@ -2341,11 +238 8,6 @@8538 @@ -2341,11 +2389,6 @@ 8285 8539 STRCAT(IObuff, _("[CR missing]")); 8286 8540 c = TRUE; … … 8294 8548 { 8295 8549 STRCAT(IObuff, _("[long lines split]")); 8296 @@ -2711,7 +275 3,7 @@8550 @@ -2711,7 +2754,7 @@ 8297 8551 { 8298 8552 if (!curbuf->b_marks_read && get_viminfo_parameter('\'') > 0 … … 8303 8557 /* Always set b_marks_read; needed when 'viminfo' is changed to include 8304 8558 * the ' parameter after opening a buffer. */ 8305 @@ -3451,12 +349 3,12 @@8559 @@ -3451,12 +3494,12 @@ 8306 8560 { 8307 8561 # ifdef UNIX … … 8318 8572 # endif 8319 8573 /* Close the file before removing it, on MS-Windows we 8320 @@ -4367,14 +44 09,14 @@8574 @@ -4367,14 +4410,14 @@ 8321 8575 || st.st_uid != st_old.st_uid 8322 8576 || st.st_gid != st_old.st_gid) … … 8335 8589 buf_setino(buf); 8336 8590 #endif 8337 @@ -5246,13 +5288,16 @@ 8591 @@ -4782,6 +4825,8 @@ 8592 char_u *sfname; 8593 { 8594 #ifdef FEAT_AUTOCMD 8595 + buf_T *buf = curbuf; 8596 + 8597 /* It's like the unnamed buffer is deleted.... */ 8598 if (curbuf->b_p_bl) 8599 apply_autocmds(EVENT_BUFDELETE, NULL, NULL, FALSE, curbuf); 8600 @@ -4790,6 +4835,12 @@ 8601 if (aborting()) /* autocmds may abort script processing */ 8602 return FAIL; 8603 # endif 8604 + if (curbuf != buf) 8605 + { 8606 + /* We are in another buffer now, don't do the renaming. */ 8607 + EMSG(_(e_auchangedbuf)); 8608 + return FAIL; 8609 + } 8610 #endif 8611 8612 if (setfname(curbuf, fname, sfname, FALSE) == OK) 8613 @@ -5246,13 +5297,16 @@ 8338 8614 /* Convert with iconv(). */ 8339 8615 if (ip->bw_restlen > 0) … … 8355 8631 } 8356 8632 else 8357 @@ -5550,9 +5 595,10 @@8633 @@ -5550,9 +5604,10 @@ 8358 8634 name = "ucs-4le"; /* FF FE 00 00 */ 8359 8635 len = 4; … … 8368 8644 } 8369 8645 else if (p[0] == 0xfe && p[1] == 0xff 8370 @@ -5917,7 +59 63,7 @@8646 @@ -5917,7 +5972,7 @@ 8371 8647 else if (*ext == '.') 8372 8648 #endif … … 8377 8653 s = ptr + 8; 8378 8654 *s = '\0'; 8379 @@ -6031,9 +60 77,9 @@8655 @@ -6031,9 +6086,9 @@ 8380 8656 { 8381 8657 tbuf[FGETS_SIZE - 2] = NUL; … … 8389 8665 } while (tbuf[FGETS_SIZE - 2] != NUL && tbuf[FGETS_SIZE - 2] != '\n'); 8390 8666 } 8391 @@ -6107,12 +61 53,24 @@8667 @@ -6107,12 +6162,24 @@ 8392 8668 #ifdef HAVE_ACL 8393 8669 vim_acl_T acl; /* ACL from original file */ … … 8416 8692 /* 8417 8693 * Fail if the "from" file doesn't exist. Avoids that "to" is deleted. 8418 @@ -6120,6 +61 78,55 @@8694 @@ -6120,6 +6187,55 @@ 8419 8695 if (mch_stat((char *)from, &st) < 0) 8420 8696 return -1; … … 8472 8748 * Delete the "to" file, this is required on some systems to make the 8473 8749 * mch_rename() work, on other systems it makes sure that we don't have 8474 @@ -6260,7 +63 67,7 @@8750 @@ -6260,7 +6376,7 @@ 8475 8751 8476 8752 if (!stuff_empty() || global_busy || !typebuf_typed() … … 8481 8757 ) 8482 8758 need_check_timestamps = TRUE; /* check later */ 8483 @@ -6353,11 +646 0,10 @@8759 @@ -6353,11 +6469,10 @@ 8484 8760 * return 2 if a message has been displayed. 8485 8761 * return 0 otherwise. … … 8494 8770 struct stat st; 8495 8771 int stat_res; 8496 @@ -6462,8 +65 68,10 @@8772 @@ -6462,8 +6577,10 @@ 8497 8773 set_vim_var_string(VV_FCS_REASON, (char_u *)reason, -1); 8498 8774 set_vim_var_string(VV_FCS_CHOICE, (char_u *)"", -1); … … 8505 8781 if (n) 8506 8782 { 8507 @@ -6538,6 +6646,11 @@ 8783 @@ -6511,7 +6628,10 @@ 8784 mesg = _("W16: Warning: Mode of file \"%s\" has changed since editing started"); 8785 mesg2 = _("See \":help W16\" for more info."); 8786 } 8787 - /* Else: only timestamp changed, ignored */ 8788 + else 8789 + /* Only timestamp changed, store it to avoid a warning 8790 + * in check_mtime() later. */ 8791 + buf->b_mtime_read = buf->b_mtime; 8792 } 8793 } 8794 } 8795 @@ -6538,6 +6658,11 @@ 8508 8796 tbuf = alloc((unsigned)(STRLEN(path) + STRLEN(mesg) 8509 8797 + STRLEN(mesg2) + 2)); … … 8517 8805 if (can_reload) 8518 8806 { 8519 @@ -6732,10 +68 45,11 @@8807 @@ -6732,10 +6857,11 @@ 8520 8808 #endif 8521 8809 #ifdef FEAT_FOLDING … … 8531 8819 && !foldmethodIsManual(wp)) 8532 8820 foldUpdateAll(wp); 8533 @@ -6753,12 +68 67,11 @@8821 @@ -6753,12 +6879,11 @@ 8534 8822 /* Careful: autocommands may have made "buf" invalid! */ 8535 8823 } … … 8545 8833 buf->b_mtime = (long)st->st_mtime; 8546 8834 buf->b_orig_size = (size_t)st->st_size; 8547 @@ -6821,10 +69 34,9 @@8835 @@ -6821,10 +6946,9 @@ 8548 8836 * The returned pointer is to allocated memory. 8549 8837 * The returned pointer is NULL if no valid name was found. … … 8557 8845 #ifdef USE_TMPNAM 8558 8846 char_u itmp[L_tmpnam]; /* use tmpnam() */ 8559 @@ -6853,7 +69 65,7 @@8847 @@ -6853,7 +6977,7 @@ 8560 8848 /* 8561 8849 * Try the entries in TEMPDIRNAMES to create the temp directory. … … 8566 8854 /* expand $TMP, leave room for "/v1100000/999999999" */ 8567 8855 expand_env((char_u *)tempdirs[i], itmp, TEMPNAMELEN - 20); 8568 @@ -8523,6 +8635,7 @@ 8856 @@ -8245,7 +8369,7 @@ 8857 8858 /* Execute the modeline settings, but don't set window-local 8859 * options if we are using the current window for another buffer. */ 8860 - do_modelines(aco.save_curwin == NULL ? OPT_NOWIN : 0); 8861 + do_modelines(curwin == aucmd_win ? OPT_NOWIN : 0); 8862 8863 /* restore the current window */ 8864 aucmd_restbuf(&aco); 8865 @@ -8261,8 +8385,8 @@ 8866 8867 /* 8868 * Prepare for executing autocommands for (hidden) buffer "buf". 8869 - * Search a window for the current buffer. Save the cursor position and 8870 - * screen offset. 8871 + * Search for a visible window containing the current buffer. If there isn't 8872 + * one then use "aucmd_win". 8873 * Set "curbuf" and "curwin" to match "buf". 8874 * When FEAT_AUTOCMD is not defined another version is used, see below. 8875 */ 8876 @@ -8272,8 +8396,9 @@ 8877 buf_T *buf; /* new curbuf */ 8878 { 8879 win_T *win; 8880 - 8881 - aco->new_curbuf = buf; 8882 +#ifdef FEAT_WINDOWS 8883 + int save_ea; 8884 +#endif 8885 8886 /* Find a window that is for the new buffer */ 8887 if (buf == curbuf) /* be quick when buf is curbuf */ 8888 @@ -8287,42 +8412,51 @@ 8889 win = NULL; 8890 #endif 8891 8892 - /* 8893 - * Prefer to use an existing window for the buffer, it has the least side 8894 - * effects (esp. if "buf" is curbuf). 8895 - * Otherwise, use curwin for "buf". It might make some items in the 8896 - * window invalid. At least save the cursor and topline. 8897 - */ 8898 + /* Allocate "aucmd_win" when needed. If this fails (out of memory) fall 8899 + * back to using the current window. */ 8900 + if (win == NULL && aucmd_win == NULL) 8901 + { 8902 + win_alloc_aucmd_win(); 8903 + if (aucmd_win == NULL) 8904 + win = curwin; 8905 + } 8906 + 8907 + aco->save_curwin = curwin; 8908 + aco->save_curbuf = curbuf; 8909 if (win != NULL) 8910 { 8911 - /* there is a window for "buf", make it the curwin */ 8912 - aco->save_curwin = curwin; 8913 + /* There is a window for "buf" in the current tab page, make it the 8914 + * curwin. This is preferred, it has the least side effects (esp. if 8915 + * "buf" is curbuf). */ 8916 curwin = win; 8917 - aco->save_buf = win->w_buffer; 8918 - aco->new_curwin = win; 8919 } 8920 else 8921 { 8922 - /* there is no window for "buf", use curwin */ 8923 - aco->save_curwin = NULL; 8924 - aco->save_buf = curbuf; 8925 - --curbuf->b_nwindows; 8926 - curwin->w_buffer = buf; 8927 + /* There is no window for "buf", use "aucmd_win". To minimize the side 8928 + * effects, insert it in a the current tab page. 8929 + * Anything related to a window (e.g., setting folds) may have 8930 + * unexpected results. */ 8931 + aucmd_win->w_buffer = buf; 8932 ++buf->b_nwindows; 8933 + win_init_empty(aucmd_win); /* set cursor and topline to safe values */ 8934 8935 - /* save cursor and topline, set them to safe values */ 8936 - aco->save_cursor = curwin->w_cursor; 8937 - curwin->w_cursor.lnum = 1; 8938 - curwin->w_cursor.col = 0; 8939 - aco->save_topline = curwin->w_topline; 8940 - curwin->w_topline = 1; 8941 -#ifdef FEAT_DIFF 8942 - aco->save_topfill = curwin->w_topfill; 8943 - curwin->w_topfill = 0; 8944 +#ifdef FEAT_WINDOWS 8945 + /* Split the current window, put the aucmd_win in the upper half. 8946 + * We don't want the BufEnter or WinEnter autocommands. */ 8947 + block_autocmds(); 8948 + make_snapshot(SNAP_AUCMD_IDX); 8949 + save_ea = p_ea; 8950 + p_ea = FALSE; 8951 + (void)win_split_ins(0, WSP_TOP, aucmd_win, 0); 8952 + (void)win_comp_pos(); /* recompute window positions */ 8953 + p_ea = save_ea; 8954 + unblock_autocmds(); 8955 #endif 8956 + curwin = aucmd_win; 8957 } 8958 - 8959 curbuf = buf; 8960 + aco->new_curwin = curwin; 8961 + aco->new_curbuf = curbuf; 8962 } 8963 8964 /* 8965 @@ -8334,21 +8468,88 @@ 8966 aucmd_restbuf(aco) 8967 aco_save_T *aco; /* structure holding saved values */ 8968 { 8969 - if (aco->save_curwin != NULL) 8970 +#ifdef FEAT_WINDOWS 8971 + int dummy; 8972 +#endif 8973 + 8974 + if (aco->new_curwin == aucmd_win) 8975 + { 8976 + --curbuf->b_nwindows; 8977 +#ifdef FEAT_WINDOWS 8978 + /* Find "aucmd_win", it can't be closed, but it may be in another tab 8979 + * page. Do not trigger autocommands here. */ 8980 + block_autocmds(); 8981 + if (curwin != aucmd_win) 8982 + { 8983 + tabpage_T *tp; 8984 + win_T *wp; 8985 + 8986 + FOR_ALL_TAB_WINDOWS(tp, wp) 8987 + { 8988 + if (wp == aucmd_win) 8989 + { 8990 + if (tp != curtab) 8991 + goto_tabpage_tp(tp); 8992 + win_goto(aucmd_win); 8993 + break; 8994 + } 8995 + } 8996 + } 8997 + 8998 + /* Remove the window and frame from the tree of frames. */ 8999 + (void)winframe_remove(curwin, &dummy, NULL); 9000 + win_remove(curwin, NULL); 9001 + last_status(FALSE); /* may need to remove last status line */ 9002 + restore_snapshot(SNAP_AUCMD_IDX, FALSE); 9003 + (void)win_comp_pos(); /* recompute window positions */ 9004 + unblock_autocmds(); 9005 + 9006 + if (win_valid(aco->save_curwin)) 9007 + curwin = aco->save_curwin; 9008 + else 9009 + /* Hmm, original window disappeared. Just use the first one. */ 9010 + curwin = firstwin; 9011 +# ifdef FEAT_EVAL 9012 + vars_clear(&aucmd_win->w_vars.dv_hashtab); /* free all w: variables */ 9013 +# endif 9014 +#else 9015 + curwin = aco->save_curwin; 9016 +#endif 9017 + curbuf = curwin->w_buffer; 9018 + 9019 + /* the buffer contents may have changed */ 9020 + check_cursor(); 9021 + if (curwin->w_topline > curbuf->b_ml.ml_line_count) 9022 + { 9023 + curwin->w_topline = curbuf->b_ml.ml_line_count; 9024 +#ifdef FEAT_DIFF 9025 + curwin->w_topfill = 0; 9026 +#endif 9027 + } 9028 +#if defined(FEAT_GUI) 9029 + /* Hide the scrollbars from the aucmd_win and update. */ 9030 + gui_mch_enable_scrollbar(&aucmd_win->w_scrollbars[SBAR_LEFT], FALSE); 9031 + gui_mch_enable_scrollbar(&aucmd_win->w_scrollbars[SBAR_RIGHT], FALSE); 9032 + gui_may_update_scrollbars(); 9033 +#endif 9034 + } 9035 + else 9036 { 9037 /* restore curwin */ 9038 #ifdef FEAT_WINDOWS 9039 if (win_valid(aco->save_curwin)) 9040 #endif 9041 { 9042 - /* restore the buffer which was previously edited by curwin, if 9043 - * it's still the same window and it's valid */ 9044 + /* Restore the buffer which was previously edited by curwin, if 9045 + * it was chagned, we are still the same window and the buffer is 9046 + * valid. */ 9047 if (curwin == aco->new_curwin 9048 - && buf_valid(aco->save_buf) 9049 - && aco->save_buf->b_ml.ml_mfp != NULL) 9050 + && curbuf != aco->new_curbuf 9051 + && buf_valid(aco->new_curbuf) 9052 + && aco->new_curbuf->b_ml.ml_mfp != NULL) 9053 { 9054 --curbuf->b_nwindows; 9055 - curbuf = aco->save_buf; 9056 + curbuf = aco->new_curbuf; 9057 curwin->w_buffer = curbuf; 9058 ++curbuf->b_nwindows; 9059 } 9060 @@ -8357,34 +8558,6 @@ 9061 curbuf = curwin->w_buffer; 9062 } 9063 } 9064 - else 9065 - { 9066 - /* restore buffer for curwin if it still exists and is loaded */ 9067 - if (buf_valid(aco->save_buf) && aco->save_buf->b_ml.ml_mfp != NULL) 9068 - { 9069 - --curbuf->b_nwindows; 9070 - curbuf = aco->save_buf; 9071 - curwin->w_buffer = curbuf; 9072 - ++curbuf->b_nwindows; 9073 - curwin->w_cursor = aco->save_cursor; 9074 - check_cursor(); 9075 - /* check topline < line_count, in case lines got deleted */ 9076 - if (aco->save_topline <= curbuf->b_ml.ml_line_count) 9077 - { 9078 - curwin->w_topline = aco->save_topline; 9079 -#ifdef FEAT_DIFF 9080 - curwin->w_topfill = aco->save_topfill; 9081 -#endif 9082 - } 9083 - else 9084 - { 9085 - curwin->w_topline = curbuf->b_ml.ml_line_count; 9086 -#ifdef FEAT_DIFF 9087 - curwin->w_topfill = 0; 9088 -#endif 9089 - } 9090 - } 9091 - } 9092 } 9093 9094 static int autocmd_nested = FALSE; 9095 @@ -8523,6 +8696,7 @@ 8569 9096 char_u *save_sourcing_name; 8570 9097 linenr_T save_sourcing_lnum; … … 8574 9101 char_u *save_autocmd_match; 8575 9102 int save_autocmd_busy; 8576 @@ -8601,6 +87 14,7 @@9103 @@ -8601,6 +8775,7 @@ 8577 9104 * Save the autocmd_* variables and info about the current buffer. 8578 9105 */ … … 8582 9109 save_autocmd_match = autocmd_match; 8583 9110 save_autocmd_busy = autocmd_busy; 8584 @@ -8618,14 +87 32,15 @@9111 @@ -8618,14 +8793,15 @@ 8585 9112 if (fname != NULL && *fname != NUL) 8586 9113 autocmd_fname = fname; … … 8600 9127 /* 8601 9128 * Set the buffer number to be used for <abuf>. 8602 @@ -8667,9 +8 782,11 @@9129 @@ -8667,9 +8843,11 @@ 8603 9130 else 8604 9131 { … … 8613 9140 || event == EVENT_SPELLFILEMISSING 8614 9141 || event == EVENT_QUICKFIXCMDPRE 8615 @@ -8810,6 +89 27,7 @@9142 @@ -8810,6 +8988,7 @@ 8616 9143 sourcing_lnum = save_sourcing_lnum; 8617 9144 vim_free(autocmd_fname); … … 8621 9148 autocmd_match = save_autocmd_match; 8622 9149 #ifdef FEAT_EVAL 8623 @@ -8918,7 +90 36,7 @@9150 @@ -8918,7 +9097,7 @@ 8624 9151 { 8625 9152 apc->curpat = NULL; … … 8630 9157 * buffer number. */ 8631 9158 if (ap->pat != NULL && ap->cmds != NULL 8632 @@ -8967,12 +9 085,11 @@9159 @@ -8967,12 +9146,11 @@ 8633 9160 * Called by do_cmdline() to get the next line for ":if". 8634 9161 * Returns allocated string, or NULL for end of autocommands. … … 8645 9172 AutoPatCmd *acp = (AutoPatCmd *)cookie; 8646 9173 char_u *retval; 8647 @@ -9083,10 +92 00,9 @@9174 @@ -9083,10 +9261,9 @@ 8648 9175 * Function given to ExpandGeneric() to obtain the list of autocommand group 8649 9176 * names. … … 8657 9184 { 8658 9185 if (idx == augroups.ga_len) /* add "END" add the end */ 8659 @@ -9104,7 +92 20,7 @@9186 @@ -9104,7 +9281,7 @@ 8660 9187 set_context_in_autocmd(xp, arg, doautocmd) 8661 9188 expand_T *xp; … … 8666 9193 char_u *p; 8667 9194 int group; 8668 @@ -9152,10 +9 268,9 @@9195 @@ -9152,10 +9329,9 @@ 8669 9196 /* 8670 9197 * Function given to ExpandGeneric() to obtain the list of event names. … … 8678 9205 { 8679 9206 if (idx < augroups.ga_len) /* First list group names, if wanted */ 8680 @@ -9467,13 +9582,12 @@ 9207 @@ -9296,9 +9472,11 @@ 9208 aco_save_T *aco; /* structure to save values in */ 9209 buf_T *buf; /* new curbuf */ 9210 { 9211 - aco->save_buf = curbuf; 9212 + aco->save_curbuf = curbuf; 9213 + --curbuf->b_nwindows; 9214 curbuf = buf; 9215 curwin->w_buffer = buf; 9216 + ++curbuf->b_nwindows; 9217 } 9218 9219 /* 9220 @@ -9309,8 +9487,10 @@ 9221 aucmd_restbuf(aco) 9222 aco_save_T *aco; /* structure holding saved values */ 9223 { 9224 - curbuf = aco->save_buf; 9225 + --curbuf->b_nwindows; 9226 + curbuf = aco->save_curbuf; 9227 curwin->w_buffer = curbuf; 9228 + ++curbuf->b_nwindows; 9229 } 9230 9231 #endif /* FEAT_AUTOCMD */ 9232 @@ -9467,13 +9647,12 @@ 8681 9233 * 8682 9234 * Returns NULL when out of memory. … … 8695 9247 diff -Naur vim72.orig/src/fold.c vim72/src/fold.c 8696 9248 --- vim72.orig/src/fold.c 2008-08-06 04:01:12.000000000 -0700 8697 +++ vim72/src/fold.c 2009-0 6-05 14:19:21.000000000 -07009249 +++ vim72/src/fold.c 2009-07-19 15:11:59.000000000 -0700 8698 9250 @@ -48,7 +48,7 @@ 8699 9251 static int foldFind __ARGS((garray_T *gap, linenr_T lnum, fold_T **fpp)); … … 8784 9336 diff -Naur vim72.orig/src/getchar.c vim72/src/getchar.c 8785 9337 --- vim72.orig/src/getchar.c 2008-07-22 09:57:48.000000000 -0700 8786 +++ vim72/src/getchar.c 2009-06-05 14:22:17.000000000 -0700 8787 @@ -3816,7 +3816,11 @@ 9338 +++ vim72/src/getchar.c 2009-07-19 15:18:49.000000000 -0700 9339 @@ -1309,6 +1309,9 @@ 9340 return OK; 9341 } 9342 9343 +static int old_char = -1; /* character put back by vungetc() */ 9344 +static int old_mod_mask; /* mod_mask for ungotten character */ 9345 + 9346 #if defined(FEAT_EVAL) || defined(FEAT_EX_EXTRA) || defined(PROTO) 9347 9348 /* 9349 @@ -1323,6 +1326,10 @@ 9350 if (!tp->typebuf_valid) 9351 typebuf = tp->save_typebuf; 9352 9353 + tp->old_char = old_char; 9354 + tp->old_mod_mask = old_mod_mask; 9355 + old_char = -1; 9356 + 9357 tp->save_stuffbuff = stuffbuff; 9358 stuffbuff.bh_first.b_next = NULL; 9359 # ifdef USE_INPUT_BUF 9360 @@ -1344,6 +1351,9 @@ 9361 typebuf = tp->save_typebuf; 9362 } 9363 9364 + old_char = tp->old_char; 9365 + old_mod_mask = tp->old_mod_mask; 9366 + 9367 free_buff(&stuffbuff); 9368 stuffbuff = tp->save_stuffbuff; 9369 # ifdef USE_INPUT_BUF 9370 @@ -1499,9 +1509,6 @@ 9371 #define KL_PART_KEY -1 /* keylen value for incomplete key-code */ 9372 #define KL_PART_MAP -2 /* keylen value for incomplete mapping */ 9373 9374 -static int old_char = -1; /* character put back by vungetc() */ 9375 -static int old_mod_mask; /* mod_mask for ungotten character */ 9376 - 9377 /* 9378 * Get the next input character. 9379 * Can return a special key or a multi-byte character. 9380 @@ -3701,11 +3708,10 @@ 9381 * Clear all mappings or abbreviations. 9382 * 'abbr' should be FALSE for mappings, TRUE for abbreviations. 9383 */ 9384 -/*ARGSUSED*/ 9385 void 9386 map_clear(cmdp, arg, forceit, abbr) 9387 char_u *cmdp; 9388 - char_u *arg; 9389 + char_u *arg UNUSED; 9390 int forceit; 9391 int abbr; 9392 { 9393 @@ -3734,13 +3740,12 @@ 9394 /* 9395 * Clear all mappings in "mode". 9396 */ 9397 -/*ARGSUSED*/ 9398 void 9399 map_clear_int(buf, mode, local, abbr) 9400 - buf_T *buf; /* buffer for local mappings */ 9401 - int mode; /* mode in which to delete */ 9402 - int local; /* TRUE for buffer-local mappings */ 9403 - int abbr; /* TRUE for abbreviations */ 9404 + buf_T *buf UNUSED; /* buffer for local mappings */ 9405 + int mode; /* mode in which to delete */ 9406 + int local UNUSED; /* TRUE for buffer-local mappings */ 9407 + int abbr; /* TRUE for abbreviations */ 9408 { 9409 mapblock_T *mp, **mpp; 9410 int hash; 9411 @@ -3816,7 +3821,11 @@ 8788 9412 int len = 1; 8789 9413 … … 8797 9421 msg_putchar('!'); /* :map! */ 8798 9422 else if (mp->m_mode & INSERT) 8799 @@ -4702,7 +47 06,7 @@9423 @@ -4702,7 +4711,7 @@ 8800 9424 return FAIL; 8801 9425 if (mp->m_noremap != REMAP_YES && fprintf(fd, "nore") < 0) … … 8806 9430 if (buf != NULL && fputs(" <buffer>", fd) < 0) 8807 9431 return FAIL; 8808 @@ -4801,7 +48 05,7 @@9432 @@ -4801,7 +4810,7 @@ 8809 9433 } 8810 9434 if (IS_SPECIAL(c) || modifiers) /* special key */ … … 8817 9441 diff -Naur vim72.orig/src/globals.h vim72/src/globals.h 8818 9442 --- vim72.orig/src/globals.h 2008-07-26 04:53:29.000000000 -0700 8819 +++ vim72/src/globals.h 2009-0 6-05 14:24:27.000000000 -07009443 +++ vim72/src/globals.h 2009-07-19 15:17:39.000000000 -0700 8820 9444 @@ -482,8 +482,10 @@ 8821 9445 /* … … 8830 9454 /* 8831 9455 * When resizing the shell is postponed, remember the new size, and call 8832 @@ -522,7 +524,7 @@ 9456 @@ -507,6 +509,7 @@ 9457 EXTERN int clip_unnamed INIT(= FALSE); 9458 EXTERN int clip_autoselect INIT(= FALSE); 9459 EXTERN int clip_autoselectml INIT(= FALSE); 9460 +EXTERN int clip_html INIT(= FALSE); 9461 EXTERN regprog_T *clip_exclude_prog INIT(= NULL); 9462 #endif 9463 9464 @@ -522,7 +525,7 @@ 8833 9465 EXTERN win_T *prevwin INIT(= NULL); /* previous window */ 8834 9466 # define W_NEXT(wp) ((wp)->w_next) … … 8839 9471 for ((wp) = ((tp) == curtab) \ 8840 9472 ? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next) 8841 @@ -597,7 +599,8 @@ 9473 @@ -536,6 +539,10 @@ 9474 9475 EXTERN win_T *curwin; /* currently active window */ 9476 9477 +#ifdef FEAT_AUTOCMD 9478 +EXTERN win_T *aucmd_win; /* window used in aucmd_prepbuf() */ 9479 +#endif 9480 + 9481 /* 9482 * The window layout is kept in a tree of frames. topframe points to the top 9483 * of the tree. 9484 @@ -597,7 +604,8 @@ 8842 9485 EXTERN int really_exiting INIT(= FALSE); 8843 9486 /* TRUE when we are sure to exit, e.g., after … … 8849 9492 * otherwise only writing some messages */ 8850 9493 8851 @@ -616,6 +6 19,11 @@9494 @@ -616,6 +624,11 @@ 8852 9495 EXTERN int curbuf_lock INIT(= 0); 8853 9496 /* non-zero when the current buffer can't be … … 8861 9504 #ifdef FEAT_EVAL 8862 9505 # define HAVE_SANDBOX 8863 @@ -710,7 +7 18,7 @@9506 @@ -710,7 +723,7 @@ 8864 9507 8865 9508 EXTERN pos_T saved_cursor /* w_cursor before formatting text. */ … … 8870 9513 ; 8871 9514 8872 @@ -739,10 +7 47,12 @@9515 @@ -739,10 +752,12 @@ 8873 9516 */ 8874 9517 EXTERN JMP_BUF lc_jump_env; /* argument to SETJMP() */ … … 8886 9529 8887 9530 #if defined(FEAT_MBYTE) || defined(FEAT_POSTSCRIPT) 8888 @@ -986,7 +996,8 @@ 9531 @@ -800,11 +815,14 @@ 9532 */ 9533 /* length of char in bytes, including following composing chars */ 9534 EXTERN int (*mb_ptr2len) __ARGS((char_u *p)) INIT(= latin_ptr2len); 9535 +/* idem, with limit on string length */ 9536 +EXTERN int (*mb_ptr2len_len) __ARGS((char_u *p, int size)) INIT(= latin_ptr2len_len); 9537 /* byte length of char */ 9538 EXTERN int (*mb_char2len) __ARGS((int c)) INIT(= latin_char2len); 9539 /* convert char to bytes, return the length */ 9540 EXTERN int (*mb_char2bytes) __ARGS((int c, char_u *buf)) INIT(= latin_char2bytes); 9541 EXTERN int (*mb_ptr2cells) __ARGS((char_u *p)) INIT(= latin_ptr2cells); 9542 +EXTERN int (*mb_ptr2cells_len) __ARGS((char_u *p, int size)) INIT(= latin_ptr2cells_len); 9543 EXTERN int (*mb_char2cells) __ARGS((int c)) INIT(= latin_char2cells); 9544 EXTERN int (*mb_off2cells) __ARGS((unsigned off, unsigned max_off)) INIT(= latin_off2cells); 9545 EXTERN int (*mb_ptr2char) __ARGS((char_u *p)) INIT(= latin_ptr2char); 9546 @@ -950,7 +968,7 @@ 9547 ; 9548 EXTERN typebuf_T typebuf /* typeahead buffer */ 9549 #ifdef DO_INIT 9550 - = {NULL, NULL} 9551 + = {NULL, NULL, 0, 0, 0, 0, 0, 0, 0} 9552 #endif 9553 ; 9554 #ifdef FEAT_EX_EXTRA 9555 @@ -986,7 +1004,8 @@ 8889 9556 EXTERN FILE *scriptout INIT(= NULL); /* stream to write script to */ 8890 9557 EXTERN int read_cmd_fd INIT(= 0); /* fd to read commands from */ … … 8896 9563 #ifdef USE_TERM_CONSOLE 8897 9564 EXTERN int term_console INIT(= FALSE); /* set to TRUE when console used */ 8898 @@ -1022,12 +10 33,13 @@9565 @@ -1022,12 +1041,13 @@ 8899 9566 #endif 8900 9567 #ifdef FEAT_AUTOCMD … … 8911 9578 ; 8912 9579 #endif 8913 @@ -1339,7 +135 1,6 @@9580 @@ -1339,7 +1359,6 @@ 8914 9581 8915 9582 #ifdef FEAT_NETBEANS_INTG … … 8919 9586 EXTERN int netbeansForcedQuit INIT(= 0);/* don't write modified files */ 8920 9587 EXTERN int netbeansReadFile INIT(= 1); /* OK to read from disk if != 0 */ 8921 @@ -1548,6 +15 59,14 @@9588 @@ -1548,6 +1567,14 @@ 8922 9589 EXTERN time_t starttime; 8923 9590 … … 8936 9603 diff -Naur vim72.orig/src/gui_at_fs.c vim72/src/gui_at_fs.c 8937 9604 --- vim72.orig/src/gui_at_fs.c 2006-05-12 02:26:24.000000000 -0700 8938 +++ vim72/src/gui_at_fs.c 2009-0 6-05 14:25:31.000000000 -07009605 +++ vim72/src/gui_at_fs.c 2009-07-19 15:16:46.000000000 -0700 8939 9606 @@ -829,7 +829,7 @@ 8940 9607 text.format = FMT8BIT; … … 9222 9889 diff -Naur vim72.orig/src/gui_athena.c vim72/src/gui_athena.c 9223 9890 --- vim72.orig/src/gui_athena.c 2008-06-21 12:38:58.000000000 -0700 9224 +++ vim72/src/gui_athena.c 2009-0 6-05 14:25:31.000000000 -07009891 +++ vim72/src/gui_athena.c 2009-07-19 15:16:46.000000000 -0700 9225 9892 @@ -86,10 +86,9 @@ 9226 9893 * Scrollbar callback (XtNjumpProc) for when the scrollbar is dragged with the … … 9479 10146 diff -Naur vim72.orig/src/gui_at_sb.c vim72/src/gui_at_sb.c 9480 10147 --- vim72.orig/src/gui_at_sb.c 2004-06-07 07:32:25.000000000 -0700 9481 +++ vim72/src/gui_at_sb.c 2009-0 6-05 14:25:31.000000000 -070010148 +++ vim72/src/gui_at_sb.c 2009-07-19 15:16:46.000000000 -0700 9482 10149 @@ -198,10 +198,13 @@ 9483 10150 /* extension */ NULL … … 9729 10396 diff -Naur vim72.orig/src/gui_beval.c vim72/src/gui_beval.c 9730 10397 --- vim72.orig/src/gui_beval.c 2007-05-07 12:33:41.000000000 -0700 9731 +++ vim72/src/gui_beval.c 2009-0 6-05 14:25:31.000000000 -070010398 +++ vim72/src/gui_beval.c 2009-07-19 15:16:46.000000000 -0700 9732 10399 @@ -15,11 +15,10 @@ 9733 10400 /* … … 9830 10497 diff -Naur vim72.orig/src/gui.c vim72/src/gui.c 9831 10498 --- vim72.orig/src/gui.c 2008-07-27 12:32:14.000000000 -0700 9832 +++ vim72/src/gui.c 2009-0 6-05 14:25:31.000000000 -070010499 +++ vim72/src/gui.c 2009-07-19 15:18:18.000000000 -0700 9833 10500 @@ -139,7 +139,7 @@ 9834 10501 /* The read returns when the child closes the pipe (or when … … 9853 10520 #define FONTLEN 320 9854 10521 char_u font_name[FONTLEN]; 10522 @@ -960,7 +959,7 @@ 10523 guicolor_T fg, bg; 10524 10525 if ( 10526 -# ifdef HAVE_GTK2 10527 +# if defined(HAVE_GTK2) && !defined(FEAT_HANGULIN) 10528 preedit_get_status() 10529 # else 10530 im_get_status() 9855 10531 @@ -1138,10 +1137,9 @@ 9856 10532 * Position the various GUI components (text area, menu). The vertical … … 9970 10646 } 9971 10647 #ifdef FEAT_WINDOWS 9972 @@ -4407,7 +4407,7 @@ 10648 @@ -3879,6 +3879,21 @@ 10649 * Scrollbar stuff: 10650 */ 10651 10652 +/* 10653 + * Called when something in the window layout has changed. 10654 + */ 10655 + void 10656 +gui_may_update_scrollbars() 10657 +{ 10658 + if (gui.in_use && starting == 0) 10659 + { 10660 + out_flush(); 10661 + gui_init_which_components(NULL); 10662 + gui_update_scrollbars(TRUE); 10663 + } 10664 + need_mouse_correct = TRUE; 10665 +} 10666 + 10667 void 10668 gui_update_scrollbars(force) 10669 int force; /* Force all scrollbars to get updated */ 10670 @@ -4407,7 +4422,7 @@ 9973 10671 if (curwin->w_p_wrap) 9974 10672 return FALSE; … … 9979 10677 9980 10678 curwin->w_leftcol = (colnr_T)scrollbar_value; 9981 @@ -4420,7 +44 20,7 @@10679 @@ -4420,7 +4435,7 @@ 9982 10680 && longest_lnum < curwin->w_botline 9983 10681 && !virtual_active()) … … 9988 10686 curwin->w_cursor.lnum = longest_lnum; 9989 10687 curwin->w_cursor.col = 0; 9990 @@ -4666,11 +46 66,10 @@10688 @@ -4666,11 +4681,10 @@ 9991 10689 /* 9992 10690 * Find window where the mouse pointer "y" coordinate is in. … … 10002 10700 #ifdef FEAT_WINDOWS 10003 10701 int row; 10004 @@ -5120,11 +51 19,10 @@10702 @@ -5120,11 +5134,10 @@ 10005 10703 * of dropped files, they will be freed in this function, and caller can't use 10006 10704 * fnames after call this function. … … 10018 10716 diff -Naur vim72.orig/src/gui_gtk.c vim72/src/gui_gtk.c 10019 10717 --- vim72.orig/src/gui_gtk.c 2008-07-31 12:48:20.000000000 -0700 10020 +++ vim72/src/gui_gtk.c 2009-0 6-05 14:25:19.000000000 -070010718 +++ vim72/src/gui_gtk.c 2009-07-19 15:16:36.000000000 -0700 10021 10719 @@ -285,14 +285,14 @@ 10022 10720 return image; … … 10222 10920 diff -Naur vim72.orig/src/gui_gtk_f.c vim72/src/gui_gtk_f.c 10223 10921 --- vim72.orig/src/gui_gtk_f.c 2007-05-07 12:38:02.000000000 -0700 10224 +++ vim72/src/gui_gtk_f.c 2009-0 6-05 14:25:22.000000000 -070010922 +++ vim72/src/gui_gtk_f.c 2009-07-19 15:16:39.000000000 -0700 10225 10923 @@ -227,14 +227,14 @@ 10226 10924 … … 10306 11004 diff -Naur vim72.orig/src/gui_gtk_x11.c vim72/src/gui_gtk_x11.c 10307 11005 --- vim72.orig/src/gui_gtk_x11.c 2008-07-04 03:46:24.000000000 -0700 10308 +++ vim72/src/gui_gtk_x11.c 2009-06-05 14:26:08.000000000 -0700 10309 @@ -412,6 +412,7 @@ 11006 +++ vim72/src/gui_gtk_x11.c 2009-07-19 15:18:26.000000000 -0700 11007 @@ -107,6 +107,7 @@ 11008 TARGET_UTF8_STRING, 11009 TARGET_STRING, 11010 TARGET_COMPOUND_TEXT, 11011 + TARGET_HTML, 11012 TARGET_TEXT, 11013 TARGET_TEXT_URI_LIST, 11014 TARGET_TEXT_PLAIN, 11015 @@ -123,6 +124,7 @@ 11016 {VIMENC_ATOM_NAME, 0, TARGET_VIMENC}, 11017 {VIM_ATOM_NAME, 0, TARGET_VIM}, 11018 #ifdef FEAT_MBYTE 11019 + {"text/html", 0, TARGET_HTML}, 11020 {"UTF8_STRING", 0, TARGET_UTF8_STRING}, 11021 #endif 11022 {"COMPOUND_TEXT", 0, TARGET_COMPOUND_TEXT}, 11023 @@ -140,6 +142,7 @@ 11024 { 11025 {"text/uri-list", 0, TARGET_TEXT_URI_LIST}, 11026 # ifdef FEAT_MBYTE 11027 + {"text/html", 0, TARGET_HTML}, 11028 {"UTF8_STRING", 0, TARGET_UTF8_STRING}, 11029 # endif 11030 {"STRING", 0, TARGET_STRING}, 11031 @@ -178,6 +181,7 @@ 11032 * Atoms used to control/reference X11 selections. 11033 */ 11034 #ifdef FEAT_MBYTE 11035 +static GdkAtom html_atom = GDK_NONE; 11036 static GdkAtom utf8_string_atom = GDK_NONE; 11037 #endif 11038 #ifndef HAVE_GTK2 11039 @@ -412,6 +416,7 @@ 10310 11040 #endif 10311 11041 #if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION) … … 10315 11045 static int found_iconic_arg = FALSE; 10316 11046 10317 @@ -449,8 +45 0,10 @@11047 @@ -449,8 +454,10 @@ 10318 11048 char_u buf[MAXPATHL]; 10319 11049 … … 10328 11058 #endif 10329 11059 10330 @@ -611,6 +61 4,9 @@11060 @@ -611,6 +618,9 @@ 10331 11061 gui_mch_free_all() 10332 11062 { … … 10338 11068 #endif 10339 11069 10340 @@ -619,9 +62 5,10 @@11070 @@ -619,9 +629,10 @@ 10341 11071 * Doesn't seem possible, since check_copy_area() relies on 10342 11072 * this information. --danielk … … 10351 11081 gui.visibility = event->state; 10352 11082 /* 10353 @@ -638,9 +64 5,10 @@11083 @@ -638,9 +649,10 @@ 10354 11084 /* 10355 11085 * Redraw the corresponding portions of the screen. … … 10364 11094 /* Skip this when the GUI isn't set up yet, will redraw later. */ 10365 11095 if (gui.starting) 10366 @@ -668,9 +6 76,10 @@11096 @@ -668,9 +680,10 @@ 10367 11097 /* 10368 11098 * Handle changes to the "Comm" property … … 10377 11107 if (event->type == GDK_PROPERTY_NOTIFY 10378 11108 && event->state == (int)GDK_PROPERTY_NEW_VALUE 10379 @@ -740,9 +7 49,8 @@11109 @@ -740,9 +753,8 @@ 10380 11110 blink_state = BLINK_NONE; 10381 11111 } … … 10388 11118 if (blink_state == BLINK_ON) 10389 11119 { 10390 @@ -781,9 +7 89,10 @@11120 @@ -781,9 +793,10 @@ 10391 11121 } 10392 11122 } … … 10401 11131 if (blink_state == BLINK_NONE) 10402 11132 gui_mch_start_blink(); 10403 @@ -795,9 +80 4,10 @@11133 @@ -795,9 +808,10 @@ 10404 11134 return FALSE; 10405 11135 } … … 10414 11144 if (blink_state != BLINK_NONE) 10415 11145 gui_mch_stop_blink(); 10416 @@ -805,9 +81 5,10 @@11146 @@ -805,9 +819,10 @@ 10417 11147 return FALSE; 10418 11148 } … … 10427 11157 gui_focus_change(TRUE); 10428 11158 10429 @@ -826,9 +8 37,10 @@11159 @@ -826,9 +841,10 @@ 10430 11160 return TRUE; 10431 11161 } … … 10440 11170 gui_focus_change(FALSE); 10441 11171 10442 @@ -956,9 +9 68,10 @@11172 @@ -956,9 +972,10 @@ 10443 11173 /* 10444 11174 * Main keyboard handler: … … 10453 11183 #ifdef HAVE_GTK2 10454 11184 /* 256 bytes is way over the top, but for safety let's reduce it only 10455 @@ -1225,9 +12 38,10 @@11185 @@ -1225,9 +1242,10 @@ 10456 11186 } 10457 11187 … … 10466 11196 /* 10467 11197 * GTK+ 2 input methods may do fancy stuff on key release events too. 10468 @@ -1243,11 +12 57,10 @@11198 @@ -1243,11 +1261,10 @@ 10469 11199 * Selection handlers: 10470 11200 */ … … 10480 11210 if (event->selection == clip_plus.gtk_sel_atom) 10481 11211 clip_lose_selection(&clip_plus); 10482 @@ -1265,12 +12 78,11 @@11212 @@ -1265,12 +1282,11 @@ 10483 11213 #define RS_FAIL 2 /* selection_received_cb() called and failed */ 10484 11214 static int received_selection = RS_NONE; … … 10496 11226 VimClipboard *cbd; 10497 11227 char_u *text; 10498 @@ -1414,13 +1426,12 @@ 11228 @@ -1352,6 +1368,24 @@ 11229 else 11230 text = tmpbuf_utf8; 11231 } 11232 + else if (len >= 2 && text[0] == 0xff && text[1] == 0xfe) 11233 + { 11234 + vimconv_T conv; 11235 + 11236 + /* UTF-16, we get this for HTML */ 11237 + conv.vc_type = CONV_NONE; 11238 + convert_setup_ext(&conv, (char_u *)"utf-16le", FALSE, p_enc, TRUE); 11239 + 11240 + if (conv.vc_type != CONV_NONE) 11241 + { 11242 + text += 2; 11243 + len -= 2; 11244 + tmpbuf = string_convert(&conv, text, &len); 11245 + convert_setup(&conv, NULL, NULL); 11246 + } 11247 + if (tmpbuf != NULL) 11248 + text = tmpbuf; 11249 + } 11250 } 11251 #else /* !HAVE_GTK2 */ 11252 # ifdef FEAT_MBYTE 11253 @@ -1414,13 +1448,12 @@ 10499 11254 * Prepare our selection data for passing it to the external selection 10500 11255 * client. … … 10513 11268 char_u *string; 10514 11269 char_u *tmpbuf; 10515 @@ -1678,7 +1689,7 @@ 11270 @@ -1440,6 +1473,7 @@ 11271 11272 if (info != (guint)TARGET_STRING 11273 #ifdef FEAT_MBYTE 11274 + && (!clip_html || info != (guint)TARGET_HTML) 11275 && info != (guint)TARGET_UTF8_STRING 11276 && info != (guint)TARGET_VIMENC 11277 #endif 11278 @@ -1475,6 +1509,40 @@ 11279 } 11280 11281 #ifdef FEAT_MBYTE 11282 + else if (info == (guint)TARGET_HTML) 11283 + { 11284 + vimconv_T conv; 11285 + 11286 + /* Since we get utf-16, we probably should set it as well. */ 11287 + conv.vc_type = CONV_NONE; 11288 + convert_setup_ext(&conv, p_enc, TRUE, (char_u *)"utf-16le", FALSE); 11289 + if (conv.vc_type != CONV_NONE) 11290 + { 11291 + tmpbuf = string_convert(&conv, string, &length); 11292 + convert_setup(&conv, NULL, NULL); 11293 + vim_free(string); 11294 + string = tmpbuf; 11295 + } 11296 + 11297 + /* Prepend the BOM: "fffe" */ 11298 + if (string != NULL) 11299 + { 11300 + tmpbuf = alloc(length + 2); 11301 + tmpbuf[0] = 0xff; 11302 + tmpbuf[1] = 0xfe; 11303 + mch_memmove(tmpbuf + 2, string, (size_t)length); 11304 + vim_free(string); 11305 + string = tmpbuf; 11306 + length += 2; 11307 + 11308 + selection_data->type = selection_data->target; 11309 + selection_data->format = 16; /* 16 bits per char */ 11310 + gtk_selection_data_set(selection_data, html_atom, 16, 11311 + string, length); 11312 + vim_free(string); 11313 + } 11314 + return; 11315 + } 11316 else if (info == (guint)TARGET_VIMENC) 11317 { 11318 int l = STRLEN(p_enc); 11319 @@ -1678,7 +1746,7 @@ 10516 11320 10517 11321 offshoot = dx > dy ? dx : dy; … … 10522 11326 * 10523 11327 * One could think endlessly about the most ergonomic variant here. 10524 @@ -1707,9 +17 18,8 @@11328 @@ -1707,9 +1775,8 @@ 10525 11329 /* 10526 11330 * Timer used to recognize multiple clicks of the mouse button. … … 10533 11337 int x; 10534 11338 int y; 10535 @@ -1749,9 +1 759,10 @@11339 @@ -1749,9 +1816,10 @@ 10536 11340 return FALSE; 10537 11341 } … … 10546 11350 if (event->is_hint) 10547 11351 { 10548 @@ -1777,9 +1 788,10 @@11352 @@ -1777,9 +1845,10 @@ 10549 11353 * by our own timeout mechanism instead of the one provided by GTK+ itself. 10550 11354 * This is due to the way the generic VIM code is recognizing multiple clicks. … … 10559 11363 int button; 10560 11364 int repeated_click = FALSE; 10561 @@ -1855,9 +1 867,10 @@11365 @@ -1855,9 +1924,10 @@ 10562 11366 * GTK+ 2 doesn't handle mouse buttons 4, 5, 6 and 7 the same way as GTK+ 1. 10563 11367 * Instead, it abstracts scrolling via the new GdkEventScroll. … … 10572 11376 int button; 10573 11377 int_u vim_modifiers; 10574 @@ -1896,9 +19 09,10 @@11378 @@ -1896,9 +1966,10 @@ 10575 11379 #endif /* HAVE_GTK2 */ 10576 11380 … … 10585 11389 int x, y; 10586 11390 int_u vim_modifiers; 10587 @@ -2100,7 +21 14,6 @@11391 @@ -2100,7 +2171,6 @@ 10588 11392 /* 10589 11393 * DND receiver. … … 10593 11397 drag_data_received_cb(GtkWidget *widget, 10594 11398 GdkDragContext *context, 10595 @@ -2109,7 +21 22,7 @@11399 @@ -2109,7 +2179,7 @@ 10596 11400 GtkSelectionData *data, 10597 11401 guint info, … … 10602 11406 GdkModifierType state; 10603 11407 10604 @@ -2143,7 +2 156,6 @@11408 @@ -2143,7 +2213,6 @@ 10605 11409 * be abandoned and pop up a dialog asking the user for confirmation if 10606 11410 * necessary. … … 10610 11414 sm_client_check_changed_any(GnomeClient *client, 10611 11415 gint key, 10612 @@ -2251,7 +2 263,6 @@11416 @@ -2251,7 +2320,6 @@ 10613 11417 * for confirmation if necessary. Save the current editing session and tell 10614 11418 * the session manager how to restart Vim. … … 10618 11422 sm_client_save_yourself(GnomeClient *client, 10619 11423 gint phase, 10620 @@ -2339,7 +2 350,6 @@11424 @@ -2339,7 +2407,6 @@ 10621 11425 * here since "save_yourself" has been emitted before (unless serious trouble 10622 11426 * is happening). … … 10626 11430 sm_client_die(GnomeClient *client, gpointer data) 10627 11431 { 10628 @@ -2379,10 +2 389,9 @@11432 @@ -2379,10 +2446,9 @@ 10629 11433 /* 10630 11434 * GTK tells us that XSMP needs attention … … 10638 11442 gpointer data; 10639 11443 { 10640 @@ -2480,16 +2 489,18 @@11444 @@ -2480,16 +2546,18 @@ 10641 11445 * WM_SAVE_YOURSELF hack it actually stores the session... And yes, 10642 11446 * it should work with KDE as well. … … 10660 11464 out_flush(); 10661 11465 ml_sync_all(FALSE, FALSE); /* preserve all swap files */ 10662 @@ -2512,7 +25 23,6 @@11466 @@ -2512,7 +2580,6 @@ 10663 11467 /* 10664 11468 * GDK handler for X ClientMessage events. … … 10668 11472 gdk_wm_protocols_filter(GdkXEvent *xev, GdkEvent *event, gpointer data) 10669 11473 { 10670 @@ -2558,9 +2 568,8 @@11474 @@ -2558,9 +2625,8 @@ 10671 11475 /* 10672 11476 * Setup the window icon & xcmdsrv comm after the main window has been realized. … … 10679 11483 /* If you get an error message here, you still need to unpack the runtime 10680 11484 * archive! */ 10681 @@ -2712,11 +27 21,10 @@11485 @@ -2712,11 +2778,10 @@ 10682 11486 } 10683 11487 … … 10693 11497 if (!gtk_widget_has_screen(widget)) 10694 11498 return; 10695 @@ -2757,9 +2 765,8 @@11499 @@ -2757,9 +2822,8 @@ 10696 11500 * Don't try to set any VIM scrollbar sizes anywhere here. I'm relying on the 10697 11501 * fact that the main VIM engine doesn't take them into account anywhere. … … 10704 11508 GtkWidget *sbar; 10705 11509 10706 @@ -2789,9 +2 796,8 @@11510 @@ -2789,9 +2853,8 @@ 10707 11511 /* 10708 11512 * Properly clean up on shutdown. … … 10715 11519 /* Don't write messages to the GUI anymore */ 10716 11520 full_screen = FALSE; 10717 @@ -2827,11 +28 33,10 @@11521 @@ -2827,11 +2890,10 @@ 10718 11522 #endif 10719 11523 } … … 10730 11534 gui_mch_new_colors(); 10731 11535 } 10732 @@ -2840,9 +2 845,10 @@11536 @@ -2840,9 +2902,10 @@ 10733 11537 * Callback routine for the "delete_event" signal on the toplevel window. 10734 11538 * Tries to vim gracefully, or refuses to exit with changed buffers. … … 10743 11547 gui_shell_closed(); 10744 11548 return TRUE; 10745 @@ -2964,7 + 2970,7 @@11549 @@ -2964,7 +3027,7 @@ 10746 11550 10747 11551 /* At start-up, don't try to set the hints until the initial … … 10752 11556 if (!(force_width && force_height) && init_window_hints_state > 0) 10753 11557 { 10754 @@ -3142,9 +3 148,8 @@11558 @@ -3142,9 +3205,8 @@ 10755 11559 /* 10756 11560 * Handle selecting an item in the tab line popup menu. … … 10763 11567 /* Add the string cmd into input buffer */ 10764 11568 send_tabline_menu_event(clicked_page, (int)(long)user_data); 10765 @@ -3244,13 +3 249,12 @@11569 @@ -3244,13 +3306,12 @@ 10766 11570 /* 10767 11571 * Handle selecting one of the tabs. … … 10780 11584 if (!ignore_tabline_evt) 10781 11585 { 10782 @@ -3784,7 +3788,7 @@ 11586 @@ -3460,6 +3521,7 @@ 11587 11588 /* Initialise atoms */ 11589 #ifdef FEAT_MBYTE 11590 + html_atom = gdk_atom_intern("text/html", FALSE); 11591 utf8_string_atom = gdk_atom_intern("UTF8_STRING", FALSE); 11592 #endif 11593 #ifndef HAVE_GTK2 11594 @@ -3784,7 +3846,7 @@ 10783 11595 #endif 10784 11596 … … 10789 11601 10790 11602 /* 10791 @@ -3922,10 +39 26,10 @@11603 @@ -3922,10 +3984,10 @@ 10792 11604 /* 10793 11605 * This signal informs us about the need to rearrange our sub-widgets. … … 10803 11615 int usable_height = event->height; 10804 11616 10805 @@ -3948,9 + 3952,8 @@11617 @@ -3948,9 +4010,8 @@ 10806 11618 * We can't do much more here than to trying to preserve what had been done, 10807 11619 * since the window is already inevitably going away. … … 10814 11626 /* Don't write messages to the GUI anymore */ 10815 11627 full_screen = FALSE; 10816 @@ -3980,9 + 3983,8 @@11628 @@ -3980,9 +4041,8 @@ 10817 11629 * scrollbar init.), actually do the standard hinst and stop the timer. 10818 11630 * We'll not let the default hints be set while this timer's active. … … 10825 11637 if (init_window_hints_state == 1) 10826 11638 { 10827 @@ -4055,7 +4 057,7 @@11639 @@ -4055,7 +4115,7 @@ 10828 11640 Columns = w; 10829 11641 if (mask & HeightValue) … … 10834 11646 Rows = h; 10835 11647 } 10836 @@ -4070,14 +4 072,14 @@11648 @@ -4070,14 +4130,14 @@ 10837 11649 10838 11650 if (mask & (XValue | YValue)) … … 10855 11667 gtk_window_move(GTK_WINDOW(gui.mainwin), x, y); 10856 11668 #else 10857 @@ -4229,9 +42 31,8 @@11669 @@ -4229,9 +4289,8 @@ 10858 11670 } 10859 11671 … … 10866 11678 if (gui.mainwin != NULL) 10867 11679 gtk_widget_destroy(gui.mainwin); 10868 @@ -4286,7 +4 287,6 @@11680 @@ -4286,7 +4345,6 @@ 10869 11681 * report the new size through form_configure_event(). That caused the window 10870 11682 * layout to be messed up. … … 10874 11686 force_shell_resize_idle(gpointer data) 10875 11687 { 10876 @@ -4314,12 +43 14,11 @@11688 @@ -4314,12 +4372,11 @@ 10877 11689 /* 10878 11690 * Set the windows size. … … 10890 11702 #ifndef HAVE_GTK2 10891 11703 /* Hack: When the form already is at the desired size, the window might 10892 @@ -4413,9 +44 12,8 @@11704 @@ -4413,9 +4470,8 @@ 10893 11705 } 10894 11706 … … 10901 11713 # ifdef HAVE_GTK2 10902 11714 if (title != NULL && output_conv.vc_type != CONV_NONE) 10903 @@ -4493,7 +4 491,6 @@11715 @@ -4493,7 +4549,6 @@ 10904 11716 * Get a font structure for highlighting. 10905 11717 * "cbdata" is a pointer to the global gui structure. … … 10909 11721 font_sel_ok(GtkWidget *wgt, gpointer cbdata) 10910 11722 { 10911 @@ -4509,7 +45 06,6 @@11723 @@ -4509,7 +4564,6 @@ 10912 11724 gtk_main_quit(); 10913 11725 } … … 10917 11729 font_sel_cancel(GtkWidget *wgt, gpointer cbdata) 10918 11730 { 10919 @@ -4520,7 +45 16,6 @@11731 @@ -4520,7 +4574,6 @@ 10920 11732 gtk_main_quit(); 10921 11733 } … … 10925 11737 font_sel_destroy(GtkWidget *wgt, gpointer cbdata) 10926 11738 { 10927 @@ -4620,7 +46 15,6 @@11739 @@ -4620,7 +4673,6 @@ 10928 11740 /* 10929 11741 * Try to load the requested fontset. … … 10933 11745 gui_mch_get_fontset(char_u *name, int report_error, int fixed_width) 10934 11746 { 10935 @@ -4863,7 +4 857,7 @@11747 @@ -4863,7 +4915,7 @@ 10936 11748 styled_font[1] = &gui.ital_font; 10937 11749 styled_font[2] = &gui.boldital_font; … … 10942 11754 if (*styled_font[i]) 10943 11755 { 10944 @@ -5012,9 +50 06,8 @@11756 @@ -5012,9 +5064,8 @@ 10945 11757 * Initialize Vim to use the font or fontset with the given name. 10946 11758 * Return FAIL if the font could not be loaded, OK otherwise. … … 10953 11765 #ifdef HAVE_GTK2 10954 11766 PangoFontDescription *font_desc; 10955 @@ -5326,9 +53 19,8 @@11767 @@ -5326,9 +5377,8 @@ 10956 11768 /* 10957 11769 * Return the name of font "font" in allocated memory. … … 10964 11776 # ifdef HAVE_GTK2 10965 11777 if (font != NOFONT) 10966 @@ -5732,7 +57 24,7 @@11778 @@ -5732,7 +5782,7 @@ 10967 11779 { 10968 11780 int i; … … 10973 11785 10974 11786 /* Undercurl: draw curl at the bottom of the character cell. */ 10975 @@ -6402,7 +6394,6 @@ 11787 @@ -6085,12 +6135,15 @@ 11788 # ifdef FEAT_MBYTE 11789 if (enc_utf8) 11790 { 11791 - c = utf_ptr2char(p); 11792 + int pcc[MAX_MCO]; 11793 + 11794 + /* TODO: use the composing characters */ 11795 + c = utfc_ptr2char_len(p, &pcc, len - (p - s)); 11796 if (c >= 0x10000) /* show chars > 0xffff as ? */ 11797 c = 0xbf; 11798 buf[textlen].byte1 = c >> 8; 11799 buf[textlen].byte2 = c; 11800 - p += utf_ptr2len(p); 11801 + p += utfc_ptr2len_len(p, len - (p - s)); 11802 width += utf_char2cells(c); 11803 } 11804 else 11805 @@ -6114,8 +6167,8 @@ 11806 if (has_mbyte) 11807 { 11808 width = 0; 11809 - for (p = s; p < s + len; p += (*mb_ptr2len)(p)) 11810 - width += (*mb_ptr2cells)(p); 11811 + for (p = s; p < s + len; p += (*mb_ptr2len_len)(p, len - (p - s))) 11812 + width += (*mb_ptr2cells_len)(p, len - (p - s)); 11813 } 11814 else 11815 # endif 11816 @@ -6402,7 +6455,6 @@ 10976 11817 /* 10977 11818 * Callback function, used when data is available on the SNiFF connection. … … 10981 11822 sniff_request_cb( 10982 11823 gpointer data, 10983 @@ -6711,9 +6702,8 @@ 11824 @@ -6665,12 +6717,14 @@ 11825 { 11826 GdkAtom target; 11827 unsigned i; 11828 - int nbytes; 11829 - char_u *buffer; 11830 time_t start; 11831 11832 for (i = 0; i < N_SELECTION_TARGETS; ++i) 11833 { 11834 +#ifdef FEAT_MBYTE 11835 + if (!clip_html && selection_targets[i].info == TARGET_HTML) 11836 + continue; 11837 +#endif 11838 received_selection = RS_NONE; 11839 target = gdk_atom_intern(selection_targets[i].target, FALSE); 11840 11841 @@ -6690,30 +6744,14 @@ 11842 } 11843 11844 /* Final fallback position - use the X CUT_BUFFER0 store */ 11845 - nbytes = 0; 11846 - buffer = (char_u *)XFetchBuffer(GDK_WINDOW_XDISPLAY(gui.mainwin->window), 11847 - &nbytes, 0); 11848 - if (nbytes > 0) 11849 - { 11850 - /* Got something */ 11851 - clip_yank_selection(MCHAR, buffer, (long)nbytes, cbd); 11852 - if (p_verbose > 0) 11853 - { 11854 - verbose_enter(); 11855 - smsg((char_u *)_("Used CUT_BUFFER0 instead of empty selection")); 11856 - verbose_leave(); 11857 - } 11858 - } 11859 - if (buffer != NULL) 11860 - XFree(buffer); 11861 + yank_cut_buffer0(GDK_WINDOW_XDISPLAY(gui.mainwin->window), cbd); 11862 } 11863 10984 11864 /* 10985 11865 * Disown the selection. … … 10992 11872 /* WEIRD: when using NULL to actually disown the selection, we lose the 10993 11873 * selection the first time we own it. */ 10994 @@ -6741,9 +67 31,8 @@11874 @@ -6741,9 +6779,8 @@ 10995 11875 * Send the current selection to the clipboard. Do nothing for X because we 10996 11876 * will fill in the selection only when requested by another app. … … 11003 11883 } 11004 11884 11005 @@ -6950,7 +69 39,7 @@11885 @@ -6950,7 +6987,7 @@ 11006 11886 else 11007 11887 id &= ~1; /* they are always even (why?) */ … … 11014 11894 diff -Naur vim72.orig/src/gui_motif.c vim72/src/gui_motif.c 11015 11895 --- vim72.orig/src/gui_motif.c 2008-06-07 06:06:33.000000000 -0700 11016 +++ vim72/src/gui_motif.c 2009-0 6-05 14:25:31.000000000 -070011896 +++ vim72/src/gui_motif.c 2009-07-19 15:16:46.000000000 -0700 11017 11897 @@ -117,10 +117,9 @@ 11018 11898 * Call-back routines. … … 11377 12257 diff -Naur vim72.orig/src/gui_x11.c vim72/src/gui_x11.c 11378 12258 --- vim72.orig/src/gui_x11.c 2008-06-08 08:13:45.000000000 -0700 11379 +++ vim72/src/gui_x11.c 2009-0 6-05 14:25:31.000000000 -070012259 +++ vim72/src/gui_x11.c 2009-07-19 15:16:46.000000000 -0700 11380 12260 @@ -570,22 +570,20 @@ 11381 12261 * Call-back routines. … … 11822 12702 diff -Naur vim72.orig/src/gui_xmdlg.c vim72/src/gui_xmdlg.c 11823 12703 --- vim72.orig/src/gui_xmdlg.c 2008-06-21 09:05:32.000000000 -0700 11824 +++ vim72/src/gui_xmdlg.c 2009-0 6-05 14:25:31.000000000 -070012704 +++ vim72/src/gui_xmdlg.c 2009-07-19 15:16:46.000000000 -0700 11825 12705 @@ -369,10 +369,10 @@ 11826 12706 char buf[TEMP_BUF_SIZE]; … … 12044 12924 diff -Naur vim72.orig/src/gui_xmebw.c vim72/src/gui_xmebw.c 12045 12925 --- vim72.orig/src/gui_xmebw.c 2007-09-06 03:57:51.000000000 -0700 12046 +++ vim72/src/gui_xmebw.c 2009-0 6-05 14:25:31.000000000 -070012926 +++ vim72/src/gui_xmebw.c 2009-07-19 15:16:46.000000000 -0700 12047 12927 @@ -235,13 +235,12 @@ 12048 12928 return tmp; … … 12171 13051 diff -Naur vim72.orig/src/hardcopy.c vim72/src/hardcopy.c 12172 13052 --- vim72.orig/src/hardcopy.c 2008-01-11 12:46:20.000000000 -0800 12173 +++ vim72/src/hardcopy.c 2009-0 6-05 14:25:02.000000000 -070013053 +++ vim72/src/hardcopy.c 2009-07-19 15:16:23.000000000 -0700 12174 13054 @@ -442,12 +442,11 @@ 12175 13055 /* … … 12254 13134 diff -Naur vim72.orig/src/if_cscope.c vim72/src/if_cscope.c 12255 13135 --- vim72.orig/src/if_cscope.c 2008-06-24 09:32:34.000000000 -0700 12256 +++ vim72/src/if_cscope.c 2009-06-05 14:25:02.000000000 -0700 12257 @@ -74,7 +74,7 @@ 13136 +++ vim72/src/if_cscope.c 2009-07-19 15:18:44.000000000 -0700 13137 @@ -46,7 +46,6 @@ 13138 static int cs_find __ARGS((exarg_T *eap)); 13139 static int cs_find_common __ARGS((char *opt, char *pat, int, int, int)); 13140 static int cs_help __ARGS((exarg_T *eap)); 13141 -static void cs_init __ARGS((void)); 13142 static void clear_csinfo __ARGS((int i)); 13143 static int cs_insert_filelist __ARGS((char *, char *, char *, 13144 struct stat *)); 13145 @@ -66,7 +65,10 @@ 13146 static int cs_show __ARGS((exarg_T *eap)); 13147 13148 13149 -static csinfo_T csinfo[CSCOPE_MAX_CONNECTIONS]; 13150 +static csinfo_T * csinfo = NULL; 13151 +static int csinfo_size = 0; /* number of items allocated in 13152 + csinfo[] */ 13153 + 13154 static int eap_arg_len; /* length of eap->arg, set in 13155 cs_lookup_cmd() */ 13156 static cscmd_T cs_cmds[] = 13157 @@ -74,7 +76,7 @@ 12258 13158 { "add", cs_add, 12259 13159 N_("Add a new database"), "add file|dir [pre-path] [flags]", 0 }, … … 12264 13164 N_("Show this message"), "help", 0 }, 12265 13165 { "kill", cs_kill, 12266 @@ -83,7 +8 3,7 @@13166 @@ -83,7 +85,7 @@ 12267 13167 N_("Reinit all connections"), "reset", 0 }, 12268 13168 { "show", cs_show, … … 12273 13173 12274 13174 static void 12275 @@ -93,12 +9 3,128@@13175 @@ -93,12 +95,125 @@ 12276 13176 (void)EMSG2(_("E560: Usage: cs[cope] %s"), cs_cmds[(int)x].usage); 12277 13177 } … … 12328 13228 + case EXP_CSCOPE_KILL: 12329 13229 + { 12330 + static char _u connection[2];13230 + static char connection[5]; 12331 13231 + 12332 13232 + /* ":cscope kill" accepts connection numbers or partial names of … … 12334 13234 + * with connection numbers. -1 can also be used to kill all 12335 13235 + * connections. */ 12336 + for (i = 0, current_idx = 0; i < CSCOPE_MAX_CONNECTIONS; i++)13236 + for (i = 0, current_idx = 0; i < csinfo_size; i++) 12337 13237 + { 12338 13238 + if (csinfo[i].fname == NULL) … … 12340 13240 + if (current_idx++ == idx) 12341 13241 + { 12342 + /* Connection number fits in one character since 12343 + * CSCOPE_MAX_CONNECTIONS is < 10 */ 12344 + connection[0] = i + '0'; 12345 + connection[1] = NUL; 12346 + return connection; 13242 + vim_snprintf(connection, sizeof(connection), "%d", i); 13243 + return (char_u *)connection; 12347 13244 + } 12348 13245 + } … … 12405 13302 static void 12406 13303 do_cscope_general(eap, make_split) 12407 @@ -379,10 +495,9 @@ 13304 @@ -107,7 +222,6 @@ 13305 { 13306 cscmd_T *cmdp; 13307 13308 - cs_init(); 13309 if ((cmdp = cs_lookup_cmd(eap)) == NULL) 13310 { 13311 cs_help(eap); 13312 @@ -168,8 +282,6 @@ 13313 { 13314 int ret = FALSE; 13315 13316 - cs_init(); 13317 - 13318 if (*eap->arg == NUL) 13319 { 13320 (void)EMSG(_("E562: Usage: cstag <ident>")); 13321 @@ -325,7 +437,7 @@ 13322 if (num < 0 || num > 4 || (num > 0 && !dbpath)) 13323 return FALSE; 13324 13325 - for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) 13326 + for (i = 0; i < csinfo_size; i++) 13327 { 13328 if (!csinfo[i].fname) 13329 continue; 13330 @@ -379,10 +491,9 @@ 12408 13331 * 12409 13332 * MAXPATHL 256 … … 12417 13340 char *fname, *ppath, *flags = NULL; 12418 13341 12419 @@ -659,6 +774,7 @@ 13342 @@ -569,7 +680,7 @@ 13343 short i; 13344 short cnt = 0; 13345 13346 - for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) 13347 + for (i = 0; i < csinfo_size; i++) 13348 { 13349 if (csinfo[i].fname != NULL) 13350 cnt++; 13351 @@ -659,6 +770,7 @@ 12420 13352 { 12421 13353 char *cmd; … … 12425 13357 switch (csoption[0]) 12426 13358 { 12427 @@ -692,10 +80 8,17 @@13359 @@ -692,10 +804,17 @@ 12428 13360 return NULL; 12429 13361 } … … 12445 13377 return cmd; 12446 13378 } /* cs_create_cmd */ 12447 @@ -869,7 +9 92,7 @@13379 @@ -869,7 +988,7 @@ 12448 13380 vim_free(ppath); 12449 13381 … … 12454 13386 12455 13387 exit(127); 12456 @@ -1167,20 +1290,36 @@ 13388 @@ -989,7 +1108,8 @@ 13389 { 13390 int i; 13391 char *cmd; 13392 - int nummatches[CSCOPE_MAX_CONNECTIONS], totmatches; 13393 + int *nummatches; 13394 + int totmatches; 13395 #ifdef FEAT_QUICKFIX 13396 char cmdletter; 13397 char *qfpos; 13398 @@ -1000,13 +1120,17 @@ 13399 if (cmd == NULL) 13400 return FALSE; 13401 13402 + nummatches = (int *)alloc(sizeof(int)*csinfo_size); 13403 + if (nummatches == NULL) 13404 + return FALSE; 13405 + 13406 /* send query to all open connections, then count the total number 13407 * of matches so we can alloc matchesp all in one swell foop 13408 */ 13409 - for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) 13410 + for (i = 0; i < csinfo_size; i++) 13411 nummatches[i] = 0; 13412 totmatches = 0; 13413 - for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) 13414 + for (i = 0; i < csinfo_size; i++) 13415 { 13416 if (csinfo[i].fname == NULL || csinfo[i].to_fp == NULL) 13417 continue; 13418 @@ -1031,7 +1155,10 @@ 13419 char *buf; 13420 13421 if (!verbose) 13422 + { 13423 + vim_free(nummatches); 13424 return FALSE; 13425 + } 13426 13427 buf = (char *)alloc((unsigned)(strlen(opt) + strlen(pat) + strlen(nf))); 13428 if (buf == NULL) 13429 @@ -1042,6 +1169,7 @@ 13430 (void)EMSG(buf); 13431 vim_free(buf); 13432 } 13433 + vim_free(nummatches); 13434 return FALSE; 13435 } 13436 13437 @@ -1094,6 +1222,7 @@ 13438 (void)EMSG(buf); 13439 vim_free(buf); 13440 } 13441 + vim_free(nummatches); 13442 return FALSE; 13443 } 13444 } 13445 @@ -1141,6 +1270,7 @@ 13446 } 13447 mch_remove(tmp); 13448 vim_free(tmp); 13449 + vim_free(nummatches); 13450 return TRUE; 13451 } 13452 else 13453 @@ -1152,6 +1282,7 @@ 13454 /* read output */ 13455 cs_fill_results((char *)pat, totmatches, nummatches, &matches, 13456 &contexts, &matched); 13457 + vim_free(nummatches); 13458 if (matches == NULL) 13459 return FALSE; 13460 13461 @@ -1167,20 +1298,36 @@ 12457 13462 * 12458 13463 * print help … … 12496 13501 } 12497 13502 12498 @@ -1257,13 +1396,12 @@ 13503 @@ -1189,26 +1336,6 @@ 13504 } /* cs_help */ 13505 13506 13507 -/* 13508 - * PRIVATE: cs_init 13509 - * 13510 - * initialize cscope structure if not already 13511 - */ 13512 - static void 13513 -cs_init() 13514 -{ 13515 - short i; 13516 - static int init_already = FALSE; 13517 - 13518 - if (init_already) 13519 - return; 13520 - 13521 - for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) 13522 - clear_csinfo(i); 13523 - 13524 - init_already = TRUE; 13525 -} /* cs_init */ 13526 - 13527 static void 13528 clear_csinfo(i) 13529 int i; 13530 @@ -1257,13 +1384,12 @@ 12499 13531 * 12500 13532 * insert a new cscope database filename into the filelist … … 12511 13543 short i, j; 12512 13544 #ifndef UNIX 12513 @@ -1419,10 +1557,9 @@ 13545 @@ -1306,7 +1432,7 @@ 13546 #endif 13547 13548 i = -1; /* can be set to the index of an empty item in csinfo */ 13549 - for (j = 0; j < CSCOPE_MAX_CONNECTIONS; j++) 13550 + for (j = 0; j < csinfo_size; j++) 13551 { 13552 if (csinfo[j].fname != NULL 13553 #if defined(UNIX) 13554 @@ -1333,9 +1459,25 @@ 13555 13556 if (i == -1) 13557 { 13558 - if (p_csverbose) 13559 - (void)EMSG(_("E569: maximum number of cscope connections reached")); 13560 - return -1; 13561 + i = csinfo_size; 13562 + if (csinfo_size == 0) 13563 + { 13564 + /* First time allocation: allocate only 1 connection. It should 13565 + * be enough for most users. If more is needed, csinfo will be 13566 + * reallocated. */ 13567 + csinfo_size = 1; 13568 + csinfo = (csinfo_T *)alloc_clear(sizeof(csinfo_T)); 13569 + } 13570 + else 13571 + { 13572 + /* Reallocate space for more connections. */ 13573 + csinfo_size *= 2; 13574 + csinfo = vim_realloc(csinfo, sizeof(csinfo_T)*csinfo_size); 13575 + } 13576 + if (csinfo == NULL) 13577 + return -1; 13578 + for (j = csinfo_size/2; j < csinfo_size; j++) 13579 + clear_csinfo(j); 13580 } 13581 13582 if ((csinfo[i].fname = (char *)alloc((unsigned)strlen(fname)+1)) == NULL) 13583 @@ -1419,10 +1561,9 @@ 12514 13584 * 12515 13585 * nuke em … … 12523 13593 char *stok; 12524 13594 short i; 12525 @@ -2099,7 +2236,6 @@ 13595 @@ -1443,15 +1584,14 @@ 13596 /* It must be part of a name. We will try to find a match 13597 * within all the names in the csinfo data structure 13598 */ 13599 - for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) 13600 + for (i = 0; i < csinfo_size; i++) 13601 { 13602 if (csinfo[i].fname != NULL && strstr(csinfo[i].fname, stok)) 13603 break; 13604 } 13605 } 13606 13607 - if ((i >= CSCOPE_MAX_CONNECTIONS || i < -1 || csinfo[i].fname == NULL) 13608 - && i != -1) 13609 + if ((i != -1) && (i >= csinfo_size || i < -1 || csinfo[i].fname == NULL)) 13610 { 13611 if (p_csverbose) 13612 (void)EMSG2(_("E261: cscope connection %s not found"), stok); 13613 @@ -1460,7 +1600,7 @@ 13614 { 13615 if (i == -1) 13616 { 13617 - for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) 13618 + for (i = 0; i < csinfo_size; i++) 13619 { 13620 if (csinfo[i].fname) 13621 cs_kill_execute(i, csinfo[i].fname); 13622 @@ -1720,7 +1860,7 @@ 13623 if (buf == NULL) 13624 return; 13625 13626 - for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) 13627 + for (i = 0; i < csinfo_size; i++) 13628 { 13629 if (nummatches_a[i] < 1) 13630 continue; 13631 @@ -1792,7 +1932,7 @@ 13632 if ((cntxts = (char **)alloc(sizeof(char *) * totmatches)) == NULL) 13633 goto parse_out; 13634 13635 - for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) 13636 + for (i = 0; i < csinfo_size; i++) 13637 { 13638 if (nummatches_a[i] < 1) 13639 continue; 13640 @@ -2099,7 +2239,6 @@ 12526 13641 /* 12527 13642 * Used to catch and ignore SIGALRM below. … … 12531 13646 sig_handler SIGDEFARG(sigarg) 12532 13647 { 12533 @@ -2239,1 0 +2375,9@@13648 @@ -2239,19 +2378,21 @@ 12534 13649 * 12535 13650 * calls cs_kill on all cscope connections then reinits … … 12543 13658 char **dblist = NULL, **pplist = NULL, **fllist = NULL; 12544 13659 int i; 12545 @@ -2355,10 +2490,9 @@ 13660 char buf[20]; /* for sprintf " (#%d)" */ 13661 13662 + if (csinfo_size == 0) 13663 + return CSCOPE_SUCCESS; 13664 + 13665 /* malloc our db and ppath list */ 13666 - dblist = (char **)alloc(CSCOPE_MAX_CONNECTIONS * sizeof(char *)); 13667 - pplist = (char **)alloc(CSCOPE_MAX_CONNECTIONS * sizeof(char *)); 13668 - fllist = (char **)alloc(CSCOPE_MAX_CONNECTIONS * sizeof(char *)); 13669 + dblist = (char **)alloc(csinfo_size * sizeof(char *)); 13670 + pplist = (char **)alloc(csinfo_size * sizeof(char *)); 13671 + fllist = (char **)alloc(csinfo_size * sizeof(char *)); 13672 if (dblist == NULL || pplist == NULL || fllist == NULL) 13673 { 13674 vim_free(dblist); 13675 @@ -2260,7 +2401,7 @@ 13676 return CSCOPE_FAILURE; 13677 } 13678 13679 - for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) 13680 + for (i = 0; i < csinfo_size; i++) 13681 { 13682 dblist[i] = csinfo[i].fname; 13683 pplist[i] = csinfo[i].ppath; 13684 @@ -2270,7 +2411,7 @@ 13685 } 13686 13687 /* rebuild the cscope connection list */ 13688 - for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) 13689 + for (i = 0; i < csinfo_size; i++) 13690 { 13691 if (dblist[i] != NULL) 13692 { 13693 @@ -2355,10 +2496,9 @@ 12546 13694 * 12547 13695 * show all cscope connections … … 12555 13703 short i; 12556 13704 if (cs_cnt_connections() == 0) 13705 @@ -2368,7 +2508,7 @@ 13706 MSG_PUTS_ATTR( 13707 _(" # pid database name prepend path\n"), 13708 hl_attr(HLF_T)); 13709 - for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) 13710 + for (i = 0; i < csinfo_size; i++) 13711 { 13712 if (csinfo[i].fname == NULL) 13713 continue; 13714 @@ -2397,8 +2537,10 @@ 13715 { 13716 int i; 13717 13718 - for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++) 13719 + for (i = 0; i < csinfo_size; i++) 13720 cs_release_csp(i, TRUE); 13721 + vim_free(csinfo); 13722 + csinfo_size = 0; 13723 } 13724 13725 #endif /* FEAT_CSCOPE */ 12557 13726 diff -Naur vim72.orig/src/if_cscope.h vim72/src/if_cscope.h 12558 13727 --- vim72.orig/src/if_cscope.h 2007-09-02 07:51:08.000000000 -0700 12559 +++ vim72/src/if_cscope.h 2009-06-05 14:14:12.000000000 -0700 12560 @@ -42,17 +42,6 @@ 13728 +++ vim72/src/if_cscope.h 2009-07-19 15:18:44.000000000 -0700 13729 @@ -25,7 +25,6 @@ 13730 13731 #define CSCOPE_SUCCESS 0 13732 #define CSCOPE_FAILURE -1 13733 -#define CSCOPE_MAX_CONNECTIONS 8 /* you actually need more? */ 13734 13735 #define CSCOPE_DBFILE "cscope.out" 13736 #define CSCOPE_PROMPT ">> " 13737 @@ -42,17 +41,6 @@ 12561 13738 * f 7name Find this file 12562 13739 * i 8name Find files #including this file … … 12578 13755 diff -Naur vim72.orig/src/if_mzsch.c vim72/src/if_mzsch.c 12579 13756 --- vim72.orig/src/if_mzsch.c 2007-07-01 09:44:49.000000000 -0700 12580 +++ vim72/src/if_mzsch.c 2009-0 6-05 14:25:19.000000000 -070013757 +++ vim72/src/if_mzsch.c 2009-07-19 15:18:39.000000000 -0700 12581 13758 @@ -667,13 +667,11 @@ 12582 13759 static void CALLBACK … … 12595 13772 pascal void 12596 13773 timer_proc(EventLoopTimerRef theTimer, void *userData) 13774 @@ -1958,9 +1956,9 @@ 13775 curbuf = savebuf; 13776 raise_vim_exn(_("cannot delete line")); 13777 } 13778 - deleted_lines_mark((linenr_T)n, 1L); 13779 if (buf->buf == curwin->w_buffer) 13780 mz_fix_cursor(n, n + 1, -1); 13781 + deleted_lines_mark((linenr_T)n, 1L); 13782 13783 curbuf = savebuf; 13784 13785 @@ -2065,9 +2063,9 @@ 13786 curbuf = savebuf; 13787 raise_vim_exn(_("cannot delete line")); 13788 } 13789 - deleted_lines_mark((linenr_T)lo, (long)old_len); 13790 if (buf->buf == curwin->w_buffer) 13791 mz_fix_cursor(lo, hi, -old_len); 13792 + deleted_lines_mark((linenr_T)lo, (long)old_len); 13793 } 13794 13795 curbuf = savebuf; 12597 13796 diff -Naur vim72.orig/src/if_perl.xs vim72/src/if_perl.xs 12598 13797 --- vim72.orig/src/if_perl.xs 2008-07-17 13:55:09.000000000 -0700 12599 +++ vim72/src/if_perl.xs 2009-0 6-05 14:18:24.000000000 -070013798 +++ vim72/src/if_perl.xs 2009-07-19 15:18:52.000000000 -0700 12600 13799 @@ -136,6 +136,9 @@ 12601 13800 # define Perl_newXS_flags dll_Perl_newXS_flags … … 12646 13845 perl_interp = perl_alloc(); 12647 13846 perl_construct(perl_interp); 13847 @@ -715,9 +720,11 @@ 13848 #ifdef HAVE_SANDBOX 13849 if (sandbox) 13850 { 13851 +# ifndef MAKE_TEST /* avoid a warning for unreachable code */ 13852 if ((safe = perl_get_sv( "VIM::safe", FALSE )) == NULL || !SvTRUE(safe)) 13853 EMSG(_("E299: Perl evaluation forbidden in sandbox without the Safe module")); 13854 else 13855 +# endif 13856 { 13857 PUSHMARK(SP); 13858 XPUSHs(safe); 13859 @@ -1228,9 +1235,8 @@ 13860 if (u_savedel(lnum, 1) == OK) 13861 { 13862 ml_delete(lnum, 0); 13863 + check_cursor(); 13864 deleted_lines_mark(lnum, 1L); 13865 - if (aco.save_buf == curbuf) 13866 - check_cursor(); 13867 } 13868 13869 /* restore curwin/curbuf and a few other things */ 12648 13870 diff -Naur vim72.orig/src/if_python.c vim72/src/if_python.c 12649 13871 --- vim72.orig/src/if_python.c 2008-07-17 14:09:32.000000000 -0700 12650 +++ vim72/src/if_python.c 2009-0 6-05 14:25:31.000000000 -070013872 +++ vim72/src/if_python.c 2009-07-19 15:18:39.000000000 -0700 12651 13873 @@ -531,6 +531,12 @@ 12652 13874 if (PythonMod_Init()) … … 12836 14058 /* Fixups... */ 12837 14059 BufferType.ob_type = &PyType_Type; 14060 @@ -2489,9 +2497,9 @@ 14061 PyErr_SetVim(_("cannot delete line")); 14062 else 14063 { 14064 - deleted_lines_mark((linenr_T)n, 1L); 14065 if (buf == curwin->w_buffer) 14066 py_fix_cursor((linenr_T)n, (linenr_T)n + 1, (linenr_T)-1); 14067 + deleted_lines_mark((linenr_T)n, 1L); 14068 } 14069 14070 curbuf = savebuf; 14071 @@ -2588,10 +2596,9 @@ 14072 break; 14073 } 14074 } 14075 - deleted_lines_mark((linenr_T)lo, (long)i); 14076 - 14077 if (buf == curwin->w_buffer) 14078 py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)-n); 14079 + deleted_lines_mark((linenr_T)lo, (long)i); 14080 } 14081 14082 curbuf = savebuf; 12838 14083 diff -Naur vim72.orig/src/if_ruby.c vim72/src/if_ruby.c 12839 14084 --- vim72.orig/src/if_ruby.c 2007-09-10 01:40:38.000000000 -0700 12840 +++ vim72/src/if_ruby.c 2009-0 6-05 14:25:34.000000000 -070014085 +++ vim72/src/if_ruby.c 2009-07-19 15:16:49.000000000 -0700 12841 14086 @@ -492,7 +492,7 @@ 12842 14087 } … … 12930 14175 diff -Naur vim72.orig/src/if_tcl.c vim72/src/if_tcl.c 12931 14176 --- vim72.orig/src/if_tcl.c 2007-05-07 12:50:14.000000000 -0700 12932 +++ vim72/src/if_tcl.c 2009-0 6-05 14:25:41.000000000 -070014177 +++ vim72/src/if_tcl.c 2009-07-19 15:16:54.000000000 -0700 12933 14178 @@ -161,7 +161,7 @@ 12934 14179 # endif … … 13145 14390 diff -Naur vim72.orig/src/if_xcmdsrv.c vim72/src/if_xcmdsrv.c 13146 14391 --- vim72.orig/src/if_xcmdsrv.c 2008-07-18 06:05:03.000000000 -0700 13147 +++ vim72/src/if_xcmdsrv.c 2009-0 6-05 14:25:02.000000000 -070014392 +++ vim72/src/if_xcmdsrv.c 2009-07-19 15:16:23.000000000 -0700 13148 14393 @@ -682,7 +682,7 @@ 13149 14394 * Scan all of the names out of the property. … … 13261 14506 diff -Naur vim72.orig/src/macros.h vim72/src/macros.h 13262 14507 --- vim72.orig/src/macros.h 2007-08-04 04:44:18.000000000 -0700 13263 +++ vim72/src/macros.h 2009-0 6-05 14:25:15.000000000 -070014508 +++ vim72/src/macros.h 2009-07-19 15:16:33.000000000 -0700 13264 14509 @@ -127,15 +127,31 @@ 13265 14510 #ifdef FEAT_LANGMAP … … 13310 14555 diff -Naur vim72.orig/src/main.c vim72/src/main.c 13311 14556 --- vim72.orig/src/main.c 2008-07-24 01:40:56.000000000 -0700 13312 +++ vim72/src/main.c 2009-0 6-05 14:25:15.000000000 -070014557 +++ vim72/src/main.c 2009-07-19 15:16:33.000000000 -0700 13313 14558 @@ -645,11 +645,12 @@ 13314 14559 … … 13402 14647 diff -Naur vim72.orig/src/Makefile vim72/src/Makefile 13403 14648 --- vim72.orig/src/Makefile 2008-08-09 07:50:04.000000000 -0700 13404 +++ vim72/src/Makefile 2009-0 6-05 14:25:34.000000000 -070014649 +++ vim72/src/Makefile 2009-07-19 15:16:49.000000000 -0700 13405 14650 @@ -105,8 +105,8 @@ 13406 14651 # 4. "make test" {{{1 … … 13516 14761 diff -Naur vim72.orig/src/mark.c vim72/src/mark.c 13517 14762 --- vim72.orig/src/mark.c 2008-08-08 15:06:49.000000000 -0700 13518 +++ vim72/src/mark.c 2009-0 6-05 14:25:02.000000000 -070014763 +++ vim72/src/mark.c 2009-07-19 15:16:23.000000000 -0700 13519 14764 @@ -884,10 +884,9 @@ 13520 14765 /* … … 13637 14882 diff -Naur vim72.orig/src/mbyte.c vim72/src/mbyte.c 13638 14883 --- vim72.orig/src/mbyte.c 2008-07-14 05:38:05.000000000 -0700 13639 +++ vim72/src/mbyte.c 2009-06-05 14:25:15.000000000 -0700 13640 @@ -717,7 +717,7 @@ 14884 +++ vim72/src/mbyte.c 2009-07-19 15:17:33.000000000 -0700 14885 @@ -127,7 +127,10 @@ 14886 static int dbcs_char2len __ARGS((int c)); 14887 static int dbcs_char2bytes __ARGS((int c, char_u *buf)); 14888 static int dbcs_ptr2len __ARGS((char_u *p)); 14889 +static int dbcs_ptr2len_len __ARGS((char_u *p, int size)); 14890 +static int utf_ptr2cells_len __ARGS((char_u *p, int size)); 14891 static int dbcs_char2cells __ARGS((int c)); 14892 +static int dbcs_ptr2cells_len __ARGS((char_u *p, int size)); 14893 static int dbcs_ptr2char __ARGS((char_u *p)); 14894 14895 /* Lookup table to quickly get the length in bytes of a UTF-8 character from 14896 @@ -606,9 +609,11 @@ 14897 if (enc_utf8) 14898 { 14899 mb_ptr2len = utfc_ptr2len; 14900 + mb_ptr2len_len = utfc_ptr2len_len; 14901 mb_char2len = utf_char2len; 14902 mb_char2bytes = utf_char2bytes; 14903 mb_ptr2cells = utf_ptr2cells; 14904 + mb_ptr2cells_len = utf_ptr2cells_len; 14905 mb_char2cells = utf_char2cells; 14906 mb_off2cells = utf_off2cells; 14907 mb_ptr2char = utf_ptr2char; 14908 @@ -617,9 +622,11 @@ 14909 else if (enc_dbcs != 0) 14910 { 14911 mb_ptr2len = dbcs_ptr2len; 14912 + mb_ptr2len_len = dbcs_ptr2len_len; 14913 mb_char2len = dbcs_char2len; 14914 mb_char2bytes = dbcs_char2bytes; 14915 mb_ptr2cells = dbcs_ptr2cells; 14916 + mb_ptr2cells_len = dbcs_ptr2cells_len; 14917 mb_char2cells = dbcs_char2cells; 14918 mb_off2cells = dbcs_off2cells; 14919 mb_ptr2char = dbcs_ptr2char; 14920 @@ -628,9 +635,11 @@ 14921 else 14922 { 14923 mb_ptr2len = latin_ptr2len; 14924 + mb_ptr2len_len = latin_ptr2len_len; 14925 mb_char2len = latin_char2len; 14926 mb_char2bytes = latin_char2bytes; 14927 mb_ptr2cells = latin_ptr2cells; 14928 + mb_ptr2cells_len = latin_ptr2cells_len; 14929 mb_char2cells = latin_char2cells; 14930 mb_off2cells = latin_off2cells; 14931 mb_ptr2char = latin_ptr2char; 14932 @@ -717,7 +726,7 @@ 13641 14933 * where mblen() returns 0 for invalid character. 13642 14934 * Therefore, following condition includes 0. … … 13647 14939 n = 2; 13648 14940 else 13649 @@ -1015,10 +10 15,9 @@14941 @@ -1015,10 +1024,9 @@ 13650 14942 * Return length in bytes of character "c". 13651 14943 * Returns 1 for a single-byte character. … … 13659 14951 return 1; 13660 14952 } 13661 @@ -1248,10 +1247,9 @@ 14953 @@ -1070,7 +1078,6 @@ 14954 * Get byte length of character at "*p" but stop at a NUL. 14955 * For UTF-8 this includes following composing characters. 14956 * Returns 0 when *p is NUL. 14957 - * 14958 */ 14959 int 14960 latin_ptr2len(p) 14961 @@ -1092,6 +1099,40 @@ 14962 return len; 14963 } 14964 14965 +/* 14966 + * mb_ptr2len_len() function pointer. 14967 + * Like mb_ptr2len(), but limit to read "size" bytes. 14968 + * Returns 0 for an empty string. 14969 + * Returns 1 for an illegal char or an incomplete byte sequence. 14970 + */ 14971 + int 14972 +latin_ptr2len_len(p, size) 14973 + char_u *p; 14974 + int size; 14975 +{ 14976 + if (size < 1 || *p == NUL) 14977 + return 0; 14978 + return 1; 14979 +} 14980 + 14981 + static int 14982 +dbcs_ptr2len_len(p, size) 14983 + char_u *p; 14984 + int size; 14985 +{ 14986 + int len; 14987 + 14988 + if (size < 1 || *p == NUL) 14989 + return 0; 14990 + if (size == 1) 14991 + return 1; 14992 + /* Check that second byte is not missing. */ 14993 + len = MB_BYTE2LEN(*p); 14994 + if (len == 2 && p[1] == NUL) 14995 + len = 1; 14996 + return len; 14997 +} 14998 + 14999 struct interval 15000 { 15001 unsigned short first; 15002 @@ -1248,10 +1289,9 @@ 13662 15003 * Return the number of display cells character at "*p" occupies. 13663 15004 * This doesn't take care of unprintable characters, use ptr2cells() for that. … … 13671 15012 return 1; 13672 15013 } 13673 @@ -1293,10 +1291,9 @@ 15014 @@ -1289,14 +1329,62 @@ 15015 } 15016 15017 /* 15018 + * mb_ptr2cells_len() function pointer. 15019 + * Like mb_ptr2cells(), but limit string length to "size". 15020 + * For an empty string or truncated character returns 1. 15021 + */ 15022 + int 15023 +latin_ptr2cells_len(p, size) 15024 + char_u *p UNUSED; 15025 + int size UNUSED; 15026 +{ 15027 + return 1; 15028 +} 15029 + 15030 + static int 15031 +utf_ptr2cells_len(p, size) 15032 + char_u *p; 15033 + int size; 15034 +{ 15035 + int c; 15036 + 15037 + /* Need to convert to a wide character. */ 15038 + if (size > 0 && *p >= 0x80) 15039 + { 15040 + if (utf_ptr2len_len(p, size) < utf8len_tab[*p]) 15041 + return 1; 15042 + c = utf_ptr2char(p); 15043 + /* An illegal byte is displayed as <xx>. */ 15044 + if (utf_ptr2len(p) == 1 || c == NUL) 15045 + return 4; 15046 + /* If the char is ASCII it must be an overlong sequence. */ 15047 + if (c < 0x80) 15048 + return char2cells(c); 15049 + return utf_char2cells(c); 15050 + } 15051 + return 1; 15052 +} 15053 + 15054 + static int 15055 +dbcs_ptr2cells_len(p, size) 15056 + char_u *p; 15057 + int size; 15058 +{ 15059 + /* Number of cells is equal to number of bytes, except for euc-jp when 15060 + * the first byte is 0x8e. */ 15061 + if (size <= 1 || (enc_dbcs == DBCS_JPNU && *p == 0x8e)) 15062 + return 1; 15063 + return MB_BYTE2LEN(*p); 15064 +} 15065 + 15066 +/* 15067 * mb_char2cells() function pointer. 13674 15068 * Return the number of display cells character "c" occupies. 13675 15069 * Only takes care of multi-byte chars, not "^C" and such. … … 13683 15077 return 1; 13684 15078 } 13685 @@ -1318,11 +1 315,10 @@15079 @@ -1318,11 +1406,10 @@ 13686 15080 * Return number of display cells for char at ScreenLines[off]. 13687 15081 * We make sure that the offset used is less than "max_off". … … 13697 15091 return 1; 13698 15092 } 13699 @@ -2419,11 +2415,10 @@ 15093 @@ -1720,6 +1807,7 @@ 15094 /* 15095 * Return the number of bytes the UTF-8 encoding of the character at "p[size]" 15096 * takes. This includes following composing characters. 15097 + * Returns 0 for an empty string. 15098 * Returns 1 for an illegal char or an incomplete byte sequence. 15099 */ 15100 int 15101 @@ -1732,7 +1820,7 @@ 15102 int prevlen; 15103 #endif 15104 15105 - if (*p == NUL) 15106 + if (size < 1 || *p == NUL) 15107 return 0; 15108 if (p[0] < 0x80 && (size == 1 || p[1] < 0x80)) /* be quick for ASCII */ 15109 return 1; 15110 @@ -2419,11 +2507,10 @@ 13700 15111 * Return offset from "p" to the first byte of the character it points into. 13701 15112 * Returns 0 when already at the first byte of a character. … … 13711 15122 return 0; 13712 15123 } 13713 @@ -2540,7 +2 535,6 @@15124 @@ -2540,7 +2627,6 @@ 13714 15125 return (int)(p - q); 13715 15126 } … … 13719 15130 * Copy a character from "*fp" to "*tp" and advance the pointers. 13720 15131 */ 13721 @@ -2555,7 +2 549,6 @@15132 @@ -2555,7 +2641,6 @@ 13722 15133 *tp += l; 13723 15134 *fp += l; … … 13727 15138 /* 13728 15139 * Return the offset from "p" to the first byte of a character. When "p" is 13729 @@ -3133,7 +3 126,7 @@15140 @@ -3133,7 +3218,7 @@ 13730 15141 else 13731 15142 s = p + 1; … … 13736 15147 if (s[i] == '_' || s[i] == '-') 13737 15148 buf[i] = '-'; 13738 @@ -3584,9 +3577,10 @@ 15149 @@ -3180,7 +3265,7 @@ 15150 15151 # if defined(USE_ICONV) || defined(PROTO) 15152 15153 -static char_u *iconv_string __ARGS((vimconv_T *vcp, char_u *str, int slen, int *unconvlenp)); 15154 +static char_u *iconv_string __ARGS((vimconv_T *vcp, char_u *str, int slen, int *unconvlenp, int *resultlenp)); 15155 15156 /* 15157 * Call iconv_open() with a check if iconv() works properly (there are broken 15158 @@ -3241,13 +3326,15 @@ 15159 * If "unconvlenp" is not NULL handle the string ending in an incomplete 15160 * sequence and set "*unconvlenp" to the length of it. 15161 * Returns the converted string in allocated memory. NULL for an error. 15162 + * If resultlenp is not NULL, sets it to the result length in bytes. 15163 */ 15164 static char_u * 15165 -iconv_string(vcp, str, slen, unconvlenp) 15166 +iconv_string(vcp, str, slen, unconvlenp, resultlenp) 15167 vimconv_T *vcp; 15168 char_u *str; 15169 int slen; 15170 int *unconvlenp; 15171 + int *resultlenp; 15172 { 15173 const char *from; 15174 size_t fromlen; 15175 @@ -3333,6 +3420,9 @@ 15176 /* Not enough room or skipping illegal sequence. */ 15177 done = to - (char *)result; 15178 } 15179 + 15180 + if (resultlenp != NULL) 15181 + *resultlenp = (int)(to - (char *)result); 15182 return result; 15183 } 15184 15185 @@ -3584,9 +3674,10 @@ 13739 15186 * Callback invoked when the user finished preediting. 13740 15187 * Put the final string into the input buffer. … … 13749 15196 int slen = (int)STRLEN(str); 13750 15197 int add_to_input = TRUE; 13751 @@ -3672,9 +3 666,8 @@15198 @@ -3672,9 +3763,8 @@ 13752 15199 /* 13753 15200 * Callback invoked after start to the preedit. … … 13760 15207 #ifdef XIM_DEBUG 13761 15208 xim_log("im_preedit_start_cb()\n"); 13762 @@ -3689,9 +3 682,8 @@15209 @@ -3689,9 +3779,8 @@ 13763 15210 /* 13764 15211 * Callback invoked after end to the preedit. … … 13771 15218 #ifdef XIM_DEBUG 13772 15219 xim_log("im_preedit_end_cb()\n"); 13773 @@ -3750,9 +3 742,8 @@15220 @@ -3750,9 +3839,8 @@ 13774 15221 * remaining input from within the "retrieve_surrounding" signal handler, this 13775 15222 * might not be necessary. Gotta ask on vim-dev for opinions. … … 13782 15229 char *preedit_string = NULL; 13783 15230 int cursor_index = 0; 13784 @@ -4618,11 +4 609,10 @@15231 @@ -4618,11 +4706,10 @@ 13785 15232 } 13786 15233 } … … 13796 15243 xim_set_preedit(); 13797 15244 } 13798 @@ -4929,12 + 4919,11 @@15245 @@ -4929,12 +5016,11 @@ 13799 15246 static void xim_instantiate_cb __ARGS((Display *display, XPointer client_data, XPointer call_data)); 13800 15247 static void xim_destroy_cb __ARGS((XIM im, XPointer client_data, XPointer call_data)); … … 13811 15258 Window x11_window; 13812 15259 Display *x11_display; 13813 @@ -4954,12 + 4943,11 @@15260 @@ -4954,12 +5040,11 @@ 13814 15261 xim_instantiate_cb, NULL); 13815 15262 } … … 13827 15274 Window x11_window; 13828 15275 Display *x11_display; 13829 @@ -5278,9 +5 266,10 @@15276 @@ -5278,9 +5363,10 @@ 13830 15277 } 13831 15278 } … … 13840 15287 #ifdef XIM_DEBUG 13841 15288 xim_log("xim_decide_input_style()\n"); 13842 @@ -5312,9 +53 01,10 @@15289 @@ -5312,9 +5398,10 @@ 13843 15290 static GSList *key_press_event_queue = NULL; 13844 15291 static gboolean processing_queued_event = FALSE; … … 13853 15300 XIMPreeditDrawCallbackStruct *draw_data; 13854 15301 XIMText *text; 13855 @@ -5386,7 +5 376,7 @@15302 @@ -5386,7 +5473,7 @@ 13856 15303 draw_feedback = (char *)alloc(draw_data->chg_first 13857 15304 + text->length); … … 13862 15309 if (draw_feedback != NULL) 13863 15310 { 13864 @@ -5453,18 +5 443,20 @@15311 @@ -5453,18 +5540,20 @@ 13865 15312 return -1; 13866 15313 } … … 13887 15334 #ifdef XIM_DEBUG 13888 15335 xim_log("preedit_done_cbproc()\n"); 13889 @@ -5503,9 +5 495,8 @@15336 @@ -5503,9 +5592,8 @@ 13890 15337 } 13891 15338 } … … 13898 15345 #ifdef XIM_DEBUG 13899 15346 xim_log("xim_queue_key_press_event()\n"); 13900 @@ -5521,9 +5 512,8 @@15347 @@ -5521,9 +5609,8 @@ 13901 15348 return TRUE; 13902 15349 } … … 13909 15356 XIC xxic; 13910 15357 XVaNestedList preedit_attr; 13911 @@ -5548,9 +5 538,8 @@15358 @@ -5548,9 +5635,8 @@ 13912 15359 XFree(preedit_attr); 13913 15360 } … … 13920 15367 #ifdef USE_X11R6_XIM 13921 15368 /* don't change the input context when we call reset */ 15369 @@ -5756,8 +5842,25 @@ 15370 char_u *from; 15371 char_u *to; 15372 { 15373 + return convert_setup_ext(vcp, from, TRUE, to, TRUE); 15374 +} 15375 + 15376 +/* 15377 + * As convert_setup(), but only when from_unicode_is_utf8 is TRUE will all 15378 + * "from" unicode charsets be considered utf-8. Same for "to". 15379 + */ 15380 + int 15381 +convert_setup_ext(vcp, from, from_unicode_is_utf8, to, to_unicode_is_utf8) 15382 + vimconv_T *vcp; 15383 + char_u *from; 15384 + int from_unicode_is_utf8; 15385 + char_u *to; 15386 + int to_unicode_is_utf8; 15387 +{ 15388 int from_prop; 15389 int to_prop; 15390 + int from_is_utf8; 15391 + int to_is_utf8; 15392 15393 /* Reset to no conversion. */ 15394 # ifdef USE_ICONV 15395 @@ -5775,37 +5878,46 @@ 15396 15397 from_prop = enc_canon_props(from); 15398 to_prop = enc_canon_props(to); 15399 - if ((from_prop & ENC_LATIN1) && (to_prop & ENC_UNICODE)) 15400 + if (from_unicode_is_utf8) 15401 + from_is_utf8 = from_prop & ENC_UNICODE; 15402 + else 15403 + from_is_utf8 = from_prop == ENC_UNICODE; 15404 + if (to_unicode_is_utf8) 15405 + to_is_utf8 = to_prop & ENC_UNICODE; 15406 + else 15407 + to_is_utf8 = to_prop == ENC_UNICODE; 15408 + 15409 + if ((from_prop & ENC_LATIN1) && to_is_utf8) 15410 { 15411 /* Internal latin1 -> utf-8 conversion. */ 15412 vcp->vc_type = CONV_TO_UTF8; 15413 vcp->vc_factor = 2; /* up to twice as long */ 15414 } 15415 - else if ((from_prop & ENC_LATIN9) && (to_prop & ENC_UNICODE)) 15416 + else if ((from_prop & ENC_LATIN9) && to_is_utf8) 15417 { 15418 /* Internal latin9 -> utf-8 conversion. */ 15419 vcp->vc_type = CONV_9_TO_UTF8; 15420 vcp->vc_factor = 3; /* up to three as long (euro sign) */ 15421 } 15422 - else if ((from_prop & ENC_UNICODE) && (to_prop & ENC_LATIN1)) 15423 + else if (from_is_utf8 && (to_prop & ENC_LATIN1)) 15424 { 15425 /* Internal utf-8 -> latin1 conversion. */ 15426 vcp->vc_type = CONV_TO_LATIN1; 15427 } 15428 - else if ((from_prop & ENC_UNICODE) && (to_prop & ENC_LATIN9)) 15429 + else if (from_is_utf8 && (to_prop & ENC_LATIN9)) 15430 { 15431 /* Internal utf-8 -> latin9 conversion. */ 15432 vcp->vc_type = CONV_TO_LATIN9; 15433 } 15434 #ifdef WIN3264 15435 /* Win32-specific codepage <-> codepage conversion without iconv. */ 15436 - else if (((from_prop & ENC_UNICODE) || encname2codepage(from) > 0) 15437 - && ((to_prop & ENC_UNICODE) || encname2codepage(to) > 0)) 15438 + else if ((from_is_utf8 || encname2codepage(from) > 0) 15439 + && (to_is_utf8 || encname2codepage(to) > 0)) 15440 { 15441 vcp->vc_type = CONV_CODEPAGE; 15442 vcp->vc_factor = 2; /* up to twice as long */ 15443 - vcp->vc_cpfrom = (from_prop & ENC_UNICODE) ? 0 : encname2codepage(from); 15444 - vcp->vc_cpto = (to_prop & ENC_UNICODE) ? 0 : encname2codepage(to); 15445 + vcp->vc_cpfrom = from_is_utf8 ? 0 : encname2codepage(from); 15446 + vcp->vc_cpto = to_is_utf8 ? 0 : encname2codepage(to); 15447 } 15448 #endif 15449 #ifdef MACOS_X 15450 @@ -5813,7 +5925,7 @@ 15451 { 15452 vcp->vc_type = CONV_MAC_LATIN1; 15453 } 15454 - else if ((from_prop & ENC_MACROMAN) && (to_prop & ENC_UNICODE)) 15455 + else if ((from_prop & ENC_MACROMAN) && to_is_utf8) 15456 { 15457 vcp->vc_type = CONV_MAC_UTF8; 15458 vcp->vc_factor = 2; /* up to twice as long */ 15459 @@ -5822,7 +5934,7 @@ 15460 { 15461 vcp->vc_type = CONV_LATIN1_MAC; 15462 } 15463 - else if ((from_prop & ENC_UNICODE) && (to_prop & ENC_MACROMAN)) 15464 + else if (from_is_utf8 && (to_prop & ENC_MACROMAN)) 15465 { 15466 vcp->vc_type = CONV_UTF8_MAC; 15467 } 15468 @@ -5832,8 +5944,8 @@ 15469 { 15470 /* Use iconv() for conversion. */ 15471 vcp->vc_fd = (iconv_t)my_iconv_open( 15472 - (to_prop & ENC_UNICODE) ? (char_u *)"utf-8" : to, 15473 - (from_prop & ENC_UNICODE) ? (char_u *)"utf-8" : from); 15474 + to_is_utf8 ? (char_u *)"utf-8" : to, 15475 + from_is_utf8 ? (char_u *)"utf-8" : from); 15476 if (vcp->vc_fd != (iconv_t)-1) 15477 { 15478 vcp->vc_type = CONV_ICONV; 15479 @@ -6089,9 +6201,7 @@ 15480 15481 # ifdef USE_ICONV 15482 case CONV_ICONV: /* conversion with output_conv.vc_fd */ 15483 - retval = iconv_string(vcp, ptr, len, unconvlenp); 15484 - if (retval != NULL && lenp != NULL) 15485 - *lenp = (int)STRLEN(retval); 15486 + retval = iconv_string(vcp, ptr, len, unconvlenp, lenp); 15487 break; 15488 # endif 15489 # ifdef WIN3264 13922 15490 diff -Naur vim72.orig/src/memline.c vim72/src/memline.c 13923 15491 --- vim72.orig/src/memline.c 2008-07-13 09:19:22.000000000 -0700 13924 +++ vim72/src/memline.c 2009-0 6-05 14:23:47.000000000 -070015492 +++ vim72/src/memline.c 2009-07-19 15:15:19.000000000 -0700 13925 15493 @@ -1554,10 +1554,15 @@ 13926 15494 for (i = 0; i < num_files; ++i) … … 13982 15550 diff -Naur vim72.orig/src/menu.c vim72/src/menu.c 13983 15551 --- vim72.orig/src/menu.c 2008-06-21 12:53:43.000000000 -0700 13984 +++ vim72/src/menu.c 2009-0 6-05 14:25:15.000000000 -070015552 +++ vim72/src/menu.c 2009-07-19 15:16:33.000000000 -0700 13985 15553 @@ -231,7 +231,7 @@ 13986 15554 if (skipdigits(menu_path + 7) == p) … … 14059 15627 diff -Naur vim72.orig/src/message.c vim72/src/message.c 14060 15628 --- vim72.orig/src/message.c 2008-07-09 11:24:55.000000000 -0700 14061 +++ vim72/src/message.c 2009-06-05 14:25:15.000000000 -0700 15629 +++ vim72/src/message.c 2009-07-19 15:18:26.000000000 -0700 15630 @@ -107,7 +107,7 @@ 15631 } 15632 15633 #if defined(FEAT_EVAL) || defined(FEAT_X11) || defined(USE_XSMP) \ 15634 - || defined(PROTO) 15635 + || defined(FEAT_GUI_GTK) || defined(PROTO) 15636 /* 15637 * Like msg() but keep it silent when 'verbosefile' is set. 15638 */ 14062 15639 @@ -818,10 +818,9 @@ 14063 15640 /* … … 14371 15948 diff -Naur vim72.orig/src/misc1.c vim72/src/misc1.c 14372 15949 --- vim72.orig/src/misc1.c 2008-07-12 12:20:53.000000000 -0700 14373 +++ vim72/src/misc1.c 2009-0 6-05 14:25:15.000000000 -070015950 +++ vim72/src/misc1.c 2009-07-19 15:19:00.000000000 -0700 14374 15951 @@ -2188,12 +2188,11 @@ 14375 15952 * … … 14386 15963 char_u *oldp, *newp; 14387 15964 colnr_T oldlen; 14388 @@ -2717,6 +2716,9 @@ 15965 @@ -2346,12 +2345,13 @@ 15966 int undo; /* if TRUE, prepare for undo */ 15967 { 15968 long n; 15969 + linenr_T first = curwin->w_cursor.lnum; 15970 15971 if (nlines <= 0) 15972 return; 15973 15974 /* save the deleted lines for undo */ 15975 - if (undo && u_savedel(curwin->w_cursor.lnum, nlines) == FAIL) 15976 + if (undo && u_savedel(first, nlines) == FAIL) 15977 return; 15978 15979 for (n = 0; n < nlines; ) 15980 @@ -2359,18 +2359,21 @@ 15981 if (curbuf->b_ml.ml_flags & ML_EMPTY) /* nothing to delete */ 15982 break; 15983 15984 - ml_delete(curwin->w_cursor.lnum, TRUE); 15985 + ml_delete(first, TRUE); 15986 ++n; 15987 15988 /* If we delete the last line in the file, stop */ 15989 - if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count) 15990 + if (first > curbuf->b_ml.ml_line_count) 15991 break; 15992 } 15993 - /* adjust marks, mark the buffer as changed and prepare for displaying */ 15994 - deleted_lines_mark(curwin->w_cursor.lnum, n); 15995 15996 + /* Correct the cursor position before calling deleted_lines_mark(), it may 15997 + * trigger a callback to display the cursor. */ 15998 curwin->w_cursor.col = 0; 15999 check_cursor_lnum(); 16000 + 16001 + /* adjust marks, mark the buffer as changed and prepare for displaying */ 16002 + deleted_lines_mark(first, n); 16003 } 16004 16005 int 16006 @@ -2622,6 +2625,8 @@ 16007 16008 /* 16009 * Like deleted_lines(), but adjust marks first. 16010 + * Make sure the cursor is on a valid line before calling, a GUI callback may 16011 + * be triggered to display the cursor. 16012 */ 16013 void 16014 deleted_lines_mark(lnum, count) 16015 @@ -2717,6 +2722,9 @@ 14389 16016 long xtra; 14390 16017 { … … 14396 16023 #ifdef FEAT_JUMPLIST 14397 16024 int cols; 14398 @@ -2769,7 +277 1,7 @@16025 @@ -2769,7 +2777,7 @@ 14399 16026 curbuf->b_changelistlen = JUMPLISTSIZE - 1; 14400 16027 mch_memmove(curbuf->b_changelist, curbuf->b_changelist + 1, … … 14405 16032 /* Correct position in changelist for other windows on 14406 16033 * this buffer. */ 14407 @@ -2777,7 +27 79,7 @@16034 @@ -2777,7 +2785,7 @@ 14408 16035 --wp->w_changelistidx; 14409 16036 } … … 14414 16041 /* For other windows, if the position in the changelist is 14415 16042 * at the end it stays at the end. */ 14416 @@ -2796,7 +2 798,7 @@16043 @@ -2796,7 +2804,7 @@ 14417 16044 #endif 14418 16045 } … … 14423 16050 if (wp->w_buffer == curbuf) 14424 16051 { 14425 @@ -2955,6 +29 57,8 @@16052 @@ -2955,6 +2963,8 @@ 14426 16053 int col; /* column for message; non-zero when in insert 14427 16054 mode and 'showmode' is on */ … … 14432 16059 && curbufIsChanged() == 0 14433 16060 #ifdef FEAT_AUTOCMD 14434 @@ -2977,8 +298 1,10 @@16061 @@ -2977,8 +2987,10 @@ 14435 16062 if (msg_row == Rows - 1) 14436 16063 msg_col = col; … … 14445 16072 (void)msg_end(); 14446 16073 if (msg_silent == 0 && !silent_mode) 14447 @@ -3245,9 +325 1,9 @@16074 @@ -3245,9 +3257,9 @@ 14448 16075 14449 16076 /* When using ":silent" assume that <CR> was entered. */ … … 14457 16084 /* Set the state such that text can be selected/copied/pasted and we still 14458 16085 * get mouse events. */ 14459 @@ -4141,10 +41 47,9 @@16086 @@ -4141,10 +4153,9 @@ 14460 16087 /* 14461 16088 * Function given to ExpandGeneric() to obtain an environment variable name. … … 14469 16096 { 14470 16097 # if defined(AMIGA) || defined(__MRC__) || defined(__SC__) 14471 @@ -4736,9 +474 1,9 @@16098 @@ -4736,9 +4747,9 @@ 14472 16099 * If it is then restrict the search to below this line and try again. 14473 16100 */ … … 14481 16108 cur_maxcomment = curwin->w_cursor.lnum - pos->lnum - 1; 14482 16109 if (cur_maxcomment <= 0) 14483 @@ -6269,7 +62 74,7 @@16110 @@ -6269,7 +6280,7 @@ 14484 16111 * check for that. 14485 16112 */ … … 14490 16117 linecopy[curwin->w_cursor.col] = NUL; 14491 16118 16119 @@ -8522,11 +8533,25 @@ 16120 for (setsuf = p_su; *setsuf; ) 16121 { 16122 setsuflen = copy_option_part(&setsuf, suf_buf, MAXSUFLEN, ".,"); 16123 - if (fnamelen >= setsuflen 16124 - && fnamencmp(suf_buf, fname + fnamelen - setsuflen, 16125 - (size_t)setsuflen) == 0) 16126 - break; 16127 - setsuflen = 0; 16128 + if (setsuflen == 0) 16129 + { 16130 + char_u *tail = gettail(fname); 16131 + 16132 + /* empty entry: match name without a '.' */ 16133 + if (vim_strchr(tail, '.') == NULL) 16134 + { 16135 + setsuflen = 1; 16136 + break; 16137 + } 16138 + } 16139 + else 16140 + { 16141 + if (fnamelen >= setsuflen 16142 + && fnamencmp(suf_buf, fname + fnamelen - setsuflen, 16143 + (size_t)setsuflen) == 0) 16144 + break; 16145 + setsuflen = 0; 16146 + } 16147 } 16148 return (setsuflen != 0); 16149 } 16150 @@ -9188,7 +9213,7 @@ 16151 else if (vim_strpbrk(p, (char_u *)"$~") != NULL) 16152 { 16153 vim_free(p); 16154 - ga_clear(&ga); 16155 + ga_clear_strings(&ga); 16156 i = mch_expand_wildcards(num_pat, pat, num_file, file, 16157 flags); 16158 recursive = FALSE; 14492 16159 diff -Naur vim72.orig/src/misc2.c vim72/src/misc2.c 14493 16160 --- vim72.orig/src/misc2.c 2008-07-23 12:12:56.000000000 -0700 14494 +++ vim72/src/misc2.c 2009-0 6-05 14:25:06.000000000 -070016161 +++ vim72/src/misc2.c 2009-07-19 15:16:25.000000000 -0700 14495 16162 @@ -496,7 +496,8 @@ 14496 16163 { … … 14698 16365 diff -Naur vim72.orig/src/move.c vim72/src/move.c 14699 16366 --- vim72.orig/src/move.c 2008-07-12 09:26:47.000000000 -0700 14700 +++ vim72/src/move.c 2009-0 6-05 14:24:51.000000000 -070016367 +++ vim72/src/move.c 2009-07-19 15:16:14.000000000 -0700 14701 16368 @@ -280,18 +280,20 @@ 14702 16369 … … 14774 16441 diff -Naur vim72.orig/src/nbdebug.c vim72/src/nbdebug.c 14775 16442 --- vim72.orig/src/nbdebug.c 2008-06-22 08:38:58.000000000 -0700 14776 +++ vim72/src/nbdebug.c 2009-0 6-05 14:21:41.000000000 -070016443 +++ vim72/src/nbdebug.c 2009-07-19 15:13:36.000000000 -0700 14777 16444 @@ -33,7 +33,6 @@ 14778 16445 u_int nb_dlevel = 0; /* nb_debug verbosity level */ … … 14835 16502 diff -Naur vim72.orig/src/nbdebug.h vim72/src/nbdebug.h 14836 16503 --- vim72.orig/src/nbdebug.h 2008-06-22 07:31:50.000000000 -0700 14837 +++ vim72/src/nbdebug.h 2009-0 6-05 14:21:41.000000000 -070016504 +++ vim72/src/nbdebug.h 2009-07-19 15:13:36.000000000 -0700 14838 16505 @@ -43,8 +43,6 @@ 14839 16506 … … 14867 16534 diff -Naur vim72.orig/src/netbeans.c vim72/src/netbeans.c 14868 16535 --- vim72.orig/src/netbeans.c 2008-07-13 09:19:54.000000000 -0700 14869 +++ vim72/src/netbeans.c 2009-06-05 14:25:22.000000000 -0700 14870 @@ -700,7 +700,6 @@ 16536 +++ vim72/src/netbeans.c 2009-07-19 15:18:05.000000000 -0700 16537 @@ -32,6 +32,7 @@ 16538 /* WinSock API is separated from C API, thus we can't use read(), write(), 16539 * errno... */ 16540 # define sock_errno WSAGetLastError() 16541 +# undef ECONNREFUSED 16542 # define ECONNREFUSED WSAECONNREFUSED 16543 # ifdef EINTR 16544 # undef EINTR 16545 @@ -700,7 +701,6 @@ 14871 16546 /* 14872 16547 * Read and process a command from netbeans. … … 14876 16551 /* Use this one when generating prototypes, the others are static. */ 14877 16552 void 14878 @@ -708,12 +70 7,15 @@16553 @@ -708,12 +708,15 @@ 14879 16554 #else 14880 16555 # ifdef FEAT_GUI_MOTIF … … 14895 16570 #endif 14896 16571 { 14897 @@ -1043,7 +104 5,7 @@16572 @@ -1043,7 +1046,7 @@ 14898 16573 nbdebug(("EVT: %s", buf)); 14899 16574 /* nb_send(buf, "netbeans_end"); avoid "write failed" messages */ … … 14904 16579 } 14905 16580 14906 @@ -1582,7 +158 4,9 @@16581 @@ -1582,7 +1585,9 @@ 14907 16582 buf_delsign(buf->bufp, id); 14908 16583 } … … 14914 16589 14915 16590 nbdebug((" Deleting lines %d through %d\n", del_from_lnum, del_to_lnum)); 14916 @@ -1921,7 +192 5,7 @@16591 @@ -1921,7 +1926,7 @@ 14917 16592 vim_free(path); 14918 16593 if (bufp == NULL) … … 14923 16598 return FAIL; 14924 16599 } 14925 @@ -2141,7 +214 5,9 @@16600 @@ -2141,7 +2146,9 @@ 14926 16601 #endif 14927 16602 } … … 14933 16608 /* gui_update_cursor(TRUE, FALSE); */ 14934 16609 /* update_curbuf(NOT_VALID); */ 14935 @@ -2277,9 +228 3,6 @@16610 @@ -2277,9 +2284,6 @@ 14936 16611 int serNum; 14937 16612 int localTypeNum; … … 14943 16618 14944 16619 if (buf == NULL || buf->bufp == NULL) 14945 @@ -2303,13 +230 6,10 @@16620 @@ -2303,13 +2307,10 @@ 14946 16621 pos = get_off_or_lnum(buf->bufp, &args); 14947 16622 … … 14959 16634 nbdebug((" partial line annotation -- Not Yet Implemented!\n")); 14960 16635 } 14961 @@ -2321,7 +232 1,7 @@16636 @@ -2321,7 +2322,7 @@ 14962 16637 } 14963 16638 if (pos) … … 14968 16643 if (typeNum == curPCtype) 14969 16644 coloncmd(":sign jump %d buffer=%d", serNum, 14970 @@ -2425,7 +242 5,7 @@16645 @@ -2425,7 +2426,7 @@ 14971 16646 GUARDED) == 0) 14972 16647 { … … 14977 16652 buf->bufp->b_fnum); 14978 16653 } 14979 @@ -2747,11 +2747,10 @@ 16654 @@ -2582,7 +2583,7 @@ 16655 va_list ap; 16656 16657 va_start(ap, cmd); 16658 - vsprintf(buf, cmd, ap); 16659 + vim_vsnprintf(buf, sizeof(buf), cmd, ap, NULL); 16660 va_end(ap); 16661 16662 nbdebug((" COLONCMD %s\n", buf)); 16663 @@ -2747,11 +2748,10 @@ 14980 16664 * cursor and sends it to the debugger for evaluation. The debugger should 14981 16665 * respond with a showBalloon command when there is a useful result. … … 14990 16674 win_T *wp; 14991 16675 char_u *text; 14992 @@ -2924,44 +292 3,26 @@16676 @@ -2924,44 +2924,26 @@ 14993 16677 } 14994 16678 … … 15041 16725 if (nbbuf != NULL) 15042 16726 nbbuf->bufp = NULL; 15043 @@ -3082,9 +306 3,8 @@16727 @@ -3082,9 +3064,8 @@ 15044 16728 /* 15045 16729 * Send netbeans an unmodufied command. … … 15052 16736 #if 0 15053 16737 char_u buf[128]; 15054 @@ -3391,13 +337 1,12 @@16738 @@ -3391,13 +3372,12 @@ 15055 16739 * buf->signmapused[] maps buffer-local annotation IDs to an index in 15056 16740 * globalsignmap[]. … … 15069 16753 diff -Naur vim72.orig/src/normal.c vim72/src/normal.c 15070 16754 --- vim72.orig/src/normal.c 2008-07-31 13:03:08.000000000 -0700 15071 +++ vim72/src/normal.c 2009-0 6-05 14:25:15.000000000 -070016755 +++ vim72/src/normal.c 2009-07-19 15:16:33.000000000 -0700 15072 16756 @@ -183,6 +183,8 @@ 15073 16757 static void nv_cursorhold __ARGS((cmdarg_T *cap)); … … 15495 17179 diff -Naur vim72.orig/src/ops.c vim72/src/ops.c 15496 17180 --- vim72.orig/src/ops.c 2008-06-21 13:08:59.000000000 -0700 15497 +++ vim72/src/ops.c 2009-0 6-05 14:25:51.000000000 -070017181 +++ vim72/src/ops.c 2009-07-19 15:18:26.000000000 -0700 15498 17182 @@ -72,11 +72,11 @@ 15499 17183 */ … … 15805 17489 (int)y_regs[i].y_width 15806 17490 #else 15807 @@ -6258,11 +6299,20 @@ 17491 @@ -5550,6 +5591,29 @@ 17492 if (dpy != NULL && str != NULL && motion_type >= 0 17493 && len < 1024*1024 && len > 0) 17494 { 17495 +#ifdef FEAT_MBYTE 17496 + /* The CUT_BUFFER0 is supposed to always contain latin1. Convert from 17497 + * 'enc' when it is a multi-byte encoding. When 'enc' is an 8-bit 17498 + * encoding conversion usually doesn't work, so keep the text as-is. 17499 + */ 17500 + if (has_mbyte) 17501 + { 17502 + char_u *conv_str = str; 17503 + vimconv_T vc; 17504 + 17505 + vc.vc_type = CONV_NONE; 17506 + if (convert_setup(&vc, p_enc, (char_u *)"latin1") == OK) 17507 + { 17508 + conv_str = string_convert(&vc, str, (int*)&len); 17509 + if (conv_str != NULL) 17510 + { 17511 + vim_free(str); 17512 + str = conv_str; 17513 + } 17514 + convert_setup(&vc, NULL, NULL); 17515 + } 17516 + } 17517 +#endif 17518 XStoreBuffer(dpy, (char *)str, (int)len, 0); 17519 XFlush(dpy); 17520 } 17521 @@ -6258,11 +6322,20 @@ 15808 17522 15809 17523 if (VIsual_mode == Ctrl_V) … … 15826 17540 oparg.end_vcol = MAXCOL; 15827 17541 /* Swap the start, end vcol if needed */ 15828 @@ -6366,7 +64 16,7 @@17542 @@ -6366,7 +6439,7 @@ 15829 17543 { 15830 17544 getvcols(curwin, &min_pos, &max_pos, &min_pos.col, … … 15835 17549 } 15836 17550 else 15837 @@ -6374,13 +64 24,15 @@17551 @@ -6374,13 +6447,15 @@ 15838 17552 15839 17553 if (char_count_cursor == byte_count_cursor … … 15853 17567 (long)curbuf->b_ml.ml_line_count, 15854 17568 word_count_cursor, word_count, 15855 @@ -6392,20 +64 44,22 @@17569 @@ -6392,20 +6467,22 @@ 15856 17570 { 15857 17571 p = ml_get_curline(); … … 15882 17596 diff -Naur vim72.orig/src/option.c vim72/src/option.c 15883 17597 --- vim72.orig/src/option.c 2008-07-18 06:05:33.000000000 -0700 15884 +++ vim72/src/option.c 2009-0 6-05 14:25:15.000000000 -070017598 +++ vim72/src/option.c 2009-07-19 15:17:52.000000000 -0700 15885 17599 @@ -387,6 +387,9 @@ 15886 17600 char_u *def_val[2]; /* default values for variable (vi and vim) */ … … 18327 20041 18328 20042 #define PARAM_COUNT (sizeof(options) / sizeof(struct vimoption)) 20043 @@ -3984,7 +4006,7 @@ 20044 else 20045 { 20046 prefix = 1; 20047 - if (STRNCMP(arg, "no", 2) == 0) 20048 + if (STRNCMP(arg, "no", 2) == 0 && STRNCMP(arg, "novice", 6) != 0) 20049 { 20050 prefix = 0; 20051 arg += 2; 18329 20052 @@ -4119,11 +4141,23 @@ 18330 20053 && options[opt_idx].var == VAR_WIN) … … 18560 20283 return errmsg; 18561 20284 } 18562 @@ -7105,22 +7197,28 @@ 20285 @@ -6932,6 +7024,7 @@ 20286 int new_unnamed = FALSE; 20287 int new_autoselect = FALSE; 20288 int new_autoselectml = FALSE; 20289 + int new_html = FALSE; 20290 regprog_T *new_exclude_prog = NULL; 20291 char_u *errmsg = NULL; 20292 char_u *p; 20293 @@ -6955,6 +7048,11 @@ 20294 new_autoselectml = TRUE; 20295 p += 12; 20296 } 20297 + else if (STRNCMP(p, "html", 4) == 0 && (p[4] == ',' || p[4] == NUL)) 20298 + { 20299 + new_html = TRUE; 20300 + p += 4; 20301 + } 20302 else if (STRNCMP(p, "exclude:", 8) == 0 && new_exclude_prog == NULL) 20303 { 20304 p += 8; 20305 @@ -6976,6 +7074,7 @@ 20306 clip_unnamed = new_unnamed; 20307 clip_autoselect = new_autoselect; 20308 clip_autoselectml = new_autoselectml; 20309 + clip_html = new_html; 20310 vim_free(clip_exclude_prog); 20311 clip_exclude_prog = new_exclude_prog; 20312 } 20313 @@ -7105,22 +7204,28 @@ 18563 20314 curbuf->b_did_warn = FALSE; 18564 20315 … … 18596 20347 18597 20348 /* when 'bin' is set also set some other options */ 18598 @@ -7128,7 +72 26,7 @@20349 @@ -7128,7 +7233,7 @@ 18599 20350 { 18600 20351 set_options_bin(old_value, curbuf->b_p_bin, opt_flags); … … 18605 20356 } 18606 20357 18607 @@ -7279,7 +73 77,7 @@20358 @@ -7279,7 +7384,7 @@ 18608 20359 if (!value) 18609 20360 save_file_ff(curbuf); /* Buffer is unchanged */ … … 18614 20365 #ifdef FEAT_AUTOCMD 18615 20366 modified_was_set = value; 18616 @@ -7486,9 +75 84,13 @@20367 @@ -7486,9 +7591,13 @@ 18617 20368 * set. */ 18618 20369 if (STRCMP(p_enc, "utf-8") != 0) … … 18630 20381 18631 20382 # ifdef FEAT_MBYTE 18632 @@ -7714,7 +78 16,7 @@20383 @@ -7714,7 +7823,7 @@ 18633 20384 newFoldLevel(); 18634 20385 } … … 18639 20390 { 18640 20391 foldUpdateAll(curwin); 18641 @@ -7974,6 +80 76,11 @@20392 @@ -7974,6 +8083,11 @@ 18642 20393 else /* curwin->w_p_scr > curwin->w_height */ 18643 20394 curwin->w_p_scr = curwin->w_height; … … 18651 20402 { 18652 20403 errmsg = e_positive; 18653 @@ -8227,13 +83 34,13 @@20404 @@ -8227,13 +8341,13 @@ 18654 20405 { 18655 20406 if (number == 0 && string != NULL) … … 18668 20419 /* There's another character after zeros or the string 18669 20420 * is empty. In both cases, we are trying to set a 18670 @@ -8323,7 +843 0,7 @@20421 @@ -8323,7 +8437,7 @@ 18671 20422 { 18672 20423 --arg; /* put arg at the '<' */ … … 18677 20428 key = 0; 18678 20429 } 18679 @@ -9271,10 +93 78,9 @@20430 @@ -9271,10 +9385,9 @@ 18680 20431 /* 18681 20432 * Check for NULL pointers in a winopt_T and replace them with empty_option. … … 18689 20440 #ifdef FEAT_FOLDING 18690 20441 check_string_option(&wop->wo_fdi); 18691 @@ -9296,10 +940 2,9 @@20442 @@ -9296,10 +9409,9 @@ 18692 20443 /* 18693 20444 * Free the allocated memory inside a winopt_T. … … 18701 20452 #ifdef FEAT_FOLDING 18702 20453 clear_string_option(&wop->wo_fdi); 18703 @@ -9834,7 +9939,8 @@ 20454 @@ -9645,7 +9757,7 @@ 20455 } 20456 --p; 20457 } 20458 - if (STRNCMP(p, "no", 2) == 0) 20459 + if (STRNCMP(p, "no", 2) == 0 && STRNCMP(p, "novice", 6) != 0) 20460 { 20461 xp->xp_context = EXPAND_BOOL_SETTINGS; 20462 p += 2; 20463 @@ -9834,7 +9946,8 @@ 18704 20464 regmatch->rm_ic = ic; 18705 20465 if (xp->xp_context != EXPAND_BOOL_SETTINGS) … … 18711 20471 { 18712 20472 if (loop == 0) 18713 @@ -10093,25 +10 199,110 @@20473 @@ -10093,25 +10206,110 @@ 18714 20474 18715 20475 #ifdef FEAT_LANGMAP … … 18729 20489 + * langmap_entry_T. This does the same as langmap_mapchar[] for characters >= 18730 20490 + * 256. 18731 +*/20491 */ 18732 20492 +# ifdef FEAT_MBYTE 18733 20493 +/* … … 18742 20502 +static garray_T langmap_mapga; 18743 20503 +static void langmap_set_entry __ARGS((int from, int to)); 18744 + 18745 +/* 20504 20505 /* 20506 - * char_u langmap_mapchar[256]; 20507 - * Normally maps each of the 128 upper chars to an <128 ascii char; used to 20508 - * "translate" native lang chars in normal mode or some cases of 20509 - * insert mode without having to tediously switch lang mode back&forth. 18746 20510 + * Search for an entry in "langmap_mapga" for "from". If found set the "to" 18747 20511 + * field. If not found insert a new entry at the appropriate location. … … 18784 20548 + entries[0].to = to; 18785 20549 +} 18786 18787 /* 18788 - * char_u langmap_mapchar[256]; 18789 - * Normally maps each of the 128 upper chars to an <128 ascii char; used to 18790 - * "translate" native lang chars in normal mode or some cases of 18791 - * insert mode without having to tediously switch lang mode back&forth. 20550 + 20551 +/* 18792 20552 + * Apply 'langmap' to multi-byte character "c" and return the result. 18793 20553 + */ 18794 20554 + int 18795 20555 +langmap_adjust_mb(c) … … 18831 20591 18832 20592 /* 18833 @@ -10125,7 +103 16,10 @@20593 @@ -10125,7 +10323,10 @@ 18834 20594 char_u *p2; 18835 20595 int from, to; … … 18843 20603 for (p = p_langmap; p[0] != NUL; ) 18844 20604 { 18845 @@ -10175,7 +103 69,13 @@20605 @@ -10175,7 +10376,13 @@ 18846 20606 transchar(from)); 18847 20607 return; … … 18860 20620 diff -Naur vim72.orig/src/os_unix.c vim72/src/os_unix.c 18861 20621 --- vim72.orig/src/os_unix.c 2008-08-06 04:01:40.000000000 -0700 18862 +++ vim72/src/os_unix.c 2009-0 6-05 14:25:15.000000000 -070020622 +++ vim72/src/os_unix.c 2009-07-19 15:18:55.000000000 -0700 18863 20623 @@ -181,7 +181,8 @@ 18864 20624 && defined(FEAT_TITLE) && !defined(FEAT_GUI_GTK) … … 18891 20651 static int curr_tmode = TMODE_COOK; /* contains current terminal mode */ 18892 20652 18893 @@ -315,12 +319, 15@@20653 @@ -315,12 +319,32 @@ 18894 20654 {-1, "Unknown!", FALSE} 18895 20655 }; 18896 20656 20657 + int 20658 +mch_chdir(path) 20659 + char *path; 20660 +{ 20661 + if (p_verbose >= 5) 20662 + { 20663 + verbose_enter(); 20664 + smsg((char_u *)"chdir(%s)", path); 20665 + verbose_leave(); 20666 + } 20667 +# ifdef VMS 20668 + return chdir(vms_fixfilename(path)); 20669 +# else 20670 + return chdir(path); 20671 +# endif 20672 +} 20673 + 18897 20674 +/* 18898 20675 + * Write s[len] to the screen. … … 18908 20685 RealWaitForChar(read_cmd_fd, p_wd, NULL); 18909 20686 } 18910 @@ -447,10 +4 54,9 @@20687 @@ -447,10 +471,9 @@ 18911 20688 * Return total amount of memory available in Kbyte. 18912 20689 * Doesn't change when memory has been allocated. … … 18920 20697 # ifdef __EMX__ 18921 20698 return ulimit(3, 0L) >> 10; /* always 32MB? */ 18922 @@ -799,12 +8 05,11 @@20699 @@ -799,12 +822,11 @@ 18923 20700 #endif 18924 20701 … … 18934 20711 sig_winch SIGDEFARG(sigarg) 18935 20712 { 18936 @@ -816,7 +8 21,6 @@20713 @@ -816,7 +838,6 @@ 18937 20714 #endif 18938 20715 … … 18942 20719 catch_sigint SIGDEFARG(sigarg) 18943 20720 { 18944 @@ -828,7 +8 32,6 @@20721 @@ -828,7 +849,6 @@ 18945 20722 #endif 18946 20723 … … 18950 20727 catch_sigpwr SIGDEFARG(sigarg) 18951 20728 { 18952 @@ -848,7 +8 51,6 @@20729 @@ -848,7 +868,6 @@ 18953 20730 /* 18954 20731 * signal function for alarm(). … … 18958 20735 sig_alarm SIGDEFARG(sigarg) 18959 20736 { 18960 @@ -1065,19 +10 67,23 @@20737 @@ -1065,19 +1084,23 @@ 18961 20738 SIGRETURN; 18962 20739 } … … 18985 20762 sigcont_handler SIGDEFARG(sigarg) 18986 20763 { 18987 @@ -1115,15 +11 21,28 @@20764 @@ -1115,15 +1138,28 @@ 18988 20765 } 18989 20766 # endif … … 19012 20789 + */ 19013 20790 + { 19014 + long wait ;19015 + for (wait = 0; !sigcont_received && wait <= 3L; wait++)20791 + long wait_time; 20792 + for (wait_time = 0; !sigcont_received && wait_time <= 3L; wait_time++) 19016 20793 + /* Loop is not entered most of the time */ 19017 + mch_delay(wait , FALSE);20794 + mch_delay(wait_time, FALSE); 19018 20795 + } 19019 20796 # endif 19020 20797 19021 20798 # ifdef FEAT_TITLE 19022 @@ -1172,7 +1 191,7 @@20799 @@ -1172,7 +1208,7 @@ 19023 20800 #ifdef SIGTSTP 19024 20801 signal(SIGTSTP, restricted ? SIG_IGN : SIG_DFL); … … 19029 20806 #endif 19030 20807 19031 @@ -1231,7 +12 50,7 @@20808 @@ -1231,7 +1267,7 @@ 19032 20809 reset_signals() 19033 20810 { … … 19038 20815 signal(SIGCONT, SIG_DFL); 19039 20816 #endif 19040 @@ -1326,11 +13 45,10 @@20817 @@ -1326,11 +1362,10 @@ 19041 20818 /* 19042 20819 * Check_win checks whether we have an interactive stdout. … … 19052 20829 #ifdef OS2 19053 20830 /* 19054 @@ -1414,11 +14 32,10 @@20831 @@ -1414,11 +1449,10 @@ 19055 20832 /* 19056 20833 * Another X Error handler, just used to check for errors. … … 19066 20843 got_x_error = TRUE; 19067 20844 return 0; 19068 @@ -1431,15 +14 48,12 @@20845 @@ -1431,15 +1465,12 @@ 19069 20846 */ 19070 20847 static int x_IOerror_check __ARGS((Display *dpy)); … … 19083 20860 # endif 19084 20861 19085 @@ -1448,10 +14 62,9 @@20862 @@ -1448,10 +1479,9 @@ 19086 20863 */ 19087 20864 static int x_IOerror_handler __ARGS((Display *dpy)); … … 19095 20872 xterm_dpy = NULL; 19096 20873 x11_window = 0; 19097 @@ -1460,8 +14 73,6 @@20874 @@ -1460,8 +1490,6 @@ 19098 20875 19099 20876 /* This function should not return, it causes exit(). Longjump instead. */ … … 19104 20881 #endif 19105 20882 19106 @@ -1897,10 +19 08,9 @@20883 @@ -1897,10 +1925,9 @@ 19107 20884 19108 20885 #else /* FEAT_X11 */ … … 19116 20893 return FALSE; 19117 20894 } 19118 @@ -2438,7 +2448,7 @@ 20895 @@ -2414,6 +2441,12 @@ 20896 #ifdef HAVE_FCHDIR 20897 if (fd >= 0) 20898 { 20899 + if (p_verbose >= 5) 20900 + { 20901 + verbose_enter(); 20902 + MSG("fchdir() to previous dir"); 20903 + verbose_leave(); 20904 + } 20905 l = fchdir(fd); 20906 close(fd); 20907 } 20908 @@ -2438,7 +2471,7 @@ 19119 20909 } 19120 20910 … … 19125 20915 19126 20916 /* Do not append ".", "/dir/." is equal to "/dir". */ 19127 @@ -2475,11 +2 485,10 @@20917 @@ -2475,11 +2508,10 @@ 19128 20918 * file name to remain exactly the same. 19129 20919 * Only required for file systems where case is ignored and preserved. … … 19138 20928 struct stat st; 19139 20929 char_u *slash, *tail; 19140 @@ -2657,7 +26 66,7 @@20930 @@ -2657,7 +2689,7 @@ 19141 20931 */ 19142 20932 vim_acl_T … … 19147 20937 vim_acl_T ret = NULL; 19148 20938 #ifdef HAVE_POSIX_ACL 19149 @@ -2717,7 +27 26,7 @@20939 @@ -2717,7 +2749,7 @@ 19150 20940 */ 19151 20941 void … … 19156 20946 { 19157 20947 if (aclent == NULL) 19158 @@ -2760,10 +27 69,9 @@20948 @@ -2760,10 +2792,9 @@ 19159 20949 /* 19160 20950 * Set hidden flag for "name". … … 19168 20958 /* can't hide a file */ 19169 20959 } 19170 @@ -2905,7 +29 13,7 @@20960 @@ -2905,7 +2936,7 @@ 19171 20961 * Ignore any errors. 19172 20962 */ … … 19177 20967 #endif 19178 20968 } 19179 @@ -2936,7 +29 44,8 @@20969 @@ -2936,7 +2967,8 @@ 19180 20970 } 19181 20971 # endif … … 19187 20977 # ifdef FEAT_XCLIPBOARD 19188 20978 && x11_display != xterm_dpy 19189 @@ -3451,10 +34 60,9 @@20979 @@ -3451,10 +3483,9 @@ 19190 20980 /* 19191 20981 * set screen mode, always fails. … … 19199 20989 EMSG(_(e_screenmode)); 19200 20990 return FAIL; 19201 @@ -3926,9 +39 34,9 @@20991 @@ -3926,9 +3957,9 @@ 19202 20992 */ 19203 20993 if (fd >= 0) … … 19212 21002 /* Don't need this now that we've duplicated it */ 19213 21003 close(fd); 19214 @@ -3946,7 +39 54,17 @@21004 @@ -3946,7 +3977,17 @@ 19215 21005 * children can be kill()ed. Don't do this when using pipes, 19216 21006 * because stdin is not a tty, we would lose /dev/tty. */ … … 19230 21020 # ifdef FEAT_GUI 19231 21021 if (pty_slave_fd >= 0) 19232 @@ -3996,13 +40 14,13 @@21022 @@ -3996,13 +4037,13 @@ 19233 21023 19234 21024 /* set up stdin/stdout/stderr for the child */ … … 19247 21037 19248 21038 close(pty_slave_fd); /* has been dupped, close it now */ 19249 @@ -4013,13 +40 31,13 @@21039 @@ -4013,13 +4054,13 @@ 19250 21040 /* set up stdin for the child */ 19251 21041 close(fd_toshell[1]); … … 19263 21053 19264 21054 # ifdef FEAT_GUI 19265 @@ -4027,7 +40 45,7 @@21055 @@ -4027,7 +4068,7 @@ 19266 21056 { 19267 21057 /* set up stderr for the child */ … … 19272 21062 # endif 19273 21063 } 19274 @@ -4078,6 +4 096,9 @@21064 @@ -4078,6 +4119,9 @@ 19275 21065 int fromshell_fd; 19276 21066 garray_T ga; … … 19282 21072 # ifdef FEAT_GUI 19283 21073 if (pty_master_fd >= 0) 19284 @@ -4146,9 +41 67,10 @@21074 @@ -4146,9 +4190,10 @@ 19285 21075 { 19286 21076 s = vim_strchr(lp + written, NL); … … 19295 21085 /* Finished a line, add a NL, unless this line 19296 21086 * should not have one. */ 19297 @@ -4158,7 +4 180,8 @@21087 @@ -4158,7 +4203,8 @@ 19298 21088 && (lnum != 19299 21089 curbuf->b_ml.ml_line_count … … 19305 21095 if (lnum > curbuf->b_op_end.lnum) 19306 21096 { 19307 @@ -4186,7 +42 09,9 @@21097 @@ -4186,7 +4232,9 @@ 19308 21098 ga_init2(&ga, 1, BUFLEN); 19309 21099 … … 19316 21106 { 19317 21107 /* 19318 @@ -4199,25 +42 24,34 @@21108 @@ -4199,25 +4247,34 @@ 19319 21109 * that a typed password is echoed for ssh or gpg command. 19320 21110 * Don't get characters when the child has already … … 19359 21149 * For pipes: 19360 21150 * Check for CTRL-C: send interrupt signal to child. 19361 @@ -4319,9 +4353,9 @@ 21151 @@ -4271,7 +4328,8 @@ 21152 ta_buf[i] = '\n'; 21153 # ifdef FEAT_MBYTE 21154 if (has_mbyte) 21155 - i += (*mb_ptr2len)(ta_buf + i) - 1; 21156 + i += (*mb_ptr2len_len)(ta_buf + i, 21157 + ta_len + len - i) - 1; 21158 # endif 21159 } 21160 21161 @@ -4319,9 +4377,9 @@ 19362 21162 { 19363 21163 ta_len -= len; … … 19370 21170 19371 21171 if (got_int) 19372 @@ -4429,6 +44 63,25 @@21172 @@ -4429,6 +4487,25 @@ 19373 21173 out_flush(); 19374 21174 if (got_int) … … 19396 21196 19397 21197 /* If we already detected the child has finished break the 19398 @@ -4672,7 +47 25,6 @@21198 @@ -4672,7 +4749,6 @@ 19399 21199 * Returns also, when a request from Sniff is waiting -- toni. 19400 21200 * Or when a Linux GPM mouse event is waiting. … … 19404 21204 int 19405 21205 #else 19406 @@ -4681,7 +47 33,7 @@21206 @@ -4681,7 +4757,7 @@ 19407 21207 RealWaitForChar(fd, msec, check_for_gpm) 19408 21208 int fd; … … 19413 21213 int ret; 19414 21214 #if defined(FEAT_XCLIPBOARD) || defined(USE_XSMP) || defined(FEAT_MZSCHEME) 19415 @@ -5076,7 +51 28,6 @@21215 @@ -5076,7 +5152,6 @@ 19416 21216 19417 21217 #define SHELL_SPECIAL (char_u *)"\t \"&'$;<>()\\|" … … 19421 21221 mch_expand_wildcards(num_pat, pat, num_file, file, flags) 19422 21222 int num_pat; 19423 @@ -5498,7 +55 49,7 @@21223 @@ -5498,7 +5573,7 @@ 19424 21224 i = fread((char *)buffer, 1, len, fd); 19425 21225 fclose(fd); … … 19430 21230 /* unexpected read error */ 19431 21231 EMSG2(_(e_notread), tempname); 19432 @@ -5559,7 +56 10,7 @@21232 @@ -5559,7 +5634,7 @@ 19433 21233 if (shell_style == STYLE_PRINT && !did_find_nul) 19434 21234 { … … 19439 21239 else 19440 21240 check_spaces = TRUE; 19441 @@ -5851,7 +59 02,9 @@21241 @@ -5851,7 +5926,9 @@ 19442 21242 * we are going to suspend or starting an external process 19443 21243 * so we shouldn't have problem with this … … 19449 21249 } 19450 21250 if (gpm_fd == -2) 19451 @@ -6001,7 +60 54,6 @@21251 @@ -6001,7 +6078,6 @@ 19452 21252 /* 19453 21253 * Gets info from sysmouse and adds special keys to input buf. … … 19457 21257 sig_sysmouse SIGDEFARG(sigarg) 19458 21258 { 19459 @@ -6565,11 +66 17,10 @@21259 @@ -6565,11 +6641,10 @@ 19460 21260 * This is our chance to ask the user if they want to save, 19461 21261 * or abort the logout … … 19470 21270 cmdmod_T save_cmdmod; 19471 21271 int cancel_shutdown = False; 19472 @@ -6602,16 +66 53,15 @@21272 @@ -6602,16 +6677,15 @@ 19473 21273 /* 19474 21274 * Callback that starts save-yourself. … … 19491 21291 /* Handle already being in saveyourself */ 19492 21292 if (xsmp.save_yourself) 19493 @@ -6645,11 +6 695,10 @@21293 @@ -6645,11 +6719,10 @@ 19494 21294 /* 19495 21295 * Callback to warn us of imminent death. … … 19505 21305 xsmp_close(); 19506 21306 19507 @@ -6661,11 +67 10,10 @@21307 @@ -6661,11 +6734,10 @@ 19508 21308 /* 19509 21309 * Callback to tell us that save-yourself has completed. … … 19519 21319 xsmp.save_yourself = False; 19520 21320 } 19521 @@ -6675,11 +67 23,10 @@21321 @@ -6675,11 +6747,10 @@ 19522 21322 * Callback to tell us that an instigated shutdown was cancelled 19523 21323 * (maybe even by us) … … 19532 21332 if (xsmp.save_yourself) 19533 21333 SmcSaveYourselfDone(smc_conn, True); 19534 @@ -6691,13 +67 38,12 @@21334 @@ -6691,13 +6762,12 @@ 19535 21335 /* 19536 21336 * Callback to tell us that a new ICE connection has been established. … … 19548 21348 /* Intercept creation of ICE connection fd */ 19549 21349 if (opening) 19550 @@ -6814,7 +68 60,8 @@21350 @@ -6814,7 +6884,8 @@ 19551 21351 if (xsmp_icefd != -1) 19552 21352 { … … 19560 21360 diff -Naur vim72.orig/src/os_unix.h vim72/src/os_unix.h 19561 21361 --- vim72.orig/src/os_unix.h 2008-06-17 11:01:17.000000000 -0700 19562 +++ vim72/src/os_unix.h 2009-0 6-05 14:24:58.000000000 -070021362 +++ vim72/src/os_unix.h 2009-07-19 15:18:55.000000000 -0700 19563 21363 @@ -124,7 +124,7 @@ 19564 21364 # define SIGDUMMYARG 0, 0, (struct sigcontext *)0 … … 19570 21370 # endif 19571 21371 #else 21372 @@ -482,11 +482,6 @@ 21373 # else 21374 int mch_rename __ARGS((const char *src, const char *dest)); 21375 # endif 21376 -# ifdef VMS 21377 -# define mch_chdir(s) chdir(vms_fixfilename(s)) 21378 -# else 21379 -# define mch_chdir(s) chdir(s) 21380 -# endif 21381 # ifndef VMS 21382 # ifdef __MVS__ 21383 /* on OS390 Unix getenv() doesn't return a pointer to persistent 19572 21384 diff -Naur vim72.orig/src/proto/buffer.pro vim72/src/proto/buffer.pro 19573 21385 --- vim72.orig/src/proto/buffer.pro 2008-08-09 07:31:21.000000000 -0700 19574 +++ vim72/src/proto/buffer.pro 2009-0 6-05 14:24:27.000000000 -070021386 +++ vim72/src/proto/buffer.pro 2009-07-19 15:15:54.000000000 -0700 19575 21387 @@ -37,13 +37,12 @@ 19576 21388 int otherfile __ARGS((char_u *ffname)); … … 19602 21414 diff -Naur vim72.orig/src/proto/edit.pro vim72/src/proto/edit.pro 19603 21415 --- vim72.orig/src/proto/edit.pro 2008-08-09 07:31:24.000000000 -0700 19604 +++ vim72/src/proto/edit.pro 2009-0 6-05 14:24:27.000000000 -070021416 +++ vim72/src/proto/edit.pro 2009-07-19 15:15:54.000000000 -0700 19605 21417 @@ -8,7 +8,7 @@ 19606 21418 void backspace_until_column __ARGS((int col)); … … 19614 21426 diff -Naur vim72.orig/src/proto/eval.pro vim72/src/proto/eval.pro 19615 21427 --- vim72.orig/src/proto/eval.pro 2008-08-09 07:31:25.000000000 -0700 19616 +++ vim72/src/proto/eval.pro 2009-0 6-05 14:17:16.000000000 -070021428 +++ vim72/src/proto/eval.pro 2009-07-19 15:10:37.000000000 -0700 19617 21429 @@ -17,7 +17,7 @@ 19618 21430 int eval_to_bool __ARGS((char_u *arg, int *error, char_u **nextcmd, int skip)); … … 19656 21468 diff -Naur vim72.orig/src/proto/ex_cmds.pro vim72/src/proto/ex_cmds.pro 19657 21469 --- vim72.orig/src/proto/ex_cmds.pro 2008-08-09 07:31:25.000000000 -0700 19658 +++ vim72/src/proto/ex_cmds.pro 2009-0 6-05 14:24:34.000000000 -070021470 +++ vim72/src/proto/ex_cmds.pro 2009-07-19 15:16:00.000000000 -0700 19659 21471 @@ -9,9 +9,9 @@ 19660 21472 void do_bang __ARGS((int addr_count, exarg_T *eap, int forceit, int do_in, int do_out)); … … 19680 21492 diff -Naur vim72.orig/src/proto/ex_getln.pro vim72/src/proto/ex_getln.pro 19681 21493 --- vim72.orig/src/proto/ex_getln.pro 2008-08-09 07:31:28.000000000 -0700 19682 +++ vim72/src/proto/ex_getln.pro 2009-0 6-05 14:22:42.000000000 -070021494 +++ vim72/src/proto/ex_getln.pro 2009-07-19 15:14:20.000000000 -0700 19683 21495 @@ -4,6 +4,7 @@ 19684 21496 int text_locked __ARGS((void)); … … 19698 21510 int get_histtype __ARGS((char_u *name)); 19699 21511 void add_to_history __ARGS((int histype, char_u *new_entry, int in_map, int sep)); 21512 diff -Naur vim72.orig/src/proto/gui.pro vim72/src/proto/gui.pro 21513 --- vim72.orig/src/proto/gui.pro 2008-08-09 07:31:56.000000000 -0700 21514 +++ vim72/src/proto/gui.pro 2009-07-19 15:17:39.000000000 -0700 21515 @@ -43,6 +43,7 @@ 21516 void gui_create_scrollbar __ARGS((scrollbar_T *sb, int type, win_T *wp)); 21517 scrollbar_T *gui_find_scrollbar __ARGS((long ident)); 21518 void gui_drag_scrollbar __ARGS((scrollbar_T *sb, long value, int still_dragging)); 21519 +void gui_may_update_scrollbars __ARGS((void)); 21520 void gui_update_scrollbars __ARGS((int force)); 21521 int gui_do_scroll __ARGS((void)); 21522 int gui_do_horiz_scroll __ARGS((void)); 19700 21523 diff -Naur vim72.orig/src/proto/if_cscope.pro vim72/src/proto/if_cscope.pro 19701 21524 --- vim72.orig/src/proto/if_cscope.pro 2008-08-09 07:31:33.000000000 -0700 19702 +++ vim72/src/proto/if_cscope.pro 2009-0 6-05 14:23:53.000000000 -070021525 +++ vim72/src/proto/if_cscope.pro 2009-07-19 15:15:24.000000000 -0700 19703 21526 @@ -1,4 +1,6 @@ 19704 21527 /* if_cscope.c */ … … 19710 21533 diff -Naur vim72.orig/src/proto/mark.pro vim72/src/proto/mark.pro 19711 21534 --- vim72.orig/src/proto/mark.pro 2008-08-09 07:31:36.000000000 -0700 19712 +++ vim72/src/proto/mark.pro 2009-0 6-05 14:16:09.000000000 -070021535 +++ vim72/src/proto/mark.pro 2009-07-19 15:09:53.000000000 -0700 19713 21536 @@ -26,5 +26,5 @@ 19714 21537 void write_viminfo_filemarks __ARGS((FILE *fp)); … … 19718 21541 +void copy_viminfo_marks __ARGS((vir_T *virp, FILE *fp_out, int count, int eof, int flags)); 19719 21542 /* vim: set ft=c : */ 21543 diff -Naur vim72.orig/src/proto/mbyte.pro vim72/src/proto/mbyte.pro 21544 --- vim72.orig/src/proto/mbyte.pro 2008-08-09 07:31:41.000000000 -0700 21545 +++ vim72/src/proto/mbyte.pro 2009-07-19 15:17:30.000000000 -0700 21546 @@ -7,10 +7,12 @@ 21547 int latin_char2len __ARGS((int c)); 21548 int latin_char2bytes __ARGS((int c, char_u *buf)); 21549 int latin_ptr2len __ARGS((char_u *p)); 21550 +int latin_ptr2len_len __ARGS((char_u *p, int size)); 21551 int utf_char2cells __ARGS((int c)); 21552 int latin_ptr2cells __ARGS((char_u *p)); 21553 int utf_ptr2cells __ARGS((char_u *p)); 21554 int dbcs_ptr2cells __ARGS((char_u *p)); 21555 +int latin_ptr2cells_len __ARGS((char_u *p, int size)); 21556 int latin_char2cells __ARGS((int c)); 21557 int latin_off2cells __ARGS((unsigned off, unsigned max_off)); 21558 int dbcs_off2cells __ARGS((unsigned off, unsigned max_off)); 21559 @@ -85,6 +87,7 @@ 21560 int preedit_get_status __ARGS((void)); 21561 int im_is_preediting __ARGS((void)); 21562 int convert_setup __ARGS((vimconv_T *vcp, char_u *from, char_u *to)); 21563 +int convert_setup_ext __ARGS((vimconv_T *vcp, char_u *from, int from_unicode_is_utf8, char_u *to, int to_unicode_is_utf8)); 21564 int convert_input __ARGS((char_u *ptr, int len, int maxlen)); 21565 int convert_input_safe __ARGS((char_u *ptr, int len, int maxlen, char_u **restp, int *restlenp)); 21566 char_u *string_convert __ARGS((vimconv_T *vcp, char_u *ptr, int *lenp)); 19720 21567 diff -Naur vim72.orig/src/proto/message.pro vim72/src/proto/message.pro 19721 21568 --- vim72.orig/src/proto/message.pro 2008-08-09 07:31:39.000000000 -0700 19722 +++ vim72/src/proto/message.pro 2009-0 6-05 14:23:41.000000000 -070021569 +++ vim72/src/proto/message.pro 2009-07-19 15:15:14.000000000 -0700 19723 21570 @@ -54,6 +54,7 @@ 19724 21571 void msg_clr_cmdline __ARGS((void)); … … 19731 21578 diff -Naur vim72.orig/src/proto/misc2.pro vim72/src/proto/misc2.pro 19732 21579 --- vim72.orig/src/proto/misc2.pro 2008-08-09 07:31:40.000000000 -0700 19733 +++ vim72/src/proto/misc2.pro 2009-0 6-05 14:19:07.000000000 -070021580 +++ vim72/src/proto/misc2.pro 2009-07-19 15:11:46.000000000 -0700 19734 21581 @@ -59,7 +59,7 @@ 19735 21582 int handle_x_keys __ARGS((int key)); … … 19743 21590 diff -Naur vim72.orig/src/proto/netbeans.pro vim72/src/proto/netbeans.pro 19744 21591 --- vim72.orig/src/proto/netbeans.pro 2008-08-09 07:31:56.000000000 -0700 19745 +++ vim72/src/proto/netbeans.pro 2009-0 6-05 14:19:24.000000000 -070021592 +++ vim72/src/proto/netbeans.pro 2009-07-19 15:12:02.000000000 -0700 19746 21593 @@ -11,7 +11,7 @@ 19747 21594 void netbeans_frame_moved __ARGS((int new_x, int new_y)); … … 19755 21602 diff -Naur vim72.orig/src/proto/option.pro vim72/src/proto/option.pro 19756 21603 --- vim72.orig/src/proto/option.pro 2008-08-09 07:31:43.000000000 -0700 19757 +++ vim72/src/proto/option.pro 2009-0 6-05 14:21:21.000000000 -070021604 +++ vim72/src/proto/option.pro 2009-07-19 15:13:20.000000000 -0700 19758 21605 @@ -44,6 +44,7 @@ 19759 21606 void set_context_in_set_cmd __ARGS((expand_T *xp, char_u *arg, int opt_flags)); … … 19764 21611 int shortmess __ARGS((int x)); 19765 21612 void vimrc_found __ARGS((char_u *fname, char_u *envname)); 21613 diff -Naur vim72.orig/src/proto/os_unix.pro vim72/src/proto/os_unix.pro 21614 --- vim72.orig/src/proto/os_unix.pro 2008-08-09 07:31:44.000000000 -0700 21615 +++ vim72/src/proto/os_unix.pro 2009-07-19 15:18:55.000000000 -0700 21616 @@ -1,4 +1,5 @@ 21617 /* os_unix.c */ 21618 +int mch_chdir __ARGS((char *path)); 21619 void mch_write __ARGS((char_u *s, int len)); 21620 int mch_inchar __ARGS((char_u *buf, int maxlen, long wtime, int tb_change_cnt)); 21621 int mch_char_avail __ARGS((void)); 19766 21622 diff -Naur vim72.orig/src/proto/spell.pro vim72/src/proto/spell.pro 19767 21623 --- vim72.orig/src/proto/spell.pro 2008-08-09 07:31:48.000000000 -0700 19768 +++ vim72/src/proto/spell.pro 2009-0 6-05 14:24:34.000000000 -070021624 +++ vim72/src/proto/spell.pro 2009-07-19 15:16:00.000000000 -0700 19769 21625 @@ -22,5 +22,5 @@ 19770 21626 char_u *spell_to_word_end __ARGS((char_u *start, buf_T *buf)); … … 19774 21630 +int expand_spelling __ARGS((linenr_T lnum, char_u *pat, char_u ***matchp)); 19775 21631 /* vim: set ft=c : */ 21632 diff -Naur vim72.orig/src/proto/ui.pro vim72/src/proto/ui.pro 21633 --- vim72.orig/src/proto/ui.pro 2008-08-09 07:31:52.000000000 -0700 21634 +++ vim72/src/proto/ui.pro 2009-07-19 15:18:26.000000000 -0700 21635 @@ -48,6 +48,7 @@ 21636 void open_app_context __ARGS((void)); 21637 void x11_setup_atoms __ARGS((Display *dpy)); 21638 void clip_x11_request_selection __ARGS((Widget myShell, Display *dpy, VimClipboard *cbd)); 21639 +void yank_cut_buffer0 __ARGS((Display *dpy, VimClipboard *cbd)); 21640 void clip_x11_lose_selection __ARGS((Widget myShell, VimClipboard *cbd)); 21641 int clip_x11_own_selection __ARGS((Widget myShell, VimClipboard *cbd)); 21642 void clip_x11_set_selection __ARGS((VimClipboard *cbd)); 21643 diff -Naur vim72.orig/src/proto/window.pro vim72/src/proto/window.pro 21644 --- vim72.orig/src/proto/window.pro 2008-08-09 07:31:54.000000000 -0700 21645 +++ vim72/src/proto/window.pro 2009-07-19 15:18:10.000000000 -0700 21646 @@ -1,6 +1,7 @@ 21647 /* window.c */ 21648 void do_window __ARGS((int nchar, long Prenum, int xchar)); 21649 int win_split __ARGS((int size, int flags)); 21650 +int win_split_ins __ARGS((int size, int flags, win_T *newwin, int dir)); 21651 int win_valid __ARGS((win_T *win)); 21652 int win_count __ARGS((void)); 21653 int make_windows __ARGS((int count, int vertical)); 21654 @@ -10,9 +11,12 @@ 21655 void win_close __ARGS((win_T *win, int free_buf)); 21656 void win_close_othertab __ARGS((win_T *win, int free_buf, tabpage_T *tp)); 21657 void win_free_all __ARGS((void)); 21658 +win_T *winframe_remove __ARGS((win_T *win, int *dirp, tabpage_T *tp)); 21659 void close_others __ARGS((int message, int forceit)); 21660 void curwin_init __ARGS((void)); 21661 +void win_init_empty __ARGS((win_T *wp)); 21662 int win_alloc_first __ARGS((void)); 21663 +void win_alloc_aucmd_win __ARGS((void)); 21664 void win_init_size __ARGS((void)); 21665 void free_tabpage __ARGS((tabpage_T *tp)); 21666 int win_new_tabpage __ARGS((int after)); 21667 @@ -30,6 +34,8 @@ 21668 void win_enter __ARGS((win_T *wp, int undo_sync)); 21669 win_T *buf_jump_open_win __ARGS((buf_T *buf)); 21670 win_T *buf_jump_open_tab __ARGS((buf_T *buf)); 21671 +void win_append __ARGS((win_T *after, win_T *wp)); 21672 +void win_remove __ARGS((win_T *wp, tabpage_T *tp)); 21673 int win_alloc_lines __ARGS((win_T *wp)); 21674 void win_free_lsize __ARGS((win_T *wp)); 21675 void shell_new_rows __ARGS((void)); 21676 @@ -58,6 +64,8 @@ 21677 int min_rows __ARGS((void)); 21678 int only_one_window __ARGS((void)); 21679 void check_lnums __ARGS((int do_curwin)); 21680 +void make_snapshot __ARGS((int idx)); 21681 +void restore_snapshot __ARGS((int idx, int close_curwin)); 21682 int win_hasvertsplit __ARGS((void)); 21683 int match_add __ARGS((win_T *wp, char_u *grp, char_u *pat, int prio, int id)); 21684 int match_delete __ARGS((win_T *wp, int id, int perr)); 19776 21685 diff -Naur vim72.orig/src/pty.c vim72/src/pty.c 19777 21686 --- vim72.orig/src/pty.c 2008-06-21 11:52:58.000000000 -0700 19778 +++ vim72/src/pty.c 2009-0 6-05 14:13:54.000000000 -070021687 +++ vim72/src/pty.c 2009-07-19 15:08:34.000000000 -0700 19779 21688 @@ -270,9 +270,10 @@ 19780 21689 } … … 19792 21701 diff -Naur vim72.orig/src/quickfix.c vim72/src/quickfix.c 19793 21702 --- vim72.orig/src/quickfix.c 2008-07-18 05:53:02.000000000 -0700 19794 +++ vim72/src/quickfix.c 2009-0 6-05 14:25:15.000000000 -070021703 +++ vim72/src/quickfix.c 2009-07-19 15:18:10.000000000 -0700 19795 21704 @@ -1419,6 +1419,7 @@ 19796 21705 int opened_window = FALSE; … … 19941 21850 } 19942 21851 line_breakcheck(); 21852 @@ -3397,14 +3406,15 @@ 21853 /* Init the options. */ 21854 buf_copy_options(newbuf, BCO_ENTER | BCO_NOHELP); 21855 21856 - /* set curwin/curbuf to buf and save a few things */ 21857 - aucmd_prepbuf(&aco, newbuf); 21858 + /* need to open the memfile before putting the buffer in a window */ 21859 + if (ml_open(newbuf) == OK) 21860 + { 21861 + /* set curwin/curbuf to buf and save a few things */ 21862 + aucmd_prepbuf(&aco, newbuf); 21863 21864 - /* Need to set the filename for autocommands. */ 21865 - (void)setfname(curbuf, fname, NULL, FALSE); 21866 + /* Need to set the filename for autocommands. */ 21867 + (void)setfname(curbuf, fname, NULL, FALSE); 21868 21869 - if (ml_open(curbuf) == OK) 21870 - { 21871 /* Create swap file now to avoid the ATTENTION message. */ 21872 check_need_swap(TRUE); 21873 21874 @@ -3427,10 +3437,10 @@ 21875 newbuf = curbuf; 21876 } 21877 } 21878 - } 21879 21880 - /* restore curwin/curbuf and a few other things */ 21881 - aucmd_restbuf(&aco); 21882 + /* restore curwin/curbuf and a few other things */ 21883 + aucmd_restbuf(&aco); 21884 + } 21885 21886 if (!buf_valid(newbuf)) 21887 return NULL; 19943 21888 diff -Naur vim72.orig/src/regexp.c vim72/src/regexp.c 19944 21889 --- vim72.orig/src/regexp.c 2008-08-07 12:58:50.000000000 -0700 19945 +++ vim72/src/regexp.c 2009-0 6-05 14:24:51.000000000 -070021890 +++ vim72/src/regexp.c 2009-07-19 15:16:14.000000000 -0700 19946 21891 @@ -471,7 +471,7 @@ 19947 21892 … … 20003 21948 diff -Naur vim72.orig/src/screen.c vim72/src/screen.c 20004 21949 --- vim72.orig/src/screen.c 2008-07-24 07:45:07.000000000 -0700 20005 +++ vim72/src/screen.c 2009-0 6-05 14:25:15.000000000 -070021950 +++ vim72/src/screen.c 2009-07-19 15:17:49.000000000 -0700 20006 21951 @@ -270,11 +270,10 @@ 20007 21952 * Note that when also inserting/deleting lines w_redraw_top and w_redraw_bot … … 20194 22139 * and for some xterms. */ 20195 22140 if ( 20196 @@ -6076,7 +6096,7 @@ 22141 @@ -5723,6 +5743,13 @@ 22142 int fillchar; 22143 int attr; 22144 int this_ru_col; 22145 + static int busy = FALSE; 22146 + 22147 + /* It's possible to get here recursively when 'statusline' (indirectly) 22148 + * invokes ":redrawstatus". Simply ignore the call then. */ 22149 + if (busy) 22150 + return; 22151 + busy = TRUE; 22152 22153 wp->w_redr_status = FALSE; 22154 if (wp->w_status_height == 0) 22155 @@ -5861,6 +5888,7 @@ 22156 attr); 22157 } 22158 #endif 22159 + busy = FALSE; 22160 } 22161 22162 #ifdef FEAT_STL_OPT 22163 @@ -6076,7 +6104,7 @@ 20197 22164 fillchar, maxwidth, hltab, tabtab); 20198 22165 len = (int)STRLEN(buf); … … 20203 22170 #ifdef FEAT_MBYTE 20204 22171 len += (*mb_char2bytes)(fillchar, buf + len); 20205 @@ -6263,9 +62 83,15 @@22172 @@ -6263,9 +6291,15 @@ 20206 22173 int pcc[MAX_MCO]; 20207 22174 # endif … … 20219 22186 #ifdef FEAT_MBYTE 20220 22187 /* When drawing over the right halve of a double-wide char clear out the 20221 @@ -6275,10 +630 1,21 @@22188 @@ -6275,10 +6309,21 @@ 20222 22189 && !gui.in_use 20223 22190 # endif … … 20243 22210 max_off = LineOffset[row] + screen_Columns; 20244 22211 #endif 20245 @@ -6342,7 +63 79,12 @@22212 @@ -6342,7 +6387,12 @@ 20246 22213 } 20247 22214 #endif … … 20257 22224 || (mbyte_cells == 2 20258 22225 && ScreenLines[off + 1] != (enc_dbcs ? ptr[1] : 0)) 20259 @@ -6350,24 +6 392,24 @@22226 @@ -6350,24 +6400,24 @@ 20260 22227 && c == 0x8e 20261 22228 && ScreenLines2[off] != ptr[1]) … … 20291 22258 gui.in_use 20292 22259 # endif 20293 @@ -6377,23 +64 19,14 @@22260 @@ -6377,23 +6427,14 @@ 20294 22261 # ifdef UNIX 20295 22262 term_is_xterm … … 20321 22288 #endif 20322 22289 #ifdef FEAT_MBYTE 20323 @@ -6480,6 +65 13,20 @@22290 @@ -6480,6 +6521,20 @@ 20324 22291 ++ptr; 20325 22292 } … … 20342 22309 20343 22310 #ifdef FEAT_SEARCH_EXTRA 20344 @@ -7356,7 +74 03,11 @@22311 @@ -7356,7 +7411,11 @@ 20345 22312 #endif 20346 22313 static int entered = FALSE; /* avoid recursiveness */ … … 20354 22321 * Allocation of the screen buffers is done only when the size changes and 20355 22322 * when Rows and Columns have been set and we have started doing full 20356 @@ -7440,10 +749 1,13@@22323 @@ -7440,10 +7499,17 @@ 20357 22324 { 20358 22325 outofmem = TRUE; … … 20363 22330 } 20364 22331 } 22332 +#ifdef FEAT_AUTOCMD 22333 + if (aucmd_win != NULL && win_alloc_lines(aucmd_win) == FAIL) 22334 + outofmem = TRUE; 22335 +#endif 20365 22336 +#ifdef FEAT_WINDOWS 20366 22337 +give_up: … … 20369 22340 #ifdef FEAT_MBYTE 20370 22341 for (i = 0; i < p_mco; ++i) 20371 @@ -7628,8 +76 82,17 @@22342 @@ -7628,8 +7694,17 @@ 20372 22343 --RedrawingDisabled; 20373 22344 … … 20388 22359 } 20389 22360 20390 @@ -8590,7 +86 53,6 @@22361 @@ -8590,7 +8665,6 @@ 20391 22362 * 20392 22363 * Return OK for success, FAIL if the lines are not deleted. … … 20396 22367 screen_del_lines(off, row, line_count, end, force, wp) 20397 22368 int off; 20398 @@ -8598,7 +86 60,7 @@22369 @@ -8598,7 +8672,7 @@ 20399 22370 int line_count; 20400 22371 int end; … … 20405 22376 int j; 20406 22377 int i; 20407 @@ -9416,13 +94 78,15 @@22378 @@ -9416,13 +9490,15 @@ 20408 22379 win_T *wp; 20409 22380 int always; … … 20422 22393 #ifdef FEAT_VERTSPLIT 20423 22394 int this_ru_col; 20424 @@ -9537,11 +96 01,12 @@22395 @@ -9537,11 +9613,12 @@ 20425 22396 * Some sprintfs return the length, some return a pointer. 20426 22397 * To avoid portability problems we use strlen() here. … … 20437 22408 (int)virtcol + 1); 20438 22409 20439 @@ -9551,7 +96 16,7 @@22410 @@ -9551,7 +9628,7 @@ 20440 22411 * screen up on some terminals). 20441 22412 */ … … 20446 22417 #ifdef FEAT_WINDOWS 20447 22418 if (wp->w_status_height == 0) /* can't use last char of screen */ 20448 @@ -9578,7 +96 43,7 @@22419 @@ -9578,7 +9655,7 @@ 20449 22420 buffer[i++] = fillchar; 20450 22421 ++o; … … 20457 22428 diff -Naur vim72.orig/src/search.c vim72/src/search.c 20458 22429 --- vim72.orig/src/search.c 2008-07-13 11:18:27.000000000 -0700 20459 +++ vim72/src/search.c 2009-0 6-05 14:25:15.000000000 -070022430 +++ vim72/src/search.c 2009-07-19 15:16:33.000000000 -0700 20460 22431 @@ -345,6 +345,15 @@ 20461 22432 { … … 20598 22569 diff -Naur vim72.orig/src/spell.c vim72/src/spell.c 20599 22570 --- vim72.orig/src/spell.c 2008-07-12 12:20:55.000000000 -0700 20600 +++ vim72/src/spell.c 2009-0 6-05 14:25:15.000000000 -070022571 +++ vim72/src/spell.c 2009-07-19 15:16:33.000000000 -0700 20601 22572 @@ -77,7 +77,7 @@ 20602 22573 … … 21550 23521 diff -Naur vim72.orig/src/structs.h vim72/src/structs.h 21551 23522 --- vim72.orig/src/structs.h 2008-07-30 13:02:50.000000000 -0700 21552 +++ vim72/src/structs.h 2009-0 6-05 14:24:58.000000000 -070023523 +++ vim72/src/structs.h 2009-07-19 15:18:36.000000000 -0700 21553 23524 @@ -16,7 +16,7 @@ 21554 23525 */ … … 21581 23552 # endif 21582 23553 # ifdef FEAT_WINDOWS 21583 @@ -1166,7 +1166,8 @@ 23554 @@ -882,6 +882,8 @@ 23555 { 23556 typebuf_T save_typebuf; 23557 int typebuf_valid; /* TRUE when save_typebuf valid */ 23558 + int old_char; 23559 + int old_mod_mask; 23560 struct buffheader save_stuffbuff; 23561 #ifdef USE_INPUT_BUF 23562 char_u *save_inputbuf; 23563 @@ -1166,7 +1168,8 @@ 21584 23564 char_u *b_fname; /* current file name */ 21585 23565 … … 21591 23571 #endif 21592 23572 #ifdef FEAT_CW_EDITOR 21593 @@ -1784,10 +1785,15 @@ 23573 @@ -1620,6 +1623,14 @@ 23574 }; 23575 #endif 23576 23577 +#define SNAP_HELP_IDX 0 23578 +#ifdef FEAT_AUTOCMD 23579 +# define SNAP_AUCMD_IDX 1 23580 +# define SNAP_COUNT 2 23581 +#else 23582 +# define SNAP_COUNT 1 23583 +#endif 23584 + 23585 /* 23586 * Tab pages point to the top frame of each tab page. 23587 * Note: Most values are NOT valid for the current tab page! Use "curwin", 23588 @@ -1648,7 +1659,7 @@ 23589 buf_T *(tp_diffbuf[DB_COUNT]); 23590 int tp_diff_invalid; /* list of diffs is outdated */ 23591 #endif 23592 - frame_T *tp_snapshot; /* window layout snapshot */ 23593 + frame_T *(tp_snapshot[SNAP_COUNT]); /* window layout snapshots */ 23594 #ifdef FEAT_EVAL 23595 dictitem_T tp_winvar; /* variable for "t:" Dictionary */ 23596 dict_T tp_vars; /* internal variables, local to tab page */ 23597 @@ -1784,10 +1795,15 @@ 21594 23598 #endif 21595 23599 … … 21608 23612 int w_topfill; /* number of filler lines above w_topline */ 21609 23613 int w_old_topfill; /* w_topfill at last redraw */ 23614 @@ -2270,16 +2286,11 @@ 23615 */ 23616 typedef struct 23617 { 23618 - buf_T *save_buf; /* saved curbuf */ 23619 + buf_T *save_curbuf; /* saved curbuf */ 23620 #ifdef FEAT_AUTOCMD 23621 - buf_T *new_curbuf; /* buffer to be used */ 23622 - win_T *save_curwin; /* saved curwin, NULL if it didn't change */ 23623 - win_T *new_curwin; /* new curwin if save_curwin != NULL */ 23624 - pos_T save_cursor; /* saved cursor pos of save_curwin */ 23625 - linenr_T save_topline; /* saved topline of save_curwin */ 23626 -# ifdef FEAT_DIFF 23627 - int save_topfill; /* saved topfill of save_curwin */ 23628 -# endif 23629 + win_T *save_curwin; /* saved curwin */ 23630 + win_T *new_curwin; /* new curwin */ 23631 + buf_T *new_curbuf; /* new curbuf */ 23632 #endif 23633 } aco_save_T; 23634 21610 23635 diff -Naur vim72.orig/src/syntax.c vim72/src/syntax.c 21611 23636 --- vim72.orig/src/syntax.c 2008-08-08 14:47:48.000000000 -0700 21612 +++ vim72/src/syntax.c 2009-0 6-05 14:25:15.000000000 -070023637 +++ vim72/src/syntax.c 2009-07-19 15:16:33.000000000 -0700 21613 23638 @@ -3224,11 +3224,10 @@ 21614 23639 /* … … 21798 23823 diff -Naur vim72.orig/src/tag.c vim72/src/tag.c 21799 23824 --- vim72.orig/src/tag.c 2008-07-16 14:31:30.000000000 -0700 21800 +++ vim72/src/tag.c 2009-0 6-05 14:25:15.000000000 -070023825 +++ vim72/src/tag.c 2009-07-19 15:16:33.000000000 -0700 21801 23826 @@ -100,7 +100,7 @@ 21802 23827 * Tag for preview window is remembered separately, to avoid messing up the … … 21972 23997 diff -Naur vim72.orig/src/term.c vim72/src/term.c 21973 23998 --- vim72.orig/src/term.c 2008-07-27 04:48:06.000000000 -0700 21974 +++ vim72/src/term.c 2009-0 6-05 14:25:15.000000000 -070023999 +++ vim72/src/term.c 2009-07-19 15:17:27.000000000 -0700 21975 24000 @@ -2906,7 +2906,7 @@ 21976 24001 int i; … … 22008 24033 { 22009 24034 string[new_slen++] = K_SPECIAL; 24035 @@ -5547,7 +5555,7 @@ 24036 * respects the current B/k/< settings of 'cpoption'. 24037 * 24038 * This function is called when expanding mappings/abbreviations on the 24039 - * command-line, and for building the "Ambiguous mapping..." error messæge. 24040 + * command-line, and for building the "Ambiguous mapping..." error message. 24041 * 24042 * It uses a growarray to build the translation string since the 24043 * latter can be wider than the original description. The caller has to 22010 24044 diff -Naur vim72.orig/src/testdir/Makefile vim72/src/testdir/Makefile 22011 24045 --- vim72.orig/src/testdir/Makefile 2008-06-19 13:29:46.000000000 -0700 22012 +++ vim72/src/testdir/Makefile 2009-06-05 14:22:57.000000000 -0700 22013 @@ -20,21 +20,23 @@ 24046 +++ vim72/src/testdir/Makefile 2009-07-19 15:18:15.000000000 -0700 24047 @@ -4,9 +4,11 @@ 24048 24049 VIMPROG = ../vim 24050 24051 -# Uncomment this line for using valgrind. 24052 -# The output goes into a file "valgrind.$PID" (sorry, no test number). 24053 -# VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=15 --logfile=valgrind 24054 +# Uncomment this line to use valgrind for memory leaks and extra warnings. 24055 +# The output goes into a file "valgrind.testN" 24056 +# Vim should be compiled with EXITFREE to avoid false warnings. 24057 +# This will make testing about 10 times as slow. 24058 +# VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=15 --log-file=valgrind.$* 24059 24060 SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \ 24061 test7.out test8.out test9.out test10.out test11.out \ 24062 @@ -20,21 +22,23 @@ 22014 24063 test48.out test49.out test51.out test52.out test53.out \ 22015 24064 test54.out test55.out test56.out test57.out test58.out \ … … 22043 24092 $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG) 22044 24093 22045 @@ -71,4 +7 3,4 @@24094 @@ -71,4 +75,4 @@ 22046 24095 test60.out: test60.vim 22047 24096 … … 22051 24100 diff -Naur vim72.orig/src/testdir/Make_ming.mak vim72/src/testdir/Make_ming.mak 22052 24101 --- vim72.orig/src/testdir/Make_ming.mak 1969-12-31 16:00:00.000000000 -0800 22053 +++ vim72/src/testdir/Make_ming.mak 2009-0 6-05 14:15:34.000000000 -070024102 +++ vim72/src/testdir/Make_ming.mak 2009-07-19 15:09:28.000000000 -0700 22054 24103 @@ -0,0 +1,91 @@ 22055 24104 +# Makefile to run tests for Vim, on Dos-like machines … … 22146 24195 diff -Naur vim72.orig/src/testdir/test42.ok vim72/src/testdir/test42.ok 22147 24196 --- vim72.orig/src/testdir/test42.ok 2008-02-20 04:27:37.000000000 -0800 22148 +++ vim72/src/testdir/test42.ok 2009-0 6-05 14:16:16.000000000 -070024197 +++ vim72/src/testdir/test42.ok 2009-07-19 15:09:58.000000000 -0700 22149 24198 @@ -20,7 +20,7 @@ 22150 24199 ucs-2 … … 22158 24207 diff -Naur vim72.orig/src/testdir/test66.in vim72/src/testdir/test66.in 22159 24208 --- vim72.orig/src/testdir/test66.in 1969-12-31 16:00:00.000000000 -0800 22160 +++ vim72/src/testdir/test66.in 2009-0 6-05 14:22:57.000000000 -070024209 +++ vim72/src/testdir/test66.in 2009-07-19 15:14:34.000000000 -0700 22161 24210 @@ -0,0 +1,25 @@ 22162 24211 + … … 22187 24236 diff -Naur vim72.orig/src/testdir/test66.ok vim72/src/testdir/test66.ok 22188 24237 --- vim72.orig/src/testdir/test66.ok 1969-12-31 16:00:00.000000000 -0800 22189 +++ vim72/src/testdir/test66.ok 2009-0 6-05 14:22:57.000000000 -070024238 +++ vim72/src/testdir/test66.ok 2009-07-19 15:14:34.000000000 -0700 22190 24239 @@ -0,0 +1,10 @@ 22191 24240 + abcdefghijklmnopqrstuvwxyz … … 22201 24250 diff -Naur vim72.orig/src/ui.c vim72/src/ui.c 22202 24251 --- vim72.orig/src/ui.c 2008-07-14 11:14:56.000000000 -0700 22203 +++ vim72/src/ui.c 2009-0 6-05 14:25:15.000000000 -070024252 +++ vim72/src/ui.c 2009-07-19 15:18:26.000000000 -0700 22204 24253 @@ -320,10 +320,9 @@ 22205 24254 * The gui_set_shellsize() or mch_set_shellsize() function will try to set the … … 22278 24327 &text_list, &n_text); 22279 24328 if (status != Success || n_text < 1) 22280 @@ -2110,6 +2106,8 @@ 24329 @@ -2108,8 +2104,8 @@ 24330 Atom type; 24331 static int success; 22281 24332 int i; 22282 22283 24333 - int nbytes = 0; 24334 - char_u *buffer; 22284 24335 + time_t start_time; 22285 24336 + int timed_out = FALSE; … … 22287 24338 for (i = 22288 24339 #ifdef FEAT_MBYTE 22289 @@ -2129,6 +212 7,7 @@24340 @@ -2129,6 +2125,7 @@ 22290 24341 case 3: type = text_atom; break; 22291 24342 default: type = XA_STRING; … … 22295 24346 clip_x11_request_selection_cb, (XtPointer)&success, CurrentTime); 22296 24347 22297 @@ -2141, 27 +2140,48@@24348 @@ -2141,47 +2138,59 @@ 22298 24349 * characters, then they will appear before the one that requested the 22299 24350 * paste! Don't worry, we will catch up with any other events later. … … 22356 24407 22357 24408 /* Final fallback position - use the X CUT_BUFFER0 store */ 22358 @@ -2178,10 +2198,9 @@ 24409 - buffer = (char_u *)XFetchBuffer(dpy, &nbytes, 0); 24410 - if (nbytes > 0) 24411 - { 24412 - /* Got something */ 24413 - clip_yank_selection(MCHAR, buffer, (long)nbytes, cbd); 24414 - XFree((void *)buffer); 24415 - if (p_verbose > 0) 24416 - verb_msg((char_u *)_("Used CUT_BUFFER0 instead of empty selection")); 24417 - } 24418 + yank_cut_buffer0(dpy, cbd); 24419 } 22359 24420 22360 24421 static Boolean clip_x11_convert_selection_cb __ARGS((Widget, Atom *, Atom *, Atom *, XtPointer *, long_u *, int *)); … … 22368 24429 Atom *target; 22369 24430 Atom *type; 22370 @@ -2308,10 +23 27,9 @@24431 @@ -2308,10 +2317,9 @@ 22371 24432 22372 24433 static void clip_x11_lose_ownership_cb __ARGS((Widget, Atom *)); … … 22380 24441 { 22381 24442 if (*sel_atom == clip_plus.sel_atom) 22382 @@ -2344,1 0 +2362,9@@24443 @@ -2344,14 +2352,67 @@ 22383 24444 * Send the current selection to the clipboard. Do nothing for X because we 22384 24445 * will fill in the selection only when requested by another app. … … 22392 24453 } 22393 24454 #endif 22394 @@ -2898,11 +2915,10 @@ 24455 24456 +#if defined(FEAT_XCLIPBOARD) || defined(FEAT_GUI_X11) \ 24457 + || defined(FEAT_GUI_GTK) || defined(PROTO) 24458 +/* 24459 + * Get the contents of the X CUT_BUFFER0 and put it in "cbd". 24460 + */ 24461 + void 24462 +yank_cut_buffer0(dpy, cbd) 24463 + Display *dpy; 24464 + VimClipboard *cbd; 24465 +{ 24466 + int nbytes = 0; 24467 + char_u *buffer = (char_u *)XFetchBuffer(dpy, &nbytes, 0); 24468 + 24469 + if (nbytes > 0) 24470 + { 24471 +#ifdef FEAT_MBYTE 24472 + int done = FALSE; 24473 + 24474 + /* CUT_BUFFER0 is supposed to be always latin1. Convert to 'enc' when 24475 + * using a multi-byte encoding. Conversion between two 8-bit 24476 + * character sets usually fails and the text might actually be in 24477 + * 'enc' anyway. */ 24478 + if (has_mbyte) 24479 + { 24480 + char_u *conv_buf = buffer; 24481 + vimconv_T vc; 24482 + 24483 + vc.vc_type = CONV_NONE; 24484 + if (convert_setup(&vc, (char_u *)"latin1", p_enc) == OK) 24485 + { 24486 + conv_buf = string_convert(&vc, buffer, &nbytes); 24487 + if (conv_buf != NULL) 24488 + { 24489 + clip_yank_selection(MCHAR, conv_buf, (long)nbytes, cbd); 24490 + vim_free(conv_buf); 24491 + done = TRUE; 24492 + } 24493 + convert_setup(&vc, NULL, NULL); 24494 + } 24495 + } 24496 + if (!done) /* use the text without conversion */ 24497 +#endif 24498 + clip_yank_selection(MCHAR, buffer, (long)nbytes, cbd); 24499 + XFree((void *)buffer); 24500 + if (p_verbose > 0) 24501 + { 24502 + verbose_enter(); 24503 + verb_msg((char_u *)_("Used CUT_BUFFER0 instead of empty selection")); 24504 + verbose_leave(); 24505 + } 24506 + } 24507 +} 24508 +#endif 24509 + 24510 #if defined(FEAT_MOUSE) || defined(PROTO) 24511 24512 /* 24513 @@ -2898,11 +2959,10 @@ 22395 24514 * Find the window at screen position "*rowp" and "*colp". The positions are 22396 24515 * updated to become relative to the top-left of the window. … … 22407 24526 diff -Naur vim72.orig/src/version.c vim72/src/version.c 22408 24527 --- vim72.orig/src/version.c 2008-08-09 07:24:52.000000000 -0700 22409 +++ vim72/src/version.c 2009-0 6-05 14:26:12.000000000 -070022410 @@ -677,9 +677, 380@@24528 +++ vim72/src/version.c 2009-07-19 15:19:00.000000000 -0700 24529 @@ -677,9 +677,444 @@ 22411 24530 static int included_patches[] = 22412 24531 { /* Add new patch number below this line */ 22413 24532 /**/ 24533 + 234, 24534 +/**/ 24535 + 232, 24536 +/**/ 24537 + 231, 24538 +/**/ 24539 + 230, 24540 +/**/ 24541 + 229, 24542 +/**/ 24543 + 228, 24544 +/**/ 24545 + 227, 24546 +/**/ 24547 + 226, 24548 +/**/ 24549 + 225, 24550 +/**/ 24551 + 224, 24552 +/**/ 24553 + 223, 24554 +/**/ 24555 + 222, 24556 +/**/ 24557 + 221, 24558 +/**/ 24559 + 220, 24560 +/**/ 24561 + 218, 24562 +/**/ 24563 + 217, 24564 +/**/ 24565 + 215, 24566 +/**/ 24567 + 214, 24568 +/**/ 24569 + 213, 24570 +/**/ 24571 + 211, 24572 +/**/ 24573 + 210, 24574 +/**/ 24575 + 209, 24576 +/**/ 24577 + 208, 24578 +/**/ 24579 + 207, 24580 +/**/ 24581 + 206, 24582 +/**/ 24583 + 203, 24584 +/**/ 24585 + 202, 24586 +/**/ 24587 + 201, 24588 +/**/ 24589 + 200, 24590 +/**/ 24591 + 199, 24592 +/**/ 24593 + 198, 24594 +/**/ 24595 + 197, 24596 +/**/ 22414 24597 + 196, 22415 24598 +/**/ … … 22789 24972 highest_patch() 22790 24973 { 22791 @@ -786,7 +1 157,7 @@24974 @@ -786,7 +1221,7 @@ 22792 24975 MSG_PUTS(_("\nRISC OS version")); 22793 24976 #endif … … 22798 24981 if (*compiled_arch != NUL) 22799 24982 { 22800 @@ -825,6 +1 196,19 @@24983 @@ -825,6 +1260,19 @@ 22801 24984 } 22802 24985 } … … 22820 25003 diff -Naur vim72.orig/src/vim.h vim72/src/vim.h 22821 25004 --- vim72.orig/src/vim.h 2008-08-09 09:03:38.000000000 -0700 22822 +++ vim72/src/vim.h 2009-0 6-05 14:24:34.000000000 -070025005 +++ vim72/src/vim.h 2009-07-19 15:17:25.000000000 -0700 22823 25006 @@ -341,8 +341,14 @@ 22824 25007 #ifdef BACKSLASH_IN_FILENAME … … 22864 25047 /* 22865 25048 * arguments for gui_set_shellsize() 25049 @@ -1328,11 +1337,11 @@ 25050 # define MSG_BUF_CLEN MSG_BUF_LEN /* cell length */ 25051 #endif 25052 25053 -#if defined(AMIGA) || defined(__linux__) || defined(__QNX__) || defined(__CYGWIN32__) || defined(_AIX) 25054 -# define TBUFSZ 2048 /* buffer size for termcap entry */ 25055 -#else 25056 -# define TBUFSZ 1024 /* buffer size for termcap entry */ 25057 -#endif 25058 +/* Size of the buffer used for tgetent(). Unfortunately this is largely 25059 + * undocumented, some systems use 1024. Using a buffer that is too small 25060 + * causes a buffer overrun and a crash. Use the maximum known value to stay 25061 + * on the safe side. */ 25062 +#define TBUFSZ 2048 /* buffer size for termcap entry */ 25063 25064 /* 25065 * Maximum length of key sequence to be mapped. 22866 25066 @@ -1451,8 +1460,8 @@ 22867 25067 # define PERROR(msg) perror(msg) … … 22908 25108 diff -Naur vim72.orig/src/window.c vim72/src/window.c 22909 25109 --- vim72.orig/src/window.c 2008-08-06 04:00:30.000000000 -0700 22910 +++ vim72/src/window.c 2009-06-05 14:25:31.000000000 -0700 22911 @@ -12,7 +12,7 @@ 25110 +++ vim72/src/window.c 2009-07-19 15:18:10.000000000 -0700 25111 @@ -11,8 +11,8 @@ 25112 22912 25113 static int path_is_url __ARGS((char_u *p)); 22913 25114 #if defined(FEAT_WINDOWS) || defined(PROTO) 22914 25115 -static int win_split_ins __ARGS((int size, int flags, win_T *newwin, int dir)); 22915 25116 -static void win_init __ARGS((win_T *newp, win_T *oldp)); 22916 25117 +static void win_init __ARGS((win_T *newp, win_T *oldp, int flags)); 25118 +static void win_init_some __ARGS((win_T *newp, win_T *oldp)); 22917 25119 static void frame_comp_pos __ARGS((frame_T *topfrp, int *row, int *col)); 22918 25120 static void frame_setheight __ARGS((frame_T *curfrp, int height)); 22919 25121 #ifdef FEAT_VERTSPLIT 22920 @@ -593,9 +593,7 @@ 25122 @@ -23,8 +23,8 @@ 25123 static void win_totop __ARGS((int size, int flags)); 25124 static void win_equal_rec __ARGS((win_T *next_curwin, int current, frame_T *topfr, int dir, int col, int row, int width, int height)); 25125 static int last_window __ARGS((void)); 25126 +static int one_window __ARGS((void)); 25127 static win_T *win_free_mem __ARGS((win_T *win, int *dirp, tabpage_T *tp)); 25128 -static win_T *winframe_remove __ARGS((win_T *win, int *dirp, tabpage_T *tp)); 25129 static frame_T *win_altframe __ARGS((win_T *win, tabpage_T *tp)); 25130 static tabpage_T *alt_tabpage __ARGS((void)); 25131 static win_T *frame2win __ARGS((frame_T *frp)); 25132 @@ -41,6 +41,7 @@ 25133 #endif 25134 #endif 25135 static int win_alloc_firstwin __ARGS((win_T *oldwin)); 25136 +static void new_frame __ARGS((win_T *wp)); 25137 #if defined(FEAT_WINDOWS) || defined(PROTO) 25138 static tabpage_T *alloc_tabpage __ARGS((void)); 25139 static int leave_tabpage __ARGS((buf_T *new_curbuf)); 25140 @@ -49,8 +50,6 @@ 25141 static int frame_minheight __ARGS((frame_T *topfrp, win_T *next_curwin)); 25142 static void win_enter_ext __ARGS((win_T *wp, int undo_sync, int no_curwin)); 25143 static void win_free __ARGS((win_T *wp, tabpage_T *tp)); 25144 -static void win_append __ARGS((win_T *, win_T *)); 25145 -static void win_remove __ARGS((win_T *, tabpage_T *tp)); 25146 static void frame_append __ARGS((frame_T *after, frame_T *frp)); 25147 static void frame_insert __ARGS((frame_T *before, frame_T *frp)); 25148 static void frame_remove __ARGS((frame_T *frp)); 25149 @@ -62,17 +61,15 @@ 25150 static void frame_add_height __ARGS((frame_T *frp, int n)); 25151 static void last_status_rec __ARGS((frame_T *fr, int statusline)); 25152 25153 -static void make_snapshot __ARGS((void)); 25154 static void make_snapshot_rec __ARGS((frame_T *fr, frame_T **frp)); 25155 -static void clear_snapshot __ARGS((tabpage_T *tp)); 25156 +static void clear_snapshot __ARGS((tabpage_T *tp, int idx)); 25157 static void clear_snapshot_rec __ARGS((frame_T *fr)); 25158 -static void restore_snapshot __ARGS((int close_curwin)); 25159 static int check_snapshot_rec __ARGS((frame_T *sn, frame_T *fr)); 25160 static win_T *restore_snapshot_rec __ARGS((frame_T *sn, frame_T *fr)); 25161 25162 #endif /* FEAT_WINDOWS */ 25163 25164 -static win_T *win_alloc __ARGS((win_T *after)); 25165 +static win_T *win_alloc __ARGS((win_T *after, int hidden)); 25166 static void win_new_height __ARGS((win_T *, int)); 25167 25168 #define URL_SLASH 1 /* path_is_url() has found "://" */ 25169 @@ -259,7 +256,7 @@ 25170 /* cursor to previous window with wrap around */ 25171 case 'W': 25172 CHECK_CMDWIN 25173 - if (lastwin == firstwin && Prenum != 1) /* just one window */ 25174 + if (firstwin == lastwin && Prenum != 1) /* just one window */ 25175 beep_flush(); 25176 else 25177 { 25178 @@ -343,7 +340,7 @@ 25179 25180 /* move window to new tab page */ 25181 case 'T': 25182 - if (firstwin == lastwin) 25183 + if (one_window()) 25184 MSG(_(m_onlyone)); 25185 else 25186 { 25187 @@ -593,9 +590,7 @@ 22921 25188 ++allow_keys; /* no mapping for xchar, but allow key codes */ 22922 25189 if (xchar == NUL) … … 22928 25195 --allow_keys; 22929 25196 #ifdef FEAT_CMDL_INFO 22930 @@ -912,7 +910,7 @@ 25197 @@ -680,9 +675,9 @@ 25198 /* When creating the help window make a snapshot of the window layout. 25199 * Otherwise clear the snapshot, it's now invalid. */ 25200 if (flags & WSP_HELP) 25201 - make_snapshot(); 25202 + make_snapshot(SNAP_HELP_IDX); 25203 else 25204 - clear_snapshot(curtab); 25205 + clear_snapshot(curtab, SNAP_HELP_IDX); 25206 25207 return win_split_ins(size, flags, NULL, 0); 25208 } 25209 @@ -693,7 +688,7 @@ 25210 * top/left/right/bottom. 25211 * return FAIL for failure, OK otherwise 25212 */ 25213 - static int 25214 + int 25215 win_split_ins(size, flags, newwin, dir) 25216 int size; 25217 int flags; 25218 @@ -894,14 +889,14 @@ 25219 { 25220 /* new window below/right of current one */ 25221 if (newwin == NULL) 25222 - wp = win_alloc(oldwin); 25223 + wp = win_alloc(oldwin, FALSE); 25224 else 25225 win_append(oldwin, wp); 25226 } 25227 else 25228 { 25229 if (newwin == NULL) 25230 - wp = win_alloc(oldwin->w_prev); 25231 + wp = win_alloc(oldwin->w_prev, FALSE); 25232 else 25233 win_append(oldwin->w_prev, wp); 25234 } 25235 @@ -911,8 +906,15 @@ 25236 if (wp == NULL) 22931 25237 return FAIL; 22932 25238 25239 + new_frame(wp); 25240 + if (wp->w_frame == NULL) 25241 + { 25242 + win_free(wp, NULL); 25243 + return FAIL; 25244 + } 25245 + 22933 25246 /* make the contents of the new window the same as the current one */ 22934 25247 - win_init(wp, curwin); … … 22937 25250 22938 25251 /* 22939 @@ -1161,11 +1159,14 @@ 25252 @@ -971,13 +973,7 @@ 25253 } 25254 25255 if (newwin == NULL) 25256 - { 25257 - /* Create a frame for the new window. */ 25258 - frp = (frame_T *)alloc_clear((unsigned)sizeof(frame_T)); 25259 - frp->fr_layout = FR_LEAF; 25260 - frp->fr_win = wp; 25261 - wp->w_frame = frp; 25262 - } 25263 + frp = wp->w_frame; 25264 else 25265 frp = newwin->w_frame; 25266 frp->fr_parent = curfrp->fr_parent; 25267 @@ -1157,15 +1153,19 @@ 25268 return OK; 25269 } 25270 25271 + 25272 /* 22940 25273 * Initialize window "newp" from window "oldp". 22941 25274 * Used when splitting a window and when creating a new tab page. … … 22953 25286 int i; 22954 25287 22955 @@ -1190, 7 +1191,14@@25288 @@ -1190,19 +1190,19 @@ 22956 25289 copy_jumplist(oldp, newp); 22957 25290 #endif … … 22969 25302 if (oldp->w_localdir != NULL) 22970 25303 newp->w_localdir = vim_strsave(oldp->w_localdir); 22971 @@ -1258,11 +1266,10 @@ 25304 25305 - /* Use the same argument list. */ 25306 - newp->w_alist = oldp->w_alist; 25307 - ++newp->w_alist->al_refcount; 25308 - newp->w_arg_idx = oldp->w_arg_idx; 25309 - 25310 - /* 25311 - * copy tagstack and options from existing window 25312 - */ 25313 + /* copy tagstack and folds */ 25314 for (i = 0; i < oldp->w_tagstacklen; i++) 25315 { 25316 newp->w_tagstack[i] = oldp->w_tagstack[i]; 25317 @@ -1212,10 +1212,29 @@ 25318 } 25319 newp->w_tagstackidx = oldp->w_tagstackidx; 25320 newp->w_tagstacklen = oldp->w_tagstacklen; 25321 - win_copy_options(oldp, newp); 25322 # ifdef FEAT_FOLDING 25323 copyFoldingState(oldp, newp); 25324 # endif 25325 + 25326 + win_init_some(newp, oldp); 25327 +} 25328 + 25329 +/* 25330 + * Initialize window "newp" from window"old". 25331 + * Only the essential things are copied. 25332 + */ 25333 + static void 25334 +win_init_some(newp, oldp) 25335 + win_T *newp; 25336 + win_T *oldp; 25337 +{ 25338 + /* Use the same argument list. */ 25339 + newp->w_alist = oldp->w_alist; 25340 + ++newp->w_alist->al_refcount; 25341 + newp->w_arg_idx = oldp->w_arg_idx; 25342 + 25343 + /* copy options from existing window */ 25344 + win_copy_options(oldp, newp); 25345 } 25346 25347 #endif /* FEAT_WINDOWS */ 25348 @@ -1258,11 +1277,10 @@ 22972 25349 * Must be called when there is just one window, filling the whole screen 22973 25350 * (excluding the command line). … … 22982 25359 int maxcount; 22983 25360 int todo; 22984 @@ -2343,11 +2350,10 @@ 25361 @@ -1557,15 +1575,8 @@ 25362 #if defined(FEAT_GUI) && defined(FEAT_VERTSPLIT) 25363 /* When 'guioptions' includes 'L' or 'R' may have to remove or add 25364 * scrollbars. Have to update them anyway. */ 25365 - if (gui.in_use) 25366 - { 25367 - out_flush(); 25368 - gui_init_which_components(NULL); 25369 - gui_update_scrollbars(TRUE); 25370 - } 25371 - need_mouse_correct = TRUE; 25372 + gui_may_update_scrollbars(); 25373 #endif 25374 - 25375 } 25376 25377 /* 25378 @@ -2040,13 +2051,40 @@ 25379 } 25380 25381 /* 25382 - * Return TRUE if the current window is the only window that exists. 25383 + * Return TRUE if the current window is the only window that exists (ignoring 25384 + * "aucmd_win"). 25385 * Returns FALSE if there is a window, possibly in another tab page. 25386 */ 25387 static int 25388 last_window() 25389 { 25390 - return (lastwin == firstwin && first_tabpage->tp_next == NULL); 25391 + return (one_window() && first_tabpage->tp_next == NULL); 25392 +} 25393 + 25394 +/* 25395 + * Return TRUE if there is only one window other than "aucmd_win" in the 25396 + * current tab page. 25397 + */ 25398 + static int 25399 +one_window() 25400 +{ 25401 +#ifdef FEAT_AUTOCMD 25402 + win_T *wp; 25403 + int seen_one = FALSE; 25404 + 25405 + FOR_ALL_WINDOWS(wp) 25406 + { 25407 + if (wp != aucmd_win) 25408 + { 25409 + if (seen_one) 25410 + return FALSE; 25411 + seen_one = TRUE; 25412 + } 25413 + } 25414 + return TRUE; 25415 +#else 25416 + return firstwin == lastwin; 25417 +#endif 25418 } 25419 25420 /* 25421 @@ -2075,6 +2113,19 @@ 25422 return; 25423 } 25424 25425 +#ifdef FEAT_AUTOCMD 25426 + if (win == aucmd_win) 25427 + { 25428 + EMSG(_("E813: Cannot close autocmd window")); 25429 + return; 25430 + } 25431 + if ((firstwin == aucmd_win || lastwin == aucmd_win) && one_window()) 25432 + { 25433 + EMSG(_("E814: Cannot close window, only autocmd window would remain")); 25434 + return; 25435 + } 25436 +#endif 25437 + 25438 /* 25439 * When closing the last window in a tab page first go to another tab 25440 * page and then close the window and the tab page. This avoids that 25441 @@ -2104,7 +2155,7 @@ 25442 if (win->w_buffer->b_help) 25443 help_window = TRUE; 25444 else 25445 - clear_snapshot(curtab); 25446 + clear_snapshot(curtab, SNAP_HELP_IDX); 25447 25448 #ifdef FEAT_AUTOCMD 25449 if (win == curwin) 25450 @@ -2221,7 +2272,7 @@ 25451 /* After closing the help window, try restoring the window layout from 25452 * before it was opened. */ 25453 if (help_window) 25454 - restore_snapshot(close_curwin); 25455 + restore_snapshot(SNAP_HELP_IDX, close_curwin); 25456 25457 #if defined(FEAT_GUI) && defined(FEAT_VERTSPLIT) 25458 /* When 'guioptions' includes 'L' or 'R' may have to remove scrollbars. */ 25459 @@ -2302,13 +2353,6 @@ 25460 frame_T *frp; 25461 win_T *wp; 25462 25463 -#ifdef FEAT_FOLDING 25464 - clearFolding(win); 25465 -#endif 25466 - 25467 - /* reduce the reference count to the argument list. */ 25468 - alist_unlink(win->w_alist); 25469 - 25470 /* Remove the window and its frame from the tree of frames. */ 25471 frp = win->w_frame; 25472 wp = winframe_remove(win, dirp, tp); 25473 @@ -2334,6 +2378,14 @@ 25474 tabpage_close(TRUE); 25475 # endif 25476 25477 +# ifdef FEAT_AUTOCMD 25478 + if (aucmd_win != NULL) 25479 + { 25480 + (void)win_free_mem(aucmd_win, &dummy, NULL); 25481 + aucmd_win = NULL; 25482 + } 25483 +# endif 25484 + 25485 while (firstwin != NULL) 25486 (void)win_free_mem(firstwin, &dummy, NULL); 25487 } 25488 @@ -2343,11 +2395,10 @@ 22985 25489 * Remove a window and its frame from the tree of frames. 22986 25490 * Returns a pointer to the window that got the freed up space. 22987 25491 */ 22988 25492 -/*ARGSUSED*/ 22989 static win_T * 25493 - static win_T * 25494 + win_T * 22990 25495 winframe_remove(win, dirp, tp) 22991 25496 win_T *win; … … 22995 25500 { 22996 25501 frame_T *frp, *frp2, *frp3; 22997 @@ -3220,7 +3226,7 @@ 25502 @@ -3083,7 +3134,7 @@ 25503 win_T *nextwp; 25504 int r; 25505 25506 - if (lastwin == firstwin) 25507 + if (one_window()) 25508 { 25509 if (message 25510 #ifdef FEAT_AUTOCMD 25511 @@ -3145,27 +3196,34 @@ 25512 void 25513 curwin_init() 25514 { 25515 - redraw_win_later(curwin, NOT_VALID); 25516 - curwin->w_lines_valid = 0; 25517 - curwin->w_cursor.lnum = 1; 25518 - curwin->w_curswant = curwin->w_cursor.col = 0; 25519 + win_init_empty(curwin); 25520 +} 25521 + 25522 + void 25523 +win_init_empty(wp) 25524 + win_T *wp; 25525 +{ 25526 + redraw_win_later(wp, NOT_VALID); 25527 + wp->w_lines_valid = 0; 25528 + wp->w_cursor.lnum = 1; 25529 + wp->w_curswant = wp->w_cursor.col = 0; 25530 #ifdef FEAT_VIRTUALEDIT 25531 - curwin->w_cursor.coladd = 0; 25532 + wp->w_cursor.coladd = 0; 25533 #endif 25534 - curwin->w_pcmark.lnum = 1; /* pcmark not cleared but set to line 1 */ 25535 - curwin->w_pcmark.col = 0; 25536 - curwin->w_prev_pcmark.lnum = 0; 25537 - curwin->w_prev_pcmark.col = 0; 25538 - curwin->w_topline = 1; 25539 + wp->w_pcmark.lnum = 1; /* pcmark not cleared but set to line 1 */ 25540 + wp->w_pcmark.col = 0; 25541 + wp->w_prev_pcmark.lnum = 0; 25542 + wp->w_prev_pcmark.col = 0; 25543 + wp->w_topline = 1; 25544 #ifdef FEAT_DIFF 25545 - curwin->w_topfill = 0; 25546 + wp->w_topfill = 0; 25547 #endif 25548 - curwin->w_botline = 2; 25549 + wp->w_botline = 2; 25550 #ifdef FEAT_FKMAP 25551 - if (curwin->w_p_rl) 25552 - curwin->w_farsi = W_CONV + W_R_L; 25553 + if (wp->w_p_rl) 25554 + wp->w_farsi = W_CONV + W_R_L; 25555 else 25556 - curwin->w_farsi = W_CONV; 25557 + wp->w_farsi = W_CONV; 25558 #endif 25559 } 25560 25561 @@ -3187,9 +3245,30 @@ 25562 first_tabpage->tp_topframe = topframe; 25563 curtab = first_tabpage; 25564 #endif 25565 + 25566 return OK; 25567 } 25568 25569 +#if defined(FEAT_AUTOCMD) || defined(PROTO) 25570 +/* 25571 + * Init "aucmd_win". This can only be done after the first 25572 + * window is fully initialized, thus it can't be in win_alloc_first(). 25573 + */ 25574 + void 25575 +win_alloc_aucmd_win() 25576 +{ 25577 + aucmd_win = win_alloc(NULL, TRUE); 25578 + if (aucmd_win != NULL) 25579 + { 25580 + win_init_some(aucmd_win, curwin); 25581 +# ifdef FEAT_SCROLLBIND 25582 + aucmd_win->w_p_scb = FALSE; 25583 +# endif 25584 + new_frame(aucmd_win); 25585 + } 25586 +} 25587 +#endif 25588 + 25589 /* 25590 * Allocate the first window or the first window in a new tab page. 25591 * When "oldwin" is NULL create an empty buffer for it. 25592 @@ -3201,7 +3280,7 @@ 25593 win_alloc_firstwin(oldwin) 25594 win_T *oldwin; 25595 { 25596 - curwin = win_alloc(NULL); 25597 + curwin = win_alloc(NULL, FALSE); 25598 if (oldwin == NULL) 25599 { 25600 /* Very first window, need to create an empty buffer for it and 25601 @@ -3220,7 +3299,7 @@ 22998 25602 else 22999 25603 { … … 23004 25608 # ifdef FEAT_SCROLLBIND 23005 25609 /* We don't want scroll-binding in the first window. */ 23006 @@ -3490,10 +3496,9 @@ 25610 @@ -3229,21 +3308,36 @@ 25611 } 25612 #endif 25613 25614 - topframe = (frame_T *)alloc_clear((unsigned)sizeof(frame_T)); 25615 - if (topframe == NULL) 25616 + new_frame(curwin); 25617 + if (curwin->w_frame == NULL) 25618 return FAIL; 25619 - topframe->fr_layout = FR_LEAF; 25620 + topframe = curwin->w_frame; 25621 #ifdef FEAT_VERTSPLIT 25622 topframe->fr_width = Columns; 25623 #endif 25624 topframe->fr_height = Rows - p_ch; 25625 topframe->fr_win = curwin; 25626 - curwin->w_frame = topframe; 25627 25628 return OK; 25629 } 25630 25631 /* 25632 + * Create a frame for window "wp". 25633 + */ 25634 + static void 25635 +new_frame(win_T *wp) 25636 +{ 25637 + frame_T *frp = (frame_T *)alloc_clear((unsigned)sizeof(frame_T)); 25638 + 25639 + wp->w_frame = frp; 25640 + if (frp != NULL) 25641 + { 25642 + frp->fr_layout = FR_LEAF; 25643 + frp->fr_win = wp; 25644 + } 25645 +} 25646 + 25647 +/* 25648 * Initialize the window and frame size to the maximum. 25649 */ 25650 void 25651 @@ -3293,10 +3387,13 @@ 25652 free_tabpage(tp) 25653 tabpage_T *tp; 25654 { 25655 + int idx; 25656 + 25657 # ifdef FEAT_DIFF 25658 diff_clear(tp); 25659 # endif 25660 - clear_snapshot(tp); 25661 + for (idx = 0; idx < SNAP_COUNT; ++idx) 25662 + clear_snapshot(tp, idx); 25663 #ifdef FEAT_EVAL 25664 vars_clear(&tp->tp_vars.dv_hashtab); /* free all t: variables */ 25665 #endif 25666 @@ -3363,12 +3460,7 @@ 25667 #if defined(FEAT_GUI) 25668 /* When 'guioptions' includes 'L' or 'R' may have to remove or add 25669 * scrollbars. Have to update them anyway. */ 25670 - if (gui.in_use && starting == 0) 25671 - { 25672 - gui_init_which_components(NULL); 25673 - gui_update_scrollbars(TRUE); 25674 - } 25675 - need_mouse_correct = TRUE; 25676 + gui_may_update_scrollbars(); 25677 #endif 25678 25679 redraw_all_later(CLEAR); 25680 @@ -3490,10 +3582,9 @@ 23007 25681 * FAIL. 23008 25682 * Careful: When OK is returned need to get a new tab page very very soon! … … 23016 25690 { 23017 25691 tabpage_T *tp = curtab; 23018 @@ -3535,11 +3 540,10 @@25692 @@ -3535,11 +3626,10 @@ 23019 25693 * Start using tab page "tp". 23020 25694 * Only to be used after leave_tabpage() or freeing the current tab page. … … 23029 25703 int old_off = tp->tp_firstwin->w_winrow; 23030 25704 win_T *next_prevwin = tp->tp_prevwin; 23031 @@ -4028,14 +4032,14 @@ 25705 @@ -3588,12 +3678,7 @@ 25706 #if defined(FEAT_GUI) 25707 /* When 'guioptions' includes 'L' or 'R' may have to remove or add 25708 * scrollbars. Have to update them anyway. */ 25709 - if (gui.in_use && starting == 0) 25710 - { 25711 - gui_init_which_components(NULL); 25712 - gui_update_scrollbars(TRUE); 25713 - } 25714 - need_mouse_correct = TRUE; 25715 + gui_may_update_scrollbars(); 25716 #endif 25717 25718 redraw_all_later(CLEAR); 25719 @@ -4028,14 +4113,14 @@ 23032 25720 if (mch_dirname(cwd, MAXPATHL) == OK) 23033 25721 globaldir = vim_strsave(cwd); … … 23047 25735 globaldir = NULL; 23048 25736 shorten_fnames(TRUE); 23049 @@ -4147,10 +4151,9 @@ 23050 /* 23051 * allocate a window structure and link it in the window list 25737 @@ -4145,12 +4230,13 @@ 25738 #endif 25739 25740 /* 25741 - * allocate a window structure and link it in the window list 25742 + * Allocate a window structure and link it in the window list when "hidden" is 25743 + * FALSE. 23052 25744 */ 23053 25745 -/*ARGSUSED*/ 23054 25746 static win_T * 23055 25747 -win_alloc(after) 23056 25748 - win_T *after; 25749 +win_alloc(after, hidden) 23057 25750 + win_T *after UNUSED; 25751 + int hidden UNUSED; 23058 25752 { 23059 25753 win_T *newwin; 23060 25754 25755 @@ -4176,7 +4262,8 @@ 25756 * link the window in the window list 25757 */ 25758 #ifdef FEAT_WINDOWS 25759 - win_append(after, newwin); 25760 + if (!hidden) 25761 + win_append(after, newwin); 25762 #endif 25763 #ifdef FEAT_VERTSPLIT 25764 newwin->w_wincol = 0; 25765 @@ -4237,6 +4324,13 @@ 25766 { 25767 int i; 25768 25769 +#ifdef FEAT_FOLDING 25770 + clearFolding(wp); 25771 +#endif 25772 + 25773 + /* reduce the reference count to the argument list. */ 25774 + alist_unlink(wp->w_alist); 25775 + 25776 #ifdef FEAT_AUTOCMD 25777 /* Don't execute autocommands while the window is halfway being deleted. 25778 * gui_mch_destroy_scrollbar() may trigger a FocusGained event. */ 25779 @@ -4299,7 +4393,10 @@ 25780 } 25781 #endif /* FEAT_GUI */ 25782 25783 - win_remove(wp, tp); 25784 +#ifdef FEAT_AUTOCMD 25785 + if (wp != aucmd_win) 25786 +#endif 25787 + win_remove(wp, tp); 25788 vim_free(wp); 25789 25790 #ifdef FEAT_AUTOCMD 25791 @@ -4310,7 +4407,7 @@ 25792 /* 25793 * Append window "wp" in the window list after window "after". 25794 */ 25795 - static void 25796 + void 25797 win_append(after, wp) 25798 win_T *after, *wp; 25799 { 25800 @@ -4336,7 +4433,7 @@ 25801 /* 25802 * Remove a window from the window list. 25803 */ 25804 - static void 25805 + void 25806 win_remove(wp, tp) 25807 win_T *wp; 25808 tabpage_T *tp; /* tab page "win" is in, NULL for current */ 25809 @@ -6036,6 +6133,7 @@ 25810 /* 25811 * Return TRUE if there is only one window (in the current tab page), not 25812 * counting a help or preview window, unless it is the current window. 25813 + * Does not count "aucmd_win". 25814 */ 25815 int 25816 only_one_window() 25817 @@ -6049,11 +6147,15 @@ 25818 return FALSE; 25819 25820 for (wp = firstwin; wp != NULL; wp = wp->w_next) 25821 - if (!((wp->w_buffer->b_help && !curbuf->b_help) 25822 + if ((!((wp->w_buffer->b_help && !curbuf->b_help) 25823 # ifdef FEAT_QUICKFIX 25824 || wp->w_p_pvw 25825 # endif 25826 ) || wp == curwin) 25827 +# ifdef FEAT_AUTOCMD 25828 + && wp != aucmd_win 25829 +# endif 25830 + ) 25831 ++count; 25832 return (count <= 1); 25833 #else 25834 @@ -6108,11 +6210,12 @@ 25835 /* 25836 * Create a snapshot of the current frame sizes. 25837 */ 25838 - static void 25839 -make_snapshot() 25840 + void 25841 +make_snapshot(idx) 25842 + int idx; 25843 { 25844 - clear_snapshot(curtab); 25845 - make_snapshot_rec(topframe, &curtab->tp_snapshot); 25846 + clear_snapshot(curtab, idx); 25847 + make_snapshot_rec(topframe, &curtab->tp_snapshot[idx]); 25848 } 25849 25850 static void 25851 @@ -6140,11 +6243,12 @@ 25852 * Remove any existing snapshot. 25853 */ 25854 static void 25855 -clear_snapshot(tp) 25856 +clear_snapshot(tp, idx) 25857 tabpage_T *tp; 25858 + int idx; 25859 { 25860 - clear_snapshot_rec(tp->tp_snapshot); 25861 - tp->tp_snapshot = NULL; 25862 + clear_snapshot_rec(tp->tp_snapshot[idx]); 25863 + tp->tp_snapshot[idx] = NULL; 25864 } 25865 25866 static void 25867 @@ -6164,26 +6268,27 @@ 25868 * This is only done if the screen size didn't change and the window layout is 25869 * still the same. 25870 */ 25871 - static void 25872 -restore_snapshot(close_curwin) 25873 + void 25874 +restore_snapshot(idx, close_curwin) 25875 + int idx; 25876 int close_curwin; /* closing current window */ 25877 { 25878 win_T *wp; 25879 25880 - if (curtab->tp_snapshot != NULL 25881 + if (curtab->tp_snapshot[idx] != NULL 25882 # ifdef FEAT_VERTSPLIT 25883 - && curtab->tp_snapshot->fr_width == topframe->fr_width 25884 + && curtab->tp_snapshot[idx]->fr_width == topframe->fr_width 25885 # endif 25886 - && curtab->tp_snapshot->fr_height == topframe->fr_height 25887 - && check_snapshot_rec(curtab->tp_snapshot, topframe) == OK) 25888 + && curtab->tp_snapshot[idx]->fr_height == topframe->fr_height 25889 + && check_snapshot_rec(curtab->tp_snapshot[idx], topframe) == OK) 25890 { 25891 - wp = restore_snapshot_rec(curtab->tp_snapshot, topframe); 25892 + wp = restore_snapshot_rec(curtab->tp_snapshot[idx], topframe); 25893 win_comp_pos(); 25894 if (wp != NULL && close_curwin) 25895 win_goto(wp); 25896 redraw_all_later(CLEAR); 25897 } 25898 - clear_snapshot(curtab); 25899 + clear_snapshot(curtab, idx); 25900 } 25901 25902 /* 23061 25903 diff -Naur vim72.orig/src/workshop.c vim72/src/workshop.c 23062 25904 --- vim72.orig/src/workshop.c 2008-06-21 11:53:26.000000000 -0700 23063 +++ vim72/src/workshop.c 2009-0 6-05 14:25:31.000000000 -070025905 +++ vim72/src/workshop.c 2009-07-19 15:16:46.000000000 -0700 23064 25906 @@ -204,12 +204,11 @@ 23065 25907 * Function: … … 23197 26039 } 23198 26040 26041 diff -Naur vim72.orig/src/xxd/xxd.c vim72/src/xxd/xxd.c 26042 --- vim72.orig/src/xxd/xxd.c 2007-11-29 12:05:16.000000000 -0800 26043 +++ vim72/src/xxd/xxd.c 2009-07-19 15:17:54.000000000 -0700 26044 @@ -64,6 +64,9 @@ 26045 # define _CRT_SECURE_NO_DEPRECATE 26046 # define _CRT_NONSTDC_NO_DEPRECATE 26047 #endif 26048 +#if !defined(CYGWIN) && (defined(CYGWIN32) || defined(__CYGWIN__) || defined(__CYGWIN32__)) 26049 +# define CYGWIN 26050 +#endif 26051 26052 #include <stdio.h> 26053 #ifdef VAXC 26054 @@ -77,7 +80,8 @@ 26055 #if !defined(OS2) && defined(__EMX__) 26056 # define OS2 26057 #endif 26058 -#if defined(MSDOS) || defined(WIN32) || defined(OS2) || defined(__BORLANDC__) 26059 +#if defined(MSDOS) || defined(WIN32) || defined(OS2) || defined(__BORLANDC__) \ 26060 + || defined(CYGWIN) 26061 # include <io.h> /* for setmode() */ 26062 #else 26063 # ifdef UNIX 26064 @@ -150,9 +154,6 @@ 26065 # endif 26066 #endif 26067 26068 -#if !defined(CYGWIN) && (defined(CYGWIN32) || defined(__CYGWIN__) || defined(__CYGWIN32__)) 26069 -# define CYGWIN 26070 -#endif 26071 #if defined(MSDOS) || defined(WIN32) || defined(OS2) 26072 # define BIN_READ(yes) ((yes) ? "rb" : "rt") 26073 # define BIN_WRITE(yes) ((yes) ? "wb" : "wt")
Note:
See TracChangeset
for help on using the changeset viewer.