Changeset 2893698 in clfs-sysroot


Ignore:
Timestamp:
Mar 15, 2009, 12:15:17 PM (15 years ago)
Author:
Joe Ciccone <jciccone@…>
Branches:
master
Children:
6f50e7b
Parents:
35f9c2f
Message:

Update VIM Branch Update Patch.

Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • BOOK/introduction/common/changelog.xml

    r35f9c2f r2893698  
    4040      <para>March 15, 2009</para>
    4141      <itemizedlist>
     42        <listitem>
     43          <para>[jciccone] - Updated VIM Branch Update patch to -11.</para>
     44        </listitem>
    4245        <listitem>
    4346          <para>[jciccone] - Updated MPFR to 2.4.1 and added branch update patch.</para>
  • BOOK/patches.ent

    r35f9c2f r2893698  
    8989<!ENTITY tar-new_compressors-patch-size "2 KB">
    9090
    91 <!ENTITY vim-branch_update-patch "vim-&vim-version;-branch_update-5.patch">
    92 <!ENTITY vim-branch_update-patch-md5 "ad13a427a46ae23abe8740ab66fba15d">
    93 <!ENTITY vim-branch_update-patch-size "180 KB">
     91<!ENTITY vim-branch_update-patch "vim-&vim-version;-branch_update-11.patch">
     92<!ENTITY vim-branch_update-patch-md5 "326e75a9a9ac2d3777eba30300124652">
     93<!ENTITY vim-branch_update-patch-size "253 KB">
    9494
    9595<!ENTITY zlib-fpic-patch "zlib-&zlib-version;-fPIC-1.patch">
  • patches/vim-7.2-branch_update-11.patch

    r35f9c2f r2893698  
    11Submitted By: Jim Gifford (jim at cross-lfs dot org)
    2 Date: 01-19-2009
     2Date: 03-12-2009
    33Initial Package Version: 7.2
    44Origin: Upstream
    55Upstream Status: Applied
    6 Description: Contains all upstream patches up to 7.2.084
     6Description: Contains all upstream patches up to 7.2.141
    77             The following patches were skipped
    8              007 036 041 049 071 072 074
     8             007 036 041 049 071 072 074 088 089 093 101 138
    99
    1010diff -Naur vim72.orig/Filelist vim72/Filelist
    1111--- vim72.orig/Filelist 2008-07-06 11:02:23.000000000 -0700
    12 +++ vim72/Filelist      2009-01-19 00:08:05.000000000 -0800
     12+++ vim72/Filelist      2009-03-12 11:54:40.397486521 -0700
    1313@@ -285,6 +285,7 @@
    1414                src/proto/os_win32.pro \
     
    2121diff -Naur vim72.orig/runtime/doc/cmdline.txt vim72/runtime/doc/cmdline.txt
    2222--- vim72.orig/runtime/doc/cmdline.txt  2008-08-09 07:22:59.000000000 -0700
    23 +++ vim72/runtime/doc/cmdline.txt       2009-01-19 00:08:30.000000000 -0800
     23+++ vim72/runtime/doc/cmdline.txt       2009-03-12 11:54:40.529493784 -0700
    2424@@ -1,4 +1,4 @@
    2525-*cmdline.txt*   For Vim version 7.2.  Last change: 2008 Jul 29
     
    8080diff -Naur vim72.orig/runtime/doc/eval.txt vim72/runtime/doc/eval.txt
    8181--- vim72.orig/runtime/doc/eval.txt     2008-08-09 07:22:59.000000000 -0700
    82 +++ vim72/runtime/doc/eval.txt  2009-01-19 00:10:10.000000000 -0800
     82+++ vim72/runtime/doc/eval.txt  2009-03-12 11:54:50.318122364 -0700
    8383@@ -1,4 +1,4 @@
    8484-*eval.txt*     For Vim version 7.2.  Last change: 2008 Aug 09
     
    200200diff -Naur vim72.orig/runtime/doc/netbeans.txt vim72/runtime/doc/netbeans.txt
    201201--- vim72.orig/runtime/doc/netbeans.txt 2008-08-09 07:22:59.000000000 -0700
    202 +++ vim72/runtime/doc/netbeans.txt      2009-01-19 00:10:45.000000000 -0800
     202+++ vim72/runtime/doc/netbeans.txt      2009-03-12 11:54:59.850731108 -0700
    203203@@ -1,4 +1,4 @@
    204204-*netbeans.txt*  For Vim version 7.2.  Last change: 2008 Jun 28
     
    222222diff -Naur vim72.orig/runtime/doc/options.txt vim72/runtime/doc/options.txt
    223223--- vim72.orig/runtime/doc/options.txt  2008-08-09 07:22:59.000000000 -0700
    224 +++ vim72/runtime/doc/options.txt       2009-01-19 00:09:28.000000000 -0800
     224+++ vim72/runtime/doc/options.txt       2009-03-12 11:55:13.407601900 -0700
    225225@@ -1,4 +1,4 @@
    226226-*options.txt*  For Vim version 7.2.  Last change: 2008 Aug 06
     
    229229 
    230230                  VIM REFERENCE MANUAL    by Bram Moolenaar
    231 @@ -7472,7 +7472,9 @@
     231@@ -4175,9 +4175,6 @@
     232        be able to execute Normal mode commands.
     233        This is the opposite of the 'keymap' option, where characters are
     234        mapped in Insert mode.
     235-       This only works for 8-bit characters.  The value of 'langmap' may be
     236-       specified with multi-byte characters (e.g., UTF-8), but only the lower
     237-       8 bits of each character will be used.
     238 
     239        Example (for Greek, in UTF-8):                          *greek*  >
     240            :set langmap=ΑA,ΒB,ΚC,ΔD,ΕE,ΊF,ΓG,ΗH,ΙI,ΞJ,ΚK,ΛL,ΜM,ΝN,ΟO,ΠP,QQ,ΡR,ΣS,΀T,ΘU,ΩV,WW,ΧX,Î¥Y,ΖZ,αa,βb,ψc,ÎŽd,εe,φf,γg,ηh,ιi,Οj,κk,λl,ÎŒm,Îœn,οo,πp,qq,ρr,σs,τt,Ξu,ωv,ςw,χx,Ï
     241y,ζz
     242@@ -7472,7 +7469,9 @@
    232243                        {not available when compiled without the |+wildignore|
    233244                        feature}
     
    242253diff -Naur vim72.orig/runtime/doc/spell.txt vim72/runtime/doc/spell.txt
    243254--- vim72.orig/runtime/doc/spell.txt    2008-08-09 07:23:00.000000000 -0700
    244 +++ vim72/runtime/doc/spell.txt 2009-01-19 00:09:54.000000000 -0800
     255+++ vim72/runtime/doc/spell.txt 2009-03-12 11:54:50.218113983 -0700
    245256@@ -1,4 +1,4 @@
    246257-*spell.txt*    For Vim version 7.2.  Last change: 2008 Jun 21
     
    372383diff -Naur vim72.orig/runtime/doc/starting.txt vim72/runtime/doc/starting.txt
    373384--- vim72.orig/runtime/doc/starting.txt 2008-08-09 07:23:00.000000000 -0700
    374 +++ vim72/runtime/doc/starting.txt      2009-01-19 00:08:31.000000000 -0800
     385+++ vim72/runtime/doc/starting.txt      2009-03-12 11:54:40.533495740 -0700
    375386@@ -1,4 +1,4 @@
    376387-*starting.txt*  For Vim version 7.2.  Last change: 2008 Jun 21
     
    434445diff -Naur vim72.orig/runtime/doc/usr_21.txt vim72/runtime/doc/usr_21.txt
    435446--- vim72.orig/runtime/doc/usr_21.txt   2008-08-09 07:23:01.000000000 -0700
    436 +++ vim72/runtime/doc/usr_21.txt        2009-01-19 00:08:31.000000000 -0800
     447+++ vim72/runtime/doc/usr_21.txt        2009-03-12 11:54:40.533495740 -0700
    437448@@ -1,4 +1,4 @@
    438449-*usr_21.txt*   For Vim version 7.2.  Last change: 2007 May 01
     
    501512diff -Naur vim72.orig/runtime/scripts.vim vim72/runtime/scripts.vim
    502513--- vim72.orig/runtime/scripts.vim      2008-08-08 15:27:21.000000000 -0700
    503 +++ vim72/runtime/scripts.vim   2009-01-19 00:07:18.000000000 -0800
     514+++ vim72/runtime/scripts.vim   2009-03-12 11:54:28.900750105 -0700
    504515@@ -234,6 +234,10 @@
    505516   elseif s:line1 =~ '\<DTD\s\+XHTML\s'
     
    515526diff -Naur vim72.orig/src/auto/configure vim72/src/auto/configure
    516527--- vim72.orig/src/auto/configure       2008-07-24 05:40:36.000000000 -0700
    517 +++ vim72/src/auto/configure    2009-01-19 00:09:07.000000000 -0800
    518 @@ -16819,21 +16819,29 @@
     528+++ vim72/src/auto/configure    2009-03-12 11:55:13.667618383 -0700
     529@@ -11565,6 +11565,67 @@
     530 
     531 fi
     532 
     533+{ $as_echo "$as_me:$LINENO: checking for working volatile" >&5
     534+$as_echo_n "checking for working volatile... " >&6; }
     535+if test "${ac_cv_c_volatile+set}" = set; then
     536+  $as_echo_n "(cached) " >&6
     537+else
     538+  cat >conftest.$ac_ext <<_ACEOF
     539+/* confdefs.h.  */
     540+_ACEOF
     541+cat confdefs.h >>conftest.$ac_ext
     542+cat >>conftest.$ac_ext <<_ACEOF
     543+/* end confdefs.h.  */
     544+
     545+int
     546+main ()
     547+{
     548+
     549+volatile int x;
     550+int * volatile y = (int *) 0;
     551+return !x && !y;
     552+  ;
     553+  return 0;
     554+}
     555+_ACEOF
     556+rm -f conftest.$ac_objext
     557+if { (ac_try="$ac_compile"
     558+case "(($ac_try" in
     559+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
     560+  *) ac_try_echo=$ac_try;;
     561+esac
     562+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
     563+$as_echo "$ac_try_echo") >&5
     564+  (eval "$ac_compile") 2>conftest.er1
     565+  ac_status=$?
     566+  grep -v '^ *+' conftest.er1 >conftest.err
     567+  rm -f conftest.er1
     568+  cat conftest.err >&5
     569+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
     570+  (exit $ac_status); } && {
     571+        test -z "$ac_c_werror_flag" ||
     572+        test ! -s conftest.err
     573+       } && test -s conftest.$ac_objext; then
     574+  ac_cv_c_volatile=yes
     575+else
     576+  $as_echo "$as_me: failed program was:" >&5
     577+sed 's/^/| /' conftest.$ac_ext >&5
     578+
     579+       ac_cv_c_volatile=no
     580+fi
     581+
     582+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     583+fi
     584+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_volatile" >&5
     585+$as_echo "$ac_cv_c_volatile" >&6; }
     586+if test $ac_cv_c_volatile = no; then
     587+
     588+cat >>confdefs.h <<\_ACEOF
     589+#define volatile /**/
     590+_ACEOF
     591+
     592+fi
     593+
     594 { $as_echo "$as_me:$LINENO: checking for mode_t" >&5
     595 $as_echo_n "checking for mode_t... " >&6; }
     596 if test "${ac_cv_type_mode_t+set}" = set; then
     597@@ -16819,21 +16880,29 @@
    519598   LDFLAGS="$LDFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
    520599 fi
     
    556635diff -Naur vim72.orig/src/buffer.c vim72/src/buffer.c
    557636--- vim72.orig/src/buffer.c     2008-08-06 04:00:48.000000000 -0700
    558 +++ vim72/src/buffer.c  2009-01-19 00:10:45.000000000 -0800
     637+++ vim72/src/buffer.c  2009-03-12 11:55:13.507605811 -0700
    559638@@ -437,10 +437,6 @@
    560639        return;
     
    663742        if (itemcnt == 0)
    664743            s = out;
    665 @@ -5062,7 +5064,7 @@
     744@@ -5048,7 +5050,8 @@
     745         */
     746        FOR_ALL_TAB_WINDOWS(tp, win)
     747            if (win->w_buffer == buf)
     748-               break;
     749+               goto win_found;
     750+win_found:
     751        if (win != NULL && win->w_llist_ref != NULL)
     752            return _("[Location List]");
     753        else
     754@@ -5062,7 +5065,7 @@
    666755     {
    667756        if (buf->b_sfname != NULL)
     
    672761 #endif
    673762     if (buf->b_fname == NULL)
     763diff -Naur vim72.orig/src/config.h.in vim72/src/config.h.in
     764--- vim72.orig/src/config.h.in  2008-06-21 08:01:41.000000000 -0700
     765+++ vim72/src/config.h.in       2009-03-12 11:55:13.667618383 -0700
     766@@ -50,6 +50,9 @@
     767 /* Define to empty if the keyword does not work.  */
     768 #undef const
     769 
     770+/* Define to empty if the keyword does not work.  */
     771+#undef volatile
     772+
     773 /* Define to `int' if <sys/types.h> doesn't define.  */
     774 #undef mode_t
     775 
    674776diff -Naur vim72.orig/src/configure.in vim72/src/configure.in
    675777--- vim72.orig/src/configure.in 2008-07-24 05:40:26.000000000 -0700
    676 +++ vim72/src/configure.in      2009-01-19 00:09:07.000000000 -0800
    677 @@ -3152,18 +3152,25 @@
     778+++ vim72/src/configure.in      2009-03-12 11:55:13.667618383 -0700
     779@@ -2148,6 +2148,7 @@
     780 dnl Checks for typedefs, structures, and compiler characteristics.
     781 AC_PROG_GCC_TRADITIONAL
     782 AC_C_CONST
     783+AC_C_VOLATILE
     784 AC_TYPE_MODE_T
     785 AC_TYPE_OFF_T
     786 AC_TYPE_PID_T
     787@@ -3152,18 +3153,25 @@
    678788 dnl But only when making dependencies, cproto and lint don't take "-isystem".
    679789 dnl Mac gcc returns "powerpc-apple-darwin8-gcc-4.0.1 (GCC)...", need to allow
     
    709819diff -Naur vim72.orig/src/diff.c vim72/src/diff.c
    710820--- vim72.orig/src/diff.c       2008-03-05 03:16:56.000000000 -0800
    711 +++ vim72/src/diff.c    2009-01-19 00:09:50.000000000 -0800
     821+++ vim72/src/diff.c    2009-03-12 11:55:16.155775667 -0700
     822@@ -8,7 +8,7 @@
     823  */
     824 
     825 /*
     826- * diff.c: code for diff'ing two or three buffers.
     827+ * diff.c: code for diff'ing two, three or four buffers.
     828  */
     829 
     830 #include "vim.h"
    712831@@ -73,6 +73,8 @@
    713832        {
     
    727846        }
    728847     }
     848@@ -113,7 +116,7 @@
     849  * Add a buffer to make diffs for.
     850  * Call this when a new buffer is being edited in the current window where
     851  * 'diff' is set.
     852- * Marks the current buffer as being part of the diff and requireing updating.
     853+ * Marks the current buffer as being part of the diff and requiring updating.
     854  * This must be done before any autocmd, because a command may use info
     855  * about the screen contents.
     856  */
    729857@@ -131,6 +134,7 @@
    730858        {
     
    784912        diff_a_works = MAYBE;
    785913 #if defined(MSWIN) || defined(MSDOS)
     914@@ -914,7 +929,7 @@
     915        goto theend;
     916 
     917 #ifdef UNIX
     918-    /* Temporaraly chdir to /tmp, to avoid patching files in the current
     919+    /* Temporarily chdir to /tmp, to avoid patching files in the current
     920      * directory when the patch file contains more than one patch.  When we
     921      * have our own temp dir use that instead, it will be cleaned up when we
     922      * exit (any .rej files created).  Don't change directory if we can't
    786923@@ -925,10 +940,10 @@
    787924     {
     
    797934     }
    798935 #endif
     936@@ -1138,7 +1153,7 @@
     937 
     938     for (wp = firstwin; wp != NULL; wp = wp->w_next)
     939     {
     940-       if (wp == curwin || eap->forceit)
     941+       if (wp == curwin || (eap->forceit && wp->w_p_diff))
     942        {
     943            /* Set 'diff', 'scrollbind' off and 'wrap' on. */
     944            wp->w_p_diff = FALSE;
     945@@ -2114,6 +2129,8 @@
     946            EMSG2(_("E102: Can't find buffer \"%s\""), eap->arg);
     947            return;
     948        }
     949+       if (buf == curbuf)
     950+           return;             /* nothing to do */
     951        idx_other = diff_buf_idx(buf);
     952        if (idx_other == DB_COUNT)
     953        {
    799954diff -Naur vim72.orig/src/edit.c vim72/src/edit.c
    800955--- vim72.orig/src/edit.c       2008-08-06 05:51:17.000000000 -0700
    801 +++ vim72/src/edit.c    2009-01-19 00:10:48.000000000 -0800
     956+++ vim72/src/edit.c    2009-03-12 11:55:13.411601900 -0700
    802957@@ -147,6 +147,7 @@
    803958 static int  ins_compl_bs __ARGS((void));
     
    827982     void
    828983 backspace_until_column(col)
    829 @@ -1942,13 +1946,49 @@
     984@@ -1942,13 +1946,50 @@
    830985     {
    831986        curwin->w_cursor.col--;
     
    8461001+ * Return TRUE when something was deleted.
    8471002+ */
     1003+/*ARGSUSED*/
    8481004+   static int
    8491005+del_char_after_col(limit_col)
     
    8591015+        * composing character. */
    8601016+       mb_adjust_cursor();
    861 +       while (curwin->w_cursor.col < limit_col)
     1017+       while (curwin->w_cursor.col < (colnr_T)limit_col)
    8621018+       {
    8631019+           int l = utf_ptr2len(ml_get_cursor());
     
    8801036 /*
    8811037  * CTRL-X pressed in Insert mode.
    882 @@ -2418,7 +2458,7 @@
     1038@@ -2418,7 +2459,7 @@
    8831039        {
    8841040            had_match = (curwin->w_cursor.col > compl_col);
     
    8891045 
    8901046            /* When the match isn't there (to avoid matching itself) remove it
    891 @@ -2470,7 +2510,7 @@
     1047@@ -2470,7 +2511,7 @@
    8921048            *p = NUL;
    8931049            had_match = (curwin->w_cursor.col > compl_col);
     
    8981054 
    8991055            /* When the match isn't there (to avoid matching itself) remove it
    900 @@ -3209,7 +3249,7 @@
     1056@@ -3209,7 +3250,7 @@
    9011057 {
    9021058     ins_compl_del_pum();
     
    9071063 
    9081064     if (compl_started)
    909 @@ -3264,6 +3304,20 @@
     1065@@ -3264,6 +3305,20 @@
    9101066 }
    9111067 
     
    9281084  * matches.
    9291085  */
    930 @@ -3621,10 +3675,9 @@
     1086@@ -3621,10 +3676,9 @@
    9311087            {
    9321088                ins_compl_delete();
     
    9411097            }
    9421098 
    943 @@ -4256,7 +4309,7 @@
     1099@@ -4187,7 +4241,7 @@
     1100        }
     1101 
     1102        /* check if compl_curr_match has changed, (e.g. other type of
     1103-        * expansion added somenthing) */
     1104+        * expansion added something) */
     1105        if (type != 0 && compl_curr_match != old_match)
     1106            found_new_match = OK;
     1107 
     1108@@ -4256,7 +4310,7 @@
    9441109     static void
    9451110 ins_compl_insert()
     
    9501115        compl_used_match = FALSE;
    9511116     else
    952 @@ -4425,7 +4478,7 @@
     1117@@ -4425,7 +4479,7 @@
    9531118        if (!compl_get_longest || compl_used_match)
    9541119            ins_compl_insert();
     
    9591124     else
    9601125        compl_used_match = FALSE;
    961 @@ -7123,9 +7176,12 @@
     1126@@ -4688,7 +4742,7 @@
     1127                }
     1128                compl_length = curwin->w_cursor.col - (int)compl_col;
     1129                /* IObuff is used to add a "word from the next line" would we
     1130-                * have enough space?  just being paranoic */
     1131+                * have enough space?  just being paranoid */
     1132 #define        MIN_SPACE 75
     1133                if (compl_length > (IOSIZE - MIN_SPACE))
     1134                {
     1135@@ -7123,9 +7177,12 @@
    9621136  * cc == 0: character was inserted, delete it
    9631137  * cc > 0: character was replaced, put cc (first byte of original char) back
     
    9731147     int                cc;
    9741148 #ifdef FEAT_VREPLACE
    975 @@ -7153,7 +7209,7 @@
     1149@@ -7153,7 +7210,7 @@
    9761150 #ifdef FEAT_MBYTE
    9771151        if (has_mbyte)
     
    9821156            if (State & VREPLACE_FLAG)
    9831157                orig_len = (int)STRLEN(ml_get_cursor());
    984 @@ -7203,7 +7259,7 @@
     1158@@ -7203,7 +7260,7 @@
    9851159        changed_bytes(curwin->w_cursor.lnum, curwin->w_cursor.col);
    9861160     }
     
    9911165 
    9921166 #ifdef FEAT_CINDENT
    993 @@ -8239,7 +8295,7 @@
     1167@@ -7646,9 +7703,7 @@
     1168      */
     1169     ++no_mapping;
     1170     regname = plain_vgetc();
     1171-#ifdef FEAT_LANGMAP
     1172     LANGMAP_ADJUST(regname, TRUE);
     1173-#endif
     1174     if (regname == Ctrl_R || regname == Ctrl_O || regname == Ctrl_P)
     1175     {
     1176        /* Get a third key for literal register insertion */
     1177@@ -7657,9 +7712,7 @@
     1178        add_to_showcmd_c(literally);
     1179 #endif
     1180        regname = plain_vgetc();
     1181-#ifdef FEAT_LANGMAP
     1182        LANGMAP_ADJUST(regname, TRUE);
     1183-#endif
     1184     }
     1185     --no_mapping;
     1186 
     1187@@ -8150,7 +8203,7 @@
     1188 /*
     1189  * If the cursor is on an indent, ^T/^D insert/delete one
     1190  * shiftwidth. Otherwise ^T/^D behave like a "<<" or ">>".
     1191- * Always round the indent to 'shiftwith', this is compatible
     1192+ * Always round the indent to 'shiftwidth', this is compatible
     1193  * with vi.  But vi only supports ^T and ^D after an
     1194  * autoindent, we support it everywhere.
     1195  */
     1196@@ -8239,7 +8292,7 @@
    9941197         * Replace mode */
    9951198        if (curwin->w_cursor.lnum != Insstart.lnum
     
    10001203     else
    10011204        (void)del_char(FALSE);
    1002 @@ -8556,7 +8612,7 @@
     1205@@ -8556,7 +8609,7 @@
    10031206                break;
    10041207            }
     
    10111214diff -Naur vim72.orig/src/eval.c vim72/src/eval.c
    10121215--- vim72.orig/src/eval.c       2008-08-07 12:37:22.000000000 -0700
    1013 +++ vim72/src/eval.c    2009-01-19 00:10:21.000000000 -0800
     1216+++ vim72/src/eval.c    2009-03-12 11:55:08.231269731 -0700
    10141217@@ -32,6 +32,9 @@
    10151218 
     
    11501353     static int
    11511354 tv_islocked(tv)
     1355@@ -3902,7 +3928,7 @@
     1356 
     1357 /*
     1358  * Handle top level expression:
     1359- *     expr1 ? expr0 : expr0
     1360+ *     expr2 ? expr1 : expr1
     1361  *
     1362  * "arg" must point to the first non-white of the expression.
     1363  * "arg" is advanced to the next non-white after the recognized expression.
    11521364@@ -6047,6 +6073,25 @@
    11531365 }
     
    12541466     {"has_key",                2, 2, f_has_key},
    12551467     {"haslocaldir",    0, 0, f_haslocaldir},
    1256 @@ -9518,7 +9580,7 @@
     1468@@ -7856,9 +7918,9 @@
     1469     else if (!aborting())
     1470     {
     1471        if (argcount == MAX_FUNC_ARGS)
     1472-           emsg_funcname("E740: Too many arguments for function %s", name);
     1473+           emsg_funcname(N_("E740: Too many arguments for function %s"), name);
     1474        else
     1475-           emsg_funcname("E116: Invalid arguments for function %s", name);
     1476+           emsg_funcname(N_("E116: Invalid arguments for function %s"), name);
     1477     }
     1478 
     1479     while (--argcount >= 0)
     1480@@ -8091,6 +8153,7 @@
     1481 
     1482 /*
     1483  * Give an error message with a function name.  Handle <SNR> things.
     1484+ * "ermsg" is to be passed without translation, use N_() instead of _().
     1485  */
     1486     static void
     1487 emsg_funcname(ermsg, name)
     1488@@ -9518,7 +9581,7 @@
    12571489     else
    12581490     {
     
    12631495                                    && get_tv_number_chk(&argvars[1], &error))
    12641496            flags |= WILD_KEEP_ALL;
    1265 @@ -10300,7 +10362,8 @@
     1497@@ -10300,7 +10363,8 @@
    12661498     s = get_tv_string(&argvars[0]);
    12671499     if (s == NULL || *s == NUL || VIM_ISDIGIT(*s))
     
    12731505     else
    12741506     {
    1275 @@ -10602,7 +10665,7 @@
     1507@@ -10602,7 +10666,7 @@
    12761508 # ifdef FEAT_WINDOWS
    12771509            win_T       *wp;
     
    12821514            if (row >= 0 && col >= 0)
    12831515            {
    1284 @@ -10612,9 +10675,9 @@
     1516@@ -10612,9 +10676,9 @@
    12851517                (void)mouse_comp_pos(win, &row, &col, &lnum);
    12861518 # ifdef FEAT_WINDOWS
     
    12941526                vimvars[VV_MOUSE_COL].vv_nr = col + 1;
    12951527            }
    1296 @@ -11284,13 +11347,25 @@
     1528@@ -11284,13 +11348,25 @@
    12971529     typval_T   *argvars;
    12981530     typval_T   *rettv;
     
    13241556 
    13251557 /*
    1326 @@ -11301,14 +11376,22 @@
     1558@@ -11301,14 +11377,22 @@
    13271559     typval_T   *argvars;
    13281560     typval_T   *rettv;
     
    13491581 
    13501582 /*
    1351 @@ -11782,6 +11865,10 @@
     1583@@ -11782,6 +11866,10 @@
    13521584            n = has_patch(atoi((char *)name + 5));
    13531585        else if (STRICMP(name, "vim_starting") == 0)
     
    13601592        else if (STRICMP(name, "balloon_multiline") == 0)
    13611593            n = multiline_balloon_available();
    1362 @@ -15838,10 +15925,9 @@
     1594@@ -15838,10 +15926,9 @@
    13631595     if (res == FAIL)
    13641596        res = ITEM_COMPARE_FAIL;
     
    13721604     return res;
    13731605 }
    1374 @@ -16590,8 +16676,11 @@
     1606@@ -16590,8 +16677,11 @@
    13751607                p = highlight_has_attr(id, HL_INVERSE, modec);
    13761608                break;
     
    13861618 
    13871619        case 'u':
    1388 @@ -16658,7 +16747,7 @@
     1620@@ -16658,7 +16748,7 @@
    13891621     col = get_tv_number(&argvars[1]) - 1;      /* -1 on type error */
    13901622 
     
    13951627     {
    13961628        (void)syn_get_id(curwin, lnum, (colnr_T)col, FALSE, NULL, TRUE);
    1397 @@ -18097,14 +18186,28 @@
     1629@@ -18097,14 +18187,28 @@
    13981630 }
    13991631 
     
    14271659     vimvars[VV_COUNT1].vv_nr = count1;
    14281660 }
    1429 @@ -18132,6 +18235,20 @@
     1661@@ -18132,6 +18236,20 @@
    14301662 }
    14311663 
     
    14481680  */
    14491681     void
    1450 @@ -18868,7 +18985,7 @@
     1682@@ -18868,7 +18986,7 @@
    14511683     dictitem_T *dict_var;
    14521684 {
     
    14571689     dict_var->di_tv.v_type = VAR_DICT;
    14581690     dict_var->di_tv.v_lock = VAR_FIXED;
    1459 @@ -19205,6 +19322,8 @@
     1691@@ -19205,6 +19323,8 @@
    14601692  * Copy the values from typval_T "from" to typval_T "to".
    14611693  * When needed allocates string or increases reference count.
     
    14661698     static void
    14671699 copy_tv(from, to)
    1468 @@ -20590,6 +20709,9 @@
     1700@@ -19748,7 +19868,7 @@
     1701                }
     1702            }
     1703            else
     1704-               emsg_funcname("E123: Undefined function: %s", name);
     1705+               emsg_funcname(N_("E123: Undefined function: %s"), name);
     1706        }
     1707        goto ret_free;
     1708     }
     1709@@ -19792,7 +19912,7 @@
     1710                                                      : eval_isnamec(arg[j])))
     1711                ++j;
     1712            if (arg[j] != NUL)
     1713-               emsg_funcname(_(e_invarg2), arg);
     1714+               emsg_funcname((char *)e_invarg2, arg);
     1715        }
     1716     }
     1717 
     1718@@ -20064,7 +20184,7 @@
     1719        v = find_var(name, &ht);
     1720        if (v != NULL && v->di_tv.v_type == VAR_FUNC)
     1721        {
     1722-           emsg_funcname("E707: Function name conflicts with variable: %s",
     1723+           emsg_funcname(N_("E707: Function name conflicts with variable: %s"),
     1724                                                                        name);
     1725            goto erret;
     1726        }
     1727@@ -20079,7 +20199,7 @@
     1728            }
     1729            if (fp->uf_calls > 0)
     1730            {
     1731-               emsg_funcname("E127: Cannot redefine function %s: It is in use",
     1732+               emsg_funcname(N_("E127: Cannot redefine function %s: It is in use"),
     1733                                                                        name);
     1734                goto erret;
     1735            }
     1736@@ -20590,6 +20710,9 @@
    14691737     int                st_len = 0;
    14701738 
     
    14761744 
    14771745     for (hi = func_hashtab.ht_array; todo > 0; ++hi)
    1478 @@ -20638,6 +20760,8 @@
     1746@@ -20638,6 +20761,8 @@
    14791747                                                              prof_self_cmp);
    14801748        prof_sort_list(fd, sorttab, st_len, "SELF", TRUE);
     
    14851753 
    14861754     static void
    1487 @@ -21012,7 +21136,7 @@
     1755@@ -21012,7 +21137,7 @@
    14881756     char_u     *save_sourcing_name;
    14891757     linenr_T   save_sourcing_lnum;
     
    14941762     static int depth = 0;
    14951763     dictitem_T *v;
    1496 @@ -21038,36 +21162,37 @@
     1764@@ -21038,36 +21163,37 @@
    14971765 
    14981766     line_breakcheck();         /* check for CTRL-C hit */
     
    15451813        v->di_tv.v_lock = 0;
    15461814        v->di_tv.vval.v_dict = selfdict;
    1547 @@ -21079,28 +21204,31 @@
     1815@@ -21079,28 +21205,31 @@
    15481816      * Set a:0 to "argcount".
    15491817      * Set a:000 to a list with room for the "..." arguments.
     
    15881856     for (i = 0; i < argcount; ++i)
    15891857     {
    1590 @@ -21116,7 +21244,7 @@
     1858@@ -21116,7 +21245,7 @@
    15911859        }
    15921860        if (fixvar_idx < FIXVAR_CNT && STRLEN(name) <= VAR_SHORT_LEN)
     
    15971865        }
    15981866        else
    1599 @@ -21128,7 +21256,7 @@
     1867@@ -21128,7 +21257,7 @@
    16001868            v->di_flags = DI_FLAGS_RO;
    16011869        }
     
    16061874        /* Note: the values are copied directly to avoid alloc/free.
    16071875         * "argvars" must have VAR_FIXED for v_lock. */
    1608 @@ -21137,9 +21265,9 @@
     1876@@ -21137,9 +21266,9 @@
    16091877 
    16101878        if (ai >= 0 && ai < MAX_FUNC_ARGS)
     
    16191887     }
    16201888 
    1621 @@ -21204,7 +21332,7 @@
     1889@@ -21204,7 +21333,7 @@
    16221890        if (!fp->uf_profiling && has_profiling(FALSE, fp->uf_name, NULL))
    16231891            func_do_profile(fp);
     
    16281896            ++fp->uf_tm_count;
    16291897            profile_start(&call_start);
    1630 @@ -21220,7 +21348,7 @@
     1898@@ -21220,7 +21349,7 @@
    16311899     did_emsg = FALSE;
    16321900 
     
    16371905 
    16381906     --RedrawingDisabled;
    1639 @@ -21235,16 +21363,16 @@
     1907@@ -21235,16 +21364,16 @@
    16401908 
    16411909 #ifdef FEAT_PROFILE
     
    16581926     }
    16591927 #endif
    1660 @@ -21257,9 +21385,9 @@
     1928@@ -21257,9 +21386,9 @@
    16611929 
    16621930        if (aborting())
     
    16701938        {
    16711939            char_u      buf[MSG_BUF_LEN];
    1672 @@ -21270,7 +21398,7 @@
     1940@@ -21270,7 +21399,7 @@
    16731941            /* The value may be very long.  Skip the middle part, so that we
    16741942             * have some idea how it starts and ends. smsg() would always
     
    16791947            {
    16801948                trunc_string(s, buf, MSG_BUF_CLEN);
    1681 @@ -21306,14 +21434,84 @@
     1949@@ -21306,14 +21435,84 @@
    16821950     }
    16831951 
     
    17322000+/*
    17332001+ * Return TRUE if items in "fc" do not have "copyID".  That means they are not
    1734 + * referenced from anywyere.
     2002+ * referenced from anywhere.
    17352003+ */
    17362004+    static int
     
    17702038 
    17712039 /*
    1772 @@ -21886,6 +22084,62 @@
     2040@@ -21886,6 +22085,62 @@
    17732041     }
    17742042 }
     
    18332101 
    18342102 
     2103diff -Naur vim72.orig/src/ex_cmds2.c vim72/src/ex_cmds2.c
     2104--- vim72.orig/src/ex_cmds2.c   2008-07-13 09:18:22.000000000 -0700
     2105+++ vim72/src/ex_cmds2.c        2009-03-12 11:55:13.311593519 -0700
     2106@@ -2842,6 +2842,7 @@
     2107     linenr_T               save_sourcing_lnum;
     2108     char_u                 *p;
     2109     char_u                 *fname_exp;
     2110+    char_u                 *firstline = NULL;
     2111     int                            retval = FAIL;
     2112 #ifdef FEAT_EVAL
     2113     scid_T                 save_current_SID;
     2114@@ -2992,23 +2993,6 @@
     2115 
     2116     cookie.level = ex_nesting_level;
     2117 #endif
     2118-#ifdef FEAT_MBYTE
     2119-    cookie.conv.vc_type = CONV_NONE;           /* no conversion */
     2120-
     2121-    /* Try reading the first few bytes to check for a UTF-8 BOM. */
     2122-    {
     2123-       char_u      buf[3];
     2124-
     2125-       if (fread((char *)buf, sizeof(char_u), (size_t)3, cookie.fp)
     2126-                                                                 == (size_t)3
     2127-               && buf[0] == 0xef && buf[1] == 0xbb && buf[2] == 0xbf)
     2128-           /* Found BOM, setup conversion and skip over it. */
     2129-           convert_setup(&cookie.conv, (char_u *)"utf-8", p_enc);
     2130-       else
     2131-           /* No BOM found, rewind. */
     2132-           fseek(cookie.fp, 0L, SEEK_SET);
     2133-    }
     2134-#endif
     2135 
     2136     /*
     2137      * Keep the sourcing name/lnum, for recursive calls.
     2138@@ -3018,6 +3002,27 @@
     2139     save_sourcing_lnum = sourcing_lnum;
     2140     sourcing_lnum = 0;
     2141 
     2142+#ifdef FEAT_MBYTE
     2143+    cookie.conv.vc_type = CONV_NONE;           /* no conversion */
     2144+
     2145+    /* Read the first line so we can check for a UTF-8 BOM. */
     2146+    firstline = getsourceline(0, (void *)&cookie, 0);
     2147+    if (firstline != NULL && STRLEN(firstline) >= 3 && firstline[0] == 0xef
     2148+                             && firstline[1] == 0xbb && firstline[2] == 0xbf)
     2149+    {
     2150+       /* Found BOM; setup conversion, skip over BOM and recode the line. */
     2151+       convert_setup(&cookie.conv, (char_u *)"utf-8", p_enc);
     2152+       p = string_convert(&cookie.conv, firstline + 3, NULL);
     2153+       if (p == NULL)
     2154+           p = vim_strsave(firstline + 3);
     2155+       if (p != NULL)
     2156+       {
     2157+           vim_free(firstline);
     2158+           firstline = p;
     2159+       }
     2160+    }
     2161+#endif
     2162+
     2163 #ifdef STARTUPTIME
     2164     time_push(&tv_rel, &tv_start);
     2165 #endif
     2166@@ -3111,9 +3116,8 @@
     2167     /*
     2168      * Call do_cmdline, which will call getsourceline() to get the lines.
     2169      */
     2170-    do_cmdline(NULL, getsourceline, (void *)&cookie,
     2171+    do_cmdline(firstline, getsourceline, (void *)&cookie,
     2172                                     DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_REPEAT);
     2173-
     2174     retval = OK;
     2175 
     2176 #ifdef FEAT_PROFILE
     2177@@ -3145,8 +3149,8 @@
     2178        verbose_leave();
     2179     }
     2180 #ifdef STARTUPTIME
     2181-    vim_snprintf(IObuff, IOSIZE, "sourcing %s", fname);
     2182-    time_msg(IObuff, &tv_start);
     2183+    vim_snprintf((char *)IObuff, IOSIZE, "sourcing %s", fname);
     2184+    time_msg((char *)IObuff, &tv_start);
     2185     time_pop(&tv_rel);
     2186 #endif
     2187 
     2188@@ -3171,6 +3175,7 @@
     2189 #endif
     2190     fclose(cookie.fp);
     2191     vim_free(cookie.nextline);
     2192+    vim_free(firstline);
     2193 #ifdef FEAT_MBYTE
     2194     convert_setup(&cookie.conv, NULL, NULL);
     2195 #endif
    18352196diff -Naur vim72.orig/src/ex_cmds.c vim72/src/ex_cmds.c
    18362197--- vim72.orig/src/ex_cmds.c    2008-08-04 12:15:00.000000000 -0700
    1837 +++ vim72/src/ex_cmds.c 2009-01-19 00:10:54.000000000 -0800
     2198+++ vim72/src/ex_cmds.c 2009-03-12 11:55:13.611614471 -0700
    18382199@@ -24,7 +24,7 @@
    18392200 static void do_filter __ARGS((linenr_T line1, linenr_T line2, exarg_T *eap, char_u *cmd, int do_in, int do_out));
     
    19822343     vim_free(vir.vir_line);
    19832344 #ifdef FEAT_MBYTE
    1984 @@ -5059,6 +5062,7 @@
     2345@@ -2414,8 +2417,8 @@
     2346        cursor_on();            /* msg_start() switches it off */
     2347        out_flush();
     2348        silent_mode = save_silent;
     2349-       info_message = FALSE;
     2350     }
     2351+    info_message = FALSE;
     2352 }
     2353 
     2354 /*
     2355@@ -2704,7 +2707,12 @@
     2356        if (eap->cmdidx == CMD_saveas)
     2357        {
     2358            if (retval == OK)
     2359+           {
     2360                curbuf->b_p_ro = FALSE;
     2361+#ifdef FEAT_WINDOWS
     2362+               redraw_tabline = TRUE;
     2363+#endif
     2364+           }
     2365            /* Change directories when the 'acd' option is set. */
     2366            DO_AUTOCHDIR
     2367        }
     2368@@ -5059,6 +5067,7 @@
    19852369 
    19862370            if (did_sub)
     
    19902374            sub_firstline = NULL;
    19912375        }
     2376@@ -6520,6 +6529,7 @@
     2377 static int     last_sign_typenr = MAX_TYPENR;  /* is decremented */
     2378 
     2379 static void sign_list_defined __ARGS((sign_T *sp));
     2380+static void sign_undefine __ARGS((sign_T *sp, sign_T *sp_prev));
     2381 
     2382 /*
     2383  * ":sign" command
     2384@@ -6728,24 +6738,8 @@
     2385                /* ":sign list {name}" */
     2386                sign_list_defined(sp);
     2387            else
     2388-           {
     2389                /* ":sign undefine {name}" */
     2390-               vim_free(sp->sn_name);
     2391-               vim_free(sp->sn_icon);
     2392-#ifdef FEAT_SIGN_ICONS
     2393-               if (sp->sn_image != NULL)
     2394-               {
     2395-                   out_flush();
     2396-                   gui_mch_destroy_sign(sp->sn_image);
     2397-               }
     2398-#endif
     2399-               vim_free(sp->sn_text);
     2400-               if (sp_prev == NULL)
     2401-                   first_sign = sp->sn_next;
     2402-               else
     2403-                   sp_prev->sn_next = sp->sn_next;
     2404-               vim_free(sp);
     2405-           }
     2406+               sign_undefine(sp, sp_prev);
     2407        }
     2408     }
     2409     else
     2410@@ -6994,6 +6988,31 @@
     2411 }
     2412 
     2413 /*
     2414+ * Undefine a sign and free its memory.
     2415+ */
     2416+    static void
     2417+sign_undefine(sp, sp_prev)
     2418+    sign_T     *sp;
     2419+    sign_T     *sp_prev;
     2420+{
     2421+    vim_free(sp->sn_name);
     2422+    vim_free(sp->sn_icon);
     2423+#ifdef FEAT_SIGN_ICONS
     2424+    if (sp->sn_image != NULL)
     2425+    {
     2426+       out_flush();
     2427+       gui_mch_destroy_sign(sp->sn_image);
     2428+    }
     2429+#endif
     2430+    vim_free(sp->sn_text);
     2431+    if (sp_prev == NULL)
     2432+       first_sign = sp->sn_next;
     2433+    else
     2434+       sp_prev->sn_next = sp->sn_next;
     2435+    vim_free(sp);
     2436+}
     2437+
     2438+/*
     2439  * Get highlighting attribute for sign "typenr".
     2440  * If "line" is TRUE: line highl, if FALSE: text highl.
     2441  */
     2442@@ -7067,6 +7086,18 @@
     2443     return (char_u *)_("[Deleted]");
     2444 }
     2445 
     2446+#if defined(EXITFREE) || defined(PROTO)
     2447+/*
     2448+ * Undefine/free all signs.
     2449+ */
     2450+    void
     2451+free_signs()
     2452+{
     2453+    while (first_sign != NULL)
     2454+       sign_undefine(first_sign, NULL);
     2455+}
     2456+#endif
     2457+
     2458 #endif
     2459 
     2460 #if defined(FEAT_GUI) || defined(FEAT_CLIENTSERVER) || defined(PROTO)
    19922461diff -Naur vim72.orig/src/ex_cmds.h vim72/src/ex_cmds.h
    19932462--- vim72.orig/src/ex_cmds.h    2008-06-21 11:47:57.000000000 -0700
    1994 +++ vim72/src/ex_cmds.h 2009-01-19 00:08:31.000000000 -0800
     2463+++ vim72/src/ex_cmds.h 2009-03-12 11:54:40.541495740 -0700
    19952464@@ -278,7 +278,7 @@
    19962465 EX(CMD_crewind,                "crewind",      ex_cc,
     
    20382507                        TRLBAR|EXTRA|CMDWIN|SBOXOK),
    20392508 EX(CMD_setfiletype,    "setfiletype",  ex_setfiletype,
    2040 diff -Naur vim72.orig/src/ex_cmds2.c vim72/src/ex_cmds2.c
    2041 --- vim72.orig/src/ex_cmds2.c   2008-07-13 09:18:22.000000000 -0700
    2042 +++ vim72/src/ex_cmds2.c        2009-01-19 00:07:35.000000000 -0800
    2043 @@ -3145,8 +3145,8 @@
    2044         verbose_leave();
    2045      }
    2046  #ifdef STARTUPTIME
    2047 -    vim_snprintf(IObuff, IOSIZE, "sourcing %s", fname);
    2048 -    time_msg(IObuff, &tv_start);
    2049 +    vim_snprintf((char *)IObuff, IOSIZE, "sourcing %s", fname);
    2050 +    time_msg((char *)IObuff, &tv_start);
    2051      time_pop(&tv_rel);
    2052  #endif
    2053  
    20542509diff -Naur vim72.orig/src/ex_docmd.c vim72/src/ex_docmd.c
    20552510--- vim72.orig/src/ex_docmd.c   2008-07-26 04:51:05.000000000 -0700
    2056 +++ vim72/src/ex_docmd.c        2009-01-19 00:10:13.000000000 -0800
     2511+++ vim72/src/ex_docmd.c        2009-03-12 11:55:24.900337757 -0700
    20572512@@ -364,6 +364,7 @@
    20582513 # define ex_function           ex_ni
     
    20882543 #endif
    20892544        case CMD_set:
    2090 @@ -8749,8 +8752,8 @@
     2545@@ -5121,7 +5124,11 @@
     2546            }
     2547 
     2548            vim_free(cmd->uc_rep);
     2549-           cmd->uc_rep = 0;
     2550+           cmd->uc_rep = NULL;
     2551+#if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
     2552+           vim_free(cmd->uc_compl_arg);
     2553+           cmd->uc_compl_arg = NULL;
     2554+#endif
     2555            break;
     2556        }
     2557 
     2558@@ -5479,6 +5486,9 @@
     2559     return OK;
     2560 }
     2561 
     2562+/*
     2563+ * ":command ..."
     2564+ */
     2565     static void
     2566 ex_command(eap)
     2567     exarg_T   *eap;
     2568@@ -5910,7 +5920,8 @@
     2569     char_u     *q;
     2570 
     2571     char_u     *start;
     2572-    char_u     *end;
     2573+    char_u     *end = NULL;
     2574+    char_u     *ksp;
     2575     size_t     len, totlen;
     2576 
     2577     size_t     split_len = 0;
     2578@@ -5927,16 +5938,51 @@
     2579 
     2580     /*
     2581      * Replace <> in the command by the arguments.
     2582+     * First round: "buf" is NULL, compute length, allocate "buf".
     2583+     * Second round: copy result into "buf".
     2584      */
     2585     buf = NULL;
     2586     for (;;)
     2587     {
     2588-       p = cmd->uc_rep;
     2589-       q = buf;
     2590+       p = cmd->uc_rep;    /* source */
     2591+       q = buf;            /* destination */
     2592        totlen = 0;
     2593-       while ((start = vim_strchr(p, '<')) != NULL
     2594-              && (end = vim_strchr(start + 1, '>')) != NULL)
     2595+
     2596+       for (;;)
     2597        {
     2598+           start = vim_strchr(p, '<');
     2599+           if (start != NULL)
     2600+               end = vim_strchr(start + 1, '>');
     2601+           if (buf != NULL)
     2602+           {
     2603+               ksp = vim_strchr(p, K_SPECIAL);
     2604+               if (ksp != NULL && (start == NULL || ksp < start || end == NULL)
     2605+                       && ((ksp[1] == KS_SPECIAL && ksp[2] == KE_FILLER)
     2606+# ifdef FEAT_GUI
     2607+                           || (ksp[1] == KS_EXTRA && ksp[2] == (int)KE_CSI)
     2608+# endif
     2609+                           ))
     2610+               {
     2611+                   /* K_SPECIAL han been put in the buffer as K_SPECIAL
     2612+                    * KS_SPECIAL KE_FILLER, like for mappings, but
     2613+                    * do_cmdline() doesn't handle that, so convert it back.
     2614+                    * Also change K_SPECIAL KS_EXTRA KE_CSI into CSI. */
     2615+                   len = ksp - p;
     2616+                   if (len > 0)
     2617+                   {
     2618+                       mch_memmove(q, p, len);
     2619+                       q += len;
     2620+                   }
     2621+                   *q++ = ksp[1] == KS_SPECIAL ? K_SPECIAL : CSI;
     2622+                   p = ksp + 3;
     2623+                   continue;
     2624+               }
     2625+           }
     2626+
     2627+           /* break if there no <item> is found */
     2628+           if (start == NULL || end == NULL)
     2629+               break;
     2630+
     2631            /* Include the '>' */
     2632            ++end;
     2633 
     2634@@ -7803,6 +7849,9 @@
     2635 {
     2636     vim_free(prev_dir);
     2637     prev_dir = NULL;
     2638+
     2639+    vim_free(globaldir);
     2640+    globaldir = NULL;
     2641 }
     2642 #endif
     2643 
     2644@@ -7825,6 +7874,10 @@
     2645     else
     2646 #endif
     2647     {
     2648+#ifdef FEAT_AUTOCMD
     2649+       if (allbuf_locked())
     2650+           return;
     2651+#endif
     2652        if (vim_strchr(p_cpo, CPO_CHDIR) != NULL && curbufIsChanged()
     2653                                                             && !eap->forceit)
     2654        {
     2655@@ -8749,8 +8802,8 @@
    20912656                else if (*dirnow != NUL
    20922657                        && (ssop_flags & SSOP_CURDIR) && globaldir != NULL)
     
    20942659-                   (void)mch_chdir((char *)globaldir);
    20952660-                   shorten_fnames(TRUE);
    2096 +                   if (mch_chdir((char *)globaldir) == OK)
     2661+                   if (mch_chdir((char *)globaldir) == 0)
    20972662+                       shorten_fnames(TRUE);
    20982663                }
    20992664 
    21002665                failed |= (makeopens(fd, dirnow) == FAIL);
    2101 @@ -9506,24 +9509,50 @@
     2666@@ -9506,24 +9559,50 @@
    21022667                    break;
    21032668                }
     
    21602725 
    21612726 #ifdef FEAT_SEARCHPATH
    2162 @@ -9541,6 +9570,15 @@
     2727@@ -9541,6 +9620,15 @@
    21632728 #ifdef FEAT_AUTOCMD
    21642729        case SPEC_AFILE:        /* file name for autocommand */
     
    21762741                {
    21772742                    *errormsg = (char_u *)_("E495: no autocommand file name to substitute for \"<afile>\"");
    2178 @@ -10067,7 +10105,7 @@
     2743@@ -10067,7 +10155,7 @@
    21792744      */
    21802745     if (put_line(fd, "let s:sx = expand(\"<sfile>:p:r\").\"x.vim\"") == FAIL
     
    21852750        return FAIL;
    21862751 
    2187 @@ -10689,7 +10727,8 @@
     2752@@ -10689,7 +10777,8 @@
    21882753        p_viminfo = (char_u *)"'100";
    21892754     if (eap->cmdidx == CMD_rviminfo)
     
    21972762diff -Naur vim72.orig/src/ex_getln.c vim72/src/ex_getln.c
    21982763--- vim72.orig/src/ex_getln.c   2008-08-08 02:31:33.000000000 -0700
    2199 +++ vim72/src/ex_getln.c        2009-01-19 00:09:28.000000000 -0800
     2764+++ vim72/src/ex_getln.c        2009-03-12 11:55:13.699620338 -0700
    22002765@@ -31,6 +31,8 @@
    22012766     int                cmdattr;        /* attributes for prompt */
     
    22572822 #ifdef FEAT_SEARCH_EXTRA
    22582823     if (did_incsearch)
    2259 @@ -2508,6 +2518,20 @@
     2824@@ -1990,8 +2000,8 @@
     2825 
     2826 #if defined(FEAT_AUTOCMD) || defined(PROTO)
     2827 /*
     2828- * Check if "curbuf_lock" is set and return TRUE when it is and give an error
     2829- * message.
     2830+ * Check if "curbuf_lock" or "allbuf_lock" is set and return TRUE when it is
     2831+ * and give an error message.
     2832  */
     2833     int
     2834 curbuf_locked()
     2835@@ -2001,6 +2011,21 @@
     2836        EMSG(_("E788: Not allowed to edit another buffer now"));
     2837        return TRUE;
     2838     }
     2839+    return allbuf_locked();
     2840+}
     2841+
     2842+/*
     2843+ * Check if "allbuf_lock" is set and return TRUE when it is and give an error
     2844+ * message.
     2845+ */
     2846+    int
     2847+allbuf_locked()
     2848+{
     2849+    if (allbuf_lock > 0)
     2850+    {
     2851+       EMSG(_("E811: Not allowed to change buffer information now"));
     2852+       return TRUE;
     2853+    }
     2854     return FALSE;
     2855 }
     2856 #endif
     2857@@ -2508,6 +2533,20 @@
    22602858     }
    22612859     mch_memmove(ccline.cmdbuff, p, (size_t)ccline.cmdlen + 1);
     
    22782876 }
    22792877 
    2280 @@ -2875,6 +2899,7 @@
     2878@@ -2875,6 +2914,7 @@
    22812879     prev_ccline = ccline;
    22822880     ccline.cmdbuff = NULL;
     
    22862884 
    22872885 /*
    2288 @@ -3582,6 +3607,7 @@
     2886@@ -3582,6 +3622,7 @@
    22892887 ExpandInit(xp)
    22902888     expand_T   *xp;
     
    22942892 #ifndef BACKSLASH_IN_FILENAME
    22952893     xp->xp_shell = FALSE;
    2296 @@ -4871,7 +4897,7 @@
     2894@@ -4871,7 +4912,7 @@
    22972895     if (s == NULL)
    22982896        return FAIL;
     
    23032901     if (all == NULL)
    23042902        return FAIL;
    2305 @@ -4912,9 +4938,10 @@
     2903@@ -4912,9 +4953,10 @@
    23062904  * newlines.  Returns NULL for an error or no matches.
    23072905  */
     
    23152913     expand_T   xpc;
    23162914     char_u     *buf;
    2317 @@ -4943,10 +4970,10 @@
     2915@@ -4943,10 +4985,10 @@
    23182916        {
    23192917            add_pathsep(buf);
     
    23292927                    len += (int)STRLEN(p[i]) + 1;
    23302928 
     2929@@ -6020,9 +6062,7 @@
     2930 # endif
     2931        return K_IGNORE;
     2932     }
     2933-    cmdwin_type = ccline.cmdfirstc;
     2934-    if (cmdwin_type == NUL)
     2935-       cmdwin_type = '-';
     2936+    cmdwin_type = get_cmdline_type();
     2937 
     2938     /* Create the command-line buffer empty. */
     2939     (void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE);
     2940@@ -6046,7 +6086,7 @@
     2941     /* Showing the prompt may have set need_wait_return, reset it. */
     2942     need_wait_return = FALSE;
     2943 
     2944-    histtype = hist_char2type(ccline.cmdfirstc);
     2945+    histtype = hist_char2type(cmdwin_type);
     2946     if (histtype == HIST_CMD || histtype == HIST_DEBUG)
     2947     {
     2948        if (p_wc == TAB)
    23312949diff -Naur vim72.orig/src/feature.h vim72/src/feature.h
    23322950--- vim72.orig/src/feature.h    2008-08-06 04:00:39.000000000 -0700
    2333 +++ vim72/src/feature.h 2009-01-19 00:08:31.000000000 -0800
     2951+++ vim72/src/feature.h 2009-03-12 11:54:40.545495740 -0700
    23342952@@ -767,9 +767,13 @@
    23352953 
     
    23502968diff -Naur vim72.orig/src/fileio.c vim72/src/fileio.c
    23512969--- vim72.orig/src/fileio.c     2008-08-06 04:01:03.000000000 -0700
    2352 +++ vim72/src/fileio.c  2009-01-19 00:10:40.000000000 -0800
    2353 @@ -932,7 +932,10 @@
     2970+++ vim72/src/fileio.c  2009-03-12 11:55:18.711941333 -0700
     2971@@ -69,7 +69,7 @@
     2972 static int au_find_group __ARGS((char_u *name));
     2973 
     2974 # define AUGROUP_DEFAULT    -1     /* default autocmd group */
     2975-# define AUGROUP_ERROR     -2      /* errornouse autocmd group */
     2976+# define AUGROUP_ERROR     -2      /* erroneous autocmd group */
     2977 # define AUGROUP_ALL       -3      /* all autocmd groups */
     2978 #endif
     2979 
     2980@@ -144,7 +144,9 @@
     2981 # endif
     2982 #endif
     2983 static int move_lines __ARGS((buf_T *frombuf, buf_T *tobuf));
     2984-
     2985+#ifdef FEAT_AUTOCMD
     2986+static char *e_auchangedbuf = N_("E812: Autocommands changed buffer or buffer name");
     2987+#endif
     2988 
     2989     void
     2990 filemess(buf, name, s, attr)
     2991@@ -295,6 +297,19 @@
     2992     int                conv_restlen = 0;       /* nr of bytes in conv_rest[] */
     2993 #endif
     2994 
     2995+#ifdef FEAT_AUTOCMD
     2996+    /* Remember the initial values of curbuf, curbuf->b_ffname and
     2997+     * curbuf->b_fname to detect whether they are altered as a result of
     2998+     * executing nasty autocommands.  Also check if "fname" and "sfname"
     2999+     * point to one of these values. */
     3000+    buf_T   *old_curbuf = curbuf;
     3001+    char_u  *old_b_ffname = curbuf->b_ffname;
     3002+    char_u  *old_b_fname = curbuf->b_fname;
     3003+    int     using_b_ffname = (fname == curbuf->b_ffname)
     3004+                                             || (sfname == curbuf->b_ffname);
     3005+    int     using_b_fname = (fname == curbuf->b_fname)
     3006+                                              || (sfname == curbuf->b_fname);
     3007+#endif
     3008     write_no_eol_lnum = 0;     /* in case it was set by the previous read */
     3009 
     3010     /*
     3011@@ -589,7 +604,21 @@
     3012 #ifdef FEAT_QUICKFIX
     3013                    if (!bt_dontwrite(curbuf))
     3014 #endif
     3015+                   {
     3016                        check_need_swap(newfile);
     3017+#ifdef FEAT_AUTOCMD
     3018+                       /* SwapExists autocommand may mess things up */
     3019+                       if (curbuf != old_curbuf
     3020+                               || (using_b_ffname
     3021+                                       && (old_b_ffname != curbuf->b_ffname))
     3022+                               || (using_b_fname
     3023+                                        && (old_b_fname != curbuf->b_fname)))
     3024+                       {
     3025+                           EMSG(_(e_auchangedbuf));
     3026+                           return FAIL;
     3027+                       }
     3028+#endif
     3029+                   }
     3030                    if (dir_of_file_exists(fname))
     3031                        filemess(curbuf, sfname, (char_u *)_("[New File]"), 0);
     3032                    else
     3033@@ -668,6 +697,17 @@
     3034 #endif
     3035     {
     3036        check_need_swap(newfile);
     3037+#ifdef FEAT_AUTOCMD
     3038+       if (!read_stdin && (curbuf != old_curbuf
     3039+               || (using_b_ffname && (old_b_ffname != curbuf->b_ffname))
     3040+               || (using_b_fname && (old_b_fname != curbuf->b_fname))))
     3041+       {
     3042+           EMSG(_(e_auchangedbuf));
     3043+           if (!read_buffer)
     3044+               close(fd);
     3045+           return FAIL;
     3046+       }
     3047+#endif
     3048 #ifdef UNIX
     3049        /* Set swap file protection bits after creating it. */
     3050        if (swap_mode > 0 && curbuf->b_ml.ml_mfp->mf_fname != NULL)
     3051@@ -698,7 +738,6 @@
     3052     {
     3053        int     m = msg_scroll;
     3054        int     n = msg_scrolled;
     3055-       buf_T   *old_curbuf = curbuf;
     3056 
     3057        /*
     3058         * The file must be closed again, the autocommands may want to change
     3059@@ -740,8 +779,13 @@
     3060        /*
     3061         * Don't allow the autocommands to change the current buffer.
     3062         * Try to re-open the file.
     3063+        *
     3064+        * Don't allow the autocommands to change the buffer name either
     3065+        * (cd for example) if it invalidates fname or sfname.
     3066         */
     3067        if (!read_stdin && (curbuf != old_curbuf
     3068+               || (using_b_ffname && (old_b_ffname != curbuf->b_ffname))
     3069+               || (using_b_fname && (old_b_fname != curbuf->b_fname))
     3070                || (fd = mch_open((char *)fname, O_RDONLY | O_EXTRA, 0)) < 0))
     3071        {
     3072            --no_wait_return;
     3073@@ -932,7 +976,10 @@
    23543074     else
    23553075     {
     
    23623082            fileformat = EOL_UNIX;              /* binary: use Unix format */
    23633083        else if (*p_ffs == NUL)
    2364 @@ -2211,7 +2214,7 @@
     3084@@ -2211,7 +2258,7 @@
    23653085     {
    23663086        /* Use stderr for stdin, makes shell commands work. */
     
    23713091 #endif
    23723092 
    2373 @@ -2341,11 +2344,6 @@
     3093@@ -2341,11 +2388,6 @@
    23743094                STRCAT(IObuff, _("[CR missing]"));
    23753095                c = TRUE;
     
    23833103            {
    23843104                STRCAT(IObuff, _("[long lines split]"));
    2385 @@ -2711,7 +2709,7 @@
     3105@@ -2711,7 +2753,7 @@
    23863106 {
    23873107     if (!curbuf->b_marks_read && get_viminfo_parameter('\'') > 0
     
    23923112     /* Always set b_marks_read; needed when 'viminfo' is changed to include
    23933113      * the ' parameter after opening a buffer. */
    2394 @@ -3451,7 +3449,7 @@
     3114@@ -3451,7 +3493,7 @@
    23953115                {
    23963116 # ifdef UNIX
     
    24013121                    if (mch_stat((char *)IObuff, &st) < 0
    24023122                            || st.st_uid != st_old.st_uid
    2403 @@ -4367,7 +4365,7 @@
     3123@@ -4367,7 +4409,7 @@
    24043124                || st.st_uid != st_old.st_uid
    24053125                || st.st_gid != st_old.st_gid)
     
    24103130                (void)mch_setperm(wfname, perm);
    24113131        }
    2412 @@ -5550,9 +5548,10 @@
     3132@@ -5246,13 +5288,16 @@
     3133            /* Convert with iconv(). */
     3134            if (ip->bw_restlen > 0)
     3135            {
     3136+               char *fp;
     3137+
     3138                /* Need to concatenate the remainder of the previous call and
     3139                 * the bytes of the current call.  Use the end of the
     3140                 * conversion buffer for this. */
     3141                fromlen = len + ip->bw_restlen;
     3142-               from = (char *)ip->bw_conv_buf + ip->bw_conv_buflen - fromlen;
     3143-               mch_memmove((void *)from, ip->bw_rest, (size_t)ip->bw_restlen);
     3144-               mch_memmove((void *)(from + ip->bw_restlen), buf, (size_t)len);
     3145+               fp = (char *)ip->bw_conv_buf + ip->bw_conv_buflen - fromlen;
     3146+               mch_memmove(fp, ip->bw_rest, (size_t)ip->bw_restlen);
     3147+               mch_memmove(fp + ip->bw_restlen, buf, (size_t)len);
     3148+               from = fp;
     3149                tolen = ip->bw_conv_buflen - fromlen;
     3150            }
     3151            else
     3152@@ -5550,9 +5595,10 @@
    24133153            name = "ucs-4le";   /* FF FE 00 00 */
    24143154            len = 4;
     
    24233163     }
    24243164     else if (p[0] == 0xfe && p[1] == 0xff
    2425 @@ -6031,9 +6030,9 @@
     3165@@ -6031,9 +6077,9 @@
    24263166        {
    24273167            tbuf[FGETS_SIZE - 2] = NUL;
     
    24353175        } while (tbuf[FGETS_SIZE - 2] != NUL && tbuf[FGETS_SIZE - 2] != '\n');
    24363176     }
    2437 @@ -6107,12 +6106,24 @@
     3177@@ -6107,12 +6153,24 @@
    24383178 #ifdef HAVE_ACL
    24393179     vim_acl_T  acl;            /* ACL from original file */
     
    24623202     /*
    24633203      * Fail if the "from" file doesn't exist.  Avoids that "to" is deleted.
    2464 @@ -6120,6 +6131,55 @@
     3204@@ -6120,6 +6178,55 @@
    24653205     if (mch_stat((char *)from, &st) < 0)
    24663206        return -1;
     
    25183258      * Delete the "to" file, this is required on some systems to make the
    25193259      * mch_rename() work, on other systems it makes sure that we don't have
    2520 @@ -8523,6 +8583,7 @@
     3260@@ -6260,7 +6367,7 @@
     3261 
     3262     if (!stuff_empty() || global_busy || !typebuf_typed()
     3263 #ifdef FEAT_AUTOCMD
     3264-                       || autocmd_busy || curbuf_lock > 0
     3265+                       || autocmd_busy || curbuf_lock > 0 || allbuf_lock > 0
     3266 #endif
     3267                                        )
     3268        need_check_timestamps = TRUE;           /* check later */
     3269@@ -6462,8 +6569,10 @@
     3270            set_vim_var_string(VV_FCS_REASON, (char_u *)reason, -1);
     3271            set_vim_var_string(VV_FCS_CHOICE, (char_u *)"", -1);
     3272 # endif
     3273+           ++allbuf_lock;
     3274            n = apply_autocmds(EVENT_FILECHANGEDSHELL,
     3275                                      buf->b_fname, buf->b_fname, FALSE, buf);
     3276+           --allbuf_lock;
     3277            busy = FALSE;
     3278            if (n)
     3279            {
     3280@@ -8523,6 +8632,7 @@
    25213281     char_u     *save_sourcing_name;
    25223282     linenr_T   save_sourcing_lnum;
     
    25263286     char_u     *save_autocmd_match;
    25273287     int                save_autocmd_busy;
    2528 @@ -8601,6 +8662,7 @@
     3288@@ -8601,6 +8711,7 @@
    25293289      * Save the autocmd_* variables and info about the current buffer.
    25303290      */
     
    25343294     save_autocmd_match = autocmd_match;
    25353295     save_autocmd_busy = autocmd_busy;
    2536 @@ -8618,14 +8680,15 @@
     3296@@ -8618,14 +8729,15 @@
    25373297        if (fname != NULL && *fname != NUL)
    25383298            autocmd_fname = fname;
     
    25523312     /*
    25533313      * Set the buffer number to be used for <abuf>.
    2554 @@ -8810,6 +8873,7 @@
     3314@@ -8810,6 +8922,7 @@
    25553315     sourcing_lnum = save_sourcing_lnum;
    25563316     vim_free(autocmd_fname);
     
    25603320     autocmd_match = save_autocmd_match;
    25613321 #ifdef FEAT_EVAL
    2562 @@ -8918,7 +8982,7 @@
     3322@@ -8918,7 +9031,7 @@
    25633323     {
    25643324        apc->curpat = NULL;
     
    25693329         * buffer number. */
    25703330        if (ap->pat != NULL && ap->cmds != NULL
    2571 @@ -9104,7 +9168,7 @@
     3331@@ -9104,7 +9217,7 @@
    25723332 set_context_in_autocmd(xp, arg, doautocmd)
    25733333     expand_T   *xp;
     
    25803340diff -Naur vim72.orig/src/fold.c vim72/src/fold.c
    25813341--- vim72.orig/src/fold.c       2008-08-06 04:01:12.000000000 -0700
    2582 +++ vim72/src/fold.c    2009-01-19 00:10:42.000000000 -0800
     3342+++ vim72/src/fold.c    2009-03-12 11:54:59.842732505 -0700
    25833343@@ -48,7 +48,7 @@
    25843344 static int foldFind __ARGS((garray_T *gap, linenr_T lnum, fold_T **fpp));
     
    26693429diff -Naur vim72.orig/src/getchar.c vim72/src/getchar.c
    26703430--- vim72.orig/src/getchar.c    2008-07-22 09:57:48.000000000 -0700
    2671 +++ vim72/src/getchar.c 2009-01-19 00:09:36.000000000 -0800
    2672 @@ -4702,7 +4702,7 @@
     3431+++ vim72/src/getchar.c 2009-03-12 11:55:13.579612236 -0700
     3432@@ -3816,7 +3816,11 @@
     3433     int len = 1;
     3434 
     3435     if (msg_didout || msg_silent != 0)
     3436+    {
     3437        msg_putchar('\n');
     3438+       if (got_int)        /* 'q' typed at MORE prompt */
     3439+           return;
     3440+    }
     3441     if ((mp->m_mode & (INSERT + CMDLINE)) == INSERT + CMDLINE)
     3442        msg_putchar('!');                       /* :map! */
     3443     else if (mp->m_mode & INSERT)
     3444@@ -4702,7 +4706,7 @@
    26733445                        return FAIL;
    26743446                    if (mp->m_noremap != REMAP_YES && fprintf(fd, "nore") < 0)
     
    26793451                    if (buf != NULL && fputs(" <buffer>", fd) < 0)
    26803452                        return FAIL;
    2681 @@ -4801,7 +4801,7 @@
     3453@@ -4801,7 +4805,7 @@
    26823454            }
    26833455            if (IS_SPECIAL(c) || modifiers)     /* special key */
     
    26903462diff -Naur vim72.orig/src/globals.h vim72/src/globals.h
    26913463--- vim72.orig/src/globals.h    2008-07-26 04:53:29.000000000 -0700
    2692 +++ vim72/src/globals.h 2009-01-19 00:10:45.000000000 -0800
    2693 @@ -1022,6 +1022,7 @@
     3464+++ vim72/src/globals.h 2009-03-12 11:55:13.699620338 -0700
     3465@@ -482,8 +482,10 @@
     3466 /*
     3467  * While executing external commands or in Ex mode, should not insert GUI
     3468  * events in the input buffer: Set hold_gui_events to non-zero.
     3469+ *
     3470+ * volatile because it is used in signal handler sig_sysmouse().
     3471  */
     3472-EXTERN int     hold_gui_events INIT(= 0);
     3473+EXTERN volatile int hold_gui_events INIT(= 0);
     3474 
     3475 /*
     3476  * When resizing the shell is postponed, remember the new size, and call
     3477@@ -597,7 +599,8 @@
     3478 EXTERN int     really_exiting INIT(= FALSE);
     3479                                /* TRUE when we are sure to exit, e.g., after
     3480                                 * a deadly signal */
     3481-EXTERN int     full_screen INIT(= FALSE);
     3482+/* volatile because it is used in signal handler deathtrap(). */
     3483+EXTERN volatile int full_screen INIT(= FALSE);
     3484                                /* TRUE when doing full-screen output
     3485                                 * otherwise only writing some messages */
     3486 
     3487@@ -616,6 +619,11 @@
     3488 EXTERN int     curbuf_lock INIT(= 0);
     3489                                /* non-zero when the current buffer can't be
     3490                                 * changed.  Used for FileChangedRO. */
     3491+EXTERN int     allbuf_lock INIT(= 0);
     3492+                               /* non-zero when no buffer name can be
     3493+                                * changed, no buffer can be deleted and
     3494+                                * current directory can't be changed.
     3495+                                * Used for SwapExists et al. */
     3496 #endif
     3497 #ifdef FEAT_EVAL
     3498 # define HAVE_SANDBOX
     3499@@ -739,10 +747,12 @@
     3500  */
     3501 EXTERN JMP_BUF lc_jump_env;    /* argument to SETJMP() */
     3502 # ifdef SIGHASARG
     3503-EXTERN int lc_signal;          /* catched signal number, 0 when no was signal
     3504-                                  catched; used for mch_libcall() */
     3505+/* volatile because it is used in signal handlers. */
     3506+EXTERN volatile int lc_signal; /* caught signal number, 0 when no was signal
     3507+                                  caught; used for mch_libcall() */
     3508 # endif
     3509-EXTERN int lc_active INIT(= FALSE); /* TRUE when lc_jump_env is valid. */
     3510+/* volatile because it is used in signal handler deathtrap(). */
     3511+EXTERN volatile int lc_active INIT(= FALSE); /* TRUE when lc_jump_env is valid. */
     3512 #endif
     3513 
     3514 #if defined(FEAT_MBYTE) || defined(FEAT_POSTSCRIPT)
     3515@@ -986,7 +996,8 @@
     3516 EXTERN FILE    *scriptout  INIT(= NULL);   /* stream to write script to */
     3517 EXTERN int     read_cmd_fd INIT(= 0);      /* fd to read commands from */
     3518 
     3519-EXTERN int     got_int INIT(= FALSE);      /* set to TRUE when interrupt
     3520+/* volatile because it is used in signal handler catch_sigint(). */
     3521+EXTERN volatile int got_int INIT(= FALSE);    /* set to TRUE when interrupt
     3522                                                signal occurred */
     3523 #ifdef USE_TERM_CONSOLE
     3524 EXTERN int     term_console INIT(= FALSE); /* set to TRUE when console used */
     3525@@ -1022,6 +1033,7 @@
    26943526 #endif
    26953527 #ifdef FEAT_AUTOCMD
     
    26993531 EXTERN char_u  *autocmd_match INIT(= NULL); /* name for <amatch> on cmdline */
    27003532 EXTERN int     did_cursorhold INIT(= FALSE); /* set when CursorHold t'gerd */
    2701 @@ -1339,7 +1340,6 @@
     3533@@ -1339,7 +1351,6 @@
    27023534 
    27033535 #ifdef FEAT_NETBEANS_INTG
     
    27073539 EXTERN int netbeansForcedQuit INIT(= 0);/* don't write modified files */
    27083540 EXTERN int netbeansReadFile INIT(= 1); /* OK to read from disk if != 0 */
    2709 @@ -1548,6 +1548,14 @@
     3541@@ -1548,6 +1559,14 @@
    27103542 EXTERN time_t starttime;
    27113543 
     
    27223554  */
    27233555 #ifdef FEAT_FKMAP
     3556diff -Naur vim72.orig/src/gui_at_sb.c vim72/src/gui_at_sb.c
     3557--- vim72.orig/src/gui_at_sb.c  2004-06-07 07:32:25.000000000 -0700
     3558+++ vim72/src/gui_at_sb.c       2009-03-12 11:54:50.138110630 -0700
     3559@@ -1078,6 +1078,12 @@
     3560     Cardinal   *num_params;    /* unused */
     3561 {
     3562     ScrollbarWidget sbw = (ScrollbarWidget)w;
     3563+    /* Use a union to avoid a warning for the weird conversion from float to
     3564+     * XtPointer.  Comes from Xaw/Scrollbar.c. */
     3565+    union {
     3566+       XtPointer xtp;
     3567+       float xtf;
     3568+    } xtpf;
     3569 
     3570     if (LookAhead(w, event))
     3571        return;
     3572@@ -1085,7 +1091,8 @@
     3573     /* thumbProc is not pretty, but is necessary for backwards
     3574        compatibility on those architectures for which it work{s,ed};
     3575        the intent is to pass a (truncated) float by value. */
     3576-    XtCallCallbacks(w, XtNthumbProc, *(XtPointer*)&sbw->scrollbar.top);
     3577+    xtpf.xtf = sbw->scrollbar.top;
     3578+    XtCallCallbacks(w, XtNthumbProc, xtpf.xtp);
     3579     XtCallCallbacks(w, XtNjumpProc, (XtPointer)&sbw->scrollbar.top);
     3580 }
     3581 
    27243582diff -Naur vim72.orig/src/gui.c vim72/src/gui.c
    27253583--- vim72.orig/src/gui.c        2008-07-27 12:32:14.000000000 -0700
    2726 +++ vim72/src/gui.c     2009-01-19 00:10:07.000000000 -0800
     3584+++ vim72/src/gui.c     2009-03-12 11:54:50.298121805 -0700
    27273585@@ -139,7 +139,7 @@
    27283586                /* The read returns when the child closes the pipe (or when
     
    28153673        }
    28163674 #ifdef FEAT_WINDOWS
    2817 diff -Naur vim72.orig/src/gui_at_sb.c vim72/src/gui_at_sb.c
    2818 --- vim72.orig/src/gui_at_sb.c  2004-06-07 07:32:25.000000000 -0700
    2819 +++ vim72/src/gui_at_sb.c       2009-01-19 00:09:39.000000000 -0800
    2820 @@ -1078,6 +1078,12 @@
    2821      Cardinal   *num_params;    /* unused */
    2822  {
    2823      ScrollbarWidget sbw = (ScrollbarWidget)w;
    2824 +    /* Use a union to avoid a warning for the weird conversion from float to
    2825 +     * XtPointer.  Comes from Xaw/Scrollbar.c. */
    2826 +    union {
    2827 +       XtPointer xtp;
    2828 +       float xtf;
    2829 +    } xtpf;
    2830  
    2831      if (LookAhead(w, event))
    2832         return;
    2833 @@ -1085,7 +1091,8 @@
    2834      /* thumbProc is not pretty, but is necessary for backwards
    2835         compatibility on those architectures for which it work{s,ed};
    2836         the intent is to pass a (truncated) float by value. */
    2837 -    XtCallCallbacks(w, XtNthumbProc, *(XtPointer*)&sbw->scrollbar.top);
    2838 +    xtpf.xtf = sbw->scrollbar.top;
    2839 +    XtCallCallbacks(w, XtNthumbProc, xtpf.xtp);
    2840      XtCallCallbacks(w, XtNjumpProc, (XtPointer)&sbw->scrollbar.top);
    2841  }
    2842  
    28433675diff -Naur vim72.orig/src/gui_gtk_x11.c vim72/src/gui_gtk_x11.c
    28443676--- vim72.orig/src/gui_gtk_x11.c        2008-07-04 03:46:24.000000000 -0700
    2845 +++ vim72/src/gui_gtk_x11.c     2009-01-19 00:09:39.000000000 -0800
     3677+++ vim72/src/gui_gtk_x11.c     2009-03-12 11:54:50.138110630 -0700
    28463678@@ -4070,14 +4070,14 @@
    28473679 
     
    28673699diff -Naur vim72.orig/src/gui_x11.c vim72/src/gui_x11.c
    28683700--- vim72.orig/src/gui_x11.c    2008-06-08 08:13:45.000000000 -0700
    2869 +++ vim72/src/gui_x11.c 2009-01-19 00:08:42.000000000 -0800
    2870 @@ -2450,7 +2450,7 @@
     3701+++ vim72/src/gui_x11.c 2009-03-12 11:55:13.599613075 -0700
     3702@@ -1587,6 +1587,8 @@
     3703     XtCloseDisplay(gui.dpy);
     3704     gui.dpy = NULL;
     3705     vimShell = (Widget)0;
     3706+    vim_free(gui_argv);
     3707+    gui_argv = NULL;
     3708 }
     3709 
     3710 /*
     3711@@ -1761,6 +1763,8 @@
     3712      * says that this isn't needed when exiting, so just skip it. */
     3713     XtCloseDisplay(gui.dpy);
     3714 #endif
     3715+    vim_free(gui_argv);
     3716+    gui_argv = NULL;
     3717 }
     3718 
     3719 /*
     3720@@ -2450,7 +2454,7 @@
    28713721        *colorPtr = colortable[closest];
    28723722     }
     
    28773727 }
    28783728 
     3729@@ -3439,47 +3443,37 @@
     3730     char_u         *signfile;
     3731 {
     3732     XpmAttributes   attrs;
     3733-    XImage         *sign;
     3734+    XImage         *sign = NULL;
     3735     int                    status;
     3736 
     3737     /*
     3738      * Setup the color substitution table.
     3739      */
     3740-    sign = NULL;
     3741     if (signfile[0] != NUL && signfile[0] != '-')
     3742     {
     3743-       sign = (XImage *)alloc(sizeof(XImage));
     3744-       if (sign != NULL)
     3745+       XpmColorSymbol color[5] =
     3746        {
     3747-           XpmColorSymbol color[5] =
     3748-           {
     3749-               {"none", NULL, 0},
     3750-               {"iconColor1", NULL, 0},
     3751-               {"bottomShadowColor", NULL, 0},
     3752-               {"topShadowColor", NULL, 0},
     3753-               {"selectColor", NULL, 0}
     3754-           };
     3755-           attrs.valuemask = XpmColorSymbols;
     3756-           attrs.numsymbols = 2;
     3757-           attrs.colorsymbols = color;
     3758-           attrs.colorsymbols[0].pixel = gui.back_pixel;
     3759-           attrs.colorsymbols[1].pixel = gui.norm_pixel;
     3760-           status = XpmReadFileToImage(gui.dpy, (char *)signfile,
     3761+           {"none", NULL, 0},
     3762+           {"iconColor1", NULL, 0},
     3763+           {"bottomShadowColor", NULL, 0},
     3764+           {"topShadowColor", NULL, 0},
     3765+           {"selectColor", NULL, 0}
     3766+       };
     3767+       attrs.valuemask = XpmColorSymbols;
     3768+       attrs.numsymbols = 2;
     3769+       attrs.colorsymbols = color;
     3770+       attrs.colorsymbols[0].pixel = gui.back_pixel;
     3771+       attrs.colorsymbols[1].pixel = gui.norm_pixel;
     3772+       status = XpmReadFileToImage(gui.dpy, (char *)signfile,
     3773                                                         &sign, NULL, &attrs);
     3774-
     3775-           if (status == 0)
     3776-           {
     3777-               /* Sign width is fixed at two columns now.
     3778-               if (sign->width > gui.sign_width)
     3779-                   gui.sign_width = sign->width + 8; */
     3780-           }
     3781-           else
     3782-           {
     3783-               vim_free(sign);
     3784-               sign = NULL;
     3785-               EMSG(_(e_signdata));
     3786-           }
     3787+       if (status == 0)
     3788+       {
     3789+           /* Sign width is fixed at two columns now.
     3790+           if (sign->width > gui.sign_width)
     3791+               gui.sign_width = sign->width + 8; */
     3792        }
     3793+       else
     3794+           EMSG(_(e_signdata));
     3795     }
     3796 
     3797     return (void *)sign;
     3798@@ -3489,8 +3483,7 @@
     3799 gui_mch_destroy_sign(sign)
     3800     void *sign;
     3801 {
     3802-    XFree(((XImage *)sign)->data);
     3803-    vim_free(sign);
     3804+    XDestroyImage((XImage*)sign);
     3805 }
     3806 #endif
     3807 
    28793808diff -Naur vim72.orig/src/gui_xmdlg.c vim72/src/gui_xmdlg.c
    28803809--- vim72.orig/src/gui_xmdlg.c  2008-06-21 09:05:32.000000000 -0700
    2881 +++ vim72/src/gui_xmdlg.c       2009-01-19 00:09:39.000000000 -0800
     3810+++ vim72/src/gui_xmdlg.c       2009-03-12 11:54:50.142110910 -0700
    28823811@@ -369,10 +369,10 @@
    28833812     char       buf[TEMP_BUF_SIZE];
     
    30353964diff -Naur vim72.orig/src/gui_xmebw.c vim72/src/gui_xmebw.c
    30363965--- vim72.orig/src/gui_xmebw.c  2007-09-06 03:57:51.000000000 -0700
    3037 +++ vim72/src/gui_xmebw.c       2009-01-19 00:09:39.000000000 -0800
     3966+++ vim72/src/gui_xmebw.c       2009-03-12 11:54:50.142110910 -0700
    30383967@@ -1256,7 +1256,7 @@
    30393968     }
     
    30623991diff -Naur vim72.orig/src/if_cscope.c vim72/src/if_cscope.c
    30633992--- vim72.orig/src/if_cscope.c  2008-06-24 09:32:34.000000000 -0700
    3064 +++ vim72/src/if_cscope.c       2009-01-19 00:07:11.000000000 -0800
     3993+++ vim72/src/if_cscope.c       2009-03-12 11:55:05.383086185 -0700
    30653994@@ -74,7 +74,7 @@
    30663995     { "add",   cs_add,
     
    30724001                N_("Show this message"),      "help", 0 },
    30734002     { "kill",  cs_kill,
    3074 @@ -1180,7 +1180,16 @@
    3075         (void)smsg((char_u *)_("%-5s: %-30s (Usage: %s)"),
    3076                                       cmdp->name, _(cmdp->help), cmdp->usage);
     4003@@ -1177,10 +1177,27 @@
     4004     (void)MSG_PUTS(_("cscope commands:\n"));
     4005     while (cmdp->name != NULL)
     4006     {
     4007-       (void)smsg((char_u *)_("%-5s: %-30s (Usage: %s)"),
     4008-                                     cmdp->name, _(cmdp->help), cmdp->usage);
     4009+       char *help = _(cmdp->help);
     4010+       int  space_cnt = 30 - vim_strsize((char_u *)help);
     4011+
     4012+       /* Use %*s rather than %30s to ensure proper alignment in utf-8 */
     4013+       if (space_cnt < 0)
     4014+           space_cnt = 0;
     4015+       (void)smsg((char_u *)_("%-5s: %s%*s (Usage: %s)"),
     4016+                                     cmdp->name,
     4017+                                     help, space_cnt, " ",
     4018+                                     cmdp->usage);
    30774019        if (strcmp(cmdp->name, "find") == 0)
    30784020-           MSG_PUTS(FIND_HELP);
     
    30924034diff -Naur vim72.orig/src/if_cscope.h vim72/src/if_cscope.h
    30934035--- vim72.orig/src/if_cscope.h  2007-09-02 07:51:08.000000000 -0700
    3094 +++ vim72/src/if_cscope.h       2009-01-19 00:07:11.000000000 -0800
     4036+++ vim72/src/if_cscope.h       2009-03-12 11:54:28.876748429 -0700
    30954037@@ -42,17 +42,6 @@
    30964038  * f 7name     Find this file
     
    31134055diff -Naur vim72.orig/src/if_perl.xs vim72/src/if_perl.xs
    31144056--- vim72.orig/src/if_perl.xs   2008-07-17 13:55:09.000000000 -0700
    3115 +++ vim72/src/if_perl.xs        2009-01-19 00:10:02.000000000 -0800
     4057+++ vim72/src/if_perl.xs        2009-03-12 11:54:50.278119291 -0700
    31164058@@ -136,6 +136,9 @@
    31174059 #  define Perl_newXS_flags dll_Perl_newXS_flags
     
    31644106diff -Naur vim72.orig/src/if_python.c vim72/src/if_python.c
    31654107--- vim72.orig/src/if_python.c  2008-07-17 14:09:32.000000000 -0700
    3166 +++ vim72/src/if_python.c       2009-01-19 00:10:59.000000000 -0800
     4108+++ vim72/src/if_python.c       2009-03-12 11:54:59.902735857 -0700
    31674109@@ -531,6 +531,12 @@
    31684110        if (PythonMod_Init())
     
    32664208diff -Naur vim72.orig/src/if_xcmdsrv.c vim72/src/if_xcmdsrv.c
    32674209--- vim72.orig/src/if_xcmdsrv.c 2008-07-18 06:05:03.000000000 -0700
    3268 +++ vim72/src/if_xcmdsrv.c      2009-01-19 00:08:50.000000000 -0800
     4210+++ vim72/src/if_xcmdsrv.c      2009-03-12 11:54:43.269670345 -0700
    32694211@@ -736,7 +736,7 @@
    32704212                + serverReply.ga_len;
     
    32944236                p = entry;
    32954237                continue;
     4238diff -Naur vim72.orig/src/macros.h vim72/src/macros.h
     4239--- vim72.orig/src/macros.h     2007-08-04 04:44:18.000000000 -0700
     4240+++ vim72/src/macros.h  2009-03-12 11:55:13.411601900 -0700
     4241@@ -127,15 +127,31 @@
     4242 #ifdef FEAT_LANGMAP
     4243 /*
     4244  * Adjust chars in a language according to 'langmap' option.
     4245- * NOTE that there is NO overhead if 'langmap' is not set; but even
     4246- * when set we only have to do 2 ifs and an array lookup.
     4247+ * NOTE that there is no noticeable overhead if 'langmap' is not set.
     4248+ * When set the overhead for characters < 256 is small.
     4249  * Don't apply 'langmap' if the character comes from the Stuff buffer.
     4250  * The do-while is just to ignore a ';' after the macro.
     4251  */
     4252-# define LANGMAP_ADJUST(c, condition) do { \
     4253-       if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0 && (c) < 256) \
     4254-           c = langmap_mapchar[c]; \
     4255+# ifdef FEAT_MBYTE
     4256+#  define LANGMAP_ADJUST(c, condition) \
     4257+    do { \
     4258+        if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0) \
     4259+       { \
     4260+           if ((c) < 256) \
     4261+               c = langmap_mapchar[c]; \
     4262+           else \
     4263+               c = langmap_adjust_mb(c); \
     4264+       } \
     4265     } while (0)
     4266+# else
     4267+#  define LANGMAP_ADJUST(c, condition) \
     4268+    do { \
     4269+        if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0 && (c) < 256) \
     4270+            c = langmap_mapchar[c]; \
     4271+    } while (0)
     4272+# endif
     4273+#else
     4274+# define LANGMAP_ADJUST(c, condition) /* nop */
     4275 #endif
     4276 
     4277 /*
    32964278diff -Naur vim72.orig/src/main.c vim72/src/main.c
    32974279--- vim72.orig/src/main.c       2008-07-24 01:40:56.000000000 -0700
    3298 +++ vim72/src/main.c    2009-01-19 00:09:39.000000000 -0800
     4280+++ vim72/src/main.c    2009-03-12 11:54:50.142110910 -0700
    32994281@@ -645,11 +645,12 @@
    33004282 
     
    33584340diff -Naur vim72.orig/src/mark.c vim72/src/mark.c
    33594341--- vim72.orig/src/mark.c       2008-08-08 15:06:49.000000000 -0700
    3360 +++ vim72/src/mark.c    2009-01-19 00:08:31.000000000 -0800
     4342+++ vim72/src/mark.c    2009-03-12 11:54:40.549496299 -0700
    33614343@@ -1627,15 +1627,17 @@
    33624344 
     
    34274409diff -Naur vim72.orig/src/mbyte.c vim72/src/mbyte.c
    34284410--- vim72.orig/src/mbyte.c      2008-07-14 05:38:05.000000000 -0700
    3429 +++ vim72/src/mbyte.c   2009-01-19 00:09:39.000000000 -0800
     4411+++ vim72/src/mbyte.c   2009-03-12 11:54:50.142110910 -0700
    34304412@@ -717,7 +717,7 @@
    34314413                     * where mblen() returns 0 for invalid character.
     
    35094491diff -Naur vim72.orig/src/menu.c vim72/src/menu.c
    35104492--- vim72.orig/src/menu.c       2008-06-21 12:53:43.000000000 -0700
    3511 +++ vim72/src/menu.c    2009-01-19 00:07:05.000000000 -0800
     4493+++ vim72/src/menu.c    2009-03-12 11:54:28.852745635 -0700
    35124494@@ -1120,6 +1120,7 @@
    35134495        parent = menu;
     
    35204502diff -Naur vim72.orig/src/message.c vim72/src/message.c
    35214503--- vim72.orig/src/message.c    2008-07-09 11:24:55.000000000 -0700
    3522 +++ vim72/src/message.c 2009-01-19 00:10:51.000000000 -0800
    3523 @@ -4556,7 +4556,13 @@
     4504+++ vim72/src/message.c 2009-03-12 11:55:13.623615309 -0700
     4505@@ -976,7 +976,7 @@
     4506                    }
     4507                }
     4508                else if (msg_scrolled > Rows - 2
     4509-                                    && (c == 'j' || c == K_DOWN || c == 'd'))
     4510+                        && (c == 'j' || c == K_DOWN || c == 'd' || c == 'f'))
     4511                    c = K_IGNORE;
     4512            }
     4513        } while ((had_got_int && c == Ctrl_C)
     4514@@ -2504,7 +2504,6 @@
     4515            break;
     4516 
     4517        case 'u':               /* Up half a page */
     4518-       case K_PAGEUP:
     4519            scroll = -(Rows / 2);
     4520            break;
     4521 
     4522@@ -2513,10 +2512,12 @@
     4523            break;
     4524 
     4525        case 'b':               /* one page back */
     4526+       case K_PAGEUP:
     4527            scroll = -(Rows - 1);
     4528            break;
     4529 
     4530        case ' ':               /* one extra page */
     4531+       case 'f':
     4532        case K_PAGEDOWN:
     4533        case K_LEFTMOUSE:
     4534            scroll = Rows - 1;
     4535@@ -2552,7 +2553,6 @@
     4536            {
     4537                /* Jump to the choices of the dialog. */
     4538                retval = TRUE;
     4539-               lines_left = Rows - 1;
     4540            }
     4541            else
     4542 #endif
     4543@@ -2560,6 +2560,9 @@
     4544                got_int = TRUE;
     4545                quit_more = TRUE;
     4546            }
     4547+           /* When there is some more output (wrapping line) display that
     4548+            * without another prompt. */
     4549+           lines_left = Rows - 1;
     4550            break;
     4551 
     4552 #ifdef FEAT_CLIPBOARD
     4553@@ -3309,7 +3312,10 @@
     4554     {
     4555        c = gui_mch_dialog(type, title, message, buttons, dfltbutton,
     4556                                                                   textfield);
     4557-       msg_end_prompt();
     4558+       /* avoid a hit-enter prompt without clearing the cmdline */
     4559+       need_wait_return = FALSE;
     4560+       emsg_on_display = FALSE;
     4561+       cmdline_row = msg_row;
     4562 
     4563        /* Flush output to avoid that further messages and redrawing is done
     4564         * in the wrong order. */
     4565@@ -4556,7 +4562,13 @@
    35244566                        remove_trailing_zeroes = TRUE;
    35254567                    }
     
    35364578                        /* Avoid a buffer overflow */
    35374579                        strcpy(tmp, "inf");
    3538 @@ -4585,61 +4591,62 @@
     4580@@ -4585,61 +4597,62 @@
    35394581                        if (remove_trailing_zeroes)
    35404582                        {
     
    36224664diff -Naur vim72.orig/src/misc1.c vim72/src/misc1.c
    36234665--- vim72.orig/src/misc1.c      2008-07-12 12:20:53.000000000 -0700
    3624 +++ vim72/src/misc1.c   2009-01-19 00:08:31.000000000 -0800
     4666+++ vim72/src/misc1.c   2009-03-12 11:54:40.553496578 -0700
    36254667@@ -3245,9 +3245,9 @@
    36264668 
     
    36374679diff -Naur vim72.orig/src/misc2.c vim72/src/misc2.c
    36384680--- vim72.orig/src/misc2.c      2008-07-23 12:12:56.000000000 -0700
    3639 +++ vim72/src/misc2.c   2009-01-19 00:10:29.000000000 -0800
    3640 @@ -873,7 +873,7 @@
     4681+++ vim72/src/misc2.c   2009-03-12 11:55:33.688900964 -0700
     4682@@ -496,7 +496,8 @@
     4683 {
     4684     colnr_T len;
     4685 #ifdef FEAT_VIRTUALEDIT
     4686-    colnr_T oldcol = curwin->w_cursor.col + curwin->w_cursor.coladd;
     4687+    colnr_T oldcol = curwin->w_cursor.col;
     4688+    colnr_T oldcoladd = curwin->w_cursor.col + curwin->w_cursor.coladd;
     4689 #endif
     4690 
     4691     len = (colnr_T)STRLEN(ml_get_curline());
     4692@@ -535,7 +536,13 @@
     4693     if (oldcol == MAXCOL)
     4694        curwin->w_cursor.coladd = 0;
     4695     else if (ve_flags == VE_ALL)
     4696-       curwin->w_cursor.coladd = oldcol - curwin->w_cursor.col;
     4697+    {
     4698+       if (oldcoladd > curwin->w_cursor.col)
     4699+           curwin->w_cursor.coladd = oldcoladd - curwin->w_cursor.col;
     4700+       else
     4701+           /* avoid weird number when there is a miscalculation or overflow */
     4702+           curwin->w_cursor.coladd = 0;
     4703+    }
     4704 #endif
     4705 }
     4706 
     4707@@ -873,7 +880,7 @@
    36414708            /* 3. check for available memory: call mch_avail_mem() */
    36424709            if (mch_avail_mem(TRUE) < KEEP_ROOM && !releasing)
     
    36474714            }
    36484715            else
    3649 @@ -1257,7 +1257,6 @@
     4716@@ -1010,6 +1017,9 @@
     4717 # if defined(FEAT_PROFILE)
     4718     do_cmdline_cmd((char_u *)"profdel *");
     4719 # endif
     4720+# if defined(FEAT_KEYMAP)
     4721+    do_cmdline_cmd((char_u *)"set keymap=");
     4722+#endif
     4723 
     4724 # ifdef FEAT_TITLE
     4725     free_titles();
     4726@@ -1034,6 +1044,9 @@
     4727     free_regexp_stuff();
     4728     free_tag_stuff();
     4729     free_cd_dir();
     4730+# ifdef FEAT_SIGNS
     4731+    free_signs();
     4732+# endif
     4733 # ifdef FEAT_EVAL
     4734     set_expr_line(NULL);
     4735 # endif
     4736@@ -1257,7 +1270,6 @@
    36504737     return escaped_string;
    36514738 }
     
    36554742  * Return TRUE when 'shell' has "csh" in the tail.
    36564743  */
    3657 @@ -1266,9 +1265,7 @@
     4744@@ -1266,9 +1278,7 @@
    36584745 {
    36594746     return (strstr((char *)gettail(p_sh), "csh") != NULL);
     
    36654752  * Escape "string" for use as a shell argument with system().
    36664753  * This uses single quotes, except when we know we need to use double qoutes
    3667 @@ -1391,7 +1388,6 @@
     4754@@ -1391,7 +1401,6 @@
    36684755 
    36694756     return escaped_string;
     
    36734760 /*
    36744761  * Like vim_strsave(), but make all characters uppercase.
    3675 @@ -2565,7 +2561,7 @@
     4762@@ -2565,7 +2574,7 @@
    36764763     int                key;
    36774764     int                dlen = 0;
     
    36824769        return 0;
    36834770 
    3684 @@ -2601,10 +2597,11 @@
     4771@@ -2601,10 +2610,11 @@
    36854772  * returns 0 if there is no match.
    36864773  */
     
    36964783     char_u     *last_dash;
    36974784     char_u     *end_of_name;
    3698 @@ -2672,7 +2669,8 @@
     4785@@ -2672,7 +2682,8 @@
    36994786            else
    37004787            {
     
    37064793 
    37074794            /*
     4795@@ -4698,7 +4709,8 @@
     4796                                stackp->ffs_filearray_cur = i + 1;
     4797                                ff_push(search_ctx, stackp);
     4798 
     4799-                               simplify_filename(file_path);
     4800+                               if (!path_with_url(file_path))
     4801+                                   simplify_filename(file_path);
     4802                                if (mch_dirname(ff_expand_buffer, MAXPATHL)
     4803                                                                        == OK)
     4804                                {
    37084805diff -Naur vim72.orig/src/move.c vim72/src/move.c
    37094806--- vim72.orig/src/move.c       2008-07-12 09:26:47.000000000 -0700
    3710 +++ vim72/src/move.c    2009-01-19 00:09:02.000000000 -0800
     4807+++ vim72/src/move.c    2009-03-12 11:54:46.913903059 -0700
    37114808@@ -280,18 +280,20 @@
    37124809 
     
    37564853     wp->w_topfill = 0;
    37574854 #endif
     4855diff -Naur vim72.orig/src/nbdebug.c vim72/src/nbdebug.c
     4856--- vim72.orig/src/nbdebug.c    2008-06-22 08:38:58.000000000 -0700
     4857+++ vim72/src/nbdebug.c 2009-03-12 11:55:13.487606370 -0700
     4858@@ -33,7 +33,6 @@
     4859 u_int           nb_dlevel = 0;         /* nb_debug verbosity level */
     4860 
     4861 void            nbdb(char *, ...);
     4862-void            nbtrace(char *, ...);
     4863 
     4864 static int      lookup(char *);
     4865 #ifdef USE_NB_ERRORHANDLER
     4866@@ -100,25 +99,6 @@
     4867 }    /* end nbdebug_log_init */
     4868 
     4869 
     4870-
     4871-
     4872-void
     4873-nbtrace(
     4874-       char            *fmt,
     4875-       ...)
     4876-{
     4877-       va_list          ap;
     4878-
     4879-       if (nb_debug!= NULL && (nb_dlevel & (NB_TRACE | NB_TRACE_VERBOSE))) {
     4880-               va_start(ap, fmt);
     4881-               vfprintf(nb_debug, fmt, ap);
     4882-               va_end(ap);
     4883-               fflush(nb_debug);
     4884-       }
     4885-
     4886-}    /* end nbtrace */
     4887-
     4888-
     4889 void
     4890 nbdbg(
     4891        char            *fmt,
     4892@@ -136,23 +116,6 @@
     4893 }    /* end nbdbg */
     4894 
     4895 
     4896-void
     4897-nbprt(
     4898-       char            *fmt,
     4899-       ...)
     4900-{
     4901-       va_list          ap;
     4902-
     4903-       if (nb_debug != NULL && nb_dlevel & NB_PRINT) {
     4904-               va_start(ap, fmt);
     4905-               vfprintf(nb_debug, fmt, ap);
     4906-               va_end(ap);
     4907-               fflush(nb_debug);
     4908-       }
     4909-
     4910-}    /* end nbprt */
     4911-
     4912-
     4913 static int
     4914 lookup(
     4915        char            *file)
     4916diff -Naur vim72.orig/src/nbdebug.h vim72/src/nbdebug.h
     4917--- vim72.orig/src/nbdebug.h    2008-06-22 07:31:50.000000000 -0700
     4918+++ vim72/src/nbdebug.h 2009-03-12 11:55:13.487606370 -0700
     4919@@ -43,8 +43,6 @@
     4920 
     4921 
     4922 void            nbdbg(char *, ...);
     4923-void            nbprt(char *, ...);
     4924-void            nbtrace(char *, ...);
     4925 
     4926 void nbdebug_wait __ARGS((u_int wait_flags, char *wait_var, u_int wait_secs));
     4927 void nbdebug_log_init __ARGS((char *log_var, char *level_var));
     4928@@ -70,19 +68,5 @@
     4929 {
     4930 }
     4931 
     4932-void
     4933-nbprt(
     4934-       char            *fmt,
     4935-       ...)
     4936-{
     4937-}
     4938-
     4939-void
     4940-nbtrace(
     4941-       char            *fmt,
     4942-       ...)
     4943-{
     4944-}
     4945-
     4946 #endif /* NBDEBUG */
     4947 #endif /* NBDEBUG_H */
    37584948diff -Naur vim72.orig/src/netbeans.c vim72/src/netbeans.c
    37594949--- vim72.orig/src/netbeans.c   2008-07-13 09:19:54.000000000 -0700
    3760 +++ vim72/src/netbeans.c        2009-01-19 00:10:45.000000000 -0800
     4950+++ vim72/src/netbeans.c        2009-03-12 11:55:13.479606090 -0700
    37614951@@ -1043,7 +1043,7 @@
    37624952        nbdebug(("EVT: %s", buf));
     
    37684958 }
    37694959 
     4960@@ -1921,7 +1921,7 @@
     4961            vim_free(path);
     4962            if (bufp == NULL)
     4963            {
     4964-               nbdebug(("    File %s not found in setBufferNumber\n", args));
     4965+               nbdebug(("    File %s not found in setBufferNumber\n", args));
     4966                EMSG2("E642: File %s not found in setBufferNumber", args);
     4967                return FAIL;
     4968            }
    37704969@@ -2277,9 +2277,6 @@
    37714970            int serNum;
     
    37944993                nbdebug(("    partial line annotation -- Not Yet Implemented!\n"));
    37954994            }
     4995@@ -2321,7 +2315,7 @@
     4996            }
     4997            if (pos)
     4998            {
     4999-               coloncmd(":sign place %d line=%d name=%d buffer=%d",
     5000+               coloncmd(":sign place %d line=%ld name=%d buffer=%d",
     5001                           serNum, pos->lnum, typeNum, buf->bufp->b_fnum);
     5002                if (typeNum == curPCtype)
     5003                    coloncmd(":sign jump %d buffer=%d", serNum,
     5004@@ -2425,7 +2419,7 @@
     5005                                GUARDED) == 0)
     5006                            {
     5007                                coloncmd(
     5008-                                   ":sign place %d line=%d name=%d buffer=%d",
     5009+                                   ":sign place %d line=%ld name=%d buffer=%d",
     5010                                     guardId++, lnum, GUARDED,
     5011                                     buf->bufp->b_fnum);
     5012                            }
    37965013@@ -2924,44 +2918,26 @@
    37975014 }
     
    38475064diff -Naur vim72.orig/src/normal.c vim72/src/normal.c
    38485065--- vim72.orig/src/normal.c     2008-07-31 13:03:08.000000000 -0700
    3849 +++ vim72/src/normal.c  2009-01-19 00:09:18.000000000 -0800
     5066+++ vim72/src/normal.c  2009-03-12 11:55:13.415602459 -0700
    38505067@@ -183,6 +183,8 @@
    38515068 static void    nv_cursorhold __ARGS((cmdarg_T *cap));
     
    38805097 #ifdef FEAT_AUTOCMD
    38815098     /* Restore counts from before receiving K_CURSORHOLD.  This means after
    3882 @@ -717,7 +727,15 @@
     5099@@ -641,10 +651,7 @@
     5100      * Get the command character from the user.
     5101      */
     5102     c = safe_vgetc();
     5103-
     5104-#ifdef FEAT_LANGMAP
     5105     LANGMAP_ADJUST(c, TRUE);
     5106-#endif
     5107 
     5108 #ifdef FEAT_VISUAL
     5109     /*
     5110@@ -717,7 +724,15 @@
    38835111             * command, so that v:count can be used in an expression mapping
    38845112             * right after the count. */
     
    38975125            if (ctrl_w)
    38985126            {
    3899 @@ -804,7 +822,7 @@
     5127@@ -726,9 +741,7 @@
     5128            }
     5129            ++no_zero_mapping;          /* don't map zero here */
     5130            c = plain_vgetc();
     5131-#ifdef FEAT_LANGMAP
     5132            LANGMAP_ADJUST(c, TRUE);
     5133-#endif
     5134            --no_zero_mapping;
     5135            if (ctrl_w)
     5136            {
     5137@@ -751,9 +764,7 @@
     5138            ++no_mapping;
     5139            ++allow_keys;               /* no mapping for nchar, but keys */
     5140            c = plain_vgetc();          /* get next character */
     5141-#ifdef FEAT_LANGMAP
     5142            LANGMAP_ADJUST(c, TRUE);
     5143-#endif
     5144            --no_mapping;
     5145            --allow_keys;
     5146 #ifdef FEAT_CMDL_INFO
     5147@@ -804,7 +815,7 @@
    39005148      * Only set v:count when called from main() and not a stuffed command.
    39015149      */
     
    39065154 
    39075155     /*
    3908 @@ -1132,7 +1150,8 @@
     5156@@ -941,9 +952,7 @@
     5157             * "gr", "g'" and "g`".
     5158             */
     5159            ca.nchar = plain_vgetc();
     5160-#ifdef FEAT_LANGMAP
     5161            LANGMAP_ADJUST(ca.nchar, TRUE);
     5162-#endif
     5163 #ifdef FEAT_CMDL_INFO
     5164            need_flushbuf |= add_to_showcmd(ca.nchar);
     5165 #endif
     5166@@ -1044,10 +1053,8 @@
     5167                }
     5168 #endif
     5169 
     5170-#ifdef FEAT_LANGMAP
     5171                /* adjust chars > 127, except after "tTfFr" commands */
     5172                LANGMAP_ADJUST(*cp, !lang);
     5173-#endif
     5174 #ifdef FEAT_RIGHTLEFT
     5175                /* adjust Hebrew mapped char */
     5176                if (p_hkmap && lang && KeyTyped)
     5177@@ -1132,7 +1139,8 @@
    39095178        out_flush();
    39105179 #endif
     
    39165185 
    39175186     State = NORMAL;
    3918 @@ -3509,7 +3528,7 @@
     5187@@ -3509,7 +3517,7 @@
    39195188        if (find_type & FIND_STRING)
    39205189            EMSG(_("E348: No string under cursor"));
     
    39255194     }
    39265195     ptr += col;
    3927 @@ -5469,6 +5488,20 @@
     5196@@ -4611,9 +4619,7 @@
     5197            ++no_mapping;
     5198            ++allow_keys;   /* no mapping for nchar, but allow key codes */
     5199            nchar = plain_vgetc();
     5200-#ifdef FEAT_LANGMAP
     5201            LANGMAP_ADJUST(nchar, TRUE);
     5202-#endif
     5203            --no_mapping;
     5204            --allow_keys;
     5205 #ifdef FEAT_CMDL_INFO
     5206@@ -4969,9 +4975,7 @@
     5207                ++no_mapping;
     5208                ++allow_keys;   /* no mapping for nchar, but allow key codes */
     5209                nchar = plain_vgetc();
     5210-#ifdef FEAT_LANGMAP
     5211                LANGMAP_ADJUST(nchar, TRUE);
     5212-#endif
     5213                --no_mapping;
     5214                --allow_keys;
     5215 #ifdef FEAT_CMDL_INFO
     5216@@ -5469,6 +5473,20 @@
    39285217                STRCPY(buf, "he! ");
    39295218            else
     
    39465235                 * really what we want? */
    39475236                isman = (STRCMP(kp, "man") == 0);
    3948 @@ -5511,37 +5544,59 @@
     5237@@ -5511,37 +5529,59 @@
    39495238     /*
    39505239      * Now grab the chars in the identifier
     
    39855274+           vim_free(buf);
    39865275+           return;
    3987         }
     5276+       }
    39885277+       buf = (char_u *)vim_realloc(buf, STRLEN(buf) + STRLEN(p) + 1);
    39895278+       if (buf == NULL)
     
    39925281+           vim_free(p);
    39935282+           return;
    3994 +       }
     5283        }
    39955284+       STRCAT(buf, p);
    39965285+       vim_free(p);
     
    40335322     /*
    40345323      * Execute the command.
     5324@@ -6728,6 +6768,8 @@
     5325     /* Visual mode "r" */
     5326     if (VIsual_active)
     5327     {
     5328+       if (got_int)
     5329+           reset_VIsual();
     5330        nv_operator(cap);
     5331        return;
     5332     }
     5333@@ -7784,7 +7826,7 @@
     5334        else
     5335            i = curwin->w_leftcol;
     5336        /* Go to the middle of the screen line.  When 'number' is on and lines
     5337-        * are wrapping the middle can be more to the left.*/
     5338+        * are wrapping the middle can be more to the left. */
     5339        if (cap->nchar == 'm')
     5340            i += (W_WIDTH(curwin) - curwin_col_off()
     5341                    + ((curwin->w_p_wrap && i > 0)
    40355342diff -Naur vim72.orig/src/ops.c vim72/src/ops.c
    40365343--- vim72.orig/src/ops.c        2008-06-21 13:08:59.000000000 -0700
    4037 +++ vim72/src/ops.c     2009-01-19 00:10:04.000000000 -0800
    4038 @@ -2209,12 +2209,15 @@
     5344+++ vim72/src/ops.c     2009-03-12 11:55:27.544506216 -0700
     5345@@ -72,11 +72,11 @@
     5346  */
     5347 struct block_def
     5348 {
     5349-    int                startspaces;    /* 'extra' cols of first char */
     5350-    int                endspaces;      /* 'extra' cols of first char */
     5351+    int                startspaces;    /* 'extra' cols before first char */
     5352+    int                endspaces;      /* 'extra' cols after last char */
     5353     int                textlen;        /* chars in block */
     5354-    char_u     *textstart;     /* pointer to 1st char in block */
     5355-    colnr_T    textcol;        /* cols of chars (at least part.) in block */
     5356+    char_u     *textstart;     /* pointer to 1st char (partially) in block */
     5357+    colnr_T    textcol;        /* index of chars (partially) in block */
     5358     colnr_T    start_vcol;     /* start col of 1st char wholly inside block */
     5359     colnr_T    end_vcol;       /* start col of 1st char wholly after block */
     5360 #ifdef FEAT_VISUALEXTRA
     5361@@ -382,15 +382,14 @@
     5362 {
     5363     int                        left = (oap->op_type == OP_LSHIFT);
     5364     int                        oldstate = State;
     5365-    int                        total, split;
     5366-    char_u             *newp, *oldp, *midp, *ptr;
     5367+    int                        total;
     5368+    char_u             *newp, *oldp;
     5369     int                        oldcol = curwin->w_cursor.col;
     5370     int                        p_sw = (int)curbuf->b_p_sw;
     5371     int                        p_ts = (int)curbuf->b_p_ts;
     5372     struct block_def   bd;
     5373-    int                        internal = 0;
     5374     int                        incr;
     5375-    colnr_T            vcol, col = 0, ws_vcol;
     5376+    colnr_T            ws_vcol;
     5377     int                        i = 0, j = 0;
     5378     int                        len;
     5379 
     5380@@ -456,67 +455,89 @@
     5381     }
     5382     else /* left */
     5383     {
     5384-       vcol = oap->start_vcol;
     5385-       /* walk vcol past ws to be removed */
     5386-       for (midp = oldp + bd.textcol;
     5387-             vcol < (oap->start_vcol + total) && vim_iswhite(*midp); )
     5388-       {
     5389-           incr = lbr_chartabsize_adv(&midp, (colnr_T)vcol);
     5390-           vcol += incr;
     5391-       }
     5392-       /* internal is the block-internal ws replacing a split TAB */
     5393-       if (vcol > (oap->start_vcol + total))
     5394-       {
     5395-           /* we have to split the TAB *(midp-1) */
     5396-           internal = vcol - (oap->start_vcol + total);
     5397-       }
     5398-       /* if 'expandtab' is not set, use TABs */
     5399+       colnr_T     destination_col;    /* column to which text in block will
     5400+                                          be shifted */
     5401+       char_u      *verbatim_copy_end; /* end of the part of the line which is
     5402+                                          copied verbatim */
     5403+       colnr_T     verbatim_copy_width;/* the (displayed) width of this part
     5404+                                          of line */
     5405+       unsigned    fill;               /* nr of spaces that replace a TAB */
     5406+       unsigned    new_line_len;       /* the length of the line after the
     5407+                                          block shift */
     5408+       size_t      block_space_width;
     5409+       size_t      shift_amount;
     5410+       char_u      *non_white = bd.textstart;
     5411+       colnr_T     non_white_col;
     5412 
     5413-       split = bd.startspaces + internal;
     5414-       if (split > 0)
     5415-       {
     5416-           if (!curbuf->b_p_et)
     5417-           {
     5418-               for (ptr = oldp, col = 0; ptr < oldp+bd.textcol; )
     5419-                   col += lbr_chartabsize_adv(&ptr, (colnr_T)col);
     5420+       /*
     5421+        * Firstly, let's find the first non-whitespace character that is
     5422+        * displayed after the block's start column and the character's column
     5423+        * number. Also, let's calculate the width of all the whitespace
     5424+        * characters that are displayed in the block and precede the searched
     5425+        * non-whitespace character.
     5426+        */
     5427 
     5428-               /* col+1 now equals the start col of the first char of the
     5429-                * block (may be < oap.start_vcol if we're splitting a TAB) */
     5430-               i = ((col % p_ts) + split) / p_ts; /* number of tabs */
     5431-           }
     5432-           if (i)
     5433-               j = ((col % p_ts) + split) % p_ts; /* number of spp */
     5434-           else
     5435-               j = split;
     5436-       }
     5437+       /* If "bd.startspaces" is set, "bd.textstart" points to the character,
     5438+        * the part of which is displayed at the block's beginning. Let's start
     5439+        * searching from the next character. */
     5440+       if (bd.startspaces)
     5441+           mb_ptr_adv(non_white);
     5442 
     5443-       newp = alloc_check(bd.textcol + i + j + (unsigned)STRLEN(midp) + 1);
     5444-       if (newp == NULL)
     5445-           return;
     5446-       vim_memset(newp, NUL, (size_t)(bd.textcol + i + j + STRLEN(midp) + 1));
     5447+       /* The character's column is in "bd.start_vcol".  */
     5448+       non_white_col = bd.start_vcol;
     5449 
     5450-       /* copy first part we want to keep */
     5451-       mch_memmove(newp, oldp, (size_t)bd.textcol);
     5452-       /* Now copy any TABS and spp to ensure correct alignment! */
     5453-       while (vim_iswhite(*midp))
     5454+       while (vim_iswhite(*non_white))
     5455        {
     5456-           if (*midp == TAB)
     5457-               i++;
     5458-           else /*space */
     5459-               j++;
     5460-           midp++;
     5461+           incr = lbr_chartabsize_adv(&non_white, non_white_col);
     5462+           non_white_col += incr;
     5463        }
     5464-       /* We might have an extra TAB worth of spp now! */
     5465-       if (j / p_ts && !curbuf->b_p_et)
     5466+
     5467+       block_space_width = non_white_col - oap->start_vcol;
     5468+       /* We will shift by "total" or "block_space_width", whichever is less.
     5469+        */
     5470+       shift_amount = (block_space_width < total? block_space_width: total);
     5471+
     5472+       /* The column to which we will shift the text.  */
     5473+       destination_col = non_white_col - shift_amount;
     5474+
     5475+       /* Now let's find out how much of the beginning of the line we can
     5476+        * reuse without modification.  */
     5477+       verbatim_copy_end = bd.textstart;
     5478+       verbatim_copy_width = bd.start_vcol;
     5479+
     5480+       /* If "bd.startspaces" is set, "bd.textstart" points to the character
     5481+        * preceding the block. We have to subtract its width to obtain its
     5482+        * column number.  */
     5483+       if (bd.startspaces)
     5484+           verbatim_copy_width -= bd.start_char_vcols;
     5485+       while (verbatim_copy_width < destination_col)
     5486        {
     5487-           i++;
     5488-           j -= p_ts;
     5489+           incr = lbr_chartabsize(verbatim_copy_end, verbatim_copy_width);
     5490+           if (verbatim_copy_width + incr > destination_col)
     5491+               break;
     5492+           verbatim_copy_width += incr;
     5493+           mb_ptr_adv(verbatim_copy_end);
     5494        }
     5495-       copy_chars(newp + bd.textcol, (size_t)i, TAB);
     5496-       copy_spaces(newp + bd.textcol + i, (size_t)j);
     5497 
     5498-       /* the end */
     5499-       STRMOVE(newp + STRLEN(newp), midp);
     5500+       /* If "destination_col" is different from the width of the initial
     5501+        * part of the line that will be copied, it means we encountered a tab
     5502+        * character, which we will have to partly replace with spaces.  */
     5503+       fill = destination_col - verbatim_copy_width;
     5504+
     5505+       /* The replacement line will consist of:
     5506+        * - the beginning of the original line up to "verbatim_copy_end",
     5507+        * - "fill" number of spaces,
     5508+        * - the rest of the line, pointed to by non_white.  */
     5509+       new_line_len = (unsigned)(verbatim_copy_end - oldp)
     5510+                      + fill
     5511+                      + (unsigned)STRLEN(non_white) + 1;
     5512+
     5513+       newp = alloc_check(new_line_len);
     5514+       if (newp == NULL)
     5515+           return;
     5516+       mch_memmove(newp, oldp, (size_t)(verbatim_copy_end - oldp));
     5517+       copy_spaces(newp + (verbatim_copy_end - oldp), (size_t)fill);
     5518+       STRMOVE(newp + (verbatim_copy_end - oldp) + fill, non_white);
     5519     }
     5520     /* replace the line */
     5521     ml_replace(curwin->w_cursor.lnum, newp, FALSE);
     5522@@ -2209,12 +2230,15 @@
    40395523     {
    40405524        for (; pos.lnum <= oap->end.lnum; ++pos.lnum)
     
    40545538                char_u *ptr = ml_get_buf(curbuf, pos.lnum, FALSE);
    40555539 
     5540@@ -4848,7 +4872,8 @@
     5541  * - textlen includes the first/last char to be (partly) deleted
     5542  * - start/endspaces is the number of columns that are taken by the
     5543  *   first/last deleted char minus the number of columns that have to be
     5544- *   deleted.  for yank and tilde:
     5545+ *   deleted.
     5546+ * for yank and tilde:
     5547  * - textlen includes the first/last char to be wholly yanked
     5548  * - start/endspaces is the number of columns of the first/last yanked char
     5549  *   that are to be yanked.
    40565550diff -Naur vim72.orig/src/option.c vim72/src/option.c
    40575551--- vim72.orig/src/option.c     2008-07-18 06:05:33.000000000 -0700
    4058 +++ vim72/src/option.c  2009-01-19 00:10:29.000000000 -0800
     5552+++ vim72/src/option.c  2009-03-12 11:55:13.683619779 -0700
    40595553@@ -2593,13 +2593,13 @@
    40605554 #ifdef FEAT_VIMINFO
     
    40745568 #endif
    40755569 #else
    4076 @@ -7974,6 +7974,11 @@
     5570@@ -4119,11 +4119,23 @@
     5571                                           && options[opt_idx].var == VAR_WIN)
     5572                goto skip;
     5573 
     5574-           /* Disallow changing some options from modelines */
     5575-           if ((opt_flags & OPT_MODELINE) && (flags & P_SECURE))
     5576+           /* Disallow changing some options from modelines. */
     5577+           if (opt_flags & OPT_MODELINE)
     5578            {
     5579-               errmsg = (char_u *)_("E520: Not allowed in a modeline");
     5580-               goto skip;
     5581+               if (flags & P_SECURE)
     5582+               {
     5583+                   errmsg = (char_u *)_("E520: Not allowed in a modeline");
     5584+                   goto skip;
     5585+               }
     5586+#ifdef FEAT_DIFF
     5587+               /* In diff mode some options are overruled.  This avoids that
     5588+                * 'foldmethod' becomes "marker" instead of "diff" and that
     5589+                * "wrap" gets set. */
     5590+               if (curwin->w_p_diff
     5591+                       && (options[opt_idx].indir == PV_FDM
     5592+                           || options[opt_idx].indir == PV_WRAP))
     5593+                   goto skip;
     5594+#endif
     5595            }
     5596 
     5597 #ifdef HAVE_SANDBOX
     5598@@ -5268,6 +5280,21 @@
     5599 }
     5600 #endif
     5601 
     5602+#ifdef FEAT_TITLE
     5603+static void redraw_titles __ARGS((void));
     5604+
     5605+/*
     5606+ * Redraw the window title and/or tab page text later.
     5607+ */
     5608+static void redraw_titles()
     5609+{
     5610+    need_maketitle = TRUE;
     5611+# ifdef FEAT_WINDOWS
     5612+    redraw_tabline = TRUE;
     5613+# endif
     5614+}
     5615+#endif
     5616+
     5617 /*
     5618  * Set a string option to a new value (without checking the effect).
     5619  * The string is copied into allocated memory.
     5620@@ -5407,6 +5434,10 @@
     5621     int                did_chartab = FALSE;
     5622     char_u     **gvarp;
     5623     long_u     free_oldval = (options[opt_idx].flags & P_ALLOCED);
     5624+#ifdef FEAT_GUI
     5625+    /* set when changing an option that only requires a redraw in the GUI */
     5626+    int                redraw_gui_only = FALSE;
     5627+#endif
     5628 
     5629     /* Get the global option to compare with, otherwise we would have to check
     5630      * two values for all local options. */
     5631@@ -5668,7 +5699,7 @@
     5632            {
     5633 # ifdef FEAT_TITLE
     5634                /* May show a "+" in the title now. */
     5635-               need_maketitle = TRUE;
     5636+               redraw_titles();
     5637 # endif
     5638                /* Add 'fileencoding' to the swap file. */
     5639                ml_setflags(curbuf);
     5640@@ -5687,7 +5718,7 @@
     5641            {
     5642                errmsg = mb_init();
     5643 # ifdef FEAT_TITLE
     5644-               need_maketitle = TRUE;
     5645+               redraw_titles();
     5646 # endif
     5647            }
     5648        }
     5649@@ -5766,14 +5797,28 @@
     5650        /* load or unload key mapping tables */
     5651        errmsg = keymap_init();
     5652 
     5653-       /* When successfully installed a new keymap switch on using it. */
     5654-       if (*curbuf->b_p_keymap != NUL && errmsg == NULL)
     5655+       if (errmsg == NULL)
     5656        {
     5657-           curbuf->b_p_iminsert = B_IMODE_LMAP;
     5658-           if (curbuf->b_p_imsearch != B_IMODE_USE_INSERT)
     5659-               curbuf->b_p_imsearch = B_IMODE_LMAP;
     5660-           set_iminsert_global();
     5661-           set_imsearch_global();
     5662+           if (*curbuf->b_p_keymap != NUL)
     5663+           {
     5664+               /* Installed a new keymap, switch on using it. */
     5665+               curbuf->b_p_iminsert = B_IMODE_LMAP;
     5666+               if (curbuf->b_p_imsearch != B_IMODE_USE_INSERT)
     5667+                   curbuf->b_p_imsearch = B_IMODE_LMAP;
     5668+           }
     5669+           else
     5670+           {
     5671+               /* Cleared the keymap, may reset 'iminsert' and 'imsearch'. */
     5672+               if (curbuf->b_p_iminsert == B_IMODE_LMAP)
     5673+                   curbuf->b_p_iminsert = B_IMODE_NONE;
     5674+               if (curbuf->b_p_imsearch == B_IMODE_LMAP)
     5675+                   curbuf->b_p_imsearch = B_IMODE_USE_INSERT;
     5676+           }
     5677+           if ((opt_flags & OPT_LOCAL) == 0)
     5678+           {
     5679+               set_iminsert_global();
     5680+               set_imsearch_global();
     5681+           }
     5682 # ifdef FEAT_WINDOWS
     5683            status_redraw_curbuf();
     5684 # endif
     5685@@ -5796,7 +5841,7 @@
     5686            else
     5687                curbuf->b_p_tx = FALSE;
     5688 #ifdef FEAT_TITLE
     5689-           need_maketitle = TRUE;
     5690+           redraw_titles();
     5691 #endif
     5692            /* update flag in swap file */
     5693            ml_setflags(curbuf);
     5694@@ -6055,6 +6100,7 @@
     5695                    errmsg = (char_u *)N_("E596: Invalid font(s)");
     5696            }
     5697        }
     5698+       redraw_gui_only = TRUE;
     5699     }
     5700 # ifdef FEAT_XFONTSET
     5701     else if (varp == &p_guifontset)
     5702@@ -6063,6 +6109,7 @@
     5703            errmsg = (char_u *)N_("E597: can't select fontset");
     5704        else if (gui.in_use && gui_init_font(p_guifontset, TRUE) != OK)
     5705            errmsg = (char_u *)N_("E598: Invalid fontset");
     5706+       redraw_gui_only = TRUE;
     5707     }
     5708 # endif
     5709 # ifdef FEAT_MBYTE
     5710@@ -6072,6 +6119,7 @@
     5711            errmsg = (char_u *)N_("E533: can't select wide font");
     5712        else if (gui_get_wide_font() == FAIL)
     5713            errmsg = (char_u *)N_("E534: Invalid wide font");
     5714+       redraw_gui_only = TRUE;
     5715     }
     5716 # endif
     5717 #endif
     5718@@ -6133,13 +6181,24 @@
     5719 #ifdef FEAT_GUI
     5720     /* 'guioptions' */
     5721     else if (varp == &p_go)
     5722+    {
     5723        gui_init_which_components(oldval);
     5724+       redraw_gui_only = TRUE;
     5725+    }
     5726 #endif
     5727 
     5728 #if defined(FEAT_GUI_TABLINE)
     5729     /* 'guitablabel' */
     5730     else if (varp == &p_gtl)
     5731+    {
     5732        redraw_tabline = TRUE;
     5733+       redraw_gui_only = TRUE;
     5734+    }
     5735+    /* 'guitabtooltip' */
     5736+    else if (varp == &p_gtt)
     5737+    {
     5738+       redraw_gui_only = TRUE;
     5739+    }
     5740 #endif
     5741 
     5742 #if defined(FEAT_MOUSE_TTY) && (defined(UNIX) || defined(VMS))
     5743@@ -6717,7 +6776,11 @@
     5744 
     5745     if (curwin->w_curswant != MAXCOL)
     5746        curwin->w_set_curswant = TRUE;  /* in case 'showbreak' changed */
     5747-    check_redraw(options[opt_idx].flags);
     5748+#ifdef FEAT_GUI
     5749+    /* check redraw when it's not a GUI option or the GUI is active. */
     5750+    if (!redraw_gui_only || gui.in_use)
     5751+#endif
     5752+       check_redraw(options[opt_idx].flags);
     5753 
     5754     return errmsg;
     5755 }
     5756@@ -7105,22 +7168,28 @@
     5757            curbuf->b_did_warn = FALSE;
     5758 
     5759 #ifdef FEAT_TITLE
     5760-       need_maketitle = TRUE;
     5761+       redraw_titles();
     5762 #endif
     5763     }
     5764 
     5765 #ifdef FEAT_TITLE
     5766     /* when 'modifiable' is changed, redraw the window title */
     5767     else if ((int *)varp == &curbuf->b_p_ma)
     5768-       need_maketitle = TRUE;
     5769+    {
     5770+       redraw_titles();
     5771+    }
     5772     /* when 'endofline' is changed, redraw the window title */
     5773     else if ((int *)varp == &curbuf->b_p_eol)
     5774-       need_maketitle = TRUE;
     5775-#ifdef FEAT_MBYTE
     5776-    /* when 'bomb' is changed, redraw the window title */
     5777+    {
     5778+       redraw_titles();
     5779+    }
     5780+# ifdef FEAT_MBYTE
     5781+    /* when 'bomb' is changed, redraw the window title and tab page text */
     5782     else if ((int *)varp == &curbuf->b_p_bomb)
     5783-       need_maketitle = TRUE;
     5784-#endif
     5785+    {
     5786+       redraw_titles();
     5787+    }
     5788+# endif
     5789 #endif
     5790 
     5791     /* when 'bin' is set also set some other options */
     5792@@ -7128,7 +7197,7 @@
     5793     {
     5794        set_options_bin(old_value, curbuf->b_p_bin, opt_flags);
     5795 #ifdef FEAT_TITLE
     5796-       need_maketitle = TRUE;
     5797+       redraw_titles();
     5798 #endif
     5799     }
     5800 
     5801@@ -7279,7 +7348,7 @@
     5802        if (!value)
     5803            save_file_ff(curbuf);       /* Buffer is unchanged */
     5804 #ifdef FEAT_TITLE
     5805-       need_maketitle = TRUE;
     5806+       redraw_titles();
     5807 #endif
     5808 #ifdef FEAT_AUTOCMD
     5809        modified_was_set = value;
     5810@@ -7714,7 +7783,7 @@
     5811        newFoldLevel();
     5812     }
     5813 
     5814-    /* 'foldminlevel' */
     5815+    /* 'foldminlines' */
     5816     else if (pp == &curwin->w_p_fml)
     5817     {
     5818        foldUpdateAll(curwin);
     5819@@ -7974,6 +8043,11 @@
    40775820        else /* curwin->w_p_scr > curwin->w_height */
    40785821            curwin->w_p_scr = curwin->w_height;
     
    40865829     {
    40875830        errmsg = e_positive;
    4088 @@ -8227,13 +8232,13 @@
     5831@@ -8227,13 +8301,13 @@
    40895832            {
    40905833                if (number == 0 && string != NULL)
     
    41035846                        /* There's another character after zeros or the string
    41045847                         * is empty.  In both cases, we are trying to set a
    4105 @@ -8323,7 +8328,7 @@
     5848@@ -8323,7 +8397,7 @@
    41065849     {
    41075850        --arg;                      /* put arg at the '<' */
     
    41125855            key = 0;
    41135856     }
     5857@@ -10093,25 +10167,110 @@
     5858 
     5859 #ifdef FEAT_LANGMAP
     5860 /*
     5861- * Any character has an equivalent character.  This is used for keyboards that
     5862- * have a special language mode that sends characters above 128 (although
     5863- * other characters can be translated too).
     5864+ * Any character has an equivalent 'langmap' character.  This is used for
     5865+ * keyboards that have a special language mode that sends characters above
     5866+ * 128 (although other characters can be translated too).  The "to" field is a
     5867+ * Vim command character.  This avoids having to switch the keyboard back to
     5868+ * ASCII mode when leaving Insert mode.
     5869+ *
     5870+ * langmap_mapchar[] maps any of 256 chars to an ASCII char used for Vim
     5871+ * commands.
     5872+ * When FEAT_MBYTE is defined langmap_mapga.ga_data is a sorted table of
     5873+ * langmap_entry_T.  This does the same as langmap_mapchar[] for characters >=
     5874+ * 256.
     5875  */
     5876+# ifdef FEAT_MBYTE
     5877+/*
     5878+ * With multi-byte support use growarray for 'langmap' chars >= 256
     5879+ */
     5880+typedef struct
     5881+{
     5882+    int            from;
     5883+    int     to;
     5884+} langmap_entry_T;
     5885+
     5886+static garray_T langmap_mapga;
     5887+static void langmap_set_entry __ARGS((int from, int to));
     5888 
     5889 /*
     5890- * char_u langmap_mapchar[256];
     5891- * Normally maps each of the 128 upper chars to an <128 ascii char; used to
     5892- * "translate" native lang chars in normal mode or some cases of
     5893- * insert mode without having to tediously switch lang mode back&forth.
     5894+ * Search for an entry in "langmap_mapga" for "from".  If found set the "to"
     5895+ * field.  If not found insert a new entry at the appropriate location.
     5896  */
     5897+    static void
     5898+langmap_set_entry(from, to)
     5899+    int    from;
     5900+    int    to;
     5901+{
     5902+    langmap_entry_T *entries = (langmap_entry_T *)(langmap_mapga.ga_data);
     5903+    int             a = 0;
     5904+    int             b = langmap_mapga.ga_len;
     5905+
     5906+    /* Do a binary search for an existing entry. */
     5907+    while (a != b)
     5908+    {
     5909+       int i = (a + b) / 2;
     5910+       int d = entries[i].from - from;
     5911+
     5912+       if (d == 0)
     5913+       {
     5914+           entries[i].to = to;
     5915+           return;
     5916+       }
     5917+       if (d < 0)
     5918+           a = i + 1;
     5919+       else
     5920+           b = i;
     5921+    }
     5922+
     5923+    if (ga_grow(&langmap_mapga, 1) != OK)
     5924+       return;  /* out of memory */
     5925+
     5926+    /* insert new entry at position "a" */
     5927+    entries = (langmap_entry_T *)(langmap_mapga.ga_data) + a;
     5928+    mch_memmove(entries + 1, entries,
     5929+                       (langmap_mapga.ga_len - a) * sizeof(langmap_entry_T));
     5930+    ++langmap_mapga.ga_len;
     5931+    entries[0].from = from;
     5932+    entries[0].to = to;
     5933+}
     5934+
     5935+/*
     5936+ * Apply 'langmap' to multi-byte character "c" and return the result.
     5937+ */
     5938+    int
     5939+langmap_adjust_mb(c)
     5940+    int c;
     5941+{
     5942+    langmap_entry_T *entries = (langmap_entry_T *)(langmap_mapga.ga_data);
     5943+    int a = 0;
     5944+    int b = langmap_mapga.ga_len;
     5945+
     5946+    while (a != b)
     5947+    {
     5948+       int i = (a + b) / 2;
     5949+       int d = entries[i].from - c;
     5950+
     5951+       if (d == 0)
     5952+           return entries[i].to;  /* found matching entry */
     5953+       if (d < 0)
     5954+           a = i + 1;
     5955+       else
     5956+           b = i;
     5957+    }
     5958+    return c;  /* no entry found, return "c" unmodified */
     5959+}
     5960+# endif
     5961 
     5962     static void
     5963 langmap_init()
     5964 {
     5965     int i;
     5966 
     5967-    for (i = 0; i < 256; i++)          /* we init with a-one-to one map */
     5968-       langmap_mapchar[i] = i;
     5969+    for (i = 0; i < 256; i++)
     5970+       langmap_mapchar[i] = i;  /* we init with a one-to-one map */
     5971+# ifdef FEAT_MBYTE
     5972+    ga_init2(&langmap_mapga, sizeof(langmap_entry_T), 8);
     5973+# endif
     5974 }
     5975 
     5976 /*
     5977@@ -10125,7 +10284,10 @@
     5978     char_u  *p2;
     5979     int            from, to;
     5980 
     5981-    langmap_init();                        /* back to one-to-one map first */
     5982+#ifdef FEAT_MBYTE
     5983+    ga_clear(&langmap_mapga);              /* clear the previous map first */
     5984+#endif
     5985+    langmap_init();                        /* back to one-to-one map */
     5986 
     5987     for (p = p_langmap; p[0] != NUL; )
     5988     {
     5989@@ -10175,7 +10337,13 @@
     5990                                                             transchar(from));
     5991                return;
     5992            }
     5993-           langmap_mapchar[from & 255] = to;
     5994+
     5995+#ifdef FEAT_MBYTE
     5996+           if (from >= 256)
     5997+               langmap_set_entry(from, to);
     5998+           else
     5999+#endif
     6000+               langmap_mapchar[from & 255] = to;
     6001 
     6002            /* Advance to next pair */
     6003            mb_ptr_adv(p);
    41146004diff -Naur vim72.orig/src/os_unix.c vim72/src/os_unix.c
    41156005--- vim72.orig/src/os_unix.c    2008-08-06 04:01:40.000000000 -0700
    4116 +++ vim72/src/os_unix.c 2009-01-19 00:09:40.000000000 -0800
    4117 @@ -315,12 +315,15 @@
     6006+++ vim72/src/os_unix.c 2009-03-12 11:55:13.671618662 -0700
     6007@@ -181,7 +181,8 @@
     6008        && defined(FEAT_TITLE) && !defined(FEAT_GUI_GTK)
     6009 # define SET_SIG_ALARM
     6010 static RETSIGTYPE sig_alarm __ARGS(SIGPROTOARG);
     6011-static int sig_alarm_called;
     6012+/* volatile because it is used in signal handler sig_alarm(). */
     6013+static volatile int sig_alarm_called;
     6014 #endif
     6015 static RETSIGTYPE deathtrap __ARGS(SIGPROTOARG);
     6016 
     6017@@ -201,13 +202,16 @@
     6018 # define SIG_ERR       ((RETSIGTYPE (*)())-1)
     6019 #endif
     6020 
     6021-static int     do_resize = FALSE;
     6022+/* volatile because it is used in signal handler sig_winch(). */
     6023+static volatile int do_resize = FALSE;
     6024 #ifndef __EMX__
     6025 static char_u  *extra_shell_arg = NULL;
     6026 static int     show_shell_mess = TRUE;
     6027 #endif
     6028-static int     deadly_signal = 0;          /* The signal we caught */
     6029-static int     in_mch_delay = FALSE;       /* sleeping in mch_delay() */
     6030+/* volatile because it is used in signal handler deathtrap(). */
     6031+static volatile int deadly_signal = 0;     /* The signal we caught */
     6032+/* volatile because it is used in signal handler deathtrap(). */
     6033+static volatile int in_mch_delay = FALSE;    /* sleeping in mch_delay() */
     6034 
     6035 static int curr_tmode = TMODE_COOK;    /* contains current terminal mode */
     6036 
     6037@@ -315,12 +319,15 @@
    41186038     {-1,           "Unknown!", FALSE}
    41196039 };
     
    41326052        RealWaitForChar(read_cmd_fd, p_wd, NULL);
    41336053 }
    4134 @@ -2905,7 +2908,7 @@
     6054@@ -799,7 +806,7 @@
     6055 #endif
     6056 
     6057 /*
     6058- * We need correct potatotypes for a signal function, otherwise mean compilers
     6059+ * We need correct prototypes for a signal function, otherwise mean compilers
     6060  * will barf when the second argument to signal() is ``wrong''.
     6061  * Let me try it with a few tricky defines from my own osdef.h (jw).
     6062  */
     6063@@ -1065,13 +1072,18 @@
     6064     SIGRETURN;
     6065 }
     6066 
     6067-#ifdef _REENTRANT
     6068+#if defined(_REENTRANT) && defined(SIGCONT)
     6069 /*
     6070  * On Solaris with multi-threading, suspending might not work immediately.
     6071  * Catch the SIGCONT signal, which will be used as an indication whether the
     6072  * suspending has been done or not.
     6073+ *
     6074+ * On Linux, signal is not always handled immediately either.
     6075+ * See https://bugs.launchpad.net/bugs/291373
     6076+ *
     6077+ * volatile because it is used in in signal handler sigcont_handler().
     6078  */
     6079-static int sigcont_received;
     6080+static volatile int sigcont_received;
     6081 static RETSIGTYPE sigcont_handler __ARGS(SIGPROTOARG);
     6082 
     6083 /*
     6084@@ -1115,15 +1127,28 @@
     6085     }
     6086 # endif
     6087 
     6088-# ifdef _REENTRANT
     6089+# if defined(_REENTRANT) && defined(SIGCONT)
     6090     sigcont_received = FALSE;
     6091 # endif
     6092     kill(0, SIGTSTP);      /* send ourselves a STOP signal */
     6093-# ifdef _REENTRANT
     6094-    /* When we didn't suspend immediately in the kill(), do it now.  Happens
     6095-     * on multi-threaded Solaris. */
     6096-    if (!sigcont_received)
     6097-       pause();
     6098+# if defined(_REENTRANT) && defined(SIGCONT)
     6099+    /*
     6100+     * Wait for the SIGCONT signal to be handled. It generally happens
     6101+     * immediately, but somehow not all the time. Do not call pause()
     6102+     * because there would be race condition which would hang Vim if
     6103+     * signal happened in between the test of sigcont_received and the
     6104+     * call to pause(). If signal is not yet received, call sleep(0)
     6105+     * to just yield CPU. Signal should then be received. If somehow
     6106+     * it's still not received, sleep 1, 2, 3 ms. Don't bother waiting
     6107+     * further if signal is not received after 1+2+3+4 ms (not expected
     6108+     * to happen).
     6109+     */
     6110+    {
     6111+       long wait;
     6112+       for (wait = 0; !sigcont_received && wait <= 3L; wait++)
     6113+           /* Loop is not entered most of the time */
     6114+           mch_delay(wait, FALSE);
     6115+    }
     6116 # endif
     6117 
     6118 # ifdef FEAT_TITLE
     6119@@ -1172,7 +1197,7 @@
     6120 #ifdef SIGTSTP
     6121     signal(SIGTSTP, restricted ? SIG_IGN : SIG_DFL);
     6122 #endif
     6123-#ifdef _REENTRANT
     6124+#if defined(_REENTRANT) && defined(SIGCONT)
     6125     signal(SIGCONT, sigcont_handler);
     6126 #endif
     6127 
     6128@@ -1231,7 +1256,7 @@
     6129 reset_signals()
     6130 {
     6131     catch_signals(SIG_DFL, SIG_DFL);
     6132-#ifdef _REENTRANT
     6133+#if defined(_REENTRANT) && defined(SIGCONT)
     6134     /* SIGCONT isn't in the list, because its default action is ignore */
     6135     signal(SIGCONT, SIG_DFL);
     6136 #endif
     6137@@ -2905,7 +2930,7 @@
    41356138      * Ignore any errors.
    41366139      */
     
    41416144 #endif
    41426145 }
    4143 @@ -2936,7 +2939,8 @@
     6146@@ -2936,7 +2961,8 @@
    41446147     }
    41456148 #  endif
     
    41516154 #  ifdef FEAT_XCLIPBOARD
    41526155            && x11_display != xterm_dpy
    4153 @@ -3926,9 +3930,9 @@
     6156@@ -3926,9 +3952,9 @@
    41546157                 */
    41556158                if (fd >= 0)
     
    41646167                    /* Don't need this now that we've duplicated it */
    41656168                    close(fd);
    4166 @@ -3996,13 +4000,13 @@
     6169@@ -3946,7 +3972,17 @@
     6170                 * children can be kill()ed.  Don't do this when using pipes,
     6171                 * because stdin is not a tty, we would lose /dev/tty. */
     6172                if (p_stmp)
     6173+               {
     6174                    (void)setsid();
     6175+#  if defined(SIGHUP)
     6176+                   /* When doing "!xterm&" and 'shell' is bash: the shell
     6177+                    * will exit and send SIGHUP to all processes in its
     6178+                    * group, killing the just started process.  Ignore SIGHUP
     6179+                    * to avoid that. (suggested by Simon Schubert)
     6180+                    */
     6181+                   signal(SIGHUP, SIG_IGN);
     6182+#  endif
     6183+               }
     6184 # endif
     6185 # ifdef FEAT_GUI
     6186                if (pty_slave_fd >= 0)
     6187@@ -3996,13 +4032,13 @@
    41676188 
    41686189                    /* set up stdin/stdout/stderr for the child */
     
    41816202 
    41826203                    close(pty_slave_fd);    /* has been dupped, close it now */
    4183 @@ -4013,13 +4017,13 @@
     6204@@ -4013,13 +4049,13 @@
    41846205                    /* set up stdin for the child */
    41856206                    close(fd_toshell[1]);
     
    41976218 
    41986219 # ifdef FEAT_GUI
    4199 @@ -4027,7 +4031,7 @@
     6220@@ -4027,7 +4063,7 @@
    42006221                    {
    42016222                        /* set up stderr for the child */
     
    42066227 # endif
    42076228                }
    4208 @@ -4158,7 +4162,8 @@
     6229@@ -4078,6 +4114,9 @@
     6230                int         fromshell_fd;
     6231                garray_T    ga;
     6232                int         noread_cnt;
     6233+# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
     6234+               struct timeval  start_tv;
     6235+# endif
     6236 
     6237 # ifdef FEAT_GUI
     6238                if (pty_master_fd >= 0)
     6239@@ -4158,7 +4197,8 @@
    42096240                                            && (lnum !=
    42106241                                                    curbuf->b_ml.ml_line_count
     
    42166247                                if (lnum > curbuf->b_op_end.lnum)
    42176248                                {
    4218 @@ -6814,7 +6819,8 @@
     6249@@ -4186,7 +4226,9 @@
     6250                    ga_init2(&ga, 1, BUFLEN);
     6251 
     6252                noread_cnt = 0;
     6253-
     6254+# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
     6255+               gettimeofday(&start_tv, NULL);
     6256+# endif
     6257                for (;;)
     6258                {
     6259                    /*
     6260@@ -4199,25 +4241,34 @@
     6261                     * that a typed password is echoed for ssh or gpg command.
     6262                     * Don't get characters when the child has already
     6263                     * finished (wait_pid == 0).
     6264-                    * Don't get extra characters when we already have one.
     6265                     * Don't read characters unless we didn't get output for a
     6266-                    * while, avoids that ":r !ls" eats typeahead.
     6267+                    * while (noread_cnt > 4), avoids that ":r !ls" eats
     6268+                    * typeahead.
     6269                     */
     6270                    len = 0;
     6271                    if (!(options & SHELL_EXPAND)
     6272                            && ((options &
     6273                                         (SHELL_READ|SHELL_WRITE|SHELL_COOKED))
     6274                                      != (SHELL_READ|SHELL_WRITE|SHELL_COOKED)
     6275-#ifdef FEAT_GUI
     6276+# ifdef FEAT_GUI
     6277                                                    || gui.in_use
     6278-#endif
     6279+# endif
     6280                                                    )
     6281                            && wait_pid == 0
     6282-                           && (ta_len > 0
     6283-                               || (noread_cnt > 4
     6284-                                   && (len = ui_inchar(ta_buf,
     6285-                                                      BUFLEN, 10L, 0)) > 0)))
     6286+                           && (ta_len > 0 || noread_cnt > 4))
     6287                    {
     6288+                     if (ta_len == 0)
     6289+                     {
     6290+                         /* Get extra characters when we don't have any.
     6291+                          * Reset the counter and timer. */
     6292+                         noread_cnt = 0;
     6293+# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
     6294+                         gettimeofday(&start_tv, NULL);
     6295+# endif
     6296+                         len = ui_inchar(ta_buf, BUFLEN, 10L, 0);
     6297+                     }
     6298+                     if (ta_len > 0 || len > 0)
     6299+                     {
     6300                        /*
     6301                         * For pipes:
     6302                         * Check for CTRL-C: send interrupt signal to child.
     6303@@ -4319,9 +4370,9 @@
     6304                            {
     6305                                ta_len -= len;
     6306                                mch_memmove(ta_buf, ta_buf + len, ta_len);
     6307-                               noread_cnt = 0;
     6308                            }
     6309                        }
     6310+                     }
     6311                    }
     6312 
     6313                    if (got_int)
     6314@@ -4429,6 +4480,25 @@
     6315                        out_flush();
     6316                        if (got_int)
     6317                            break;
     6318+
     6319+# if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
     6320+                       {
     6321+                           struct timeval  now_tv;
     6322+                           long            msec;
     6323+
     6324+                           /* Avoid that we keep looping here without
     6325+                            * checking for a CTRL-C for a long time.  Don't
     6326+                            * break out too often to avoid losing typeahead. */
     6327+                           gettimeofday(&now_tv, NULL);
     6328+                           msec = (now_tv.tv_sec - start_tv.tv_sec) * 1000L
     6329+                               + (now_tv.tv_usec - start_tv.tv_usec) / 1000L;
     6330+                           if (msec > 2000)
     6331+                           {
     6332+                               noread_cnt = 5;
     6333+                               break;
     6334+                           }
     6335+                       }
     6336+# endif
     6337                    }
     6338 
     6339                    /* If we already detected the child has finished break the
     6340@@ -5851,7 +5921,9 @@
     6341             * we are going to suspend or starting an external process
     6342             * so we shouldn't  have problem with this
     6343             */
     6344+# ifdef SIGTSTP
     6345            signal(SIGTSTP, restricted ? SIG_IGN : SIG_DFL);
     6346+# endif
     6347            return 1; /* succeed */
     6348        }
     6349        if (gpm_fd == -2)
     6350@@ -6814,7 +6886,8 @@
    42196351     if (xsmp_icefd != -1)
    42206352     {
     
    42286360diff -Naur vim72.orig/src/proto/eval.pro vim72/src/proto/eval.pro
    42296361--- vim72.orig/src/proto/eval.pro       2008-08-09 07:31:25.000000000 -0700
    4230 +++ vim72/src/proto/eval.pro    2009-01-19 00:09:18.000000000 -0800
     6362+++ vim72/src/proto/eval.pro    2009-03-12 11:54:47.005909205 -0700
    42316363@@ -17,7 +17,7 @@
    42326364 int eval_to_bool __ARGS((char_u *arg, int *error, char_u **nextcmd, int skip));
     
    42706402diff -Naur vim72.orig/src/proto/ex_cmds.pro vim72/src/proto/ex_cmds.pro
    42716403--- vim72.orig/src/proto/ex_cmds.pro    2008-08-09 07:31:25.000000000 -0700
    4272 +++ vim72/src/proto/ex_cmds.pro 2009-01-19 00:08:31.000000000 -0800
     6404+++ vim72/src/proto/ex_cmds.pro 2009-03-12 11:55:13.611614471 -0700
    42736405@@ -11,7 +11,7 @@
    42746406 char_u *make_filter_cmd __ARGS((char_u *cmd, char_u *itmp, char_u *otmp));
     
    42806412 int viminfo_readline __ARGS((vir_T *virp));
    42816413 char_u *viminfo_readstring __ARGS((vir_T *virp, int off, int convert));
     6414@@ -40,6 +40,7 @@
     6415 int read_viminfo_sub_string __ARGS((vir_T *virp, int force));
     6416 void write_viminfo_sub_string __ARGS((FILE *fp));
     6417 void free_old_sub __ARGS((void));
     6418+void free_signs __ARGS((void));
     6419 int prepare_tagpreview __ARGS((int undo_sync));
     6420 void ex_help __ARGS((exarg_T *eap));
     6421 char_u *check_help_lang __ARGS((char_u *arg));
    42826422diff -Naur vim72.orig/src/proto/ex_getln.pro vim72/src/proto/ex_getln.pro
    42836423--- vim72.orig/src/proto/ex_getln.pro   2008-08-09 07:31:28.000000000 -0700
    4284 +++ vim72/src/proto/ex_getln.pro        2009-01-19 00:09:28.000000000 -0800
    4285 @@ -31,7 +31,7 @@
     6424+++ vim72/src/proto/ex_getln.pro        2009-03-12 11:55:13.703620617 -0700
     6425@@ -4,6 +4,7 @@
     6426 int text_locked __ARGS((void));
     6427 void text_locked_msg __ARGS((void));
     6428 int curbuf_locked __ARGS((void));
     6429+int allbuf_locked __ARGS((void));
     6430 char_u *getexline __ARGS((int c, void *dummy, int indent));
     6431 char_u *getexmodeline __ARGS((int promptc, void *dummy, int indent));
     6432 int cmdline_overstrike __ARGS((void));
     6433@@ -31,7 +32,7 @@
    42866434 void set_cmd_context __ARGS((expand_T *xp, char_u *str, int len, int col));
    42876435 int expand_cmdline __ARGS((expand_T *xp, char_u *str, int col, int *matchcount, char_u ***matches));
     
    42946442diff -Naur vim72.orig/src/proto/mark.pro vim72/src/proto/mark.pro
    42956443--- vim72.orig/src/proto/mark.pro       2008-08-09 07:31:36.000000000 -0700
    4296 +++ vim72/src/proto/mark.pro    2009-01-19 00:08:31.000000000 -0800
     6444+++ vim72/src/proto/mark.pro    2009-03-12 11:54:40.553496578 -0700
    42976445@@ -26,5 +26,5 @@
    42986446 void write_viminfo_filemarks __ARGS((FILE *fp));
     
    43046452diff -Naur vim72.orig/src/proto/misc2.pro vim72/src/proto/misc2.pro
    43056453--- vim72.orig/src/proto/misc2.pro      2008-08-09 07:31:40.000000000 -0700
    4306 +++ vim72/src/proto/misc2.pro   2009-01-19 00:10:29.000000000 -0800
     6454+++ vim72/src/proto/misc2.pro   2009-03-12 11:54:56.454515435 -0700
    43076455@@ -59,7 +59,7 @@
    43086456 int handle_x_keys __ARGS((int key));
     
    43166464diff -Naur vim72.orig/src/proto/netbeans.pro vim72/src/proto/netbeans.pro
    43176465--- vim72.orig/src/proto/netbeans.pro   2008-08-09 07:31:56.000000000 -0700
    4318 +++ vim72/src/proto/netbeans.pro        2009-01-19 00:10:45.000000000 -0800
     6466+++ vim72/src/proto/netbeans.pro        2009-03-12 11:54:59.854733063 -0700
    43196467@@ -11,7 +11,7 @@
    43206468 void netbeans_frame_moved __ARGS((int new_x, int new_y));
     
    43266474 void netbeans_removed __ARGS((buf_T *bufp, linenr_T linenr, colnr_T col, long len));
    43276475 void netbeans_unmodified __ARGS((buf_T *bufp));
     6476diff -Naur vim72.orig/src/proto/option.pro vim72/src/proto/option.pro
     6477--- vim72.orig/src/proto/option.pro     2008-08-09 07:31:43.000000000 -0700
     6478+++ vim72/src/proto/option.pro  2009-03-12 11:55:13.419602459 -0700
     6479@@ -44,6 +44,7 @@
     6480 void set_context_in_set_cmd __ARGS((expand_T *xp, char_u *arg, int opt_flags));
     6481 int ExpandSettings __ARGS((expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file));
     6482 int ExpandOldSetting __ARGS((int *num_file, char_u ***file));
     6483+int langmap_adjust_mb __ARGS((int c));
     6484 int has_format_option __ARGS((int x));
     6485 int shortmess __ARGS((int x));
     6486 void vimrc_found __ARGS((char_u *fname, char_u *envname));
    43286487diff -Naur vim72.orig/src/pty.c vim72/src/pty.c
    43296488--- vim72.orig/src/pty.c        2008-06-21 11:52:58.000000000 -0700
    4330 +++ vim72/src/pty.c     2009-01-19 00:07:02.000000000 -0800
     6489+++ vim72/src/pty.c     2009-03-12 11:54:28.844744238 -0700
    43316490@@ -270,9 +270,10 @@
    43326491 }
     
    43426501     int
    43436502 OpenPTY(ttyn)
     6503diff -Naur vim72.orig/src/quickfix.c vim72/src/quickfix.c
     6504--- vim72.orig/src/quickfix.c   2008-07-18 05:53:02.000000000 -0700
     6505+++ vim72/src/quickfix.c        2009-03-12 11:55:13.547610560 -0700
     6506@@ -1419,6 +1419,7 @@
     6507     int                        opened_window = FALSE;
     6508     win_T              *win;
     6509     win_T              *altwin;
     6510+    int                        flags;
     6511 #endif
     6512     int                        print_message = TRUE;
     6513     int                        len;
     6514@@ -1530,7 +1531,6 @@
     6515     if (qf_ptr->qf_type == 1 && (!curwin->w_buffer->b_help || cmdmod.tab != 0))
     6516     {
     6517        win_T   *wp;
     6518-       int     n;
     6519 
     6520        if (cmdmod.tab != 0)
     6521            wp = NULL;
     6522@@ -1546,13 +1546,16 @@
     6523             * Split off help window; put it at far top if no position
     6524             * specified, the current window is vertically split and narrow.
     6525             */
     6526-           n = WSP_HELP;
     6527+           flags = WSP_HELP;
     6528 # ifdef FEAT_VERTSPLIT
     6529            if (cmdmod.split == 0 && curwin->w_width != Columns
     6530                                                      && curwin->w_width < 80)
     6531-               n |= WSP_TOP;
     6532+               flags |= WSP_TOP;
     6533 # endif
     6534-           if (win_split(0, n) == FAIL)
     6535+           if (qi != &ql_info)
     6536+               flags |= WSP_NEWLOC;  /* don't copy the location list */
     6537+
     6538+           if (win_split(0, flags) == FAIL)
     6539                goto theend;
     6540            opened_window = TRUE;       /* close it when fail */
     6541 
     6542@@ -1562,7 +1565,6 @@
     6543            if (qi != &ql_info)     /* not a quickfix list */
     6544            {
     6545                /* The new window should use the supplied location list */
     6546-               qf_free_all(curwin);
     6547                curwin->w_llist = qi;
     6548                qi->qf_refcount++;
     6549            }
     6550@@ -1609,10 +1611,11 @@
     6551                {
     6552                    goto_tabpage_win(tp, wp);
     6553                    usable_win = 1;
     6554-                   break;
     6555+                   goto win_found;
     6556                }
     6557            }
     6558        }
     6559+win_found:
     6560 
     6561        /*
     6562         * If there is only one window and it is the quickfix window, create a
     6563@@ -1622,7 +1625,10 @@
     6564        {
     6565            ll_ref = curwin->w_llist_ref;
     6566 
     6567-           if (win_split(0, WSP_ABOVE) == FAIL)
     6568+           flags = WSP_ABOVE;
     6569+           if (ll_ref != NULL)
     6570+               flags |= WSP_NEWLOC;
     6571+           if (win_split(0, flags) == FAIL)
     6572                goto failed;            /* not enough room for window */
     6573            opened_window = TRUE;       /* close it when fail */
     6574            p_swb = empty_option;       /* don't split again */
     6575@@ -1634,7 +1640,6 @@
     6576            {
     6577                /* The new window should use the location list from the
     6578                 * location list window */
     6579-               qf_free_all(curwin);
     6580                curwin->w_llist = ll_ref;
     6581                ll_ref->qf_refcount++;
     6582            }
     6583@@ -2307,15 +2312,12 @@
     6584        if (eap->cmdidx == CMD_copen || eap->cmdidx == CMD_cwindow)
     6585            /* Create the new window at the very bottom. */
     6586            win_goto(lastwin);
     6587-       if (win_split(height, WSP_BELOW) == FAIL)
     6588+       if (win_split(height, WSP_BELOW | WSP_NEWLOC) == FAIL)
     6589            return;             /* not enough room for window */
     6590 #ifdef FEAT_SCROLLBIND
     6591        curwin->w_p_scb = FALSE;
     6592 #endif
     6593 
     6594-       /* Remove the location list for the quickfix window */
     6595-       qf_free_all(curwin);
     6596-
     6597        if (eap->cmdidx == CMD_lopen || eap->cmdidx == CMD_lwindow)
     6598        {
     6599            /*
     6600diff -Naur vim72.orig/src/regexp.c vim72/src/regexp.c
     6601--- vim72.orig/src/regexp.c     2008-08-07 12:58:50.000000000 -0700
     6602+++ vim72/src/regexp.c  2009-03-12 11:55:13.471605532 -0700
     6603@@ -4532,7 +4532,7 @@
     6604                cleanup_subexpr();
     6605                if (!REG_MULTI)         /* Single-line regexp */
     6606                {
     6607-                   if (reg_endp[no] == NULL)
     6608+                   if (reg_startp[no] == NULL || reg_endp[no] == NULL)
     6609                    {
     6610                        /* Backref was not set: Match an empty string. */
     6611                        len = 0;
     6612@@ -4548,7 +4548,7 @@
     6613                }
     6614                else                            /* Multi-line regexp */
     6615                {
     6616-                   if (reg_endpos[no].lnum < 0)
     6617+                   if (reg_startpos[no].lnum < 0 || reg_endpos[no].lnum < 0)
     6618                    {
     6619                        /* Backref was not set: Match an empty string. */
     6620                        len = 0;
     6621@@ -7279,13 +7279,11 @@
     6622     }
     6623     else
     6624     {
     6625-       if (submatch_match->endp[no] == NULL)
     6626+       s = submatch_match->startp[no];
     6627+       if (s == NULL || submatch_match->endp[no] == NULL)
     6628            retval = NULL;
     6629        else
     6630-       {
     6631-           s = submatch_match->startp[no];
     6632            retval = vim_strnsave(s, (int)(submatch_match->endp[no] - s));
     6633-       }
     6634     }
     6635 
     6636     return retval;
    43446637diff -Naur vim72.orig/src/screen.c vim72/src/screen.c
    43456638--- vim72.orig/src/screen.c     2008-07-24 07:45:07.000000000 -0700
    4346 +++ vim72/src/screen.c  2009-01-19 00:08:07.000000000 -0800
     6639+++ vim72/src/screen.c  2009-03-12 11:55:39.893297947 -0700
    43476640@@ -2439,9 +2439,17 @@
    43486641 
     
    43666659 
    43676660     SCREEN_LINE(row + W_WINROW(wp), W_WINCOL(wp), (int)W_WIDTH(wp),
     6661@@ -2588,6 +2596,7 @@
     6662     int                noinvcur = FALSE;       /* don't invert the cursor */
     6663 #ifdef FEAT_VISUAL
     6664     pos_T      *top, *bot;
     6665+    int                lnum_in_visual_area = FALSE;
     6666 #endif
     6667     pos_T      pos;
     6668     long       v;
     6669@@ -2784,9 +2793,10 @@
     6670            top = &VIsual;
     6671            bot = &curwin->w_cursor;
     6672        }
     6673+       lnum_in_visual_area = (lnum >= top->lnum && lnum <= bot->lnum);
     6674        if (VIsual_mode == Ctrl_V)      /* block mode */
     6675        {
     6676-           if (lnum >= top->lnum && lnum <= bot->lnum)
     6677+           if (lnum_in_visual_area)
     6678            {
     6679                fromcol = wp->w_old_cursor_fcol;
     6680                tocol = wp->w_old_cursor_lcol;
     6681@@ -3412,6 +3422,7 @@
     6682                        && (*mb_ptr2cells)(ptr) > 1)
     6683 #endif
     6684                    || ((int)vcol_prev == fromcol_prev
     6685+                       && vcol_prev < vcol     /* not at margin */
     6686                        && vcol < tocol))
     6687                area_attr = attr;               /* start highlighting */
     6688            else if (area_attr != 0
     6689@@ -3544,7 +3555,8 @@
     6690                /* Use line_attr when not in the Visual or 'incsearch' area
     6691                 * (area_attr may be 0 when "noinvcur" is set). */
     6692            else if (line_attr != 0 && ((fromcol == -10 && tocol == MAXCOL)
     6693-                                       || (vcol < fromcol || vcol >= tocol)))
     6694+                               || vcol < fromcol || vcol_prev < fromcol_prev
     6695+                               || vcol >= tocol))
     6696                char_attr = line_attr;
     6697 #endif
     6698            else
     6699@@ -4549,7 +4561,8 @@
     6700         * highlight the cursor position itself. */
     6701        if (wp->w_p_cuc && vcol == (long)wp->w_virtcol
     6702                && lnum != wp->w_cursor.lnum
     6703-               && draw_state == WL_LINE)
     6704+               && draw_state == WL_LINE
     6705+               && !lnum_in_visual_area)
     6706        {
     6707            vcol_save_attr = char_attr;
     6708            char_attr = hl_combine_attr(char_attr, hl_attr(HLF_CUC));
     6709@@ -5119,8 +5132,8 @@
     6710 #endif
     6711 
     6712 #if defined(FEAT_GUI) || defined(UNIX)
     6713-           /* The bold trick makes a single row of pixels appear in the next
     6714-            * character.  When a bold character is removed, the next
     6715+           /* The bold trick makes a single column of pixels appear in the
     6716+            * next character.  When a bold character is removed, the next
     6717             * character should be redrawn too.  This happens for our own GUI
     6718             * and for some xterms. */
     6719            if (
     6720@@ -6263,9 +6276,15 @@
     6721     int                pcc[MAX_MCO];
     6722 # endif
     6723 #endif
     6724+#if defined(FEAT_MBYTE) || defined(FEAT_GUI) || defined(UNIX)
     6725+    int                force_redraw_this;
     6726+    int                force_redraw_next = FALSE;
     6727+#endif
     6728+    int                need_redraw;
     6729 
     6730     if (ScreenLines == NULL || row >= screen_Rows)     /* safety check */
     6731        return;
     6732+    off = LineOffset[row] + col;
     6733 
     6734 #ifdef FEAT_MBYTE
     6735     /* When drawing over the right halve of a double-wide char clear out the
     6736@@ -6275,10 +6294,21 @@
     6737            && !gui.in_use
     6738 # endif
     6739            && mb_fix_col(col, row) != col)
     6740-       screen_puts_len((char_u *)" ", 1, row, col - 1, 0);
     6741+    {
     6742+       ScreenLines[off - 1] = ' ';
     6743+       ScreenAttrs[off - 1] = 0;
     6744+       if (enc_utf8)
     6745+       {
     6746+           ScreenLinesUC[off - 1] = 0;
     6747+           ScreenLinesC[0][off - 1] = 0;
     6748+       }
     6749+       /* redraw the previous cell, make it empty */
     6750+       screen_char(off - 1, row, col - 1);
     6751+       /* force the cell at "col" to be redrawn */
     6752+       force_redraw_next = TRUE;
     6753+    }
     6754 #endif
     6755 
     6756-    off = LineOffset[row] + col;
     6757 #ifdef FEAT_MBYTE
     6758     max_off = LineOffset[row] + screen_Columns;
     6759 #endif
     6760@@ -6342,7 +6372,12 @@
     6761        }
     6762 #endif
     6763 
     6764-       if (ScreenLines[off] != c
     6765+#if defined(FEAT_MBYTE) || defined(FEAT_GUI) || defined(UNIX)
     6766+       force_redraw_this = force_redraw_next;
     6767+       force_redraw_next = FALSE;
     6768+#endif
     6769+
     6770+       need_redraw = ScreenLines[off] != c
     6771 #ifdef FEAT_MBYTE
     6772                || (mbyte_cells == 2
     6773                    && ScreenLines[off + 1] != (enc_dbcs ? ptr[1] : 0))
     6774@@ -6350,24 +6385,24 @@
     6775                    && c == 0x8e
     6776                    && ScreenLines2[off] != ptr[1])
     6777                || (enc_utf8
     6778-                   && (ScreenLinesUC[off] != (u8char_T)u8c
     6779+                   && (ScreenLinesUC[off] != (u8char_T)(c >= 0x80 ? u8c : 0)
     6780                        || screen_comp_differs(off, u8cc)))
     6781 #endif
     6782                || ScreenAttrs[off] != attr
     6783-               || exmode_active
     6784+               || exmode_active;
     6785+
     6786+       if (need_redraw
     6787+#if defined(FEAT_MBYTE) || defined(FEAT_GUI) || defined(UNIX)
     6788+               || force_redraw_this
     6789+#endif
     6790                )
     6791        {
     6792 #if defined(FEAT_GUI) || defined(UNIX)
     6793            /* The bold trick makes a single row of pixels appear in the next
     6794             * character.  When a bold character is removed, the next
     6795             * character should be redrawn too.  This happens for our own GUI
     6796-            * and for some xterms.
     6797-            * Force the redraw by setting the attribute to a different value
     6798-            * than "attr", the contents of ScreenLines[] may be needed by
     6799-            * mb_off2cells() further on.
     6800-            * Don't do this for the last drawn character, because the next
     6801-            * character may not be redrawn. */
     6802-           if (
     6803+            * and for some xterms. */
     6804+           if (need_redraw && ScreenLines[off] != ' ' && (
     6805 # ifdef FEAT_GUI
     6806                    gui.in_use
     6807 # endif
     6808@@ -6377,23 +6412,14 @@
     6809 # ifdef UNIX
     6810                    term_is_xterm
     6811 # endif
     6812-              )
     6813+                   ))
     6814            {
     6815-               int             n;
     6816+               int     n = ScreenAttrs[off];
     6817 
     6818-               n = ScreenAttrs[off];
     6819-# ifdef FEAT_MBYTE
     6820-               if (col + mbyte_cells < screen_Columns
     6821-                       && (n > HL_ALL || (n & HL_BOLD))
     6822-                       && (len < 0 ? ptr[mbyte_blen] != NUL
     6823-                                            : ptr + mbyte_blen < text + len))
     6824-                   ScreenAttrs[off + mbyte_cells] = attr + 1;
     6825-# else
     6826-               if (col + 1 < screen_Columns
     6827-                       && (n > HL_ALL || (n & HL_BOLD))
     6828-                       && (len < 0 ? ptr[1] != NUL : ptr + 1 < text + len))
     6829-                   ScreenLines[off + 1] = 0;
     6830-# endif
     6831+               if (n > HL_ALL)
     6832+                   n = syn_attr2attr(n);
     6833+               if (n & HL_BOLD)
     6834+                   force_redraw_next = TRUE;
     6835            }
     6836 #endif
     6837 #ifdef FEAT_MBYTE
     6838@@ -6480,6 +6506,20 @@
     6839            ++ptr;
     6840        }
     6841     }
     6842+
     6843+#if defined(FEAT_MBYTE) || defined(FEAT_GUI) || defined(UNIX)
     6844+    /* If we detected the next character needs to be redrawn, but the text
     6845+     * doesn't extend up to there, update the character here. */
     6846+    if (force_redraw_next && col < screen_Columns)
     6847+    {
     6848+# ifdef FEAT_MBYTE
     6849+       if (enc_dbcs != 0 && dbcs_off2cells(off, max_off) > 1)
     6850+           screen_char_2(off, row, col);
     6851+       else
     6852+# endif
     6853+           screen_char(off, row, col);
     6854+    }
     6855+#endif
     6856 }
     6857 
     6858 #ifdef FEAT_SEARCH_EXTRA
     6859@@ -7356,7 +7396,11 @@
     6860 #endif
     6861     static int     entered = FALSE;            /* avoid recursiveness */
     6862     static int     done_outofmem_msg = FALSE;  /* did outofmem message */
     6863+#ifdef FEAT_AUTOCMD
     6864+    int                    retry_count = 0;
     6865 
     6866+retry:
     6867+#endif
     6868     /*
     6869      * Allocation of the screen buffers is done only when the size changes and
     6870      * when Rows and Columns have been set and we have started doing full
     6871@@ -7440,10 +7484,13 @@
     6872        {
     6873            outofmem = TRUE;
     6874 #ifdef FEAT_WINDOWS
     6875-           break;
     6876+           goto give_up;
     6877 #endif
     6878        }
     6879     }
     6880+#ifdef FEAT_WINDOWS
     6881+give_up:
     6882+#endif
     6883 
     6884 #ifdef FEAT_MBYTE
     6885     for (i = 0; i < p_mco; ++i)
     6886@@ -7628,8 +7675,17 @@
     6887     --RedrawingDisabled;
     6888 
     6889 #ifdef FEAT_AUTOCMD
     6890-    if (starting == 0)
     6891+    /*
     6892+     * Do not apply autocommands more than 3 times to avoid an endless loop
     6893+     * in case applying autocommands always changes Rows or Columns.
     6894+     */
     6895+    if (starting == 0 && ++retry_count <= 3)
     6896+    {
     6897        apply_autocmds(EVENT_VIMRESIZED, NULL, NULL, FALSE, curbuf);
     6898+       /* In rare cases, autocommands may have altered Rows or Columns,
     6899+        * jump back to check if we need to allocate the screen again. */
     6900+       goto retry;
     6901+    }
     6902 #endif
     6903 }
     6904 
    43686905diff -Naur vim72.orig/src/spell.c vim72/src/spell.c
    43696906--- vim72.orig/src/spell.c      2008-07-12 12:20:55.000000000 -0700
    4370 +++ vim72/src/spell.c   2009-01-19 00:10:18.000000000 -0800
     6907+++ vim72/src/spell.c   2009-03-12 11:55:13.363596871 -0700
    43716908@@ -77,7 +77,7 @@
    43726909 
     
    45697106  * ID in "flags" for the word "word".
    45707107  * The WF_RAREPFX flag is included in the return value for a rare prefix.
     7108@@ -2237,7 +2376,7 @@
     7109 
     7110            /* If we are back at the starting line and there is no match then
     7111             * give up. */
     7112-           if (lnum == wp->w_cursor.lnum && !found_one)
     7113+           if (lnum == wp->w_cursor.lnum && (!found_one || wrapped))
     7114                break;
     7115 
     7116            /* Skip the characters at the start of the next line that were
    45717117@@ -2513,9 +2652,11 @@
    45727118     lp->sl_midword = NULL;
     
    46337179     vim_free(pat);
    46347180     if (slang->sl_compprog == NULL)
    4635 @@ -4915,6 +5080,7 @@
     7181@@ -4791,13 +4956,16 @@
     7182  * Structure that is used to store the items in the word tree.  This avoids
     7183  * the need to keep track of each allocated thing, everything is freed all at
     7184  * once after ":mkspell" is done.
     7185+ * Note: "sb_next" must be just before "sb_data" to make sure the alignment of
     7186+ * "sb_data" is correct for systems where pointers must be aligned on
     7187+ * pointer-size boundaries and sizeof(pointer) > sizeof(int) (e.g., Sparc).
     7188  */
     7189 #define  SBLOCKSIZE 16000      /* size of sb_data */
     7190 typedef struct sblock_S sblock_T;
     7191 struct sblock_S
     7192 {
     7193-    sblock_T   *sb_next;       /* next block in list */
     7194     int                sb_used;        /* nr of bytes already in use */
     7195+    sblock_T   *sb_next;       /* next block in list */
     7196     char_u     sb_data[1];     /* data, actually longer */
     7197 };
     7198 
     7199@@ -4915,6 +5083,7 @@
    46367200 } spellinfo_T;
    46377201 
     
    46417205 static int spell_info_item __ARGS((char_u *s));
    46427206 static unsigned affitem2flag __ARGS((int flagtype, char_u *item, char_u        *fname, int lnum));
    4643 @@ -4950,7 +5116,7 @@
     7207@@ -4950,7 +5119,7 @@
    46447208 static void put_sugtime __ARGS((spellinfo_T *spin, FILE *fd));
    46457209 static int write_vim_spell __ARGS((spellinfo_T *spin, char_u *fname));
     
    46507214 static int sug_filltree __ARGS((spellinfo_T *spin, slang_T *slang));
    46517215 static int sug_maketable __ARGS((spellinfo_T *spin));
    4652 @@ -5223,8 +5389,7 @@
     7216@@ -5223,8 +5392,7 @@
    46537217        /* Handle non-empty lines. */
    46547218        if (itemcnt > 0)
     
    46607224 #ifdef FEAT_MBYTE
    46617225                /* Setup for conversion from "ENC" to 'encoding'. */
    4662 @@ -5239,7 +5404,7 @@
     7226@@ -5239,7 +5407,7 @@
    46637227                    smsg((char_u *)_("Conversion in %s not supported"), fname);
    46647228 #endif
     
    46697233            {
    46707234                if (STRCMP(items[1], "long") == 0)
    4671 @@ -5284,69 +5449,71 @@
     7235@@ -5284,69 +5452,71 @@
    46727236                        spin->si_info = p;
    46737237                    }
     
    47577321                aff->af_compforbid = affitem2flag(aff->af_flagtype, items[1],
    47587322                                                                 fname, lnum);
    4759 @@ -5354,8 +5521,8 @@
     7323@@ -5354,8 +5524,8 @@
    47607324                    smsg((char_u *)_("Defining COMPOUNDFORBIDFLAG after PFX item may give wrong results in %s line %d"),
    47617325                            fname, lnum);
     
    47687332                aff->af_comppermit = affitem2flag(aff->af_flagtype, items[1],
    47697333                                                                 fname, lnum);
    4770 @@ -5363,7 +5530,7 @@
     7334@@ -5363,7 +5533,7 @@
    47717335                    smsg((char_u *)_("Defining COMPOUNDPERMITFLAG after PFX item may give wrong results in %s line %d"),
    47727336                            fname, lnum);
     
    47777341            {
    47787342                /* Turn flag "c" into COMPOUNDRULE compatible string "c+",
    4779 @@ -5376,7 +5543,15 @@
     7343@@ -5376,7 +5546,15 @@
    47807344                    compflags = p;
    47817345                }
     
    47947358                /* Concatenate this string to previously defined ones, using a
    47957359                 * slash to separate them. */
    4796 @@ -5395,7 +5570,7 @@
     7360@@ -5395,7 +5573,7 @@
    47977361                    compflags = p;
    47987362                }
     
    48037367            {
    48047368                compmax = atoi((char *)items[1]);
    4805 @@ -5403,7 +5578,7 @@
     7369@@ -5403,7 +5581,7 @@
    48067370                    smsg((char_u *)_("Wrong COMPOUNDWORDMAX value in %s line %d: %s"),
    48077371                                                       fname, lnum, items[1]);
     
    48127376            {
    48137377                compminlen = atoi((char *)items[1]);
    4814 @@ -5411,7 +5586,7 @@
     7378@@ -5411,7 +5589,7 @@
    48157379                    smsg((char_u *)_("Wrong COMPOUNDMIN value in %s line %d: %s"),
    48167380                                                       fname, lnum, items[1]);
     
    48217385            {
    48227386                compsylmax = atoi((char *)items[1]);
    4823 @@ -5419,32 +5594,29 @@
     7387@@ -5419,32 +5597,29 @@
    48247388                    smsg((char_u *)_("Wrong COMPOUNDSYLMAX value in %s line %d: %s"),
    48257389                                                       fname, lnum, items[1]);
     
    48607424                garray_T    *gap = &spin->si_comppat;
    48617425                int         i;
    4862 @@ -5463,24 +5635,24 @@
     7426@@ -5463,24 +5638,24 @@
    48637427                                               = getroom_save(spin, items[2]);
    48647428                }
     
    48907454                aff->af_pfxpostpone = TRUE;
    48917455            }
    4892 @@ -5771,24 +5943,20 @@
     7456@@ -5771,24 +5946,20 @@
    48937457                    }
    48947458                }
     
    49207484                /* Ignore REP/REPSAL count */;
    49217485                if (!isdigit(*items[1]))
    4922 @@ -5819,7 +5987,7 @@
     7486@@ -5819,7 +5990,7 @@
    49237487                                         : &spin->si_rep, items[1], items[2]);
    49247488                }
     
    49297493                /* MAP item or count */
    49307494                if (!found_map)
    4931 @@ -5856,9 +6024,8 @@
     7495@@ -5856,9 +6027,8 @@
    49327496                    ga_append(&spin->si_map, '/');
    49337497                }
     
    49417505                if (do_sal)
    49427506                {
    4943 @@ -5877,12 +6044,12 @@
     7507@@ -5877,12 +6047,12 @@
    49447508                                                                : items[2]);
    49457509                }
     
    49567520            {
    49577521                sofoto = getroom_save(spin, items[1]);
    4958 @@ -5980,7 +6147,7 @@
     7522@@ -5980,7 +6150,7 @@
    49597523        else if (spin->si_newprefID == 0 || spin->si_newprefID == 127)
    49607524            MSG(_("Too many compound flags"));
     
    49657529 
    49667530     if (syllable != NULL)
    4967 @@ -6017,6 +6184,22 @@
     7531@@ -6017,6 +6187,22 @@
    49687532 }
    49697533 
     
    49887552  * ae_flags to ae_comppermit and ae_compforbid.
    49897553  */
    4990 @@ -7926,6 +8109,8 @@
     7554@@ -7926,6 +8112,8 @@
    49917555     char_u     *p;
    49927556     int                rr;
     
    49977561     fd = mch_fopen((char *)fname, "w");
    49987562     if (fd == NULL)
    4999 @@ -7936,11 +8121,11 @@
     7563@@ -7936,11 +8124,11 @@
    50007564 
    50017565     /* <HEADER>: <fileID> <versionnr> */
     
    50147578 
    50157579     /*
    5016 @@ -7955,7 +8140,7 @@
     7580@@ -7955,7 +8143,7 @@
    50177581 
    50187582        i = (int)STRLEN(spin->si_info);
     
    50237587 
    50247588     /* SN_REGION: <regionname> ...
    5025 @@ -7966,7 +8151,7 @@
     7589@@ -7966,7 +8154,7 @@
    50267590        putc(SNF_REQUIRED, fd);                         /* <sectionflags> */
    50277591        l = spin->si_region_count * 2;
     
    50327596        regionmask = (1 << spin->si_region_count) - 1;
    50337597     }
    5034 @@ -8016,7 +8201,7 @@
     7598@@ -8016,7 +8204,7 @@
    50357599        }
    50367600 
     
    50417605 
    50427606     /* SN_MIDWORD: <midword> */
    5043 @@ -8027,7 +8212,8 @@
     7607@@ -8027,7 +8215,8 @@
    50447608 
    50457609        i = (int)STRLEN(spin->si_midword);
     
    50517615 
    50527616     /* SN_PREFCOND: <prefcondcnt> <prefcond> ... */
    5053 @@ -8113,7 +8299,8 @@
     7617@@ -8113,7 +8302,8 @@
    50547618                p = rr == 1 ? ftp->ft_from : ftp->ft_to;
    50557619                l = (int)STRLEN(p);
     
    50617625        }
    50627626 
    5063 @@ -8131,11 +8318,11 @@
     7627@@ -8131,11 +8321,11 @@
    50647628                                                        /* <sectionlen> */
    50657629 
     
    50757639 
    50767640     /* SN_WORDS: <word> ...
    5077 @@ -8160,7 +8347,7 @@
     7641@@ -8160,7 +8350,7 @@
    50787642                    l = (int)STRLEN(hi->hi_key) + 1;
    50797643                    len += l;
     
    50847648                }
    50857649            if (round == 1)
    5086 @@ -8176,7 +8363,7 @@
     7650@@ -8176,7 +8366,7 @@
    50877651        putc(0, fd);                                    /* <sectionflags> */
    50887652        l = spin->si_map.ga_len;
     
    50937657     }
    50947658 
    5095 @@ -8232,10 +8419,11 @@
     7659@@ -8232,10 +8422,11 @@
    50967660        {
    50977661            p = ((char_u **)(spin->si_comppat.ga_data))[i];
     
    51077671     }
    51087672 
    5109 @@ -8259,7 +8447,8 @@
     7673@@ -8259,7 +8450,8 @@
    51107674 
    51117675        l = (int)STRLEN(spin->si_syllable);
     
    51177681 
    51187682     /* end of <SECTIONS> */
    5119 @@ -8295,13 +8484,18 @@
     7683@@ -8295,13 +8487,18 @@
    51207684        (void)put_node(fd, tree, 0, regionmask, round == 3);
    51217685     }
     
    51387702 }
    51397703 
    5140 @@ -9890,6 +10084,7 @@
     7704@@ -9890,6 +10087,7 @@
    51417705     char_u     *p;
    51427706     int                len;
     
    51467710     if (fd != NULL)
    51477711        put_bytes(fd, (long_u)gap->ga_len, 2);      /* <prefcondcnt> */
    5148 @@ -9906,7 +10101,7 @@
     7712@@ -9906,7 +10104,7 @@
    51497713            if (fd != NULL)
    51507714            {
     
    51557719            totlen += len;
    51567720        }
    5157 @@ -11480,15 +11675,24 @@
     7721@@ -11480,15 +11678,24 @@
    51587722                    vim_strncpy(preword + sp->ts_prewordlen,
    51597723                            tword + sp->ts_splitoff,
     
    51877751                    p = preword + sp->ts_prewordlen;
    51887752                    mb_ptr_back(preword, p);
    5189 @@ -11685,10 +11889,9 @@
     7753@@ -11685,10 +11892,9 @@
    51907754                        && (slang->sl_compsylmax < MAXWLEN
    51917755                            || sp->ts_complen + 1 - sp->ts_compsplit
     
    52017765                    try_compound = TRUE;
    52027766                    compflags[sp->ts_complen] = ((unsigned)flags >> 24);
     7767@@ -14808,7 +15014,7 @@
     7768 
     7769        case 0:
     7770            /*
     7771-            * Lenghts are equal, thus changes must result in same length: An
     7772+            * Lengths are equal, thus changes must result in same length: An
     7773             * insert is only possible in combination with a delete.
     7774             * 1: check if for identical strings
     7775             */
    52037776diff -Naur vim72.orig/src/structs.h vim72/src/structs.h
    52047777--- vim72.orig/src/structs.h    2008-07-30 13:02:50.000000000 -0700
    5205 +++ vim72/src/structs.h 2009-01-19 00:09:02.000000000 -0800
     7778+++ vim72/src/structs.h 2009-03-12 11:54:46.913903059 -0700
    52067779@@ -459,7 +459,7 @@
    52077780 typedef struct
     
    52327805diff -Naur vim72.orig/src/tag.c vim72/src/tag.c
    52337806--- vim72.orig/src/tag.c        2008-07-16 14:31:30.000000000 -0700
    5234 +++ vim72/src/tag.c     2009-01-19 00:10:57.000000000 -0800
     7807+++ vim72/src/tag.c     2009-03-12 11:55:13.591613075 -0700
    52357808@@ -515,7 +515,7 @@
    52367809             * If a count is supplied to the ":tag <name>" command, then
     
    52427815 
    52437816            if (type == DT_SELECT || type == DT_JUMP
    5244 @@ -2725,7 +2725,24 @@
     7817@@ -618,7 +618,7 @@
     7818                taglen_advance(taglen);
     7819                MSG_PUTS_ATTR(_("file\n"), hl_attr(HLF_T));
     7820 
     7821-               for (i = 0; i < num_matches; ++i)
     7822+               for (i = 0; i < num_matches && !got_int; ++i)
     7823                {
     7824                    parse_match(matches[i], &tagp);
     7825                    if (!new_tag && (
     7826@@ -655,6 +655,8 @@
     7827                    }
     7828                    if (msg_col > 0)
     7829                        msg_putchar('\n');
     7830+                   if (got_int)
     7831+                       break;
     7832                    msg_advance(15);
     7833 
     7834                    /* print any extra fields */
     7835@@ -689,6 +691,8 @@
     7836                                if (msg_col + ptr2cells(p) >= Columns)
     7837                                {
     7838                                    msg_putchar('\n');
     7839+                                   if (got_int)
     7840+                                       break;
     7841                                    msg_advance(15);
     7842                                }
     7843                                p = msg_outtrans_one(p, attr);
     7844@@ -704,6 +708,8 @@
     7845                        if (msg_col > 15)
     7846                        {
     7847                            msg_putchar('\n');
     7848+                           if (got_int)
     7849+                               break;
     7850                            msg_advance(15);
     7851                        }
     7852                    }
     7853@@ -734,6 +740,8 @@
     7854                    {
     7855                        if (msg_col + (*p == TAB ? 1 : ptr2cells(p)) > Columns)
     7856                            msg_putchar('\n');
     7857+                       if (got_int)
     7858+                           break;
     7859                        msg_advance(15);
     7860 
     7861                        /* skip backslash used for escaping command char */
     7862@@ -760,12 +768,9 @@
     7863                    if (msg_col)
     7864                        msg_putchar('\n');
     7865                    ui_breakcheck();
     7866-                   if (got_int)
     7867-                   {
     7868-                       got_int = FALSE;        /* only stop the listing */
     7869-                       break;
     7870-                   }
     7871                }
     7872+               if (got_int)
     7873+                   got_int = FALSE;    /* only stop the listing */
     7874                ask_for_selection = TRUE;
     7875            }
     7876 #if defined(FEAT_QUICKFIX) && defined(FEAT_EVAL)
     7877@@ -2542,6 +2547,15 @@
     7878 {
     7879     ga_clear_strings(&tag_fnames);
     7880     do_tag(NULL, DT_FREE, 0, 0, 0);
     7881+    tag_freematch();
     7882+
     7883+# if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
     7884+    if (ptag_entry.tagname)
     7885+    {
     7886+        vim_free(ptag_entry.tagname);
     7887+        ptag_entry.tagname = NULL;
     7888+    }
     7889+# endif
     7890 }
     7891 #endif
     7892 
     7893@@ -2725,7 +2739,24 @@
    52457894         */
    52467895        p_7f = vim_strchr(lbuf, 0x7f);
     
    52677916        /* Find ^A.  If not found the line number is after the 0x7f */
    52687917        p = vim_strchr(p_7f, Ctrl_A);
    5269 @@ -2735,7 +2752,7 @@
     7918@@ -2735,7 +2766,7 @@
    52707919            ++p;
    52717920 
     
    52767925 
    52777926 
    5278 @@ -2749,7 +2766,7 @@
     7927@@ -2749,7 +2780,7 @@
    52797928            /* find end of tagname */
    52807929            for (p = p_7f - 1; !vim_iswordc(*p); --p)
     
    52857934            while (p >= lbuf && vim_iswordc(*p))
    52867935                --p;
     7936diff -Naur vim72.orig/src/term.c vim72/src/term.c
     7937--- vim72.orig/src/term.c       2008-07-27 04:48:06.000000000 -0700
     7938+++ vim72/src/term.c    2009-03-12 11:54:59.914737254 -0700
     7939@@ -4920,7 +4920,15 @@
     7940        key_name[0] = KEY2TERMCAP0(key);
     7941        key_name[1] = KEY2TERMCAP1(key);
     7942        if (key_name[0] == KS_KEY)
     7943-           string[new_slen++] = key_name[1];   /* from ":set <M-b>=xx" */
     7944+       {
     7945+           /* from ":set <M-b>=xx" */
     7946+#ifdef FEAT_MBYTE
     7947+           if (has_mbyte)
     7948+               new_slen += (*mb_char2bytes)(key_name[1], string + new_slen);
     7949+           else
     7950+#endif
     7951+               string[new_slen++] = key_name[1];
     7952+       }
     7953        else
     7954        {
     7955            string[new_slen++] = K_SPECIAL;
     7956diff -Naur vim72.orig/src/testdir/Makefile vim72/src/testdir/Makefile
     7957--- vim72.orig/src/testdir/Makefile     2008-06-19 13:29:46.000000000 -0700
     7958+++ vim72/src/testdir/Makefile  2009-03-12 11:55:27.544506216 -0700
     7959@@ -20,21 +20,23 @@
     7960                test48.out test49.out test51.out test52.out test53.out \
     7961                test54.out test55.out test56.out test57.out test58.out \
     7962                test59.out test60.out test61.out test62.out test63.out \
     7963-               test64.out test65.out
     7964+               test64.out test65.out test66.out
     7965 
     7966 SCRIPTS_GUI = test16.out
     7967 
     7968 .SUFFIXES: .in .out
     7969 
     7970-nongui:        nolog $(SCRIPTS)
     7971-       @echo
     7972-       @cat test.log
     7973-       @echo ALL DONE
     7974+nongui:        nolog $(SCRIPTS) report
     7975+
     7976+gui:   nolog $(SCRIPTS) $(SCRIPTS_GUI) report
     7977 
     7978-gui:   nolog $(SCRIPTS) $(SCRIPTS_GUI)
     7979+report:
     7980        @echo
     7981-       @cat test.log
     7982-       @echo ALL DONE
     7983+       @echo 'Test results:'
     7984+       @/bin/sh -c "if test -f test.log; \
     7985+               then cat test.log; echo TEST FAILURE; exit 1; \
     7986+               else echo ALL DONE; \
     7987+               fi"
     7988 
     7989 $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG)
     7990 
     7991@@ -71,4 +73,4 @@
     7992 test60.out: test60.vim
     7993 
     7994 nolog:
     7995-       -echo Test results: >test.log
     7996+       -rm -f test.log
    52877997diff -Naur vim72.orig/src/testdir/Make_ming.mak vim72/src/testdir/Make_ming.mak
    52887998--- vim72.orig/src/testdir/Make_ming.mak        1969-12-31 16:00:00.000000000 -0800
    5289 +++ vim72/src/testdir/Make_ming.mak     2009-01-19 00:08:05.000000000 -0800
     7999+++ vim72/src/testdir/Make_ming.mak     2009-03-12 11:54:40.397486521 -0700
    52908000@@ -0,0 +1,91 @@
    52918001+# Makefile to run tests for Vim, on Dos-like machines
     
    53808090+       -$(DEL) test.ok
    53818091+       -$(DEL) viminfo
    5382 diff -Naur vim72.orig/src/testdir/Makefile vim72/src/testdir/Makefile
    5383 --- vim72.orig/src/testdir/Makefile     2008-06-19 13:29:46.000000000 -0700
    5384 +++ vim72/src/testdir/Makefile  2009-01-19 00:07:44.000000000 -0800
    5385 @@ -26,15 +26,17 @@
    5386  
    5387  .SUFFIXES: .in .out
    5388  
    5389 -nongui:        nolog $(SCRIPTS)
    5390 -       @echo
    5391 -       @cat test.log
    5392 -       @echo ALL DONE
    5393 +nongui:        nolog $(SCRIPTS) report
    5394 +
    5395 +gui:   nolog $(SCRIPTS) $(SCRIPTS_GUI) report
    5396  
    5397 -gui:   nolog $(SCRIPTS) $(SCRIPTS_GUI)
    5398 +report:
    5399         @echo
    5400 -       @cat test.log
    5401 -       @echo ALL DONE
    5402 +       @echo 'Test results:'
    5403 +       @/bin/sh -c "if test -f test.log; \
    5404 +               then cat test.log; echo TEST FAILURE; exit 1; \
    5405 +               else echo ALL DONE; \
    5406 +               fi"
    5407  
    5408  $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG)
    5409  
    5410 @@ -71,4 +73,4 @@
    5411  test60.out: test60.vim
    5412  
    5413  nolog:
    5414 -       -echo Test results: >test.log
    5415 +       -rm -f test.log
    54168092diff -Naur vim72.orig/src/testdir/test42.ok vim72/src/testdir/test42.ok
    54178093--- vim72.orig/src/testdir/test42.ok    2008-02-20 04:27:37.000000000 -0800
    5418 +++ vim72/src/testdir/test42.ok 2009-01-19 00:08:36.000000000 -0800
     8094+++ vim72/src/testdir/test42.ok 2009-03-12 11:54:40.601499372 -0700
    54198095@@ -20,7 +20,7 @@
    54208096 ucs-2
     
    54268102 ucs-2le
    54278103 
     8104diff -Naur vim72.orig/src/testdir/test66.in vim72/src/testdir/test66.in
     8105--- vim72.orig/src/testdir/test66.in    1969-12-31 16:00:00.000000000 -0800
     8106+++ vim72/src/testdir/test66.in 2009-03-12 11:55:27.544506216 -0700
     8107@@ -0,0 +1,25 @@
     8108+
     8109+Test for visual block shift and tab characters.
     8110+
     8111+STARTTEST
     8112+:so small.vim
     8113+/^abcdefgh
     8114+4jI    j<<11|D
     8115+7|a           
     8116+7|a               
     8117+7|a            4k13|4j<
     8118+:$-4,$w! test.out
     8119+:$-4,$s/\s\+//g
     8120+4kI    j<<
     8121+7|a           
     8122+7|a                                   
     8123+7|a                    4k13|4j3<
     8124+:$-4,$w >> test.out
     8125+:qa!
     8126+ENDTEST
     8127+
     8128+abcdefghijklmnopqrstuvwxyz
     8129+abcdefghijklmnopqrstuvwxyz
     8130+abcdefghijklmnopqrstuvwxyz
     8131+abcdefghijklmnopqrstuvwxyz
     8132+abcdefghijklmnopqrstuvwxyz
     8133diff -Naur vim72.orig/src/testdir/test66.ok vim72/src/testdir/test66.ok
     8134--- vim72.orig/src/testdir/test66.ok    1969-12-31 16:00:00.000000000 -0800
     8135+++ vim72/src/testdir/test66.ok 2009-03-12 11:55:27.544506216 -0700
     8136@@ -0,0 +1,10 @@
     8137+    abcdefghijklmnopqrstuvwxyz
     8138+abcdefghij
     8139+    abc            defghijklmnopqrstuvwxyz
     8140+    abc            defghijklmnopqrstuvwxyz
     8141+    abc            defghijklmnopqrstuvwxyz
     8142+    abcdefghijklmnopqrstuvwxyz
     8143+abcdefghij
     8144+    abc            defghijklmnopqrstuvwxyz
     8145+    abc                defghijklmnopqrstuvwxyz
     8146+    abc            defghijklmnopqrstuvwxyz
    54288147diff -Naur vim72.orig/src/ui.c vim72/src/ui.c
    54298148--- vim72.orig/src/ui.c 2008-07-14 11:14:56.000000000 -0700
    5430 +++ vim72/src/ui.c      2009-01-19 00:09:40.000000000 -0800
     8149+++ vim72/src/ui.c      2009-03-12 11:54:50.158111748 -0700
    54318150@@ -1820,7 +1820,7 @@
    54328151 #ifdef HAVE_DUP
     
    55368255diff -Naur vim72.orig/src/version.c vim72/src/version.c
    55378256--- vim72.orig/src/version.c    2008-08-09 07:24:52.000000000 -0700
    5538 +++ vim72/src/version.c 2009-01-19 00:10:59.000000000 -0800
    5539 @@ -677,9 +677,176 @@
     8257+++ vim72/src/version.c 2009-03-12 11:55:39.893297947 -0700
     8258@@ -677,9 +677,280 @@
    55408259 static int included_patches[] =
    55418260 {   /* Add new patch number below this line */
    55428261 /**/
     8262+    141,
     8263+/**/
     8264+    140,
     8265+/**/
     8266+    139,
     8267+/**/
     8268+    137,
     8269+/**/
     8270+    136,
     8271+/**/
     8272+    135,
     8273+/**/
     8274+    134,
     8275+/**/
     8276+    133,
     8277+/**/
     8278+    132,
     8279+/**/
     8280+    131,
     8281+/**/
     8282+    130,
     8283+/**/
     8284+    129,
     8285+/**/
     8286+    128,
     8287+/**/
     8288+    127,
     8289+/**/
     8290+    126,
     8291+/**/
     8292+    125,
     8293+/**/
     8294+    124,
     8295+/**/
     8296+    123,
     8297+/**/
     8298+    122,
     8299+/**/
     8300+    121,
     8301+/**/
     8302+    120,
     8303+/**/
     8304+    119,
     8305+/**/
     8306+    118,
     8307+/**/
     8308+    117,
     8309+/**/
     8310+    116,
     8311+/**/
     8312+    115,
     8313+/**/
     8314+    114,
     8315+/**/
     8316+    113,
     8317+/**/
     8318+    112,
     8319+/**/
     8320+    111,
     8321+/**/
     8322+    110,
     8323+/**/
     8324+    109,
     8325+/**/
     8326+    108,
     8327+/**/
     8328+    107,
     8329+/**/
     8330+    106,
     8331+/**/
     8332+    105,
     8333+/**/
     8334+    104,
     8335+/**/
     8336+    103,
     8337+/**/
     8338+    102,
     8339+/**/
     8340+    100,
     8341+/**/
     8342+    99,
     8343+/**/
     8344+    98,
     8345+/**/
     8346+    97,
     8347+/**/
     8348+    96,
     8349+/**/
     8350+    95,
     8351+/**/
     8352+    94,
     8353+/**/
     8354+    92,
     8355+/**/
     8356+    91,
     8357+/**/
     8358+    90,
     8359+/**/
     8360+    87,
     8361+/**/
     8362+    86,
     8363+/**/
     8364+    85,
     8365+/**/
    55438366+    84,
    55448367+/**/
     
    57148537 highest_patch()
    57158538 {
    5716 @@ -786,7 +953,7 @@
     8539@@ -786,7 +1057,7 @@
    57178540     MSG_PUTS(_("\nRISC OS version"));
    57188541 #endif
     
    57238546     if (*compiled_arch != NUL)
    57248547     {
    5725 @@ -825,6 +992,19 @@
     8548@@ -825,6 +1096,19 @@
    57268549        }
    57278550     }
     
    57458568diff -Naur vim72.orig/src/vim.h vim72/src/vim.h
    57468569--- vim72.orig/src/vim.h        2008-08-09 09:03:38.000000000 -0700
    5747 +++ vim72/src/vim.h     2009-01-19 00:09:15.000000000 -0800
     8570+++ vim72/src/vim.h     2009-03-12 11:55:13.547610560 -0700
    57488571@@ -341,8 +341,14 @@
    57498572 #ifdef BACKSLASH_IN_FILENAME
     
    57728595 typedef unsigned long __w64    long_u;
    57738596 typedef                 long __w64     long_i;
    5774 @@ -1728,7 +1734,8 @@
     8597@@ -1051,6 +1057,7 @@
     8598 #define WSP_HELP       16      /* creating the help window */
     8599 #define WSP_BELOW      32      /* put new window below/right */
     8600 #define WSP_ABOVE      64      /* put new window above/left */
     8601+#define WSP_NEWLOC     128     /* don't copy location list */
     8602 
     8603 /*
     8604  * arguments for gui_set_shellsize()
     8605@@ -1728,7 +1735,8 @@
    57758606 #define VV_MOUSE_COL   51
    57768607 #define VV_OP          52
     
    57828613 #ifdef FEAT_CLIPBOARD
    57838614 
    5784 @@ -1979,6 +1986,9 @@
     8615@@ -1979,6 +1987,9 @@
    57858616 # endif
    57868617 #endif
     
    57928623 # include "nbdebug.h"
    57938624 #else
    5794 @@ -2054,4 +2064,10 @@
     8625@@ -2054,4 +2065,10 @@
    57958626 #define DOSO_VIMRC     1       /* loading vimrc file */
    57968627 #define DOSO_GVIMRC    2       /* loading gvimrc file */
     
    58058636diff -Naur vim72.orig/src/window.c vim72/src/window.c
    58068637--- vim72.orig/src/window.c     2008-08-06 04:00:30.000000000 -0700
    5807 +++ vim72/src/window.c  2009-01-19 00:09:40.000000000 -0800
    5808 @@ -4028,14 +4028,14 @@
     8638+++ vim72/src/window.c  2009-03-12 11:55:13.547610560 -0700
     8639@@ -12,7 +12,7 @@
     8640 static int path_is_url __ARGS((char_u *p));
     8641 #if defined(FEAT_WINDOWS) || defined(PROTO)
     8642 static int win_split_ins __ARGS((int size, int flags, win_T *newwin, int dir));
     8643-static void win_init __ARGS((win_T *newp, win_T *oldp));
     8644+static void win_init __ARGS((win_T *newp, win_T *oldp, int flags));
     8645 static void frame_comp_pos __ARGS((frame_T *topfrp, int *row, int *col));
     8646 static void frame_setheight __ARGS((frame_T *curfrp, int height));
     8647 #ifdef FEAT_VERTSPLIT
     8648@@ -593,9 +593,7 @@
     8649                ++allow_keys;   /* no mapping for xchar, but allow key codes */
     8650                if (xchar == NUL)
     8651                    xchar = plain_vgetc();
     8652-#ifdef FEAT_LANGMAP
     8653                LANGMAP_ADJUST(xchar, TRUE);
     8654-#endif
     8655                --no_mapping;
     8656                --allow_keys;
     8657 #ifdef FEAT_CMDL_INFO
     8658@@ -912,7 +910,7 @@
     8659            return FAIL;
     8660 
     8661        /* make the contents of the new window the same as the current one */
     8662-       win_init(wp, curwin);
     8663+       win_init(wp, curwin, flags);
     8664     }
     8665 
     8666     /*
     8667@@ -1161,11 +1159,15 @@
     8668  * Initialize window "newp" from window "oldp".
     8669  * Used when splitting a window and when creating a new tab page.
     8670  * The windows will both edit the same buffer.
     8671+ * WSP_NEWLOC may be specified in flags to prevent the location list from
     8672+ * being copied.
     8673  */
     8674+/*ARGSUSED*/
     8675     static void
     8676-win_init(newp, oldp)
     8677+win_init(newp, oldp, flags)
     8678     win_T      *newp;
     8679     win_T      *oldp;
     8680+    int                 flags;
     8681 {
     8682     int                i;
     8683 
     8684@@ -1190,7 +1192,14 @@
     8685     copy_jumplist(oldp, newp);
     8686 #endif
     8687 #ifdef FEAT_QUICKFIX
     8688-    copy_loclist(oldp, newp);
     8689+    if (flags & WSP_NEWLOC)
     8690+    {
     8691+       /* Don't copy the location list.  */
     8692+       newp->w_llist = NULL;
     8693+       newp->w_llist_ref = NULL;
     8694+    }
     8695+    else
     8696+       copy_loclist(oldp, newp);
     8697 #endif
     8698     if (oldp->w_localdir != NULL)
     8699        newp->w_localdir = vim_strsave(oldp->w_localdir);
     8700@@ -3220,7 +3229,7 @@
     8701     else
     8702     {
     8703        /* First window in new tab page, initialize it from "oldwin". */
     8704-       win_init(curwin, oldwin);
     8705+       win_init(curwin, oldwin, 0);
     8706 
     8707 # ifdef FEAT_SCROLLBIND
     8708        /* We don't want scroll-binding in the first window. */
     8709@@ -4028,14 +4037,14 @@
    58098710            if (mch_dirname(cwd, MAXPATHL) == OK)
    58108711                globaldir = vim_strsave(cwd);
     
    58268727diff -Naur vim72.orig/src/workshop.c vim72/src/workshop.c
    58278728--- vim72.orig/src/workshop.c   2008-06-21 11:53:26.000000000 -0700
    5828 +++ vim72/src/workshop.c        2009-01-19 00:09:33.000000000 -0800
     8729+++ vim72/src/workshop.c        2009-03-12 11:54:50.062104763 -0700
    58298730@@ -1121,8 +1121,12 @@
    58308731                                      ? (char *)curbuf->b_sfname : "<None>");
Note: See TracChangeset for help on using the changeset viewer.