Ignore:
Timestamp:
Jun 4, 2012, 6:07:54 PM (12 years ago)
Author:
Jonathan Norman <jon@…>
Branches:
clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
Children:
3e3e226
Parents:
c7fdbf48
Message:

Updated bash and vim branch update patches to -4

File:
1 moved

Legend:

Unmodified
Added
Removed
  • patches/vim-7.3-branch_update-4.patch

    rc7fdbf48 reb3c388  
    11Submitted By: Jonathan Norman (jonathan at bluesquarelinux dot co dot uk)
    2 Date: 2012-02-15
     2Date: 2012-06-03
    33Initial Package Version: 7.3
    44Origin: Upstream
    55Upstream Status: Applied
    6 Description: Contains all upstream patches up to 7.3.444
     6Description: Contains all upstream patches up to 7.3.538
    77
    88diff -Naur vim73.orig/Filelist vim73/Filelist
    9 --- vim73.orig/Filelist 2012-02-15 21:57:45.065436261 +0000
    10 +++ vim73/Filelist      2012-02-15 21:57:46.545475298 +0000
     9--- vim73.orig/Filelist 2012-06-03 23:09:52.956007482 +0000
     10+++ vim73/Filelist      2012-06-03 23:09:54.868058365 +0000
    1111@@ -39,6 +39,7 @@
    1212                src/mark.c \
     
    7272                runtime/spell/??/main.aap \
    7373diff -Naur vim73.orig/Makefile vim73/Makefile
    74 --- vim73.orig/Makefile 2012-02-15 21:57:45.117437632 +0000
    75 +++ vim73/Makefile      2012-02-15 21:57:45.645451559 +0000
     74--- vim73.orig/Makefile 2012-06-03 23:09:53.028009398 +0000
     75+++ vim73/Makefile      2012-06-03 23:09:53.712027602 +0000
    7676@@ -23,6 +23,9 @@
    7777 # has run can result in compiling with $(CC) empty.
     
    9595        cd src && $(MAKE) $@
    9696diff -Naur vim73.orig/README_extra.txt vim73/README_extra.txt
    97 --- vim73.orig/README_extra.txt 2012-02-15 21:57:45.041435628 +0000
    98 +++ vim73/README_extra.txt      2012-02-15 21:57:45.977460316 +0000
     97--- vim73.orig/README_extra.txt 2012-06-03 23:09:52.920006524 +0000
     98+++ vim73/README_extra.txt      2012-06-03 23:09:54.124038565 +0000
    9999@@ -13,9 +13,6 @@
    100100 
     
    108108 
    109109diff -Naur vim73.orig/runtime/doc/autocmd.txt vim73/runtime/doc/autocmd.txt
    110 --- vim73.orig/runtime/doc/autocmd.txt  2012-02-15 21:57:45.113437526 +0000
    111 +++ vim73/runtime/doc/autocmd.txt       2012-02-15 21:57:46.965486377 +0000
     110--- vim73.orig/runtime/doc/autocmd.txt  2012-06-03 23:09:53.024009292 +0000
     111+++ vim73/runtime/doc/autocmd.txt       2012-06-03 23:09:55.576077206 +0000
    112112@@ -299,6 +299,8 @@
    113113 |InsertEnter|          starting Insert mode
     
    137137 InsertEnter                    Just before starting Insert mode.  Also for
    138138                                Replace mode and Virtual Replace mode.  The
    139 @@ -1051,14 +1064,17 @@
     139@@ -682,7 +695,10 @@
     140 QuickFixCmdPre                 Before a quickfix command is run (|:make|,
     141                                |:lmake|, |:grep|, |:lgrep|, |:grepadd|,
     142                                |:lgrepadd|, |:vimgrep|, |:lvimgrep|,
     143-                               |:vimgrepadd|, |:lvimgrepadd|, |:cscope|).
     144+                               |:vimgrepadd|, |:lvimgrepadd|, |:cscope|,
     145+                               |:cfile|, |:cgetfile|, |:caddfile|, |:lfile|,
     146+                               |:lgetfile|, |:laddfile|, |:helpgrep|,
     147+                               |:lhelpgrep|).
     148                                The pattern is matched against the command
     149                                being run.  When |:grep| is used but 'grepprg'
     150                                is set to "internal" it still matches "grep".
     151@@ -693,7 +709,10 @@
     152                                                        *QuickFixCmdPost*
     153 QuickFixCmdPost                        Like QuickFixCmdPre, but after a quickfix
     154                                command is run, before jumping to the first
     155-                               location.  See |QuickFixCmdPost-example|.
     156+                               location. For |:cfile| and |:lfile| commands
     157+                               it is run after error file is read and before
     158+                               moving to the first error.
     159+                               See |QuickFixCmdPost-example|.
     160                                                        *RemoteReply*
     161 RemoteReply                    When a reply from a Vim that functions as
     162                                server was received |server2client()|.  The
     163@@ -1051,14 +1070,17 @@
    140164                        argument is included, Vim executes only the matching
    141165                        autocommands for that group.  Note: if you use an
     
    159183                        the autocommands, not the buffers to which they are
    160184diff -Naur vim73.orig/runtime/doc/change.txt vim73/runtime/doc/change.txt
    161 --- vim73.orig/runtime/doc/change.txt   2012-02-15 21:57:45.109437420 +0000
    162 +++ vim73/runtime/doc/change.txt        2012-02-15 21:57:45.869457468 +0000
     185--- vim73.orig/runtime/doc/change.txt   2012-06-03 23:09:53.016009080 +0000
     186+++ vim73/runtime/doc/change.txt        2012-06-03 23:09:53.976034626 +0000
    163187@@ -916,8 +916,10 @@
    164188 {Visual}["x]Y          Yank the highlighted lines [into register x] (for
     
    174198 :[range]y[ank] [x] {count}
    175199                        Yank {count} lines, starting with last line number
     200diff -Naur vim73.orig/runtime/doc/cmdline.txt vim73/runtime/doc/cmdline.txt
     201--- vim73.orig/runtime/doc/cmdline.txt  2012-06-03 23:09:53.016009080 +0000
     202+++ vim73/runtime/doc/cmdline.txt       2012-06-03 23:09:55.820083699 +0000
     203@@ -330,12 +330,12 @@
     204 
     205 :his[tory] [{name}] [{first}][, [{last}]]
     206                List the contents of history {name} which can be:
     207-               c[md]    or :   command-line history
     208-               s[earch] or /   search string history
     209-               e[xpr]   or =   expression register history
     210-               i[nput]  or @   input line history
     211-               d[ebug]  or >   debug command history
     212-               a[ll]           all of the above
     213+               c[md]    or :           command-line history
     214+               s[earch] or / or ?      search string history
     215+               e[xpr]   or =           expression register history
     216+               i[nput]  or @           input line history
     217+               d[ebug]  or >           debug command history
     218+               a[ll]                   all of the above
     219                {not in Vi}
     220 
     221                If the numbers {first} and/or {last} are given, the respective
     222diff -Naur vim73.orig/runtime/doc/diff.txt vim73/runtime/doc/diff.txt
     223--- vim73.orig/runtime/doc/diff.txt     2012-06-03 23:09:53.024009292 +0000
     224+++ vim73/runtime/doc/diff.txt  2012-06-03 23:09:55.876085191 +0000
     225@@ -178,7 +178,7 @@
     226 nodiff" before hiding it.
     227 
     228                                                        *:diffu* *:diffupdate*
     229-:diffu[pdate]                  Update the diff highlighting and folds.
     230+:diffu[pdate][!]               Update the diff highlighting and folds.
     231 
     232 Vim attempts to keep the differences updated when you make changes to the
     233 text.  This mostly takes care of inserted and deleted lines.  Changes within a
     234@@ -187,6 +187,9 @@
     235 
     236        :diffupdate
     237 
     238+If the ! is included Vim will check if the file was changed externally and
     239+needs to be reloaded.  It will prompt for each changed file, like `:checktime`
     240+was used.
     241 
     242 Vim will show filler lines for lines that are missing in one window but are
     243 present in another.  These lines were inserted in another file or deleted in
    176244diff -Naur vim73.orig/runtime/doc/eval.txt vim73/runtime/doc/eval.txt
    177 --- vim73.orig/runtime/doc/eval.txt     2012-02-15 21:57:45.105437315 +0000
    178 +++ vim73/runtime/doc/eval.txt  2012-02-15 21:57:46.673478676 +0000
     245--- vim73.orig/runtime/doc/eval.txt     2012-06-03 23:09:53.016009080 +0000
     246+++ vim73/runtime/doc/eval.txt  2012-06-03 23:09:55.556076674 +0000
    179247@@ -798,11 +798,12 @@
    180248 For |Lists| only "+" is possible and then both expr6 must be a list.  The
     
    225293 append( {lnum}, {list})                Number  append lines {list} below line {lnum}
    226294 argc()                         Number  number of files in the argument list
    227 @@ -1807,6 +1819,7 @@
     295@@ -1726,7 +1738,8 @@
     296 extend( {expr1}, {expr2} [, {expr3}])
     297                                List/Dict insert items of {expr2} into {expr1}
     298 exp( {expr})                   Float   exponential of {expr}
     299-expand( {expr} [, {flag}])     String  expand special keywords in {expr}
     300+expand( {expr} [, {nosuf} [, {list}]])
     301+                               any     expand special keywords in {expr}
     302 feedkeys( {string} [, {mode}]) Number  add key sequence to typeahead buffer
     303 filereadable( {file})          Number  TRUE if {file} is a readable file
     304 filewritable( {file})          Number  TRUE if {file} is a writable file
     305@@ -1780,7 +1793,8 @@
     306 getwinposx()                   Number  X coord in pixels of GUI Vim window
     307 getwinposy()                   Number  Y coord in pixels of GUI Vim window
     308 getwinvar( {nr}, {varname})    any     variable {varname} in window {nr}
     309-glob( {expr} [, {flag}])       String  expand file wildcards in {expr}
     310+glob( {expr} [, {nosuf} [, {list}]])
     311+                               any     expand file wildcards in {expr}
     312 globpath( {path}, {expr} [, {flag}])
     313                                String  do glob({expr}) for all dirs in {path}
     314 has( {feature})                        Number  TRUE if feature {feature} supported
     315@@ -1807,6 +1821,7 @@
    228316 inputsave()                    Number  save and clear typeahead
    229317 inputsecret( {prompt} [, {text}]) String  like input() but hiding the text
     
    233321 islocked( {expr})              Number  TRUE if {expr} is locked
    234322 items( {dict})                 List    key-value pairs in {dict}
    235 @@ -1822,7 +1835,7 @@
     323@@ -1822,7 +1837,7 @@
    236324 log( {expr})                   Float   natural logarithm (base e) of {expr}
    237325 log10( {expr})                 Float   logarithm of Float {expr} to base 10
     
    242330 mapcheck( {name}[, {mode} [, {abbr}]])
    243331                                String  check for mappings matching {name}
    244 @@ -1846,6 +1859,7 @@
     332@@ -1846,6 +1861,7 @@
    245333 mzeval( {expr})                        any     evaluate |MzScheme| expression
    246334 nextnonblank( {lnum})          Number  line nr of non-blank line >= {lnum}
     
    250338 pow( {x}, {y})                 Float   {x} to the power of {y}
    251339 prevnonblank( {lnum})          Number  line nr of non-blank line <= {lnum}
    252 @@ -1904,7 +1918,8 @@
     340@@ -1904,7 +1920,8 @@
    253341 simplify( {filename})          String  simplify filename as much as possible
    254342 sin( {expr})                   Float   sine of {expr}
     
    260348 spellbadword()                 String  badly spelled word at cursor
    261349 spellsuggest( {word} [, {max} [, {capital}]])
    262 @@ -1967,6 +1982,7 @@
     350@@ -1967,6 +1984,7 @@
    263351 winwidth( {nr})                        Number  width of window {nr}
    264352 writefile( {list}, {fname} [, {binary}])
     
    268356 abs({expr})                                                    *abs()*
    269357                Return the absolute value of {expr}.  When {expr} evaluates to
    270 @@ -2006,6 +2022,13 @@
     358@@ -2006,6 +2024,13 @@
    271359                Use |insert()| to add an item at another position.
    272360 
     
    282370                When {expr} is a |List|: Append each item of the |List| as a
    283371                text line below line {lnum} in the current buffer.
    284 @@ -3759,6 +3782,11 @@
     372@@ -2708,13 +2733,15 @@
     373                {only available when compiled with the |+float| feature}
     374 
     375 
     376-expand({expr} [, {flag}])                              *expand()*
     377+expand({expr} [, {nosuf} [, {list}]])                          *expand()*
     378                Expand wildcards and the following special keywords in {expr}.
     379-               The result is a String.
     380+               'wildignorecase' applies.
     381 
     382-               When there are several matches, they are separated by <NL>
     383-               characters.  [Note: in version 5.0 a space was used, which
     384-               caused problems when a file name contains a space]
     385+               If {list} is given and it is non-zero, a List will be returned.
     386+               Otherwise the result is a String and when there are several
     387+               matches, they are separated by <NL> characters.  [Note: in
     388+               version 5.0 a space was used, which caused problems when a
     389+               file name contains a space]
     390 
     391                If the expansion fails, the result is an empty string.  A name
     392                for a non-existing file is not included.
     393@@ -2731,6 +2758,7 @@
     394                        <abuf>          autocmd buffer number (as a String!)
     395                        <amatch>        autocmd matched name
     396                        <sfile>         sourced script file name
     397+                       <slnum>         sourced script file line number
     398                        <cword>         word under the cursor
     399                        <cWORD>         WORD under the cursor
     400                        <client>        the {clientid} of the last received
     401@@ -2767,10 +2795,10 @@
     402                When {expr} does not start with '%', '#' or '<', it is
     403                expanded like a file name is expanded on the command line.
     404                'suffixes' and 'wildignore' are used, unless the optional
     405-               {flag} argument is given and it is non-zero.  Names for
     406-               non-existing files are included.  The "**" item can be used to
     407-               search in a directory tree.  For example, to find all "README"
     408-               files in the current directory and below: >
     409+               {nosuf} argument is given and it is non-zero.
     410+               Names for non-existing files are included.  The "**" item can
     411+               be used to search in a directory tree.  For example, to find
     412+               all "README" files in the current directory and below: >
     413                        :echo expand("**/README")
     414 <
     415                Expand() can also be used to expand variables and environment
     416@@ -3414,17 +3442,23 @@
     417                        :let list_is_on = getwinvar(2, '&list')
     418                        :echo "myvar = " . getwinvar(1, 'myvar')
     419 <
     420-glob({expr} [, {flag}])                                        *glob()*
     421+glob({expr} [, {nosuf} [, {list}]])                            *glob()*
     422                Expand the file wildcards in {expr}.  See |wildcards| for the
     423                use of special characters.
     424-               The result is a String.
     425-               When there are several matches, they are separated by <NL>
     426-               characters.
     427-               Unless the optional {flag} argument is given and is non-zero,
     428+
     429+               Unless the optional {nosuf} argument is given and is non-zero,
     430                the 'suffixes' and 'wildignore' options apply: Names matching
     431                one of the patterns in 'wildignore' will be skipped and
     432                'suffixes' affect the ordering of matches.
     433-               If the expansion fails, the result is an empty string.
     434+               'wildignorecase' always applies.
     435+
     436+               When {list} is present and it is non-zero the result is a List
     437+               with all matching files. The advantage of using a List is,
     438+               you also get filenames containing newlines correctly.
     439+               Otherwise the result is a String and when there are several
     440+               matches, they are separated by <NL> characters.
     441+
     442+               If the expansion fails, the result is an empty String or List.
     443                A name for a non-existing file is not included.
     444 
     445                For most systems backticks can be used to get files names from
     446@@ -3759,6 +3793,11 @@
    285447                Note that when {item} is a |List| it is inserted as a single
    286448                item.  Use |extend()| to concatenate |Lists|.
     
    294456                The result is a Number, which is non-zero when a directory
    295457                with the name {directory} exists.  If {directory} doesn't
    296 @@ -3966,23 +3994,51 @@
     458@@ -3966,23 +4005,51 @@
    297459                further items in {expr} are processed.
    298460 
     
    353515                then the global mappings.
    354516                This function can be used to map a key even when it's already
    355 @@ -4295,6 +4351,13 @@
     517@@ -4295,6 +4362,13 @@
    356518                        call setpos('.', save_cursor)
    357519 <              Also see |setpos()|.
     
    367529                Shorten directory names in the path {expr} and return the
    368530                result.  The tail, the file name, is kept as-is.  The other
    369 @@ -5228,7 +5291,7 @@
     531@@ -5228,7 +5302,7 @@
    370532                {only available when compiled with the |+float| feature}
    371533 
     
    376538                want a list to remain unmodified make a copy first: >
    377539                        :let sortedlist = sort(copy(mylist))
    378 @@ -5236,6 +5299,8 @@
     540@@ -5236,6 +5310,8 @@
    379541                Numbers sort after Strings, |Lists| after Numbers.
    380542                For sorting text in the current buffer use |:sort|.
     
    385547                is called to compare items.  The function is invoked with two
    386548                items as argument and must return zero if they are equal, 1 or
    387 @@ -6056,7 +6121,15 @@
     549@@ -6056,7 +6132,15 @@
    388550                To copy a file byte for byte: >
    389551                        :let fl = readfile("foo", "b")
     
    404566diff -Naur vim73.orig/runtime/doc/eval.txt.orig vim73/runtime/doc/eval.txt.orig
    405567--- vim73.orig/runtime/doc/eval.txt.orig        1970-01-01 00:00:00.000000000 +0000
    406 +++ vim73/runtime/doc/eval.txt.orig     2012-02-15 21:57:46.013461267 +0000
     568+++ vim73/runtime/doc/eval.txt.orig     2012-06-03 23:09:54.176039949 +0000
    407569@@ -0,0 +1,8362 @@
    408570+*eval.txt*     For Vim version 7.3.  Last change: 2010 Aug 15
     
    87698931+ vim:tw=78:ts=8:ft=help:norl:
    87708932diff -Naur vim73.orig/runtime/doc/if_cscop.txt vim73/runtime/doc/if_cscop.txt
    8771 --- vim73.orig/runtime/doc/if_cscop.txt 2012-02-15 21:57:45.109437420 +0000
    8772 +++ vim73/runtime/doc/if_cscop.txt      2012-02-15 21:57:46.089463271 +0000
     8933--- vim73.orig/runtime/doc/if_cscop.txt 2012-06-03 23:09:53.020009186 +0000
     8934+++ vim73/runtime/doc/if_cscop.txt      2012-06-03 23:09:54.252041972 +0000
    87738935@@ -272,6 +272,15 @@
    87748936        :set cst
     
    92819443+
    92829444+ vim:tw=78:ts=8:ft=help:norl:
     9445diff -Naur vim73.orig/runtime/doc/if_lua.txt vim73/runtime/doc/if_lua.txt
     9446--- vim73.orig/runtime/doc/if_lua.txt   2012-06-03 23:09:53.020009186 +0000
     9447+++ vim73/runtime/doc/if_lua.txt        2012-06-03 23:09:55.696080401 +0000
     9448@@ -1,4 +1,4 @@
     9449-*if_lua.txt*    For Vim version 7.3.  Last change: 2010 Jul 22
     9450+*if_lua.txt*    For Vim version 7.3.  Last change: 2012 Jan 16
     9451 
     9452 
     9453                  VIM REFERENCE MANUAL    by Luis Carvalho
     9454@@ -8,8 +8,11 @@
     9455 
     9456 1. Commands                    |lua-commands|
     9457 2. The vim module              |lua-vim|
     9458-3. Buffer userdata             |lua-buffer|
     9459-4. Window userdata             |lua-window|
     9460+3. List userdata               |lua-list|
     9461+4. Dict userdata               |lua-dict|
     9462+5. Buffer userdata             |lua-buffer|
     9463+6. Window userdata             |lua-window|
     9464+7. The luaeval function                |lua-luaeval|
     9465 
     9466 {Vi does not have any of these commands}
     9467 
     9468@@ -88,11 +91,9 @@
     9469 All these commands execute a Lua chunk from either the command line (:lua and
     9470 :luado) or a file (:luafile) with the given line [range]. Similarly to the Lua
     9471 interpreter, each chunk has its own scope and so only global variables are
     9472-shared between command calls. Lua default libraries "table", "string", "math",
     9473-and "package" are available, "io" and "debug" are not, and "os" is restricted
     9474-to functions "date", "clock", "time", "difftime", and "getenv". In addition,
     9475-Lua "print" function has its output redirected to the Vim message area, with
     9476-arguments separated by a white space instead of a tab.
     9477+shared between command calls. All Lua default libraries are available. In
     9478+addition, Lua "print" function has its output redirected to the Vim message
     9479+area, with arguments separated by a white space instead of a tab.
     9480 
     9481 Lua uses the "vim" module (see |lua-vim|) to issue commands to Vim
     9482 and manage buffers (|lua-buffer|) and windows (|lua-window|). However,
     9483@@ -108,9 +109,9 @@
     9484 module also includes routines for buffer, window, and current line queries,
     9485 Vim evaluation and command execution, and others.
     9486 
     9487-       vim.isbuffer(value)     Returns 'true' (boolean, not string) if
     9488-                               "value" is a buffer userdata and 'false'
     9489-                               otherwise (see |lua-buffer|).
     9490+       vim.list()              Returns an empty list (see |List|).
     9491+
     9492+       vim.dict()              Returns an empty dictionary (see |Dictionary|).
     9493 
     9494        vim.buffer([arg])       If "arg" is a number, returns buffer with
     9495                                number "arg" in the buffer list or, if "arg"
     9496@@ -121,16 +122,21 @@
     9497                                'true' returns the first buffer in the buffer
     9498                                list or else the current buffer.
     9499 
     9500-       vim.iswindow(value)     Returns 'true' (boolean, not string) if
     9501-                               "value" is a window userdata and
     9502-                               'false' otherwise (see |lua-window|).
     9503-
     9504        vim.window([arg])       If "arg" is a number, returns window with
     9505                                number "arg" or 'nil' (nil value, not string)
     9506                                if not found. Otherwise, if "toboolean(arg)"
     9507                                is 'true' returns the first window or else the
     9508                                current window.
     9509 
     9510+       vim.type({arg})         Returns the type of {arg}. It is equivalent to
     9511+                               Lua's "type" function, but returns "list",
     9512+                               "dict", "buffer", or "window" if {arg} is a
     9513+                               list, dictionary, buffer, or window,
     9514+                               respectively. Examples: >
     9515+                                       :lua l = vim.list()
     9516+                                       :lua print(type(l), vim.type(l))
     9517+                                       :" userdata list
     9518+<
     9519        vim.command({cmd})      Executes the vim (ex-mode) command {cmd}.
     9520                                Examples: >
     9521                                        :lua vim.command"set tw=60"
     9522@@ -141,7 +147,7 @@
     9523                                Vim strings and numbers are directly converted
     9524                                to Lua strings and numbers respectively. Vim
     9525                                lists and dictionaries are converted to Lua
     9526-                               tables (lists become integer-keyed tables).
     9527+                               userdata (see |lua-list| and |lua-dict|).
     9528                                Examples: >
     9529                                        :lua tw = vim.eval"&tw"
     9530                                        :lua print(vim.eval"{'a': 'one'}".a)
     9531@@ -157,7 +163,72 @@
     9532 
     9533 
     9534 ==============================================================================
     9535-3. Buffer userdata                                     *lua-buffer*
     9536+3. List userdata                                       *lua-list*
     9537+
     9538+List userdata represent vim lists, and the interface tries to follow closely
     9539+Vim's syntax for lists. Since lists are objects, changes in list references in
     9540+Lua are reflected in Vim and vice-versa. A list "l" has the following
     9541+properties and methods:
     9542+
     9543+Properties
     9544+----------
     9545+       o "#l" is the number of items in list "l", equivalent to "len(l)"
     9546+           in Vim.
     9547+       o "l[k]" returns the k-th item in "l"; "l" is zero-indexed, as in Vim.
     9548+           To modify the k-th item, simply do "l[k] = newitem"; in
     9549+           particular, "l[k] = nil" removes the k-th item from "l".
     9550+       o "l()" returns an iterator for "l".
     9551+
     9552+Methods
     9553+-------
     9554+       o "l:add(item)" appends "item" to the end of "l".
     9555+       o "l:insert(item[, pos])" inserts "item" at (optional)
     9556+           position "pos" in the list. The default value for "pos" is 0.
     9557+
     9558+Examples:
     9559+>
     9560+       :let l = [1, 'item']
     9561+       :lua l = vim.eval('l') -- same 'l'
     9562+       :lua l:add(vim.list())
     9563+       :lua l[0] = math.pi
     9564+       :echo l[0] " 3.141593
     9565+       :lua l[0] = nil -- remove first item
     9566+       :lua l:insert(true, 1)
     9567+       :lua print(l, #l, l[0], l[1], l[-1])
     9568+       :lua for item in l() do print(item) end
     9569+<
     9570+
     9571+==============================================================================
     9572+4. Dict userdata                                       *lua-dict*
     9573+
     9574+Similarly to list userdata, dict userdata represent vim dictionaries; since
     9575+dictionaries are also objects, references are kept between Lua and Vim. A dict
     9576+"d" has the following properties:
     9577+
     9578+Properties
     9579+----------
     9580+       o "#d" is the number of items in dict "d", equivalent to "len(d)"
     9581+           in Vim.
     9582+       o "d.key" or "d['key']" returns the value at entry "key" in "d".
     9583+           To modify the entry at this key, simply do "d.key = newvalue"; in
     9584+           particular, "d.key = nil" removes the entry from "d".
     9585+       o "d()" returns an iterator for "d" and is equivalent to "items(d)" in
     9586+           Vim.
     9587+
     9588+Examples:
     9589+>
     9590+       :let d = {'n':10}
     9591+       :lua d = vim.eval('d') -- same 'd'
     9592+       :lua print(d, d.n, #d)
     9593+       :let d.self = d
     9594+       :lua for k, v in d() do print(d, k, v) end
     9595+       :lua d.x = math.pi
     9596+       :lua d.self = nil -- remove entry
     9597+       :echo d
     9598+<
     9599+
     9600+==============================================================================
     9601+5. Buffer userdata                                     *lua-buffer*
     9602 
     9603 Buffer userdata represent vim buffers. A buffer userdata "b" has the following
     9604 properties and methods:
     9605@@ -209,7 +280,7 @@
     9606 <
     9607 
     9608 ==============================================================================
     9609-4. Window userdata                                     *lua-window*
     9610+6. Window userdata                                     *lua-window*
     9611 
     9612 Window objects represent vim windows. A window userdata "w" has the following
     9613 properties and methods:
     9614@@ -241,4 +312,29 @@
     9615 <
     9616 
     9617 ==============================================================================
     9618- vim:tw=78:ts=8:ft=help:norl:
     9619+7. The luaeval function                                        *lua-luaeval*
     9620+
     9621+The (dual) equivalent of "vim.eval" for passing Lua values to Vim is
     9622+"luaeval". "luaeval" takes an expression string and an optional argument and
     9623+returns the result of the expression. It is semantically equivalent in Lua to:
     9624+>
     9625+       local chunkheader = "local _A = select(1, ...) return "
     9626+       function luaeval (expstr, arg)
     9627+           local chunk = assert(loadstring(chunkheader .. expstr, "luaeval"))
     9628+           return chunk(arg) -- return typval
     9629+       end
     9630+<
     9631+Note that "_A" receives the argument to "luaeval". Examples: >
     9632+
     9633+       :echo luaeval('math.pi')
     9634+       :lua a = vim.list():add('newlist')
     9635+       :let a = luaeval('a')
     9636+       :echo a[0] " 'newlist'
     9637+       :function Rand(x,y) " random uniform between x and y
     9638+       :  return luaeval('(_A.y-_A.x)*math.random()+_A.x', {'x':a:x,'y':a:y})
     9639+       :  endfunction
     9640+       :echo Rand(1,10)
     9641+
     9642+
     9643+==============================================================================
     9644+ vim:tw=78:ts=8:noet:ft=help:norl:
    92839645diff -Naur vim73.orig/runtime/doc/indent.txt vim73/runtime/doc/indent.txt
    9284 --- vim73.orig/runtime/doc/indent.txt   2012-02-15 21:57:45.113437526 +0000
    9285 +++ vim73/runtime/doc/indent.txt        2012-02-15 21:57:46.169465381 +0000
     9646--- vim73.orig/runtime/doc/indent.txt   2012-06-03 23:09:53.024009292 +0000
     9647+++ vim73/runtime/doc/indent.txt        2012-06-03 23:09:55.712080826 +0000
    92869648@@ -128,13 +128,20 @@
    92879649 used CTRL-T or CTRL-D.
     
    95279889              using "(0" or "u0", respectively and the unclosed parentheses is
    95289890              the last non-white character in its line and it is not the
    9529 @@ -410,6 +459,7 @@
     9891@@ -410,6 +459,23 @@
    95309892                  a_short_line(argument,    a_short_line(argument,
    95319893                               argument);                argument);
    95329894 <
     9895+                                                       *cino-k*
     9896+       kN    When in unclosed parentheses which follow "if", "for" or
     9897+             "while" and N is non-zero, overrides the behaviour defined by
     9898+             "(N": causes the indent to be N characters relative to the outer
     9899+             context (i.e. the line where "if", "for" or "while" is).  Has
     9900+             no effect on deeper levels of nesting.  Affects flags like "wN"
     9901+             only for the "if", "for" and "while" conditions.  If 0, defaults
     9902+             to behaviour defined by the "(N" flag.  (default: 0).
     9903+
     9904+               cino=(0                    cino=(0,ks >
     9905+                 if (condition1            if (condition1
     9906+                     && condition2)                && condition2)
     9907+                     action();                 action();
     9908+                 function(argument1        function(argument1
     9909+                          && argument2);            && argument2);
     9910+<
    95339911+                                                       *cino-m*
    95349912        mN    When N is non-zero, line up a line starting with a closing
    95359913              parentheses with the first character of the line with the
    95369914              matching opening parentheses.  (default 0).
    9537 @@ -424,6 +474,7 @@
     9915@@ -424,6 +490,7 @@
    95389916                     )                      )
    95399917                      foo;                      foo;
     
    95439921              parentheses with the first character of the previous line.
    95449922              (default 0).
    9545 @@ -433,7 +484,7 @@
     9923@@ -433,7 +500,7 @@
    95469924                         cond2                     cond2
    95479925                     )                             )
     
    95529930              currently unused but must be non-zero (e.g. 'j1').  'j1' will
    95539931              indent for example the following code snippet correctly: >
    9554 @@ -444,7 +495,7 @@
     9932@@ -444,7 +511,7 @@
    95559933                    }
    95569934                });
     
    95619939              them with labels.  The value 'N' is currently unused but must be
    95629940              non-zero (e.g. 'J1'). >
    9563 @@ -462,14 +513,19 @@
     9941@@ -462,23 +529,28 @@
    95649942                    }
    95659943                }
     
    95799957+                                                               *cino-#*
    95809958        #N    When N is non-zero recognize shell/Perl comments, starting with
    9581               '#'.  Default N is zero: don't recognizes '#' comments.  Note
     9959-             '#'.  Default N is zero: don't recognizes '#' comments.  Note
     9960+             '#'.  Default N is zero: don't recognize '#' comments.  Note
    95829961              that lines starting with # will still be seen as preprocessor
    9583 @@ -477,7 +533,7 @@
     9962              lines.
    95849963 
    95859964 
    95869965 The defaults, spelled out in full, are:
    95879966-       cinoptions=>s,e0,n0,f0,{0,}0,^0,L-1,:s,=s,l0,b0,gs,hs,ps,ts,is,+s,
     9967-                       c3,C0,/0,(2s,us,U0,w0,W0,m0,j0,J0,)20,*70,#0
    95889968+       cinoptions=>s,e0,n0,f0,{0,}0,^0,L-1,:s,=s,l0,b0,gs,hs,N0,ps,ts,is,+s,
    9589                         c3,C0,/0,(2s,us,U0,w0,W0,m0,j0,J0,)20,*70,#0
     9969+                       c3,C0,/0,(2s,us,U0,w0,W0,k0,m0,j0,J0,)20,*70,#0
    95909970 
    95919971 Vim puts a line in column 1 if:
     9972 - It starts with '#' (preprocessor directives), if 'cinkeys' contains '#'.
    95929973diff -Naur vim73.orig/runtime/doc/indent.txt.orig vim73/runtime/doc/indent.txt.orig
    95939974--- vim73.orig/runtime/doc/indent.txt.orig      1970-01-01 00:00:00.000000000 +0000
     
    1040610787+ vim:tw=78:ts=8:ft=help:norl:
    1040710788diff -Naur vim73.orig/runtime/doc/map.txt vim73/runtime/doc/map.txt
    10408 --- vim73.orig/runtime/doc/map.txt      2012-02-15 21:57:45.109437420 +0000
    10409 +++ vim73/runtime/doc/map.txt   2012-02-15 21:57:46.273468124 +0000
     10789--- vim73.orig/runtime/doc/map.txt      2012-06-03 23:09:53.020009186 +0000
     10790+++ vim73/runtime/doc/map.txt   2012-06-03 23:09:55.820083699 +0000
    1041010791@@ -226,7 +226,7 @@
    1041110792 
     
    1041710798 Be very careful about side effects!  The expression is evaluated while
    1041810799 obtaining characters, you may very well make the command dysfunctional.
    10419 @@ -1202,20 +1202,26 @@
     10800@@ -1202,20 +1202,28 @@
    1042010801 
    1042110802        -complete=augroup       autocmd groups
    1042210803        -complete=buffer        buffer names
     10804+       -complete=behave        :behave suboptions
    1042310805+       -complete=color         color schemes
    1042410806        -complete=command       Ex command (and arguments)
     
    1043510817        -complete=help          help subjects
    1043610818        -complete=highlight     highlight groups
     10819+       -complete=history       :history suboptions
    1043710820+       -complete=locale        locale names (as output of locale -a)
    1043810821        -complete=mapping       mapping name
     
    1044510828        -complete=tag_listfiles tags, file names are shown when CTRL-D is hit
    1044610829diff -Naur vim73.orig/runtime/doc/motion.txt vim73/runtime/doc/motion.txt
    10447 --- vim73.orig/runtime/doc/motion.txt   2012-02-15 21:57:45.109437420 +0000
    10448 +++ vim73/runtime/doc/motion.txt        2012-02-15 21:57:46.181465699 +0000
     10830--- vim73.orig/runtime/doc/motion.txt   2012-06-03 23:09:53.020009186 +0000
     10831+++ vim73/runtime/doc/motion.txt        2012-06-03 23:09:54.380045379 +0000
    1044910832@@ -269,11 +269,11 @@
    1045010833                        {char} can be entered like with the |f| command.
     
    1046210845 3. Up-down motions                                     *up-down-motions*
    1046310846diff -Naur vim73.orig/runtime/doc/netbeans.txt vim73/runtime/doc/netbeans.txt
    10464 --- vim73.orig/runtime/doc/netbeans.txt 2012-02-15 21:57:45.109437420 +0000
    10465 +++ vim73/runtime/doc/netbeans.txt      2012-02-15 21:57:46.565475827 +0000
     10847--- vim73.orig/runtime/doc/netbeans.txt 2012-06-03 23:09:53.016009080 +0000
     10848+++ vim73/runtime/doc/netbeans.txt      2012-06-03 23:09:54.892059004 +0000
    1046610849@@ -1,4 +1,4 @@
    1046710850-*netbeans.txt*  For Vim version 7.3.  Last change: 2010 Jul 20
     
    1052510908 ==============================================================================
    1052610909diff -Naur vim73.orig/runtime/doc/options.txt vim73/runtime/doc/options.txt
    10527 --- vim73.orig/runtime/doc/options.txt  2012-02-15 21:57:45.109437420 +0000
    10528 +++ vim73/runtime/doc/options.txt       2012-02-15 21:57:46.969486483 +0000
     10910--- vim73.orig/runtime/doc/options.txt  2012-06-03 23:09:53.020009186 +0000
     10911+++ vim73/runtime/doc/options.txt       2012-06-03 23:09:55.460074120 +0000
    1052910912@@ -150,6 +150,18 @@
    1053010913 (the ^[ is a real <Esc> here, use CTRL-V <Esc> to enter it)
     
    1063211015        and the other initializations, so that when the 'shell' option is set
    1063311016        there, the 'shellpipe' option changes automatically, unless it was
    10634 @@ -5980,8 +6023,8 @@
     11017@@ -5980,6 +6023,7 @@
    1063511018 
    1063611019                                                *'shellxquote'* *'sxq'*
    1063711020 'shellxquote' 'sxq'    string  (default: "";
    10638 -                                       for Win32, when 'shell' contains "sh"
    10639 -                                       somewhere: "\""
    10640 +                                       for Win32, when 'shell' is cmd.exe or
    10641 +                                       contains "sh" somewhere: "\""
     11021+                                       for Win32, when 'shell' is cmd.exe: "("
     11022                                        for Win32, when 'shell' contains "sh"
     11023                                        somewhere: "\""
    1064211024                                        for Unix, when using system(): "\"")
    10643                         global
    10644                         {not in Vi}
    10645 @@ -5989,11 +6032,12 @@
     11025@@ -5989,14 +6033,28 @@
    1064611026        the "!" and ":!" commands.  Includes the redirection.  See
    1064711027        'shellquote' to exclude the redirection.  It's probably not useful
     
    1065211032-       according the value of 'shell', to reduce the need to set this option
    1065311033-       by the user.  See |dos-shell|.
     11034+       When the value is '(' then ')' is appended. When the value is '"('
     11035+       then ')"' is appended.
     11036+       When the value is '(' then also see 'shellxescape'.
    1065411037+       This is an empty string by default on most systems, but is known to be
    1065511038+       useful for on Win32 version, either for cmd.exe which automatically
     
    1066111044        security reasons.
    1066211045 
    10663 @@ -7530,8 +7574,9 @@
     11046+                                               *'shellxescape'* *'sxe'*
     11047+'shellxescape' 'sxe'   string  (default: "";
     11048+                                for MS-DOS and MS-Windows: "\"&|<>()@^")
     11049+                       global
     11050+                       {not in Vi}
     11051+       When 'shellxquote' is set to "(" then the characters listed in this
     11052+       option will be escaped with a '^' character.  This makes it possible
     11053+       to execute most external commands with cmd.exe.
     11054+
     11055+
     11056                        *'shiftround'* *'sr'* *'noshiftround'* *'nosr'*
     11057 'shiftround' 'sr'      boolean (default off)
     11058                        global
     11059@@ -7530,8 +7588,9 @@
    1066411060        !       When included, save and restore global variables that start
    1066511061                with an uppercase letter, and don't contain a lowercase
     
    1067311069                the '<' item, with the disadvantage that you need to put a
    1067411070                backslash before the ", otherwise it will be recognized as the
    10675 @@ -7747,6 +7792,17 @@
     11071@@ -7747,6 +7806,17 @@
    1067611072        a pattern from the list.  This avoids problems when a future version
    1067711073        uses another default.
     
    1069311089diff -Naur vim73.orig/runtime/doc/options.txt.orig vim73/runtime/doc/options.txt.orig
    1069411090--- vim73.orig/runtime/doc/options.txt.orig     1970-01-01 00:00:00.000000000 +0000
    10695 +++ vim73/runtime/doc/options.txt.orig  2012-02-15 21:57:45.713453353 +0000
     11091+++ vim73/runtime/doc/options.txt.orig  2012-06-03 23:09:53.792029731 +0000
    1069611092@@ -0,0 +1,8079 @@
    1069711093+*options.txt*  For Vim version 7.3.  Last change: 2010 Aug 15
     
    1877619172+ vim:tw=78:ts=8:ft=help:norl:
    1877719173diff -Naur vim73.orig/runtime/doc/os_risc.txt vim73/runtime/doc/os_risc.txt
    18778 --- vim73.orig/runtime/doc/os_risc.txt  2012-02-15 21:57:45.113437526 +0000
    18779 +++ vim73/runtime/doc/os_risc.txt       2012-02-15 21:57:45.965460001 +0000
     19174--- vim73.orig/runtime/doc/os_risc.txt  2012-06-03 23:09:53.024009292 +0000
     19175+++ vim73/runtime/doc/os_risc.txt       2012-06-03 23:09:54.112038245 +0000
    1878019176@@ -1,322 +1,12 @@
    1878119177-*os_risc.txt*   For Vim version 7.3.  Last change: 2010 Aug 07
     
    1910519501  vim:tw=78:ts=8:ft=help:norl:
    1910619502diff -Naur vim73.orig/runtime/doc/os_win32.txt vim73/runtime/doc/os_win32.txt
    19107 --- vim73.orig/runtime/doc/os_win32.txt 2012-02-15 21:57:45.109437420 +0000
    19108 +++ vim73/runtime/doc/os_win32.txt      2012-02-15 21:57:46.169465381 +0000
     19503--- vim73.orig/runtime/doc/os_win32.txt 2012-06-03 23:09:53.016009080 +0000
     19504+++ vim73/runtime/doc/os_win32.txt      2012-06-03 23:09:54.368045058 +0000
    1910919505@@ -313,6 +313,37 @@
    1911019506    with :!start do not get passed Vim's open file handles, which means they do
     
    1914619542    Vim doesn't wait for it to finish!  Help!
    1914719543diff -Naur vim73.orig/runtime/doc/pattern.txt vim73/runtime/doc/pattern.txt
    19148 --- vim73.orig/runtime/doc/pattern.txt  2012-02-15 21:57:45.109437420 +0000
    19149 +++ vim73/runtime/doc/pattern.txt       2012-02-15 21:57:46.277468229 +0000
     19544--- vim73.orig/runtime/doc/pattern.txt  2012-06-03 23:09:53.020009186 +0000
     19545+++ vim73/runtime/doc/pattern.txt       2012-06-03 23:09:54.508048784 +0000
    1915019546@@ -1027,11 +1027,9 @@
    1915119547          These items only work for 8-bit characters.
     
    1916319559          character in the form:
    1916419560diff -Naur vim73.orig/runtime/filetype.vim vim73/runtime/filetype.vim
    19165 --- vim73.orig/runtime/filetype.vim     2012-02-15 21:57:45.077436578 +0000
    19166 +++ vim73/runtime/filetype.vim  2012-02-15 21:57:46.905484794 +0000
     19561--- vim73.orig/runtime/filetype.vim     2012-06-03 23:09:52.976008014 +0000
     19562+++ vim73/runtime/filetype.vim  2012-06-03 23:09:55.356071352 +0000
    1916719563@@ -2475,17 +2475,19 @@
    1916819564 " detected filetypes.
     
    2170722103+unlet s:cpo_save
    2170822104diff -Naur vim73.orig/runtime/ftplugof.vim vim73/runtime/ftplugof.vim
    21709 --- vim73.orig/runtime/ftplugof.vim     2012-02-15 21:57:45.117437632 +0000
    21710 +++ vim73/runtime/ftplugof.vim  2012-02-15 21:57:46.549475403 +0000
     22105--- vim73.orig/runtime/ftplugof.vim     2012-06-03 23:09:53.028009398 +0000
     22106+++ vim73/runtime/ftplugof.vim  2012-06-03 23:09:54.868058365 +0000
    2171122107@@ -1,11 +1,13 @@
    2171222108 " Vim support file to switch off loading plugins for file types
     
    2172822124diff -Naur vim73.orig/src/GvimExt/Make_cyg.mak vim73/src/GvimExt/Make_cyg.mak
    2172922125--- vim73.orig/src/GvimExt/Make_cyg.mak 1970-01-01 00:00:00.000000000 +0000
    21730 +++ vim73/src/GvimExt/Make_cyg.mak      2012-02-15 21:57:46.501474139 +0000
     22126+++ vim73/src/GvimExt/Make_cyg.mak      2012-06-03 23:09:54.804056662 +0000
    2173122127@@ -0,0 +1,77 @@
    2173222128+# Project: gvimext
     
    2180822204+       -$(DEL)  $(OBJ) $(RES) $(DLL)
    2180922205diff -Naur vim73.orig/src/GvimExt/Make_ming.mak vim73/src/GvimExt/Make_ming.mak
    21810 --- vim73.orig/src/GvimExt/Make_ming.mak        2012-02-15 21:57:45.057436051 +0000
    21811 +++ vim73/src/GvimExt/Make_ming.mak     2012-02-15 21:57:46.501474139 +0000
     22206--- vim73.orig/src/GvimExt/Make_ming.mak        2012-06-03 23:09:52.944007163 +0000
     22207+++ vim73/src/GvimExt/Make_ming.mak     2012-06-03 23:09:54.804056662 +0000
    2181222208@@ -1,6 +1,6 @@
    2181322209 # Project: gvimext
     
    2187722273-
    2187822274diff -Naur vim73.orig/src/GvimExt/gvimext.cpp vim73/src/GvimExt/gvimext.cpp
    21879 --- vim73.orig/src/GvimExt/gvimext.cpp  2012-02-15 21:57:45.057436051 +0000
    21880 +++ vim73/src/GvimExt/gvimext.cpp       2012-02-15 21:57:46.337469812 +0000
     22275--- vim73.orig/src/GvimExt/gvimext.cpp  2012-06-03 23:09:52.944007163 +0000
     22276+++ vim73/src/GvimExt/gvimext.cpp       2012-06-03 23:09:54.580050701 +0000
    2188122277@@ -142,6 +142,7 @@
    2188222278 static int dyn_libintl_init(char *dir);
     
    2196322359                &pi)            // Pointer to PROCESS_INFORMATION structure.
    2196422360diff -Naur vim73.orig/src/GvimExt/gvimext.def vim73/src/GvimExt/gvimext.def
    21965 --- vim73.orig/src/GvimExt/gvimext.def  2012-02-15 21:57:45.057436051 +0000
    21966 +++ vim73/src/GvimExt/gvimext.def       2012-02-15 21:57:46.141464642 +0000
     22361--- vim73.orig/src/GvimExt/gvimext.def  2012-06-03 23:09:52.944007163 +0000
     22362+++ vim73/src/GvimExt/gvimext.def       2012-06-03 23:09:54.328043994 +0000
    2196722363@@ -1,7 +1,7 @@
    2196822364 ;gvimdef.def : Declares the module parameters for the DLL.
     
    2197522371     DllCanUnloadNow private
    2197622372diff -Naur vim73.orig/src/GvimExt/gvimext_ming.def vim73/src/GvimExt/gvimext_ming.def
    21977 --- vim73.orig/src/GvimExt/gvimext_ming.def     2012-02-15 21:57:45.057436051 +0000
    21978 +++ vim73/src/GvimExt/gvimext_ming.def  2012-02-15 21:57:46.141464642 +0000
     22373--- vim73.orig/src/GvimExt/gvimext_ming.def     2012-06-03 23:09:52.944007163 +0000
     22374+++ vim73/src/GvimExt/gvimext_ming.def  2012-06-03 23:09:54.328043994 +0000
    2197922375@@ -3,7 +3,7 @@
    2198022376 ;Hence this is the same file as gvimext.def with private removed
     
    2198722383     DllCanUnloadNow = DllCanUnloadNow@0
    2198822384diff -Naur vim73.orig/src/INSTALL vim73/src/INSTALL
    21989 --- vim73.orig/src/INSTALL      2012-02-15 21:57:45.053435946 +0000
    21990 +++ vim73/src/INSTALL   2012-02-15 21:57:45.977460316 +0000
     22385--- vim73.orig/src/INSTALL      2012-06-03 23:09:52.940007057 +0000
     22386+++ vim73/src/INSTALL   2012-06-03 23:09:54.124038565 +0000
    2199122387@@ -6,9 +6,8 @@
    2199222388 Contents:
     
    2203822434 [NOTE: this is quite old, it might not work anymore]
    2203922435diff -Naur vim73.orig/src/INSTALLpc.txt vim73/src/INSTALLpc.txt
    22040 --- vim73.orig/src/INSTALLpc.txt        2012-02-15 21:57:45.057436051 +0000
    22041 +++ vim73/src/INSTALLpc.txt     2012-02-15 21:57:46.237467173 +0000
     22436--- vim73.orig/src/INSTALLpc.txt        2012-06-03 23:09:52.948007269 +0000
     22437+++ vim73/src/INSTALLpc.txt     2012-06-03 23:09:55.528075930 +0000
    2204222438@@ -11,9 +11,9 @@
    2204322439 this, then you will get the default behavior as is documented, which should
     
    2207822474 
    2207922475 
    22080 @@ -408,3 +412,59 @@
     22476@@ -235,6 +239,12 @@
     22477 found at
     22478     http://www.upx.org/
     22479 
     22480+As of 2011, UPX still does not support compressing 64-bit EXE's; if you have
     22481+built a 64-bit vim then an alternative to UPX is 'MPRESS'. MPRESS can be found
     22482+at:
     22483+    http://www.matcode.com/mpress.htm
     22484+
     22485+
     22486 ADDITION: NLS support with MinGW
     22487 
     22488 (by Eduardo F. Amatria <eferna1@platea.pntic.mec.es>)
     22489@@ -408,3 +418,59 @@
    2208122490 
    2208222491 If you get all kinds of strange error messages when compiling, try adding
     
    2213922548+Happy Vimming!
    2214022549diff -Naur vim73.orig/src/Make_cyg.mak vim73/src/Make_cyg.mak
    22141 --- vim73.orig/src/Make_cyg.mak 2012-02-15 21:57:45.041435628 +0000
    22142 +++ vim73/src/Make_cyg.mak      2012-02-15 21:57:46.501474139 +0000
     22550--- vim73.orig/src/Make_cyg.mak 2012-06-03 23:09:52.920006524 +0000
     22551+++ vim73/src/Make_cyg.mak      2012-06-03 23:09:54.804056662 +0000
    2214322552@@ -1,6 +1,6 @@
    2214422553 #
     
    2220222611        -$(DEL) obj$(DIRSLASH)*.o
    2220322612diff -Naur vim73.orig/src/Make_ming.mak vim73/src/Make_ming.mak
    22204 --- vim73.orig/src/Make_ming.mak        2012-02-15 21:57:45.057436051 +0000
    22205 +++ vim73/src/Make_ming.mak     2012-02-15 21:57:46.529474878 +0000
    22206 @@ -56,6 +56,12 @@
     22613--- vim73.orig/src/Make_ming.mak        2012-06-03 23:09:52.944007163 +0000
     22614+++ vim73/src/Make_ming.mak     2012-06-03 23:09:55.744081677 +0000
     22615@@ -14,9 +14,11 @@
     22616 # it's just run out of memory or something.  Run again, and it will continue
     22617 # with 'xxd'.
     22618 #
     22619-# "make upx" makes *compressed* versions of the GUI and console EXEs, using the
     22620-# excellent UPX compressor:
     22621+# "make upx" makes *compressed* versions of the 32 bit GUI and console EXEs,
     22622+# using the excellent UPX compressor:
     22623 #     http://upx.sourceforge.net/
     22624+# "make mpress" uses the MPRESS compressor for 32- and 64-bit EXEs:
     22625+#     http://www.matcode.com/mpress.htm
     22626 #
     22627 # Maintained by Ron Aaron <ronaharon@yahoo.com>
     22628 # updated 2003 Jan 20
     22629@@ -49,13 +51,21 @@
     22630 # set to yes to enable OLE support
     22631 OLE=no
     22632 # Set the default $(WINVER) to make it work with pre-Win2k
     22633+ifndef WINVER
     22634 WINVER = 0x0400
     22635+endif
     22636 # Set to yes to enable Cscope support
     22637 CSCOPE=yes
     22638 # Set to yes to enable Netbeans support
    2220722639 NETBEANS=$(GUI)
    2220822640 
     
    2221722649 ifeq (no, $(GETTEXT))
    2221822650 GETTEXT=
    22219 @@ -81,7 +87,7 @@
     22651@@ -81,7 +91,7 @@
    2222022652 
    2222122653 # If you are using gettext-0.10.35 from http://sourceforge.net/projects/gettext
     
    2222622658 #STATIC_GETTEXT=USE_STATIC_GETTEXT
    2222722659 #DYNAMIC_GETTEXT=DYNAMIC_GETTEXT
    22228 @@ -102,6 +108,13 @@
     22660@@ -102,6 +112,13 @@
    2222922661 # on NT, it's here:
    2223022662 PERLLIB=$(PERL)/lib
     
    2224022672 
    2224122673 # uncomment 'LUA' if you want a Lua-enabled version
    22242 @@ -141,11 +154,17 @@
     22674@@ -141,11 +158,17 @@
    2224322675 MZSCHEME_GENERATE_BASE=no
    2224422676 endif
     
    2226022692 # the modern MinGW can dynamically link to dlls directly.
    2226122693 # point MZSCHEME_DLLS to where you put libmzschXXXXXXX.dll and libgcXXXXXXX.dll
    22262 @@ -304,11 +323,13 @@
     22694@@ -304,11 +327,13 @@
    2226322695 endif
    2226422696 CC := $(CROSS_COMPILE)gcc
     
    2227422706 ifdef GETTEXT
    2227522707 DEFINES += -DHAVE_GETTEXT -DHAVE_LOCALE_H
    22276 @@ -343,7 +364,7 @@
     22708@@ -343,7 +368,7 @@
    2227722709 ifdef MZSCHEME
    2227822710 CFLAGS += -I$(MZSCHEME)/include -DFEAT_MZSCHEME -DMZSCHEME_COLLECTS=\"$(MZSCHEME)/collects\"
     
    2228322715 endif
    2228422716 
    22285 @@ -571,8 +592,13 @@
     22717@@ -571,8 +596,13 @@
    2228622718 endif
    2228722719 
     
    2229822730 
    2229922731 ifeq (yes, $(MBYTE))
    22300 @@ -615,7 +641,7 @@
     22732@@ -614,8 +644,12 @@
     22733        upx gvim.exe
    2230122734        upx vim.exe
    2230222735 
     22736+mpress: exes
     22737+       mpress gvim.exe
     22738+       mpress vim.exe
     22739+
    2230322740 xxd/xxd.exe: xxd/xxd.c
    2230422741-       $(MAKE) -C xxd -f Make_cyg.mak CC=$(CC)
     
    2230722744 GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
    2230822745        $(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE)
    22309 @@ -633,7 +659,7 @@
     22746@@ -633,7 +667,7 @@
    2231022747        -$(DEL) mzscheme_base.c
    2231122748 endif
     
    2231622753 ###########################################################################
    2231722754 INCL = vim.h feature.h os_win32.h os_dos.h ascii.h keymap.h term.h macros.h \
    22318 @@ -650,10 +676,10 @@
     22755@@ -649,11 +683,9 @@
     22756 $(OUTDIR)/%.o : %.c $(INCL)
    2231922757        $(CC) -c $(CFLAGS) $< -o $@
    2232022758 
    22321  $(OUTDIR)/vimres.res: vim.rc version.h gui_w32_rc.h
     22759-$(OUTDIR)/vimres.res: vim.rc version.h gui_w32_rc.h
    2232222760-       $(WINDRES) $(DEFINES) vim.rc $(OUTDIR)/vimres.res
    22323 +       $(WINDRES) $(WINDRES_FLAGS) $(DEFINES) vim.rc $(OUTDIR)/vimres.res
    22324  
    22325  $(OUTDIR)/vimrc.o: $(OUTDIR)/vimres.res
     22761-
     22762-$(OUTDIR)/vimrc.o: $(OUTDIR)/vimres.res
    2232622763-       $(WINDRES) $(OUTDIR)/vimres.res $(OUTDIR)/vimrc.o
    22327 +       $(WINDRES) $(WINDRES_FLAGS) $(OUTDIR)/vimres.res $(OUTDIR)/vimrc.o
     22764+$(OUTDIR)/vimrc.o: vim.rc version.h gui_w32_rc.h
     22765+       $(WINDRES) $(WINDRES_FLAGS) $(DEFINES) \
     22766+           --input-format=rc --output-format=coff -i vim.rc -o $@
    2232822767 
    2232922768 $(OUTDIR):
    2233022769        $(MKDIR) $(OUTDIR)
    22331 @@ -677,7 +703,7 @@
     22770@@ -677,7 +709,7 @@
    2233222771 endif
    2233322772 
     
    2233922778 $(OUTDIR)/netbeans.o:  netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC)
    2234022779diff -Naur vim73.orig/src/Make_mvc.mak vim73/src/Make_mvc.mak
    22341 --- vim73.orig/src/Make_mvc.mak 2012-02-15 21:57:45.041435628 +0000
    22342 +++ vim73/src/Make_mvc.mak      2012-02-15 21:57:46.953486059 +0000
     22780--- vim73.orig/src/Make_mvc.mak 2012-06-03 23:09:52.924006631 +0000
     22781+++ vim73/src/Make_mvc.mak      2012-06-03 23:09:55.492074972 +0000
    2234322782@@ -380,9 +380,6 @@
    2234422783 !if "$(_NMAKE_VER)" == "10.00.30319.01"
     
    2236222801 !endif
    2236322802 !endif
     22803@@ -619,7 +616,7 @@
     22804                -DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
     22805 TCL_OBJ        = $(OUTDIR)\if_tcl.obj
     22806 TCL_INC        = /I "$(TCL)\Include" /I "$(TCL)"
     22807-TCL_LIB = $(TCL)\lib\tclstub$(TCL_VER).lib
     22808+TCL_LIB = "$(TCL)\lib\tclstub$(TCL_VER).lib"
     22809 !else
     22810 CFLAGS  = $(CFLAGS) -DFEAT_TCL
     22811 TCL_OBJ        = $(OUTDIR)\if_tcl.obj
    2236422812@@ -705,12 +702,18 @@
    2236522813 MZSCHEME_VER = 205_000
     
    2245322901 
    2245422902diff -Naur vim73.orig/src/Make_ro.mak vim73/src/Make_ro.mak
    22455 --- vim73.orig/src/Make_ro.mak  2012-02-15 21:57:45.053435946 +0000
     22903--- vim73.orig/src/Make_ro.mak  2012-06-03 23:09:52.940007057 +0000
    2245622904+++ vim73/src/Make_ro.mak       1970-01-01 00:00:00.000000000 +0000
    2245722905@@ -1,135 +0,0 @@
     
    2259223040-o.window:      c.window
    2259323041diff -Naur vim73.orig/src/Makefile vim73/src/Makefile
    22594 --- vim73.orig/src/Makefile     2012-02-15 21:57:45.065436261 +0000
    22595 +++ vim73/src/Makefile  2012-02-15 21:57:46.689479097 +0000
     23042--- vim73.orig/src/Makefile     2012-06-03 23:09:52.956007482 +0000
     23043+++ vim73/src/Makefile  2012-06-03 23:09:55.668079655 +0000
    2259623044@@ -29,7 +29,7 @@
    2259723045 #      - Uncomment the line "CONF_OPT_X = --without-x" if you have X11 but
     
    2281823266                $(CONF_OPT_CSCOPE) $(CONF_OPT_MULTIBYTE) $(CONF_OPT_INPUT) \
    2281923267                $(CONF_OPT_OUTPUT) $(CONF_OPT_GPM) $(CONF_OPT_WORKSHOP) \
    22820 @@ -1694,8 +1715,9 @@
     23268@@ -1694,11 +1715,12 @@
    2282123269 $(VIMTARGET): auto/config.mk objects $(OBJ) version.c version.h
    2282223270        $(CCC) version.c -o objects/version.o
     
    2282923277 
    2283023278 xxd/xxd$(EXEEXT): xxd/xxd.c
    22831         cd xxd; CC="$(CC)" CFLAGS="$(CPPFLAGS) $(CFLAGS)" \
     23279-       cd xxd; CC="$(CC)" CFLAGS="$(CPPFLAGS) $(CFLAGS)" \
     23280+       cd xxd; CC="$(CC)" CFLAGS="$(CPPFLAGS) $(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
     23281                $(MAKE) -f Makefile
     23282 
     23283 # Build the language specific files if they were unpacked.
    2283223284@@ -1818,6 +1840,15 @@
    2283323285                ln -s $(VIMTARGET) vim; \
     
    2293823390  arabic.h version.h
    2293923391diff -Naur vim73.orig/src/VisVim/Commands.cpp vim73/src/VisVim/Commands.cpp
    22940 --- vim73.orig/src/VisVim/Commands.cpp  2012-02-15 21:57:45.045435734 +0000
    22941 +++ vim73/src/VisVim/Commands.cpp       2012-02-15 21:57:46.345470023 +0000
     23392--- vim73.orig/src/VisVim/Commands.cpp  2012-06-03 23:09:52.932006845 +0000
     23393+++ vim73/src/VisVim/Commands.cpp       2012-06-03 23:09:54.592051020 +0000
    2294223394@@ -549,7 +549,7 @@
    2294323395        if (g_bNewTabs)
     
    2295923411                        *s++ = '/';
    2296023412                else
     23413diff -Naur vim73.orig/src/arabic.c vim73/src/arabic.c
     23414--- vim73.orig/src/arabic.c     2012-06-03 23:09:52.924006631 +0000
     23415+++ vim73/src/arabic.c  2012-06-03 23:09:55.924086467 +0000
     23416@@ -1066,7 +1066,7 @@
     23417 
     23418     if (curr_c != c && ccp != NULL)
     23419     {
     23420-       char_u buf[MB_MAXBYTES];
     23421+       char_u buf[MB_MAXBYTES + 1];
     23422 
     23423        /* Update the first byte of the character. */
     23424        (*mb_char2bytes)(curr_c, buf);
    2296123425diff -Naur vim73.orig/src/ascii.h vim73/src/ascii.h
    22962 --- vim73.orig/src/ascii.h      2012-02-15 21:57:45.061436156 +0000
    22963 +++ vim73/src/ascii.h   2012-02-15 21:57:46.701479413 +0000
     23426--- vim73.orig/src/ascii.h      2012-06-03 23:09:52.948007269 +0000
     23427+++ vim73/src/ascii.h   2012-06-03 23:09:55.076063900 +0000
    2296423428@@ -123,7 +123,7 @@
    2296523429 #define DCS            0x90    /* Device Control String */
     
    2298623450 #endif
    2298723451diff -Naur vim73.orig/src/auto/config.mk vim73/src/auto/config.mk
    22988 --- vim73.orig/src/auto/config.mk       2012-02-15 21:57:45.061436156 +0000
     23452--- vim73.orig/src/auto/config.mk       2012-06-03 23:09:52.948007269 +0000
    2298923453+++ vim73/src/auto/config.mk    1970-01-01 00:00:00.000000000 +0000
    2299023454@@ -1,5 +0,0 @@
     
    2299523459-VIEWNAME = view
    2299623460diff -Naur vim73.orig/src/auto/configure vim73/src/auto/configure
    22997 --- vim73.orig/src/auto/configure       2012-02-15 21:57:45.061436156 +0000
    22998 +++ vim73/src/auto/configure    2012-02-15 21:57:46.917485111 +0000
     23461--- vim73.orig/src/auto/configure       2012-06-03 23:09:52.948007269 +0000
     23462+++ vim73/src/auto/configure    2012-06-03 23:09:55.372071777 +0000
    2299923463@@ -593,6 +593,7 @@
    2300023464 
     
    2359724061 cat >confcache <<\_ACEOF
    2359824062diff -Naur vim73.orig/src/blowfish.c vim73/src/blowfish.c
    23599 --- vim73.orig/src/blowfish.c   2012-02-15 21:57:45.049435840 +0000
    23600 +++ vim73/src/blowfish.c        2012-02-15 21:57:45.661451983 +0000
     24063--- vim73.orig/src/blowfish.c   2012-06-03 23:09:52.932006845 +0000
     24064+++ vim73/src/blowfish.c        2012-06-03 23:09:53.732028133 +0000
    2360124065@@ -413,6 +413,7 @@
    2360224066     int    salt_len;
     
    2361924083     mch_memmove(sbx, sbi, 4 * 4 * 256);
    2362024084diff -Naur vim73.orig/src/buffer.c vim73/src/buffer.c
    23621 --- vim73.orig/src/buffer.c     2012-02-15 21:57:45.041435628 +0000
    23622 +++ vim73/src/buffer.c  2012-02-15 21:57:46.809482262 +0000
    23623 @@ -416,6 +416,14 @@
     24085--- vim73.orig/src/buffer.c     2012-06-03 23:09:52.920006524 +0000
     24086+++ vim73/src/buffer.c  2012-06-03 23:09:55.588077525 +0000
     24087@@ -64,6 +64,9 @@
     24088 static char *msg_loclist = N_("[Location List]");
     24089 static char *msg_qflist = N_("[Quickfix List]");
     24090 #endif
     24091+#ifdef FEAT_AUTOCMD
     24092+static char *e_auabort = N_("E855: Autocommands caused command to abort");
     24093+#endif
     24094 
     24095 /*
     24096  * Open current buffer, that is: open the memfile and read the file into
     24097@@ -96,7 +99,7 @@
     24098         * There MUST be a memfile, otherwise we can't do anything
     24099         * If we can't create one for the current buffer, take another buffer
     24100         */
     24101-       close_buffer(NULL, curbuf, 0);
     24102+       close_buffer(NULL, curbuf, 0, FALSE);
     24103        for (curbuf = firstbuf; curbuf != NULL; curbuf = curbuf->b_next)
     24104            if (curbuf->b_ml.ml_mfp != NULL)
     24105                break;
     24106@@ -316,12 +319,17 @@
     24107  * get a new buffer very soon!
     24108  *
     24109  * The 'bufhidden' option can force freeing and deleting.
     24110+ *
     24111+ * When "abort_if_last" is TRUE then do not close the buffer if autocommands
     24112+ * cause there to be only one window with this buffer.  e.g. when ":quit" is
     24113+ * supposed to close the window but autocommands close all other windows.
     24114  */
     24115     void
     24116-close_buffer(win, buf, action)
     24117+close_buffer(win, buf, action, abort_if_last)
     24118     win_T      *win;           /* if not NULL, set b_last_cursor */
     24119     buf_T      *buf;
     24120     int                action;
     24121+    int                abort_if_last UNUSED;
     24122 {
     24123 #ifdef FEAT_AUTOCMD
     24124     int                is_curbuf;
     24125@@ -371,8 +379,12 @@
     24126     {
     24127        apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname, buf->b_fname,
     24128                                                                  FALSE, buf);
     24129-       if (!buf_valid(buf))        /* autocommands may delete the buffer */
     24130+       /* Return if autocommands deleted the buffer or made it the only one. */
     24131+       if (!buf_valid(buf) || (abort_if_last && one_window()))
     24132+       {
     24133+           EMSG(_(e_auabort));
     24134            return;
     24135+       }
     24136 
     24137        /* When the buffer becomes hidden, but is not unloaded, trigger
     24138         * BufHidden */
     24139@@ -380,8 +392,13 @@
     24140        {
     24141            apply_autocmds(EVENT_BUFHIDDEN, buf->b_fname, buf->b_fname,
     24142                                                                  FALSE, buf);
     24143-           if (!buf_valid(buf))        /* autocmds may delete the buffer */
     24144+           /* Return if autocommands deleted the buffer or made it the only
     24145+            * one. */
     24146+           if (!buf_valid(buf) || (abort_if_last && one_window()))
     24147+           {
     24148+               EMSG(_(e_auabort));
     24149                return;
     24150+           }
     24151        }
     24152 # ifdef FEAT_EVAL
     24153        if (aborting())     /* autocmds may abort script processing */
     24154@@ -416,6 +433,14 @@
    2362424155 #endif
    2362524156 
     
    2363624167 #ifdef FEAT_AUTOCMD
    2363724168     /* Autocommands may have deleted the buffer. */
    23638 @@ -560,6 +568,11 @@
     24169@@ -560,6 +585,11 @@
    2363924170 #ifdef FEAT_DIFF
    2364024171     diff_buf_delete(buf);          /* Can't use 'diff' for unloaded buffer. */
     
    2364824179 #ifdef FEAT_FOLDING
    2364924180     /* No folds in an empty buffer. */
    23650 @@ -639,6 +652,9 @@
     24181@@ -639,6 +669,9 @@
    2365124182     {
    2365224183        clear_wininfo(buf);             /* including window-local options */
     
    2365824189 #ifdef FEAT_EVAL
    2365924190     vars_clear(&buf->b_vars.dv_hashtab); /* free all internal variables */
    23660 @@ -661,9 +677,6 @@
     24191@@ -661,9 +694,6 @@
    2366124192     vim_free(buf->b_start_fenc);
    2366224193     buf->b_start_fenc = NULL;
     
    2366824199 
    2366924200 /*
    23670 @@ -1288,9 +1301,12 @@
     24201@@ -762,7 +792,7 @@
     24202         * open a new, empty buffer. */
     24203        swap_exists_action = SEA_NONE;  /* don't want it again */
     24204        swap_exists_did_quit = TRUE;
     24205-       close_buffer(curwin, curbuf, DOBUF_UNLOAD);
     24206+       close_buffer(curwin, curbuf, DOBUF_UNLOAD, FALSE);
     24207        if (!buf_valid(old_curbuf) || old_curbuf == curbuf)
     24208            old_curbuf = buflist_new(NULL, NULL, 1L, BLN_CURBUF | BLN_LISTED);
     24209        if (old_curbuf != NULL)
     24210@@ -1109,7 +1139,7 @@
     24211             * if the buffer still exists.
     24212             */
     24213            if (buf != curbuf && buf_valid(buf) && buf->b_nwindows == 0)
     24214-               close_buffer(NULL, buf, action);
     24215+               close_buffer(NULL, buf, action, FALSE);
     24216            return retval;
     24217        }
     24218 
     24219@@ -1133,7 +1163,7 @@
     24220            close_windows(buf, FALSE);
     24221 #endif
     24222            if (buf != curbuf && buf_valid(buf) && buf->b_nwindows <= 0)
     24223-               close_buffer(NULL, buf, action);
     24224+               close_buffer(NULL, buf, action, FALSE);
     24225            return OK;
     24226        }
     24227 
     24228@@ -1288,9 +1318,12 @@
    2367124229     /* Go to the other buffer. */
    2367224230     set_curbuf(buf, action);
     
    2368324241 
    2368424242 #if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
    23685 @@ -1343,6 +1359,10 @@
     24243@@ -1343,6 +1376,10 @@
    2368624244 # endif
    2368724245 #endif
     
    2369424252        if (unload)
    2369524253            close_windows(prevbuf, FALSE);
    23696 @@ -1392,10 +1412,6 @@
     24254@@ -1358,7 +1395,7 @@
     24255            close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL, prevbuf,
     24256                    unload ? action : (action == DOBUF_GOTO
     24257                        && !P_HID(prevbuf)
     24258-                       && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0);
     24259+                       && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0, FALSE);
     24260        }
     24261     }
     24262 #ifdef FEAT_AUTOCMD
     24263@@ -1392,10 +1429,6 @@
    2369724264     foldUpdateAll(curwin);     /* update folds (later). */
    2369824265 #endif
     
    2370524272     curwin->w_buffer = buf;
    2370624273     curbuf = buf;
    23707 @@ -1406,6 +1422,10 @@
     24274@@ -1406,6 +1439,10 @@
    2370824275        diff_buf_add(curbuf);
    2370924276 #endif
     
    2371624283     curwin->w_cursor.lnum = 1;
    2371724284     curwin->w_cursor.col = 0;
    23718 @@ -1805,9 +1825,6 @@
     24285@@ -1805,9 +1842,6 @@
    2371924286 #ifdef FEAT_AUTOCMD
    2372024287     clear_string_option(&buf->b_p_ft);
     
    2372624293     clear_string_option(&buf->b_p_cink);
    2372724294     clear_string_option(&buf->b_p_cino);
    23728 @@ -1917,9 +1934,7 @@
     24295@@ -1917,9 +1951,7 @@
    2372924296                tabpage_new();
    2373024297            else if (win_split(0, 0) == FAIL)   /* Open in a new window */
     
    2373724304     }
    2373824305 #endif
    23739 @@ -2526,6 +2541,9 @@
     24306@@ -2526,6 +2558,9 @@
    2374024307     if (p_fdls >= 0)
    2374124308        curwin->w_p_fdl = p_fdls;
     
    2374724314 
    2374824315 /*
    23749 @@ -3175,7 +3193,7 @@
     24316@@ -2690,7 +2725,8 @@
     24317                vim_free(ffname);
     24318                return FAIL;
     24319            }
     24320-           close_buffer(NULL, obuf, DOBUF_WIPE); /* delete from the list */
     24321+           /* delete from the list */
     24322+           close_buffer(NULL, obuf, DOBUF_WIPE, FALSE);
     24323        }
     24324        sfname = vim_strsave(sfname);
     24325        if (ffname == NULL || sfname == NULL)
     24326@@ -3175,7 +3211,7 @@
    2375024327            /* format: "fname + (path) (1 of 2) - VIM" */
    2375124328 
     
    2375624333            {
    2375724334                p = transstr(gettail(curbuf->b_fname));
    23758 @@ -3231,7 +3249,7 @@
     24335@@ -3231,7 +3267,7 @@
    2375924336            if (serverName != NULL)
    2376024337            {
     
    2376524342            else
    2376624343 #endif
    23767 @@ -3240,9 +3258,8 @@
     24344@@ -3240,9 +3276,8 @@
    2376824345            if (maxlen > 0)
    2376924346            {
     
    2377724354        }
    2377824355     }
    23779 @@ -3363,7 +3380,8 @@
     24356@@ -3363,7 +3398,8 @@
    2378024357  * or truncated if too long, fillchar is used for all whitespace.
    2378124358  */
     
    2378724364     char_u     *out;           /* buffer to write into != NameBuff */
    2378824365     size_t     outlen;         /* length of out[] */
    23789 @@ -3458,6 +3476,18 @@
     24366@@ -3458,6 +3494,18 @@
    2379024367     prevchar_isitem = FALSE;
    2379124368     for (s = usefmt; *s; )
     
    2380624383            prevchar_isflag = prevchar_isitem = FALSE;
    2380724384 
    23808 @@ -3473,6 +3503,8 @@
     24385@@ -3473,6 +3521,8 @@
    2380924386         * Handle one '%' item.
    2381024387         */
     
    2381524392        {
    2381624393            if (p + 1 >= out + outlen)
     24394@@ -4355,7 +4405,12 @@
     24395 {
     24396     int                i;
     24397     win_T      *wp, *wpnext;
     24398-    char_u     *opened;        /* array of flags for which args are open */
     24399+    char_u     *opened;        /* Array of weight for which args are open:
     24400+                                *  0: not opened
     24401+                                *  1: opened in other tab
     24402+                                *  2: opened in curtab
     24403+                                *  3: opened in curtab and curwin
     24404+                                */
     24405     int                opened_len;     /* length of opened[] */
     24406     int                use_firstwin = FALSE;   /* use first window for arglist */
     24407     int                split_ret = OK;
     24408@@ -4364,6 +4419,8 @@
     24409     buf_T      *buf;
     24410     tabpage_T  *tpnext;
     24411     int                had_tab = cmdmod.tab;
     24412+    win_T      *old_curwin, *last_curwin;
     24413+    tabpage_T  *old_curtab, *last_curtab;
     24414     win_T      *new_curwin = NULL;
     24415     tabpage_T  *new_curtab = NULL;
     24416 
     24417@@ -4380,6 +4437,15 @@
     24418     if (opened == NULL)
     24419        return;
     24420 
     24421+    /* Autocommands may do anything to the argument list.  Make sure it's not
     24422+     * freed while we are working here by "locking" it.  We still have to
     24423+     * watch out for its size to be changed. */
     24424+    alist = curwin->w_alist;
     24425+    ++alist->al_refcount;
     24426+
     24427+    old_curwin = curwin;
     24428+    old_curtab = curtab;
     24429+
     24430 #ifdef FEAT_GUI
     24431     need_mouse_correct = TRUE;
     24432 #endif
     24433@@ -4401,36 +4467,51 @@
     24434            wpnext = wp->w_next;
     24435            buf = wp->w_buffer;
     24436            if (buf->b_ffname == NULL
     24437-                   || buf->b_nwindows > 1
     24438+                   || (!keep_tabs && buf->b_nwindows > 1)
     24439 #ifdef FEAT_VERTSPLIT
     24440                    || wp->w_width != Columns
     24441 #endif
     24442                    )
     24443-               i = ARGCOUNT;
     24444+               i = opened_len;
     24445            else
     24446            {
     24447                /* check if the buffer in this window is in the arglist */
     24448-               for (i = 0; i < ARGCOUNT; ++i)
     24449+               for (i = 0; i < opened_len; ++i)
     24450                {
     24451-                   if (ARGLIST[i].ae_fnum == buf->b_fnum
     24452-                           || fullpathcmp(alist_name(&ARGLIST[i]),
     24453-                                             buf->b_ffname, TRUE) & FPC_SAME)
     24454+                   if (i < alist->al_ga.ga_len
     24455+                           && (AARGLIST(alist)[i].ae_fnum == buf->b_fnum
     24456+                               || fullpathcmp(alist_name(&AARGLIST(alist)[i]),
     24457+                                             buf->b_ffname, TRUE) & FPC_SAME))
     24458                    {
     24459-                       if (i < opened_len)
     24460+                       int weight = 1;
     24461+
     24462+                       if (old_curtab == curtab)
     24463                        {
     24464-                           opened[i] = TRUE;
     24465+                           ++weight;
     24466+                           if (old_curwin == wp)
     24467+                               ++weight;
     24468+                       }
     24469+
     24470+                       if (weight > (int)opened[i])
     24471+                       {
     24472+                           opened[i] = (char_u)weight;
     24473                            if (i == 0)
     24474                            {
     24475+                               if (new_curwin != NULL)
     24476+                                   new_curwin->w_arg_idx = opened_len;
     24477                                new_curwin = wp;
     24478                                new_curtab = curtab;
     24479                            }
     24480                        }
     24481-                       if (wp->w_alist != curwin->w_alist)
     24482+                       else if (keep_tabs)
     24483+                           i = opened_len;
     24484+
     24485+                       if (wp->w_alist != alist)
     24486                        {
     24487                            /* Use the current argument list for all windows
     24488                             * containing a file from it. */
     24489                            alist_unlink(wp->w_alist);
     24490-                           wp->w_alist = curwin->w_alist;
     24491+                           wp->w_alist = alist;
     24492                            ++wp->w_alist->al_refcount;
     24493                        }
     24494                        break;
     24495@@ -4439,7 +4520,7 @@
     24496            }
     24497            wp->w_arg_idx = i;
     24498 
     24499-           if (i == ARGCOUNT && !keep_tabs)    /* close this window */
     24500+           if (i == opened_len && !keep_tabs)/* close this window */
     24501            {
     24502                if (P_HID(buf) || forceit || buf->b_nwindows > 1
     24503                                                        || !bufIsChanged(buf))
     24504@@ -4461,7 +4542,8 @@
     24505                    }
     24506 #ifdef FEAT_WINDOWS
     24507                    /* don't close last window */
     24508-                   if (firstwin == lastwin && first_tabpage->tp_next == NULL)
     24509+                   if (firstwin == lastwin
     24510+                           && (first_tabpage->tp_next == NULL || !had_tab))
     24511 #endif
     24512                        use_firstwin = TRUE;
     24513 #ifdef FEAT_WINDOWS
     24514@@ -4495,20 +4577,16 @@
     24515      * Open a window for files in the argument list that don't have one.
     24516      * ARGCOUNT may change while doing this, because of autocommands.
     24517      */
     24518-    if (count > ARGCOUNT || count <= 0)
     24519-       count = ARGCOUNT;
     24520-
     24521-    /* Autocommands may do anything to the argument list.  Make sure it's not
     24522-     * freed while we are working here by "locking" it.  We still have to
     24523-     * watch out for its size to be changed. */
     24524-    alist = curwin->w_alist;
     24525-    ++alist->al_refcount;
     24526+    if (count > opened_len || count <= 0)
     24527+       count = opened_len;
     24528 
     24529 #ifdef FEAT_AUTOCMD
     24530     /* Don't execute Win/Buf Enter/Leave autocommands here. */
     24531     ++autocmd_no_enter;
     24532     ++autocmd_no_leave;
     24533 #endif
     24534+    last_curwin = curwin;
     24535+    last_curtab = curtab;
     24536     win_enter(lastwin, FALSE);
     24537 #ifdef FEAT_WINDOWS
     24538     /* ":drop all" should re-use an empty window to avoid "--remote-tab"
     24539@@ -4518,11 +4596,11 @@
     24540        use_firstwin = TRUE;
     24541 #endif
     24542 
     24543-    for (i = 0; i < count && i < alist->al_ga.ga_len && !got_int; ++i)
     24544+    for (i = 0; i < count && i < opened_len && !got_int; ++i)
     24545     {
     24546        if (alist == &global_alist && i == global_alist.al_ga.ga_len - 1)
     24547            arg_had_last = TRUE;
     24548-       if (i < opened_len && opened[i])
     24549+       if (opened[i] > 0)
     24550        {
     24551            /* Move the already present window to below the current window */
     24552            if (curwin->w_arg_idx != i)
     24553@@ -4531,7 +4609,13 @@
     24554                {
     24555                    if (wpnext->w_arg_idx == i)
     24556                    {
     24557-                       win_move_after(wpnext, curwin);
     24558+                       if (keep_tabs)
     24559+                       {
     24560+                           new_curwin = wpnext;
     24561+                           new_curtab = curtab;
     24562+                       }
     24563+                       else
     24564+                           win_move_after(wpnext, curwin);
     24565                        break;
     24566                    }
     24567                }
     24568@@ -4586,6 +4670,14 @@
     24569 #ifdef FEAT_AUTOCMD
     24570     --autocmd_no_enter;
     24571 #endif
     24572+    /* restore last referenced tabpage's curwin */
     24573+    if (last_curtab != new_curtab)
     24574+    {
     24575+       if (valid_tabpage(last_curtab))
     24576+           goto_tabpage_tp(last_curtab);
     24577+       if (win_valid(last_curwin))
     24578+           win_enter(last_curwin, FALSE);
     24579+    }
     24580     /* to window with first arg */
     24581     if (valid_tabpage(new_curtab))
     24582        goto_tabpage_tp(new_curtab);
     24583@@ -5465,7 +5557,7 @@
     24584        buf = firstbuf;
     24585     else
     24586        buf = rbuf;
     24587-    while (buf != NULL)
     24588+    while (buf != NULL && !got_int)
     24589     {
     24590        if (buf->b_signlist != NULL)
     24591        {
     24592@@ -5473,7 +5565,7 @@
     24593            MSG_PUTS_ATTR(lbuf, hl_attr(HLF_D));
     24594            msg_putchar('\n');
     24595        }
     24596-       for (p = buf->b_signlist; p != NULL; p = p->next)
     24597+       for (p = buf->b_signlist; p != NULL && !got_int; p = p->next)
     24598        {
     24599            vim_snprintf(lbuf, BUFSIZ, _("    line=%ld  id=%d  name=%s"),
     24600                           (long)p->lnum, p->id, sign_typenr2name(p->typenr));
     24601@@ -5606,7 +5698,7 @@
     24602     if (!aucmd)                    /* Don't trigger BufDelete autocommands here. */
     24603        block_autocmds();
     24604 #endif
     24605-    close_buffer(NULL, buf, DOBUF_WIPE);
     24606+    close_buffer(NULL, buf, DOBUF_WIPE, FALSE);
     24607 #ifdef FEAT_AUTOCMD
     24608     if (!aucmd)
     24609        unblock_autocmds();
    2381724610diff -Naur vim73.orig/src/charset.c vim73/src/charset.c
    23818 --- vim73.orig/src/charset.c    2012-02-15 21:57:45.057436051 +0000
    23819 +++ vim73/src/charset.c 2012-02-15 21:57:46.841483105 +0000
     24611--- vim73.orig/src/charset.c    2012-06-03 23:09:52.948007269 +0000
     24612+++ vim73/src/charset.c 2012-06-03 23:09:55.892085615 +0000
    2382024613@@ -463,41 +463,42 @@
    2382124614            if (enc_utf8)
     
    2389424687     int
    2389524688 vim_strnsize(s, len)
    23896 @@ -1829,7 +1830,7 @@
     24689@@ -1601,10 +1602,9 @@
     24690 #define LATIN1LOWER 'l'
     24691 #define LATIN1UPPER 'U'
     24692 
     24693-/*                                                                 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]%_'abcdefghijklmnopqrstuvwxyz{|}~                                  ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ */
     24694 static char_u latin1flags[257] = "                                                                 UUUUUUUUUUUUUUUUUUUUUUUUUU      llllllllllllllllllllllllll                                                                     UUUUUUUUUUUUUUUUUUUUUUU UUUUUUUllllllllllllllllllllllll llllllll";
     24695-static char_u latin1upper[257] = "                                 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~€‚ƒ„
     24696†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ÷ØÙÚÛÜÝÞÿ";
     24697-static char_u latin1lower[257] = "                                 !\"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„
     24698†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿àáâãäåæçèéêëìíîïðñòóôõö×øùúûüýþßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ";
     24699+static char_u latin1upper[257] = "                                 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xf7\xd8\xd9\xda\xdb\xdc\xdd\xde\xff";
     24700+static char_u latin1lower[257] = "                                 !\"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xd7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
     24701 
     24702     int
     24703 vim_islower(c)
     24704@@ -1829,7 +1829,7 @@
    2389724705                        hex = 0;        /* can't be octal */
    2389824706                        break;
     
    2390424712            }
    2390524713diff -Naur vim73.orig/src/config.h.in vim73/src/config.h.in
    23906 --- vim73.orig/src/config.h.in  2012-02-15 21:57:45.065436261 +0000
    23907 +++ vim73/src/config.h.in       2012-02-15 21:57:46.921485217 +0000
     24714--- vim73.orig/src/config.h.in  2012-06-03 23:09:52.956007482 +0000
     24715+++ vim73/src/config.h.in       2012-06-03 23:09:55.372071777 +0000
    2390824716@@ -346,9 +346,15 @@
    2390924717 /* Define if dynamic python does not require RTLD_GLOBAL */
     
    2393124739 
    2393224740diff -Naur vim73.orig/src/config.mk.in vim73/src/config.mk.in
    23933 --- vim73.orig/src/config.mk.in 2012-02-15 21:57:45.061436156 +0000
    23934 +++ vim73/src/config.mk.in      2012-02-15 21:57:45.325443119 +0000
     24741--- vim73.orig/src/config.mk.in 2012-06-03 23:09:52.952007375 +0000
     24742+++ vim73/src/config.mk.in      2012-06-03 23:09:53.304016743 +0000
    2393524743@@ -30,6 +30,7 @@
    2393624744 CPP            = @CPP@
     
    2394224750 X_PRE_LIBS     = @X_PRE_LIBS@
    2394324751diff -Naur vim73.orig/src/configure.in vim73/src/configure.in
    23944 --- vim73.orig/src/configure.in 2012-02-15 21:57:45.061436156 +0000
    23945 +++ vim73/src/configure.in      2012-02-15 21:57:46.917485111 +0000
     24752--- vim73.orig/src/configure.in 2012-06-03 23:09:52.948007269 +0000
     24753+++ vim73/src/configure.in      2012-06-03 23:09:55.368071671 +0000
    2394624754@@ -28,6 +28,16 @@
    2394724755 AC_HEADER_STDC
     
    2444425252 
    2444525253diff -Naur vim73.orig/src/diff.c vim73/src/diff.c
    24446 --- vim73.orig/src/diff.c       2012-02-15 21:57:45.041435628 +0000
    24447 +++ vim73/src/diff.c    2012-02-15 21:57:45.149438477 +0000
    24448 @@ -1127,11 +1127,13 @@
     25254--- vim73.orig/src/diff.c       2012-06-03 23:09:52.920006524 +0000
     25255+++ vim73/src/diff.c    2012-06-03 23:09:55.880085297 +0000
     25256@@ -783,6 +783,15 @@
     25257        goto theend;
     25258     }
     25259 
     25260+    /* :diffupdate! */
     25261+    if (eap != NULL && eap->forceit)
     25262+       for (idx_new = idx_orig; idx_new < DB_COUNT; ++idx_new)
     25263+       {
     25264+           buf = curtab->tp_diffbuf[idx_new];
     25265+           if (buf_valid(buf))
     25266+               buf_check_timestamp(buf, FALSE);
     25267+       }
     25268+
     25269     /* Write the first buffer to a tempfile. */
     25270     buf = curtab->tp_diffbuf[idx_orig];
     25271     if (diff_write(buf, tmp_orig) == FAIL)
     25272@@ -1127,11 +1136,13 @@
    2444925273 # endif
    2445025274 
     
    2446225286 # ifdef FEAT_FOLDING
    2446325287     curwin = wp;
    24464 @@ -1177,10 +1179,7 @@
     25288@@ -1177,10 +1188,7 @@
    2446525289        {
    2446625290            /* Set 'diff', 'scrollbind' off and 'wrap' on. */
     
    2447525299            curwin = wp;
    2447625300diff -Naur vim73.orig/src/digraph.c vim73/src/digraph.c
    24477 --- vim73.orig/src/digraph.c    2012-02-15 21:57:45.061436156 +0000
    24478 +++ vim73/src/digraph.c 2012-02-15 21:57:46.757480890 +0000
     25301--- vim73.orig/src/digraph.c    2012-06-03 23:09:52.952007375 +0000
     25302+++ vim73/src/digraph.c 2012-06-03 23:09:55.156066030 +0000
    2447925303@@ -2080,13 +2080,13 @@
    2448025304 /*
     
    2452525349 }
    2452625350diff -Naur vim73.orig/src/edit.c vim73/src/edit.c
    24527 --- vim73.orig/src/edit.c       2012-02-15 21:57:45.061436156 +0000
    24528 +++ vim73/src/edit.c    2012-02-15 21:57:46.885484267 +0000
     25351--- vim73.orig/src/edit.c       2012-06-03 23:09:52.952007375 +0000
     25352+++ vim73/src/edit.c    2012-06-03 23:09:55.928086574 +0000
    2452925353@@ -58,6 +58,10 @@
    2453025354 };
     
    2456825392 static int  ins_compl_get_exp __ARGS((pos_T *ini));
    2456925393 static void ins_compl_delete __ARGS((void));
    24570 @@ -1377,10 +1386,45 @@
     25394@@ -244,12 +253,14 @@
     25395 #ifdef FEAT_DIGRAPHS
     25396 static int  ins_digraph __ARGS((void));
     25397 #endif
     25398-static int  ins_copychar __ARGS((linenr_T lnum));
     25399 static int  ins_ctrl_ey __ARGS((int tc));
     25400 #ifdef FEAT_SMARTINDENT
     25401 static void ins_try_si __ARGS((int c));
     25402 #endif
     25403 static colnr_T get_nolist_virtcol __ARGS((void));
     25404+#ifdef FEAT_AUTOCMD
     25405+static char_u *do_insert_char_pre __ARGS((int c));
     25406+#endif
     25407 
     25408 static colnr_T Insstart_textlen;       /* length of line when insert started */
     25409 static colnr_T Insstart_blank_vcol;    /* vcol for first inserted blank */
     25410@@ -775,7 +786,20 @@
     25411                 * completion: Add to "compl_leader". */
     25412                if (ins_compl_accept_char(c))
     25413                {
     25414-                   ins_compl_addleader(c);
     25415+#ifdef FEAT_AUTOCMD
     25416+                   /* Trigger InsertCharPre. */
     25417+                   char_u *str = do_insert_char_pre(c);
     25418+                   char_u *p;
     25419+
     25420+                   if (str != NULL)
     25421+                   {
     25422+                       for (p = str; *p != NUL; mb_ptr_adv(p))
     25423+                           ins_compl_addleader(PTR2CHAR(p));
     25424+                       vim_free(str);
     25425+                   }
     25426+                   else
     25427+#endif
     25428+                       ins_compl_addleader(c);
     25429                    continue;
     25430                }
     25431 
     25432@@ -1377,10 +1401,42 @@
    2457125433                goto do_intr;
    2457225434 #endif
     
    2458025442+           if (!p_paste)
    2458125443+           {
    24582 +               /* Trigger the InsertCharPre event.  Lock the text to avoid
    24583 +                * weird things from happening. */
    24584 +               set_vim_var_char(c);
    24585 +               ++textlock;
    24586 +               if (apply_autocmds(EVENT_INSERTCHARPRE, NULL, NULL,
    24587 +                                                              FALSE, curbuf))
     25444+               /* Trigger InsertCharPre. */
     25445+               char_u *str = do_insert_char_pre(c);
     25446+               char_u *p;
     25447+
     25448+               if (str != NULL)
    2458825449+               {
    24589 +                   /* Get the new value of v:char.  If it is more than one
    24590 +                    * character insert it literally. */
    24591 +                   char_u *s = get_vim_var_str(VV_CHAR);
    24592 +                   if (MB_CHARLEN(s) > 1)
     25450+                   if (*str != NUL && stop_arrow() != FAIL)
    2459325451+                   {
    24594 +                       if (stop_arrow() != FAIL)
     25452+                       /* Insert the new value of v:char literally. */
     25453+                       for (p = str; *p != NUL; mb_ptr_adv(p))
    2459525454+                       {
    24596 +                           ins_str(s);
    24597 +                           AppendToRedobuffLit(s, -1);
     25455+                           c = PTR2CHAR(p);
     25456+                           if (c == CAR || c == K_KENTER || c == NL)
     25457+                               ins_eol(c);
     25458+                           else
     25459+                               ins_char(c);
    2459825460+                       }
    24599 +                       c = NUL;
     25461+                       AppendToRedobuffLit(str, -1);
    2460025462+                   }
    24601 +                   else
    24602 +                       c = PTR2CHAR(s);
     25463+                   vim_free(str);
     25464+                   c = NUL;
    2460325465+               }
    2460425466+
    24605 +               set_vim_var_string(VV_CHAR, NULL, -1);
    24606 +               --textlock;
    24607 +
    24608 +               /* If the new value is an empty string then don't insert a
    24609 +                * char. */
     25467+               /* If the new value is already inserted or an empty string
     25468+                * then don't insert any character. */
    2461025469+               if (c == NUL)
    2461125470+                   break;
     
    2461525474            /* Try to perform smart-indenting. */
    2461625475            ins_try_si(c);
    24617 @@ -1549,12 +1593,16 @@
     25476@@ -1398,13 +1454,16 @@
     25477                    Insstart_blank_vcol = get_nolist_virtcol();
     25478            }
     25479 
     25480-           if (vim_iswordc(c) || !echeck_abbr(
     25481+           /* Insert a normal character and check for abbreviations on a
     25482+            * special character.  Let CTRL-] expand abbreviations without
     25483+            * inserting it. */
     25484+           if (vim_iswordc(c) || (!echeck_abbr(
     25485 #ifdef FEAT_MBYTE
     25486                        /* Add ABBR_OFF for characters above 0x100, this is
     25487                         * what check_abbr() expects. */
     25488                        (has_mbyte && c >= 0x100) ? (c + ABBR_OFF) :
     25489 #endif
     25490-                       c))
     25491+                       c) && c != Ctrl_RSB))
     25492            {
     25493                insert_special(c, FALSE, FALSE);
     25494 #ifdef FEAT_RIGHTLEFT
     25495@@ -1549,12 +1608,16 @@
    2461825496 ins_ctrl_v()
    2461925497 {
     
    2463225510 
    2463325511 #ifdef FEAT_CMDL_INFO
    24634 @@ -1562,8 +1610,10 @@
     25512@@ -1562,8 +1625,10 @@
    2463525513 #endif
    2463625514 
     
    2464525523     clear_showcmd();
    2464625524 #endif
    24647 @@ -1713,9 +1763,9 @@
     25525@@ -1583,11 +1648,7 @@
     25526 #define PC_STATUS_RIGHT        1       /* right halve of double-wide char */
     25527 #define PC_STATUS_LEFT 2       /* left halve of double-wide char */
     25528 #define PC_STATUS_SET  3       /* pc_bytes was filled */
     25529-#ifdef FEAT_MBYTE
     25530 static char_u pc_bytes[MB_MAXBYTES + 1]; /* saved bytes */
     25531-#else
     25532-static char_u pc_bytes[2];             /* saved bytes */
     25533-#endif
     25534 static int  pc_attr;
     25535 static int  pc_row;
     25536 static int  pc_col;
     25537@@ -1713,9 +1774,9 @@
    2464825538     static void
    2464925539 undisplay_dollar()
     
    2465725547     }
    2465825548 }
    24659 @@ -2133,7 +2183,7 @@
     25549@@ -2133,7 +2194,7 @@
    2466025550                    || c == Ctrl_I || c == Ctrl_D || c == Ctrl_P
    2466125551                    || c == Ctrl_N || c == Ctrl_T || c == Ctrl_V
     
    2466625556            return (c == Ctrl_Y || c == Ctrl_E);
    2466725557        case CTRL_X_WHOLE_LINE:
    24668 @@ -2658,6 +2708,7 @@
     25558@@ -2658,6 +2719,7 @@
    2466925559     if (stop_arrow() == FAIL)
    2467025560        return;
     
    2467425564        startcol = curwin->w_cursor.col;
    2467525565     compl_col = startcol;
    24676 @@ -3295,7 +3346,7 @@
     25566@@ -3295,7 +3357,7 @@
    2467725567     /* Deleted more than what was used to find matches or didn't finish
    2467825568      * finding all matches: need to look for matches all over again. */
     
    2468325573 
    2468425574     vim_free(compl_leader);
    24685 @@ -3309,6 +3360,20 @@
     25575@@ -3309,6 +3371,20 @@
    2468625576 }
    2468725577 
     
    2470425594  * Show the popup menu with a different set of matches.
    2470525595  * May also search for matches again if the previous search was interrupted.
    24706 @@ -3397,14 +3462,20 @@
     25596@@ -3397,14 +3473,20 @@
    2470725597        ins_char(c);
    2470825598 
     
    2473025620 
    2473125621 /*
    24732 @@ -3480,11 +3551,7 @@
     25622@@ -3480,11 +3562,7 @@
    2473325623            return;
    2473425624     }
     
    2474325633 }
    2474425634 
    24745 @@ -3653,9 +3720,6 @@
     25635@@ -3653,9 +3731,6 @@
    2474625636             * memory that was used, and make sure we can redo the insert. */
    2474725637            if (compl_curr_match != NULL || compl_leader != NULL || c == Ctrl_E)
     
    2475325643                 * If any of the original typed text has been changed, eg when
    2475425644                 * ignorecase is set, we must add back-spaces to the redo
    24755 @@ -3666,25 +3730,9 @@
     25645@@ -3666,25 +3741,9 @@
    2475625646                 */
    2475725647                if (compl_curr_match != NULL && compl_used_match && c != Ctrl_E)
     
    2478125671 
    2478225672 #ifdef FEAT_CINDENT
    24783 @@ -3774,6 +3822,44 @@
     25673@@ -3774,6 +3833,44 @@
    2478425674 }
    2478525675 
     
    2482625716  * (depending on flag) starting from buf and looking for a non-scanned
    2482725717  * buffer (other than curbuf). curbuf is special, if it is called with
    24828 @@ -3829,10 +3915,14 @@
     25718@@ -3829,10 +3926,14 @@
    2482925719     int                type;       /* CTRL_X_OMNI or CTRL_X_FUNCTION */
    2483025720     char_u     *base;
     
    2484225732     funcname = (type == CTRL_X_FUNCTION) ? curbuf->b_p_cfu : curbuf->b_p_ofu;
    2484325733     if (*funcname == NUL)
    24844 @@ -3843,13 +3933,50 @@
     25734@@ -3843,13 +3944,50 @@
    2484525735     args[1] = base;
    2484625736 
     
    2489825788 #endif /* FEAT_COMPL_FUNC */
    2489925789 
    24900 @@ -3876,6 +4003,33 @@
     25790@@ -3876,6 +4014,33 @@
    2490125791 }
    2490225792 
     
    2493225822  * If the given string is already in the list of completions, then return
    2493325823  * NOTDONE, otherwise add it to the list and return OK.  If there is an error,
    24934 @@ -3889,6 +4043,7 @@
     25824@@ -3889,6 +4054,7 @@
    2493525825     char_u     *word;
    2493625826     int                icase = FALSE;
     
    2494025830 
    2494125831     if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL)
    24942 @@ -3906,13 +4061,15 @@
     25832@@ -3906,13 +4072,15 @@
    2494325833            icase = get_dict_number(tv->vval.v_dict, (char_u *)"icase");
    2494425834        if (get_dict_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL)
     
    2495725847     return ins_compl_add(word, -1, icase, NULL, cptext, dir, 0, adup);
    2495825848 }
    24959 @@ -4403,6 +4560,11 @@
     25849@@ -4403,6 +4571,11 @@
    2496025850     int            found_end = FALSE;
    2496125851     int            advance;
     
    2496925859                        && (compl_shown_match->cp_flags & ORIGINAL_TEXT) == 0)
    2497025860     {
    24971 @@ -4994,6 +5156,8 @@
     25861@@ -4994,6 +5167,8 @@
    2497225862            int         col;
    2497325863            char_u      *funcname;
     
    2497825868            /* Call 'completefunc' or 'omnifunc' and get pattern length as a
    2497925869             * string */
    24980 @@ -5009,8 +5173,32 @@
     25870@@ -5009,8 +5184,40 @@
    2498125871            args[0] = (char_u *)"1";
    2498225872            args[1] = NULL;
     
    2499925889+
    2500025890+           /* Return value -2 means the user complete function wants to
    25001 +            * cancel the complete without an error. */
     25891+            * cancel the complete without an error.
     25892+            * Return value -3 does the same as -2 and leaves CTRL-X mode.*/
    2500225893+           if (col == -2)
    2500325894+               return FAIL;
     25895+           if (col == -3)
     25896+           {
     25897+               ctrl_x_mode = 0;
     25898+               edit_submode = NULL;
     25899+               msg_clr_cmdline();
     25900+               return FAIL;
     25901+           }
    2500425902+
    2500525903+           /*
     
    2501125909            if (col < 0)
    2501225910                col = curs_col;
    25013 @@ -5089,6 +5277,10 @@
     25911@@ -5089,6 +5296,10 @@
    2501425912        else
    2501525913            edit_submode = (char_u *)_(CTRL_X_MSG(ctrl_x_mode));
     
    2502225920        vim_free(compl_orig_text);
    2502325921        compl_orig_text = vim_strnsave(line + compl_col, compl_length);
    25024 @@ -5249,7 +5441,7 @@
     25922@@ -5249,7 +5460,7 @@
    2502525923                                compl_curr_match->cp_number);
    2502625924                edit_submode_extra = match_ref;
     
    2503125929            }
    2503225930        }
    25033 @@ -5902,6 +6094,7 @@
     25931@@ -5691,6 +5902,8 @@
     25932      * Don't do this when 'cindent' or 'indentexpr' is set, because we might
     25933      * need to re-indent at a ':', or any other character (but not what
     25934      * 'paste' is set)..
     25935+     * Don't do this when there an InsertCharPre autocommand is defined,
     25936+     * because we need to fire the event for every character.
     25937      */
     25938 #ifdef USE_ON_FLY_SCROLL
     25939     dont_scroll = FALSE;               /* allow scrolling here */
     25940@@ -5708,6 +5921,9 @@
     25941 #ifdef FEAT_RIGHTLEFT
     25942            && !p_ri
     25943 #endif
     25944+#ifdef FEAT_AUTOCMD
     25945+           && !has_insertcharpre()
     25946+#endif
     25947               )
     25948     {
     25949 #define INPUT_BUFLEN 100
     25950@@ -5902,6 +6118,7 @@
    2503425951         * Stop at first entered white when 'formatoptions' has 'v'
    2503525952         */
     
    2503925956                    || curwin->w_cursor.col >= Insstart.col)
    2504025957        {
    25041 @@ -8768,7 +8961,7 @@
     25958@@ -6598,11 +6815,7 @@
     25959     char_u     *s;
     25960 
     25961     vim_free(last_insert);
     25962-#ifdef FEAT_MBYTE
     25963     last_insert = alloc(MB_MAXBYTES * 3 + 5);
     25964-#else
     25965-    last_insert = alloc(6);
     25966-#endif
     25967     if (last_insert != NULL)
     25968     {
     25969        s = last_insert;
     25970@@ -6640,7 +6853,7 @@
     25971     char_u     *s;
     25972 {
     25973 #ifdef FEAT_MBYTE
     25974-    char_u     temp[MB_MAXBYTES];
     25975+    char_u     temp[MB_MAXBYTES + 1];
     25976     int                i;
     25977     int                len;
     25978 
     25979@@ -7202,7 +7415,7 @@
     25980     int                cc;
     25981 {
     25982     int                n;
     25983-    char_u     buf[MB_MAXBYTES];
     25984+    char_u     buf[MB_MAXBYTES + 1];
     25985     int                i;
     25986     int                c;
     25987 
     25988@@ -8768,7 +8981,7 @@
    2504225989      * We can emulate the vi behaviour by pretending there is a dollar
    2504325990      * displayed even when there isn't.
     
    2504825995 
    2504925996 #ifdef FEAT_FOLDING
    25050 @@ -9598,6 +9791,7 @@
     25997@@ -9598,6 +9811,7 @@
    2505125998 {
    2505225999     int            c;
     
    2505626003     pc_status = PC_STATUS_UNSET;
    2505726004     if (redrawing() && !char_avail())
    25058 @@ -9606,6 +9800,7 @@
     26005@@ -9606,6 +9820,7 @@
    2505926006        ins_redraw(FALSE);
    2506026007 
     
    2506426011        add_to_showcmd_c(Ctrl_K);
    2506526012 #endif
    25066 @@ -9622,8 +9817,10 @@
     26013@@ -9622,8 +9837,10 @@
    2506726014     c = plain_vgetc();
    2506826015     --no_mapping;
     
    2507726024     if (IS_SPECIAL(c) || mod_mask)         /* special key */
    2507826025     {
    25079 @@ -9635,6 +9832,7 @@
     26026@@ -9635,6 +9852,7 @@
    2508026027     }
    2508126028     if (c != ESC)
     
    2508526032        {
    2508626033            /* may need to redraw when no more chars available now */
    25087 @@ -9642,11 +9840,9 @@
     26034@@ -9642,11 +9860,9 @@
    2508826035 
    2508926036            if (char2cells(c) == 1)
     
    2509826045 #ifdef FEAT_CMDL_INFO
    2509926046            add_to_showcmd_c(c);
    25100 @@ -9657,8 +9853,10 @@
     26047@@ -9657,8 +9873,10 @@
    2510126048        cc = plain_vgetc();
    2510226049        --no_mapping;
     
    2511126058        {
    2511226059            AppendToRedobuff((char_u *)CTRL_V_STR);
     26060@@ -9680,7 +9898,7 @@
     26061  * Handle CTRL-E and CTRL-Y in Insert mode: copy char from other line.
     26062  * Returns the char to be inserted, or NUL if none found.
     26063  */
     26064-    static int
     26065+    int
     26066 ins_copychar(lnum)
     26067     linenr_T   lnum;
     26068 {
     26069@@ -9870,3 +10088,52 @@
     26070     validate_virtcol();
     26071     return curwin->w_virtcol;
     26072 }
     26073+
     26074+#ifdef FEAT_AUTOCMD
     26075+/*
     26076+ * Handle the InsertCharPre autocommand.
     26077+ * "c" is the character that was typed.
     26078+ * Return a pointer to allocated memory with the replacement string.
     26079+ * Return NULL to continue inserting "c".
     26080+ */
     26081+    static char_u *
     26082+do_insert_char_pre(c)
     26083+    int c;
     26084+{
     26085+    char_u     *res;
     26086+    char_u     buf[MB_MAXBYTES + 1];
     26087+
     26088+    /* Return quickly when there is nothing to do. */
     26089+    if (!has_insertcharpre())
     26090+       return NULL;
     26091+
     26092+#ifdef FEAT_MBYTE
     26093+    if (has_mbyte)
     26094+       buf[(*mb_char2bytes)(c, buf)] = NUL;
     26095+    else
     26096+#endif
     26097+    {
     26098+       buf[0] = c;
     26099+       buf[1] = NUL;
     26100+    }
     26101+
     26102+    /* Lock the text to avoid weird things from happening. */
     26103+    ++textlock;
     26104+    set_vim_var_string(VV_CHAR, buf, -1);  /* set v:char */
     26105+
     26106+    res = NULL;
     26107+    if (apply_autocmds(EVENT_INSERTCHARPRE, NULL, NULL, FALSE, curbuf))
     26108+    {
     26109+       /* Get the value of v:char.  It may be empty or more than one
     26110+        * character.  Only use it when changed, otherwise continue with the
     26111+        * original character to avoid breaking autoindent. */
     26112+       if (STRCMP(buf, get_vim_var_str(VV_CHAR)) != 0)
     26113+           res = vim_strsave(get_vim_var_str(VV_CHAR));
     26114+    }
     26115+
     26116+    set_vim_var_string(VV_CHAR, NULL, -1);  /* clear v:char */
     26117+    --textlock;
     26118+
     26119+    return res;
     26120+}
     26121+#endif
    2511326122diff -Naur vim73.orig/src/eval.c vim73/src/eval.c
    25114 --- vim73.orig/src/eval.c       2012-02-15 21:57:45.065436261 +0000
    25115 +++ vim73/src/eval.c    2012-02-15 21:57:46.941485744 +0000
     26123--- vim73.orig/src/eval.c       2012-06-03 23:09:52.952007375 +0000
     26124+++ vim73/src/eval.c    2012-06-03 23:09:55.932086681 +0000
    2511626125@@ -10,9 +10,6 @@
    2511726126 /*
     
    2519426203 static void f_islocked __ARGS((typval_T *argvars, typval_T *rettv));
    2519526204 static void f_items __ARGS((typval_T *argvars, typval_T *rettv));
    25196 @@ -646,6 +643,7 @@
     26205@@ -625,6 +622,9 @@
     26206 static void f_log __ARGS((typval_T *argvars, typval_T *rettv));
     26207 static void f_log10 __ARGS((typval_T *argvars, typval_T *rettv));
     26208 #endif
     26209+#ifdef FEAT_LUA
     26210+static void f_luaeval __ARGS((typval_T *argvars, typval_T *rettv));
     26211+#endif
     26212 static void f_map __ARGS((typval_T *argvars, typval_T *rettv));
     26213 static void f_maparg __ARGS((typval_T *argvars, typval_T *rettv));
     26214 static void f_mapcheck __ARGS((typval_T *argvars, typval_T *rettv));
     26215@@ -646,6 +646,7 @@
    2519726216 #endif
    2519826217 static void f_nextnonblank __ARGS((typval_T *argvars, typval_T *rettv));
     
    2520226221 #ifdef FEAT_FLOAT
    2520326222 static void f_pow __ARGS((typval_T *argvars, typval_T *rettv));
    25204 @@ -757,6 +755,7 @@
     26223@@ -757,6 +758,7 @@
    2520526224 static void f_winsaveview __ARGS((typval_T *argvars, typval_T *rettv));
    2520626225 static void f_winwidth __ARGS((typval_T *argvars, typval_T *rettv));
     
    2521026229 static int list2fpos __ARGS((typval_T *arg, pos_T *posp, int *fnump));
    2521126230 static pos_T *var2fpos __ARGS((typval_T *varp, int dollar_lnum, int *fnum));
    25212 @@ -791,6 +790,8 @@
     26231@@ -791,6 +793,8 @@
    2521326232 static void set_var __ARGS((char_u *name, typval_T *varp, int copy));
    2521426233 static int var_check_ro __ARGS((int flags, char_u *name));
     
    2521926238 static int item_copy __ARGS((typval_T *from, typval_T *to, int deep, int copyID));
    2522026239 static char_u *find_option_end __ARGS((char_u **arg, int *opt_flags));
    25221 @@ -853,6 +854,7 @@
     26240@@ -853,6 +857,7 @@
    2522226241 
    2522326242     init_var_dict(&globvardict, &globvars_var);
     
    2522726246     hash_init(&func_hashtab);
    2522826247 
    25229 @@ -878,7 +880,7 @@
     26248@@ -875,10 +880,11 @@
     26249            hash_add(&compat_hashtab, p->vv_di.di_key);
     26250     }
     26251     set_vim_var_nr(VV_SEARCHFORWARD, 1L);
     26252+    set_reg_var(0);  /* default for v:register is not 0 but '"' */
    2523026253 
    2523126254 #ifdef EBCDIC
     
    2523626259     sortFunctions();
    2523726260 #endif
    25238 @@ -910,6 +912,7 @@
     26261@@ -910,6 +916,7 @@
    2523926262     hash_clear(&compat_hashtab);
    2524026263 
     
    2524426267     /* global variables */
    2524526268     vars_clear(&globvarht);
    25246 @@ -1355,7 +1358,11 @@
     26269@@ -1355,7 +1362,11 @@
    2524726270        {
    2524826271            ga_init2(&ga, (int)sizeof(char), 80);
     
    2525626279            retval = (char_u *)ga.ga_data;
    2525726280        }
    25258 @@ -1557,7 +1564,7 @@
     26281@@ -1557,7 +1568,7 @@
    2525926282  * arguments are currently supported.
    2526026283  * Returns OK or FAIL.
     
    2526526288     char_u      *func;
    2526626289     int                argc;
    25267 @@ -2325,7 +2332,7 @@
     26290@@ -2325,7 +2336,7 @@
    2526826291            else if (endchars != NULL
    2526926292                             && vim_strchr(endchars, *skipwhite(arg)) == NULL)
     
    2527426297                c1 = name[len];
    2527526298                name[len] = NUL;
    25276 @@ -2718,8 +2725,27 @@
     26299@@ -2718,8 +2729,27 @@
    2527726300            lp->ll_list = NULL;
    2527826301            lp->ll_dict = lp->ll_tv->vval.v_dict;
     
    2530226325                if (*p == '[' || *p == '.' || unlet)
    2530326326                {
    25304 @@ -2739,6 +2765,10 @@
     26327@@ -2739,6 +2769,10 @@
    2530526328                    p = NULL;
    2530626329                break;
     
    2531326336                clear_tv(&var1);
    2531426337            lp->ll_tv = &lp->ll_di->di_tv;
    25315 @@ -2770,6 +2800,8 @@
     26338@@ -2770,6 +2804,8 @@
    2531626339            {
    2531726340                if (lp->ll_range && !lp->ll_empty2)
     
    2532226345            }
    2532326346 
    25324 @@ -2787,7 +2819,11 @@
     26347@@ -2787,7 +2823,11 @@
    2532526348                {
    2532626349                    ni = list_find(lp->ll_list, lp->ll_n2);
     
    2533426357                }
    2533526358 
    25336 @@ -2795,7 +2831,11 @@
     26359@@ -2795,7 +2835,11 @@
    2533726360                if (lp->ll_n1 < 0)
    2533826361                    lp->ll_n1 = list_idx_of_item(lp->ll_list, lp->ll_li);
     
    2534626369 
    2534726370            lp->ll_tv = &lp->ll_li->li_tv;
    25348 @@ -3337,6 +3377,18 @@
     26371@@ -3337,6 +3381,18 @@
    2534926372     int                failed = FALSE;
    2535026373     funcdict_T fudi;
     
    2536526388     if (fudi.fd_newkey != NULL)
    2536626389     {
    25367 @@ -3386,6 +3438,9 @@
     26390@@ -3386,6 +3442,9 @@
    2536826391        {
    2536926392            curwin->w_cursor.lnum = lnum;
     
    2537526398        arg = startarg;
    2537626399        if (get_func_tv(name, (int)STRLEN(name), &rettv, &arg,
    25377 @@ -4349,7 +4404,8 @@
     26400@@ -4349,7 +4408,8 @@
    2537826401                else
    2537926402                {
     
    2538526408                        n1 = !n1;
    2538626409                }
    25387 @@ -4378,7 +4434,8 @@
     26410@@ -4378,7 +4438,8 @@
    2538826411                else
    2538926412                {
     
    2539526418                        n1 = !n1;
    2539626419                }
    25397 @@ -5097,9 +5154,7 @@
     26420@@ -5097,9 +5158,7 @@
    2539826421            else
    2539926422                ret = OK;
     
    2540626429 
    2540726430     *arg = skipwhite(*arg);
    25408 @@ -5913,10 +5968,11 @@
     26431@@ -5913,10 +5972,11 @@
    2540926432  * Return TRUE when two lists have exactly the same values.
    2541026433  */
     
    2541926442     listitem_T *item1, *item2;
    2542026443 
    25421 @@ -5930,7 +5986,7 @@
     26444@@ -5930,7 +5990,7 @@
    2542226445     for (item1 = l1->lv_first, item2 = l2->lv_first;
    2542326446            item1 != NULL && item2 != NULL;
     
    2542826451     return item1 == NULL && item2 == NULL;
    2542926452 }
    25430 @@ -5952,10 +6008,11 @@
     26453@@ -5952,10 +6012,11 @@
    2543126454  * Return TRUE when two dictionaries have exactly the same key/values.
    2543226455  */
     
    2544126464     hashitem_T *hi;
    2544226465     dictitem_T *item2;
    25443 @@ -5976,7 +6033,7 @@
     26466@@ -5976,7 +6037,7 @@
    2544426467            item2 = dict_find(d2, hi->hi_key, -1);
    2544526468            if (item2 == NULL)
     
    2545026473            --todo;
    2545126474        }
    25452 @@ -5984,41 +6041,54 @@
     26475@@ -5984,41 +6045,54 @@
    2545326476     return TRUE;
    2545426477 }
     
    2551626539 
    2551726540        case VAR_FUNC:
    25518 @@ -6502,47 +6572,119 @@
     26541@@ -6502,47 +6576,119 @@
    2551926542     return (char_u *)ga.ga_data;
    2552026543 }
     
    2565326676  *
    2565426677  * We use reference counts to be able to free most items right away when they
    25655 @@ -6837,7 +6979,7 @@
     26678@@ -6635,6 +6781,10 @@
     26679     /* v: vars */
     26680     set_ref_in_ht(&vimvarht, copyID);
     26681 
     26682+#ifdef FEAT_LUA
     26683+    set_ref_in_lua(copyID);
     26684+#endif
     26685+
     26686     /*
     26687      * 2. Free lists and dictionaries that are not referenced.
     26688      */
     26689@@ -6837,7 +6987,7 @@
    2565626690  * Unreference a Dictionary: decrement the reference count and free it when it
    2565726691  * becomes zero.
     
    2566226696     dict_T *d;
    2566326697 {
    25664 @@ -7075,7 +7217,7 @@
     26698@@ -7075,7 +7225,7 @@
    2566526699 }
    2566626700 
     
    2567126705  */
    2567226706     int
    25673 @@ -7097,6 +7239,7 @@
     26707@@ -7097,6 +7247,7 @@
    2567426708        dictitem_free(item);
    2567526709        return FAIL;
     
    2567926713 }
    2568026714 
    25681 @@ -7649,6 +7792,7 @@
     26715@@ -7649,6 +7800,7 @@
    2568226716     {"acos",           1, 1, f_acos},  /* WJMc */
    2568326717 #endif
     
    2568726721     {"argc",           0, 0, f_argc},
    2568826722     {"argidx",         0, 0, f_argidx},
    25689 @@ -7784,6 +7928,7 @@
     26723@@ -7708,7 +7860,7 @@
     26724 #ifdef FEAT_FLOAT
     26725     {"exp",            1, 1, f_exp},
     26726 #endif
     26727-    {"expand",         1, 2, f_expand},
     26728+    {"expand",         1, 3, f_expand},
     26729     {"extend",         2, 3, f_extend},
     26730     {"feedkeys",       1, 2, f_feedkeys},
     26731     {"file_readable",  1, 1, f_filereadable},  /* obsolete */
     26732@@ -7759,7 +7911,7 @@
     26733     {"getwinposx",     0, 0, f_getwinposx},
     26734     {"getwinposy",     0, 0, f_getwinposy},
     26735     {"getwinvar",      2, 2, f_getwinvar},
     26736-    {"glob",           1, 2, f_glob},
     26737+    {"glob",           1, 3, f_glob},
     26738     {"globpath",       2, 3, f_globpath},
     26739     {"has",            1, 1, f_has},
     26740     {"has_key",                2, 2, f_has_key},
     26741@@ -7784,6 +7936,7 @@
    2569026742     {"inputsave",      0, 0, f_inputsave},
    2569126743     {"inputsecret",    1, 2, f_inputsecret},
     
    2569526747     {"islocked",       1, 1, f_islocked},
    2569626748     {"items",          1, 1, f_items},
    25697 @@ -7802,7 +7947,7 @@
     26749@@ -7801,8 +7954,11 @@
     26750     {"log",            1, 1, f_log},
    2569826751     {"log10",          1, 1, f_log10},
    2569926752 #endif
     26753+#ifdef FEAT_LUA
     26754+    {"luaeval",         1, 2, f_luaeval},
     26755+#endif
    2570026756     {"map",            2, 2, f_map},
    2570126757-    {"maparg",         1, 3, f_maparg},
     
    2570426760     {"match",          2, 4, f_match},
    2570526761     {"matchadd",       2, 4, f_matchadd},
    25706 @@ -7822,6 +7967,7 @@
     26762@@ -7822,6 +7978,7 @@
    2570726763 #endif
    2570826764     {"nextnonblank",   1, 1, f_nextnonblank},
     
    2571226768 #ifdef FEAT_FLOAT
    2571326769     {"pow",            2, 2, f_pow},
    25714 @@ -7870,7 +8016,7 @@
     26770@@ -7870,7 +8027,7 @@
    2571526771     {"sin",            1, 1, f_sin},
    2571626772     {"sinh",           1, 1, f_sinh},
     
    2572126777     {"spellbadword",   0, 1, f_spellbadword},
    2572226778     {"spellsuggest",   1, 3, f_spellsuggest},
    25723 @@ -7933,6 +8079,7 @@
     26779@@ -7933,6 +8090,7 @@
    2572426780     {"winsaveview",    0, 0, f_winsaveview},
    2572526781     {"winwidth",       1, 1, f_winwidth},
     
    2572926785 
    2573026786 #if defined(FEAT_CMDL_COMPL) || defined(PROTO)
    25731 @@ -8497,7 +8644,7 @@
     26787@@ -8497,7 +8655,7 @@
    2573226788     if (argvars[0].v_type == VAR_LIST)
    2573326789     {
     
    2573826794            copy_tv(&argvars[0], rettv);
    2573926795     }
    25740 @@ -8506,6 +8653,18 @@
     26796@@ -8506,6 +8664,18 @@
    2574126797 }
    2574226798 
     
    2575726813  */
    2575826814     static void
    25759 @@ -9298,7 +9457,7 @@
     26815@@ -9298,7 +9468,7 @@
    2576026816 
    2576126817     if (!error)
     
    2576626822 }
    2576726823 
    25768 @@ -9389,7 +9548,7 @@
     26824@@ -9389,7 +9559,7 @@
    2576926825            }
    2577026826 
     
    2577526831        }
    2577626832     }
    25777 @@ -9416,7 +9575,7 @@
     26833@@ -9416,7 +9586,7 @@
    2577826834                if (!HASHITEM_EMPTY(hi))
    2577926835                {
     
    2578426840                }
    2578526841            }
    25786 @@ -9857,7 +10016,7 @@
     26842@@ -9857,17 +10027,36 @@
    2578726843     char_u     *s;
    2578826844     int                len;
     
    2579226848     expand_T   xpc;
    2579326849     int                error = FALSE;
    25794  
    25795 @@ -9875,12 +10034,14 @@
     26850+    char_u     *result;
     26851 
     26852     rettv->v_type = VAR_STRING;
     26853+    if (argvars[1].v_type != VAR_UNKNOWN
     26854+           && argvars[2].v_type != VAR_UNKNOWN
     26855+           && get_tv_number_chk(&argvars[2], &error)
     26856+           && !error)
     26857+    {
     26858+       rettv->v_type = VAR_LIST;
     26859+       rettv->vval.v_list = NULL;
     26860+    }
     26861+
     26862     s = get_tv_string(&argvars[0]);
     26863     if (*s == '%' || *s == '#' || *s == '<')
     26864     {
     26865        ++emsg_off;
     26866-       rettv->vval.v_string = eval_vars(s, s, &len, NULL, &errormsg, NULL);
     26867+       result = eval_vars(s, s, &len, NULL, &errormsg, NULL);
     26868        --emsg_off;
     26869+       if (rettv->v_type == VAR_LIST)
     26870+       {
     26871+           if (rettv_list_alloc(rettv) != FAIL && result != NULL)
     26872+               list_append_string(rettv->vval.v_list, result, -1);
     26873+           else
     26874+               vim_free(result);
     26875+       }
     26876+       else
     26877+           rettv->vval.v_string = result;
     26878     }
     26879     else
     26880     {
     26881@@ -9875,12 +10064,25 @@
    2579626882         * for 'wildignore' and don't put matches for 'suffixes' at the end. */
    2579726883        if (argvars[1].v_type != VAR_UNKNOWN
     
    2580626892+           if (p_wic)
    2580726893+               options += WILD_ICASE;
    25808 +           rettv->vval.v_string = ExpandOne(&xpc, s, NULL, options, WILD_ALL);
     26894+           if (rettv->v_type == VAR_STRING)
     26895+               rettv->vval.v_string = ExpandOne(&xpc, s, NULL,
     26896+                                                          options, WILD_ALL);
     26897+           else if (rettv_list_alloc(rettv) != FAIL)
     26898+           {
     26899+               int i;
     26900+
     26901+               ExpandOne(&xpc, s, NULL, options, WILD_ALL_KEEP);
     26902+               for (i = 0; i < xpc.xp_numfiles; i++)
     26903+                   list_append_string(rettv->vval.v_list, xpc.xp_files[i], -1);
     26904+               ExpandCleanup(&xpc);
     26905+           }
    2580926906        }
    2581026907        else
    2581126908            rettv->vval.v_string = NULL;
    25812 @@ -9896,6 +10057,8 @@
     26909@@ -9896,6 +10098,8 @@
    2581326910     typval_T   *argvars;
    2581426911     typval_T   *rettv;
     
    2581926916     {
    2582026917        list_T          *l1, *l2;
    25821 @@ -9905,7 +10068,7 @@
     26918@@ -9905,7 +10109,7 @@
    2582226919 
    2582326920        l1 = argvars[0].vval.v_list;
     
    2582826925        {
    2582926926            if (argvars[2].v_type != VAR_UNKNOWN)
    25830 @@ -9944,7 +10107,7 @@
     26927@@ -9944,7 +10148,7 @@
    2583126928 
    2583226929        d1 = argvars[0].vval.v_dict;
     
    2583726934        {
    2583826935            /* Check the third argument. */
    25839 @@ -10186,20 +10349,22 @@
     26936@@ -9987,7 +10191,7 @@
     26937                        EMSG2(_("E737: Key already exists: %s"), hi2->hi_key);
     26938                        break;
     26939                    }
     26940-                   else if (*action == 'f')
     26941+                   else if (*action == 'f' && HI2DI(hi2) != di1)
     26942                    {
     26943                        clear_tv(&di1->di_tv);
     26944                        copy_tv(&HI2DI(hi2)->di_tv, &di1->di_tv);
     26945@@ -10186,20 +10390,22 @@
    2584026946     typval_T   save_key;
    2584126947     int                rem;
     
    2586326969     }
    2586426970     else
    25865 @@ -10236,7 +10401,8 @@
     26971@@ -10236,7 +10442,8 @@
    2586626972                {
    2586726973                    --todo;
     
    2587326979                    vimvars[VV_KEY].vv_str = vim_strsave(di->di_key);
    2587426980                    if (filter_map_one(&di->di_tv, expr, map, &rem) == FAIL
    25875 @@ -10255,7 +10421,7 @@
     26981@@ -10255,7 +10462,7 @@
    2587626982 
    2587726983            for (li = l->lv_first; li != NULL; li = nli)
     
    2588226988                nli = li->li_next;
    2588326989                vimvars[VV_KEY].vv_nr = idx;
    25884 @@ -10839,6 +11005,11 @@
     26990@@ -10839,6 +11046,11 @@
    2588526991 
    2588626992        if (*varname == '&')    /* buffer-local-option */
     
    2589427000        {
    2589527001            if (*varname == NUL)
    25896 @@ -11039,18 +11210,22 @@
     27002@@ -11039,18 +11251,22 @@
    2589727003     typval_T   *argvars UNUSED;
    2589827004     typval_T   *rettv;
     
    2592427030 }
    2592527031 
    25926 @@ -11653,7 +11828,7 @@
     27032@@ -11653,22 +11869,44 @@
    2592727033     typval_T   *argvars;
    2592827034     typval_T   *rettv;
     
    2593327039     int                error = FALSE;
    2593427040 
    25935 @@ -11661,14 +11836,16 @@
    25936      * for 'wildignore' and don't put matches for 'suffixes' at the end. */
    25937      if (argvars[1].v_type != VAR_UNKNOWN
    25938                                 && get_tv_number_chk(&argvars[1], &error))
     27041     /* When the optional second argument is non-zero, don't remove matches
     27042-    * for 'wildignore' and don't put matches for 'suffixes' at the end. */
     27043-    if (argvars[1].v_type != VAR_UNKNOWN
     27044-                               && get_tv_number_chk(&argvars[1], &error))
    2593927045-       flags |= WILD_KEEP_ALL;
    25940 +       options |= WILD_KEEP_ALL;
     27046+     * for 'wildignore' and don't put matches for 'suffixes' at the end. */
    2594127047     rettv->v_type = VAR_STRING;
     27048+    if (argvars[1].v_type != VAR_UNKNOWN)
     27049+    {
     27050+       if (get_tv_number_chk(&argvars[1], &error))
     27051+           options |= WILD_KEEP_ALL;
     27052+       if (argvars[2].v_type != VAR_UNKNOWN
     27053+                                   && get_tv_number_chk(&argvars[2], &error))
     27054+       {
     27055+           rettv->v_type = VAR_LIST;
     27056+           rettv->vval.v_list = NULL;
     27057+       }
     27058+    }
    2594227059     if (!error)
    2594327060     {
    2594427061        ExpandInit(&xpc);
    2594527062        xpc.xp_context = EXPAND_FILES;
     27063-       rettv->vval.v_string = ExpandOne(&xpc, get_tv_string(&argvars[0]),
     27064-                                                      NULL, flags, WILD_ALL);
    2594627065+       if (p_wic)
    2594727066+           options += WILD_ICASE;
    25948         rettv->vval.v_string = ExpandOne(&xpc, get_tv_string(&argvars[0]),
    25949 -                                                      NULL, flags, WILD_ALL);
     27067+       if (rettv->v_type == VAR_STRING)
     27068+           rettv->vval.v_string = ExpandOne(&xpc, get_tv_string(&argvars[0]),
    2595027069+                                                    NULL, options, WILD_ALL);
     27070+       else if (rettv_list_alloc(rettv) != FAIL)
     27071+       {
     27072+         int i;
     27073+
     27074+         ExpandOne(&xpc, get_tv_string(&argvars[0]),
     27075+                                               NULL, options, WILD_ALL_KEEP);
     27076+         for (i = 0; i < xpc.xp_numfiles; i++)
     27077+             list_append_string(rettv->vval.v_list, xpc.xp_files[i], -1);
     27078+
     27079+         ExpandCleanup(&xpc);
     27080+       }
    2595127081     }
    2595227082     else
    2595327083        rettv->vval.v_string = NULL;
    25954 @@ -11741,9 +11918,6 @@
     27084@@ -11741,9 +11979,6 @@
    2595527085 #ifdef __QNX__
    2595627086        "qnx",
     
    2596227092        "unix",
    2596327093 #endif
    25964 @@ -11856,7 +12030,7 @@
     27094@@ -11856,7 +12091,7 @@
    2596527095 #ifdef FEAT_SEARCHPATH
    2596627096        "file_in_path",
    2596727097 #endif
    2596827098-#if defined(UNIX) && !defined(USE_SYSTEM)
    25969 +#if (defined(UNIX) && !defined(USE_SYSTEM)) || defined(WIN3264)
     27099+#ifdef FEAT_FILTERPIPE
    2597027100        "filterpipe",
    2597127101 #endif
    2597227102 #ifdef FEAT_FIND_ID
    25973 @@ -12002,9 +12176,6 @@
     27103@@ -12002,9 +12237,6 @@
    2597427104 #ifdef FEAT_OLE
    2597527105        "ole",
     
    2598127111        "path_extra",
    2598227112 #endif
    25983 @@ -12116,6 +12287,9 @@
     27113@@ -12116,6 +12348,9 @@
    2598427114 #ifdef FEAT_TOOLBAR
    2598527115        "toolbar",
     
    2599127121        "user-commands",    /* was accidentally included in 5.4 */
    2599227122        "user_commands",
    25993 @@ -12159,6 +12333,9 @@
     27123@@ -12159,6 +12394,9 @@
    2599427124 #ifdef FEAT_XFONTSET
    2599527125        "xfontset",
     
    2600127131        "xsmp",
    2600227132 #endif
    26003 @@ -12572,7 +12749,7 @@
     27133@@ -12572,7 +12810,7 @@
    2600427134        }
    2600527135 
     
    2601027140                rettv->vval.v_number = idx;
    2601127141                break;
    26012 @@ -12712,7 +12889,7 @@
     27142@@ -12712,7 +12950,7 @@
    2601327143            IObuff[0] = NUL;
    2601427144        if (message != NULL && defstr != NULL
     
    2601927149        else
    2602027150        {
    26021 @@ -12850,7 +13027,7 @@
     27151@@ -12850,7 +13088,7 @@
    2602227152     if (argvars[0].v_type != VAR_LIST)
    2602327153        EMSG2(_(e_listarg), "insert()");
     
    2602827158        if (argvars[2].v_type != VAR_UNKNOWN)
    2602927159            before = get_tv_number_chk(&argvars[2], &error);
    26030 @@ -12877,6 +13054,17 @@
     27160@@ -12877,6 +13115,17 @@
    2603127161 }
    2603227162 
     
    2604627176  */
    2604727177     static void
    26048 @@ -13290,8 +13478,10 @@
     27178@@ -13290,8 +13539,10 @@
    2604927179     char_u     *keys_buf = NULL;
    2605027180     char_u     *rhs;
     
    2605827188     /* return empty string for failure */
    2605927189     rettv->v_type = VAR_STRING;
    26060 @@ -13305,7 +13495,11 @@
     27190@@ -13305,7 +13556,11 @@
    2606127191     {
    2606227192        which = get_tv_string_buf_chk(&argvars[1], buf);
     
    2607027200     else
    2607127201        which = (char_u *)"";
    26072 @@ -13315,19 +13509,34 @@
     27202@@ -13315,19 +13570,34 @@
    2607327203     mode = get_map_mode(&which, 0);
    2607427204 
     
    2611527245 }
    2611627246 
    26117 @@ -14006,6 +14215,18 @@
     27247@@ -13367,6 +13637,23 @@
     27248 }
     27249 #endif
     27250 
     27251+#ifdef FEAT_LUA
     27252+/*
     27253+ * "luaeval()" function
     27254+ */
     27255+    static void
     27256+f_luaeval(argvars, rettv)
     27257+    typval_T   *argvars;
     27258+    typval_T   *rettv;
     27259+{
     27260+    char_u     *str;
     27261+    char_u     buf[NUMBUFLEN];
     27262+
     27263+    str = get_tv_string_buf(&argvars[0], buf);
     27264+    do_luaeval(str, argvars + 1, rettv);
     27265+}
     27266+#endif
     27267+
     27268 /*
     27269  * "map()" function
     27270  */
     27271@@ -14006,6 +14293,18 @@
    2611827272 }
    2611927273 
     
    2613427288  */
    2613527289     static void
    26136 @@ -14177,22 +14398,19 @@
     27290@@ -14177,22 +14476,19 @@
    2613727291     typval_T   *rettv;
    2613827292 {
     
    2616827322     if (argvars[1].v_type != VAR_UNKNOWN)
    2616927323     {
    26170 @@ -14214,49 +14432,61 @@
     27324@@ -14214,49 +14510,61 @@
    2617127325        return;
    2617227326     }
     
    2626127415                }
    2626227416                li->li_tv.v_type = VAR_STRING;
    26263 @@ -14264,71 +14494,109 @@
     27417@@ -14264,71 +14572,111 @@
    2626427418                li->li_tv.vval.v_string = s;
    2626527419                list_append(rettv->vval.v_list, li);
     
    2636027514+                   prevsize = (long)(p - start);
    2636127515+               else
     27516+               {
     27517+                   long grow50pc = (prevsize * 3) / 2;
     27518+                   long growmin  = (long)((p - start) * 2 + prevlen);
     27519+                   prevsize = grow50pc > growmin ? grow50pc : growmin;
     27520+               }
     27521+               newprev = prev == NULL ? alloc(prevsize)
     27522+                                               : vim_realloc(prev, prevsize);
     27523+               if (newprev == NULL)
    2636227524                {
    2636327525-                   mch_memmove(s, prev, prevlen);
     
    2636627528-                   prev = s;
    2636727529-                   prevlen += buflen;
    26368 +                   long grow50pc = (prevsize * 3) / 2;
    26369 +                   long growmin  = (long)((p - start) * 2 + prevlen);
    26370 +                   prevsize = grow50pc > growmin ? grow50pc : growmin;
    26371                 }
    26372 +               if ((newprev = vim_realloc(prev, prevsize)) == NULL)
    26373 +               {
    2637427530+                   do_outofmem_msg((long_u)prevsize);
    2637527531+                   failed = TRUE;
    2637627532+                   break;
    26377 +               }
     27533                }
    2637827534+               prev = newprev;
    2637927535            }
    2638027536-           filtd = 0;
     27537-       }
     27538-       else
     27539-       {
     27540-           mch_memmove(buf, buf + tolist, buflen - tolist);
     27541-           filtd -= tolist;
    2638127542+           /* Add the line part to end of "prev". */
    2638227543+           mch_memmove(prev + prevlen, start, p - start);
    2638327544+           prevlen += (long)(p - start);
    2638427545        }
    26385 -       else
    26386 -       {
    26387 -           mch_memmove(buf, buf + tolist, buflen - tolist);
    26388 -           filtd -= tolist;
    26389 -       }
    2639027546-    }
    2639127547+    } /* while */
     
    2641327569     fclose(fd);
    2641427570 }
    26415 @@ -14691,13 +14959,14 @@
     27571@@ -14691,13 +15039,14 @@
    2641627572     char_u     *key;
    2641727573     dict_T     *d;
     
    2642927585            key = get_tv_string_chk(&argvars[1]);
    2643027586            if (key != NULL)
    26431 @@ -14717,7 +14986,7 @@
     27587@@ -14717,7 +15066,7 @@
    2643227588     else if (argvars[0].v_type != VAR_LIST)
    2643327589        EMSG2(_(e_listdictarg), "remove()");
     
    2643827594        int         error = FALSE;
    2643927595 
    26440 @@ -14847,6 +15116,9 @@
     27596@@ -14847,6 +15196,9 @@
    2644127597     typval_T   *rettv;
    2644227598 {
     
    2644827604     p = get_tv_string(&argvars[0]);
    2644927605 #ifdef FEAT_SHORTCUT
    26450 @@ -14862,7 +15134,6 @@
     27606@@ -14862,7 +15214,6 @@
    2645127607 #else
    2645227608 # ifdef HAVE_READLINK
     
    2645627612        int     len;
    2645727613        char_u  *remain = NULL;
    26458 @@ -14879,7 +15150,10 @@
     27614@@ -14879,7 +15230,10 @@
    2645927615 
    2646027616        len = STRLEN(p);
     
    2646727623        q = getnextcomp(p);
    2646827624        if (*q != NUL)
    26469 @@ -14890,6 +15164,10 @@
     27625@@ -14890,6 +15244,10 @@
    2647027626            q[-1] = NUL;
    2647127627        }
     
    2647827634        {
    2647927635            for (;;)
    26480 @@ -15033,6 +15311,7 @@
     27636@@ -15033,6 +15391,7 @@
    2648127637 
    2648227638 #ifdef HAVE_READLINK
     
    2648627642     rettv->v_type = VAR_STRING;
    2648727643 }
    26488 @@ -15051,7 +15330,7 @@
     27644@@ -15051,7 +15410,7 @@
    2648927645     if (argvars[0].v_type != VAR_LIST)
    2649027646        EMSG2(_(e_listarg), "reverse()");
     
    2649527651        li = l->lv_last;
    2649627652        l->lv_first = l->lv_last = NULL;
    26497 @@ -16256,6 +16535,7 @@
     27653@@ -16256,6 +16615,7 @@
    2649827654 
    2649927655 static int     item_compare_ic;
     
    2650327659 #define ITEM_COMPARE_FAIL 999
    2650427660 
    26505 @@ -16315,7 +16595,8 @@
     27661@@ -16315,7 +16675,8 @@
    2650627662 
    2650727663     rettv.v_type = VAR_UNKNOWN;                /* clear_tv() uses this */
     
    2651327669     clear_tv(&argv[1]);
    2651427670 
    26515 @@ -16348,7 +16629,8 @@
     27671@@ -16348,7 +16709,8 @@
    2651627672     else
    2651727673     {
     
    2652327679        rettv->vval.v_list = l;
    2652427680        rettv->v_type = VAR_LIST;
    26525 @@ -16360,8 +16642,10 @@
     27681@@ -16360,8 +16722,10 @@
    2652627682 
    2652727683        item_compare_ic = FALSE;
     
    2653427690                item_compare_func = argvars[1].vval.v_string;
    2653527691            else
    26536 @@ -16376,6 +16660,17 @@
     27692@@ -16376,6 +16740,17 @@
    2653727693                else
    2653827694                    item_compare_func = get_tv_string(&argvars[1]);
     
    2655227708 
    2655327709        /* Make an array with each entry pointing to an item in the List. */
    26554 @@ -17512,18 +17807,22 @@
     27710@@ -17512,18 +17887,22 @@
    2655527711     typval_T   *argvars UNUSED;
    2655627712     typval_T   *rettv;
     
    2657627732 
    2657727733 /*
    26578 @@ -17711,7 +18010,7 @@
     27734@@ -17711,7 +18090,7 @@
    2657927735     typval_T   *argvars;
    2658027736     typval_T   *rettv;
     
    2658527741     char_u     *tostr;
    2658627742     char_u     *p;
    26587 @@ -17728,7 +18027,7 @@
     27743@@ -17728,7 +18107,7 @@
    2658827744     char_u     buf2[NUMBUFLEN];
    2658927745     garray_T   ga;
     
    2659427750     tostr = get_tv_string_buf_chk(&argvars[2], buf2);
    2659527751 
    26596 @@ -17754,19 +18053,19 @@
     27752@@ -17754,19 +18133,19 @@
    2659727753        }
    2659827754 
     
    2661827774                    for (p = tostr; *p != NUL; p += tolen)
    2661927775                    {
    26620 @@ -17785,11 +18084,11 @@
     27776@@ -17785,11 +18164,11 @@
    2662127777                ++idx;
    2662227778            }
     
    2663227788                for (p = tostr; *p != NUL; p += tolen)
    2663327789                {
    26634 @@ -17804,18 +18103,18 @@
     27790@@ -17804,18 +18183,18 @@
    2663527791            mch_memmove((char *)ga.ga_data + ga.ga_len, cpstr, (size_t)cplen);
    2663627792            ga.ga_len += cplen;
     
    2665527811     }
    2665627812 
    26657 @@ -18258,6 +18557,19 @@
     27813@@ -17882,11 +18261,21 @@
     27814     rettv->v_type = VAR_STRING;
     27815 #ifdef FEAT_PERSISTENT_UNDO
     27816     {
     27817-       char_u *ffname = FullName_save(get_tv_string(&argvars[0]), FALSE);
     27818+       char_u *fname = get_tv_string(&argvars[0]);
     27819+
     27820+       if (*fname == NUL)
     27821+       {
     27822+           /* If there is no file name there will be no undo file. */
     27823+           rettv->vval.v_string = NULL;
     27824+       }
     27825+       else
     27826+       {
     27827+           char_u *ffname = FullName_save(fname, FALSE);
     27828 
     27829-       if (ffname != NULL)
     27830-           rettv->vval.v_string = u_get_undo_file_name(ffname, FALSE);
     27831-       vim_free(ffname);
     27832+           if (ffname != NULL)
     27833+               rettv->vval.v_string = u_get_undo_file_name(ffname, FALSE);
     27834+           vim_free(ffname);
     27835+       }
     27836     }
     27837 #else
     27838     rettv->vval.v_string = NULL;
     27839@@ -18258,6 +18647,19 @@
    2665827840 }
    2665927841 
     
    2667527857  * Returns NULL when there is an error.
    2667627858  */
    26677 @@ -19453,9 +19765,14 @@
     27859@@ -18768,11 +19170,7 @@
     27860 set_vim_var_char(c)
     27861     int c;
     27862 {
     27863-#ifdef FEAT_MBYTE
     27864-    char_u     buf[MB_MAXBYTES];
     27865-#else
     27866-    char_u     buf[2];
     27867-#endif
     27868+    char_u     buf[MB_MAXBYTES + 1];
     27869 
     27870 #ifdef FEAT_MBYTE
     27871     if (has_mbyte)
     27872@@ -19453,9 +19851,14 @@
    2667827873         * worked find the variable again.  Don't auto-load a script if it was
    2667927874         * loaded already, otherwise it would be loaded every time when
     
    2669227887            return NULL;
    2669327888     }
    26694 @@ -19730,7 +20047,6 @@
     27889@@ -19730,7 +20133,6 @@
    2669527890     dictitem_T *v;
    2669627891     char_u     *varname;
     
    2670027895     ht = find_var_ht(name, &varname);
    2670127896     if (ht == NULL || *varname == NUL)
    26702 @@ -19740,25 +20056,8 @@
     27897@@ -19740,25 +20142,8 @@
    2670327898     }
    2670427899     v = find_var_in_ht(ht, varname, TRUE);
     
    2672827923     if (v != NULL)
    2672927924     {
    26730 @@ -19824,13 +20123,8 @@
     27925@@ -19824,13 +20209,8 @@
    2673127926        }
    2673227927 
     
    2674427939        v = (dictitem_T *)alloc((unsigned)(sizeof(dictitem_T)
    2674527940                                                          + STRLEN(varname)));
    26746 @@ -19895,6 +20189,55 @@
     27941@@ -19895,6 +20275,55 @@
    2674727942 }
    2674827943 
     
    2680027995  * Also give an error message, using "name".
    2680127996  */
    26802 @@ -20302,6 +20645,7 @@
     27997@@ -20099,7 +20528,13 @@
     27998                /* Call msg_start() after eval1(), evaluating the expression
     27999                 * may cause a message to appear. */
     28000                if (eap->cmdidx == CMD_echo)
     28001+               {
     28002+                   /* Mark the saved text as finishing the line, so that what
     28003+                    * follows is displayed on a new line when scrolling back
     28004+                    * at the more prompt. */
     28005+                   msg_sb_eol();
     28006                    msg_start();
     28007+               }
     28008            }
     28009            else if (eap->cmdidx == CMD_echo)
     28010                msg_puts_attr((char_u *)" ", echo_attr);
     28011@@ -20302,6 +20737,7 @@
    2680328012     exarg_T    *eap;
    2680428013 {
     
    2680828017     int                c;
    2680928018     int                saved_did_emsg;
    26810 @@ -20548,6 +20892,15 @@
     28019@@ -20548,6 +20984,15 @@
    2681128020            arg = vim_strsave(arg);
    2681228021            if (arg == NULL)
     
    2682428033            *p = c;
    2682528034            newargs.ga_len++;
    26826 @@ -20623,7 +20976,8 @@
     28035@@ -20623,7 +21068,8 @@
    2682728036     nesting = 0;
    2682828037     for (;;)
     
    2683428043        sourcing_lnum_off = sourcing_lnum;
    2683528044 
    26836 @@ -20726,6 +21080,8 @@
     28045@@ -20726,6 +21172,8 @@
    2683728046                                    && (!ASCII_ISALPHA(p[2]) || p[2] == 'r'))
    2683828047                        || (p[0] == 't' && p[1] == 'c'
     
    2684328052                                    && (!ASCII_ISALPHA(p[3]) || p[3] == 'y'))
    2684428053                        || (p[0] == 'm' && p[1] == 'z'
    26845 @@ -21562,6 +21918,9 @@
     28054@@ -21562,6 +22010,9 @@
    2684628055            ++hi;
    2684728056        fp = HI2UF(hi);
     
    2685328062            return fp->uf_name; /* prevents overflow */
    2685428063 
    26855 @@ -21921,8 +22280,12 @@
     28064@@ -21921,8 +22372,12 @@
    2685628065                        s = tv2string(&argvars[i], &tofree, numbuf2, 0);
    2685728066                        if (s != NULL)
     
    2686828077                        }
    2686928078                    }
    26870 @@ -22010,8 +22373,12 @@
     28079@@ -22010,8 +22465,12 @@
    2687128080            s = tv2string(fc->rettv, &tofree, numbuf2, 0);
    2687228081            if (s != NULL)
     
    2688328092            }
    2688428093        }
    26885 @@ -22519,18 +22886,21 @@
     28094@@ -22519,18 +22978,21 @@
    2688628095        if (tab != NULL)
    2688728096        {
     
    2691028119                                       (int)(tab - virp->vir_line + 1), TRUE);
    2691128120 #ifdef FEAT_FLOAT
    26912 @@ -22539,9 +22909,27 @@
     28121@@ -22539,9 +23001,28 @@
    2691328122 #endif
    2691428123                else
     
    2692628135+                       vim_free(tv.vval.v_string);
    2692728136+                       tv = *etv;
     28137+                       vim_free(etv);
    2692828138+                   }
    2692928139+               }
     
    2693928149        }
    2694028150     }
    26941 @@ -22583,8 +22971,10 @@
     28151@@ -22583,8 +23064,10 @@
    2694228152                    case VAR_STRING: s = "STR"; break;
    2694328153                    case VAR_NUMBER: s = "NUM"; break;
     
    2695128161                }
    2695228162                fprintf(fp, "!%s\t%s\t", this_var->di_key, s);
    26953 @@ -22656,7 +23046,7 @@
     28163@@ -22656,7 +23139,7 @@
    2695428164                    f = -f;
    2695528165                    sign = '-';
     
    2696028170                        || put_eol(fd) == FAIL)
    2696128171                    return FAIL;
    26962 @@ -23019,6 +23409,7 @@
     28172@@ -23019,6 +23502,7 @@
    2696328173     int                c;
    2696428174     int                has_fullname = 0;
     
    2696828178 #endif
    2696928179 
    26970 @@ -23193,24 +23584,25 @@
     28180@@ -23193,24 +23677,25 @@
    2697128181     }
    2697228182 
     
    2700128211        {
    2700228212            if (shortpath_for_partial(fnamep, bufp, fnamelen) == FAIL)
    27003 @@ -23218,18 +23610,16 @@
     28213@@ -23218,18 +23703,16 @@
    2700428214        }
    2700528215        else
     
    2702428234                    return -1;
    2702528235diff -Naur vim73.orig/src/ex_cmds.c vim73/src/ex_cmds.c
    27026 --- vim73.orig/src/ex_cmds.c    2012-02-15 21:57:45.057436051 +0000
    27027 +++ vim73/src/ex_cmds.c 2012-02-15 21:57:46.717479836 +0000
     28236--- vim73.orig/src/ex_cmds.c    2012-06-03 23:09:52.940007057 +0000
     28237+++ vim73/src/ex_cmds.c 2012-06-03 23:09:55.848084445 +0000
    2702828238@@ -11,10 +11,6 @@
    2702928239  * ex_cmds.c: some functions for command line commands
     
    2703728247 #include "version.h"
    2703828248 
    27039 @@ -323,7 +319,8 @@
     28249@@ -29,7 +25,6 @@
     28250 static int read_viminfo_up_to_marks __ARGS((vir_T *virp, int forceit, int writing));
     28251 #endif
     28252 
     28253-static int check_overwrite __ARGS((exarg_T *eap, buf_T *buf, char_u *fname, char_u *ffname, int other));
     28254 static int check_readonly __ARGS((int *forceit, buf_T *buf));
     28255 #ifdef FEAT_AUTOCMD
     28256 static void delbuf_msg __ARGS((char_u *name));
     28257@@ -323,7 +318,8 @@
    2704028258     /* When sorting numbers "start_col_nr" is the number, not the column
    2704128259      * number. */
     
    2704728265     {
    2704828266        /* We need to copy one line into "sortbuf1", because there is no
    27049 @@ -482,7 +479,7 @@
     28267@@ -482,7 +478,7 @@
    2705028268             * of the match, by temporarily terminating the string there */
    2705128269            s2 = s + end_col;
     
    2705628274            p = s + start_col;
    2705728275            if (sort_hex)
    27058 @@ -491,9 +488,13 @@
     28276@@ -491,9 +487,13 @@
    2705928277                s = skiptodigit(p);
    2706028278            if (s > p && s[-1] == '-')
     
    2707328291        else
    2707428292        {
    27075 @@ -819,7 +820,13 @@
     28293@@ -819,7 +819,13 @@
    2707628294        curwin->w_cursor.lnum = dest + (line2 - line1) + 1;
    2707728295 
     
    2708828306        changed_lines(dest + 1, 0, line1 + num_lines, 0L);
    2708928307 
    27090 @@ -898,9 +905,6 @@
     28308@@ -898,9 +904,6 @@
    2709128309  * Handle the ":!cmd" command. Also for ":r !cmd" and ":w !cmd"
    2709228310  * Bangs in the argument are replaced with the previously entered command.
     
    2709828316     void
    2709928317 do_bang(addr_count, eap, forceit, do_in, do_out)
    27100 @@ -979,11 +983,7 @@
     28318@@ -979,11 +982,7 @@
    2710128319        trailarg = NULL;
    2710228320        while (*p)
     
    2711128329                if (p > newcmd && p[-1] == '\\')
    2711228330                    STRMOVE(p - 1, p);
    27113 @@ -1113,7 +1113,7 @@
     28331@@ -1113,7 +1112,7 @@
    2711428332     if (do_out)
    2711528333        shell_flags |= SHELL_DOOUT;
    2711628334 
    2711728335-#if !defined(USE_SYSTEM) && defined(UNIX)
    27118 +#if (!defined(USE_SYSTEM) && defined(UNIX)) || defined(WIN3264)
     28336+#ifdef FEAT_FILTERPIPE
    2711928337     if (!do_in && do_out && !p_stmp)
    2712028338     {
    2712128339        /* Use a pipe to fetch stdout of the command, do not use a temp file. */
    27122 @@ -1577,14 +1577,8 @@
     28340@@ -1577,14 +1576,8 @@
    2712328341            if (p != NULL)
    2712428342                *p = NUL;
     
    2713528353        {
    2713628354            p = vim_strchr(cmd, '|');
    27137 @@ -1633,16 +1627,9 @@
     28355@@ -1633,16 +1626,9 @@
    2713828356     else
    2713928357        vim_snprintf((char *)end, (size_t)(buflen - (end - buf)),
     
    2715228370                (char *)opt, (char *)fname);
    2715328371 }
    27154 @@ -1843,11 +1830,7 @@
     28372@@ -1843,11 +1829,7 @@
    2715528373 #ifdef VMS
    2715628374                                    (char_u *)"-tmp",
     
    2716428382                                    FALSE);
    2716528383            if (tempname == NULL)               /* out of memory */
    27166 @@ -2700,6 +2683,10 @@
     28384@@ -2700,6 +2682,10 @@
    2716728385                                                                        TRUE);
    2716828386                do_modelines(0);
     
    2717528393        }
    2717628394 
    27177 @@ -2772,7 +2759,7 @@
     28395@@ -2735,7 +2721,7 @@
     28396  * May set eap->forceit if a dialog says it's OK to overwrite.
     28397  * Return OK if it's OK, FAIL if it is not.
     28398  */
     28399-    static int
     28400+    int
     28401 check_overwrite(eap, buf, fname, ffname, other)
     28402     exarg_T    *eap;
     28403     buf_T      *buf;
     28404@@ -2772,7 +2758,7 @@
    2717828405 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
    2717928406            if (p_confirm || cmdmod.confirm)
     
    2718428411                dialog_msg(buff, _("Overwrite existing file \"%s\"?"), fname);
    2718528412                if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 2) != VIM_YES)
    27186 @@ -2790,7 +2777,7 @@
     28413@@ -2790,7 +2776,7 @@
    2718728414        /* For ":w! filename" check that no swap file exists for "filename". */
    2718828415        if (other && !emsg_silent)
     
    2719328420            int         r;
    2719428421            char_u      *swapname;
    27195 @@ -2801,20 +2788,29 @@
     28422@@ -2801,20 +2787,29 @@
    2719628423             * Use 'shortname' of the current buffer, since there is no buffer
    2719728424             * for the written file. */
     
    2722428451                    dialog_msg(buff,
    2722528452                            _("Swap file \"%s\" exists, overwrite anyway?"),
    27226 @@ -2964,7 +2960,7 @@
     28453@@ -2964,7 +2959,7 @@
    2722728454 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
    2722828455        if ((p_confirm || cmdmod.confirm) && buf->b_fname != NULL)
     
    2723328460            if (buf->b_p_ro)
    2723428461                dialog_msg(buff, _("'readonly' option is set for \"%s\".\nDo you wish to write anyway?"),
    27235 @@ -3394,6 +3390,13 @@
    27236                                       (flags & ECMD_HIDE) ? 0 : DOBUF_UNLOAD);
     28462@@ -3391,9 +3386,16 @@
     28463                /* close the link to the current buffer */
     28464                u_sync(FALSE);
     28465                close_buffer(oldwin, curbuf,
     28466-                                     (flags & ECMD_HIDE) ? 0 : DOBUF_UNLOAD);
     28467+                              (flags & ECMD_HIDE) ? 0 : DOBUF_UNLOAD, FALSE);
    2723728468 
    2723828469 #ifdef FEAT_AUTOCMD
     
    2724728478                if (aborting())     /* autocmds may abort script processing */
    2724828479                {
    27249 @@ -3498,9 +3501,7 @@
     28480@@ -3418,7 +3420,7 @@
     28481                     * and re-attach to buffer, perhaps.
     28482                     */
     28483                    if (curwin->w_s == &(curwin->w_buffer->b_s))
     28484-                           curwin->w_s = &(buf->b_s);
     28485+                       curwin->w_s = &(buf->b_s);
     28486 #endif
     28487                    curwin->w_buffer = buf;
     28488                    curbuf = buf;
     28489@@ -3498,9 +3500,7 @@
    2725028490        curbuf->b_p_bin = FALSE;        /* reset 'bin' before reading file */
    2725128491        curwin->w_p_nu = 0;             /* no line numbers */
     
    2725828498        curwin->w_p_arab = FALSE;       /* no arabic mode */
    2725928499 #endif
    27260 @@ -3631,10 +3632,6 @@
     28500@@ -3631,10 +3631,6 @@
    2726128501      */
    2726228502     check_arg_idx(curwin);
     
    2726928509     if (!auto_buf)
    2727028510 #endif
    27271 @@ -4109,8 +4106,8 @@
     28511@@ -4109,8 +4105,8 @@
    2727228512     switch (*kind)
    2727328513     {
     
    2728028520            break;
    2728128521 
    27282 @@ -4637,7 +4634,15 @@
     28522@@ -4637,7 +4633,15 @@
    2728328523                         * for a match in this line again. */
    2728428524                        skip_match = TRUE;
     
    2729728537                }
    2729828538 
    27299 @@ -5353,8 +5358,9 @@
     28539@@ -5146,10 +5150,13 @@
     28540 
     28541        if (!global_busy)
     28542        {
     28543-           if (endcolumn)
     28544-               coladvance((colnr_T)MAXCOL);
     28545-           else
     28546-               beginline(BL_WHITE | BL_FIX);
     28547+           if (!do_ask)  /* when interactive leave cursor on the match */
     28548+           {
     28549+               if (endcolumn)
     28550+                   coladvance((colnr_T)MAXCOL);
     28551+               else
     28552+                   beginline(BL_WHITE | BL_FIX);
     28553+           }
     28554            if (!do_sub_msg(do_count) && do_ask)
     28555                MSG("");
     28556        }
     28557@@ -5353,8 +5360,9 @@
    2730028558 global_exe(cmd)
    2730128559     char_u     *cmd;
     
    2730928567     /*
    2731028568      * Set current position only once for a global command.
    27311 @@ -5398,8 +5404,10 @@
     28569@@ -5398,8 +5406,10 @@
    2731228570        msg_didout = FALSE;
    2731328571 
     
    2732228580 }
    2732328581 
    27324 @@ -5409,7 +5417,7 @@
     28582@@ -5409,7 +5419,7 @@
    2732528583     vir_T      *virp;
    2732628584     int                force;
     
    2733128589     if (force || old_sub == NULL)
    2733228590        old_sub = viminfo_readstring(virp, 1, TRUE);
    27333 @@ -5471,9 +5479,8 @@
     28591@@ -5471,9 +5481,8 @@
    2733428592                return FALSE;
    2733528593            curwin->w_p_pvw = TRUE;
     
    2734328601            curwin->w_p_diff = FALSE;       /* no 'diff' */
    2734428602 # endif
    27345 @@ -5514,6 +5521,9 @@
     28603@@ -5514,6 +5523,9 @@
    2734628604     int                len;
    2734728605     char_u     *lang;
     
    2735328611     if (eap != NULL)
    2735428612     {
    27355 @@ -5677,6 +5687,12 @@
     28613@@ -5533,7 +5545,7 @@
     28614        }
     28615        arg = eap->arg;
     28616 
     28617-       if (eap->forceit && *arg == NUL)
     28618+       if (eap->forceit && *arg == NUL && !curbuf->b_help)
     28619        {
     28620            EMSG(_("E478: Don't panic!"));
     28621            return;
     28622@@ -5677,6 +5689,12 @@
    2735628623     if (!p_im)
    2735728624        restart_edit = 0;           /* don't want insert mode in help file */
     
    2736628633        do_tag(tag, DT_HELP, 1, FALSE, TRUE);
    2736728634 
    27368 @@ -5979,6 +5995,7 @@
     28635@@ -5946,6 +5964,29 @@
     28636                break;
     28637          }
     28638          *d = NUL;
     28639+
     28640+         if (*IObuff == '`')
     28641+         {
     28642+             if (d > IObuff + 2 && d[-1] == '`')
     28643+             {
     28644+                 /* remove the backticks from `command` */
     28645+                 mch_memmove(IObuff, IObuff + 1, STRLEN(IObuff));
     28646+                 d[-2] = NUL;
     28647+             }
     28648+             else if (d > IObuff + 3 && d[-2] == '`' && d[-1] == ',')
     28649+             {
     28650+                 /* remove the backticks and comma from `command`, */
     28651+                 mch_memmove(IObuff, IObuff + 1, STRLEN(IObuff));
     28652+                 d[-3] = NUL;
     28653+             }
     28654+             else if (d > IObuff + 4 && d[-3] == '`'
     28655+                                            && d[-2] == '\\' && d[-1] == '.')
     28656+             {
     28657+                 /* remove the backticks and dot from `command`\. */
     28658+                 mch_memmove(IObuff, IObuff + 1, STRLEN(IObuff));
     28659+                 d[-4] = NUL;
     28660+             }
     28661+         }
     28662        }
     28663     }
     28664 
     28665@@ -5979,6 +6020,7 @@
    2736928666     char_u     *line;
    2737028667     int                in_example = FALSE;
     
    2737428671     char_u     *rt;
    2737528672     int                mustfree;
    27376 @@ -6025,124 +6042,187 @@
     28673@@ -6025,124 +6067,187 @@
    2737728674     }
    2737828675 
     
    2765328950     }
    2765428951 }
    27655 @@ -6559,8 +6639,7 @@
     28952@@ -6430,7 +6535,10 @@
     28953            p1 = vim_strchr(IObuff, '*');       /* find first '*' */
     28954            while (p1 != NULL)
     28955            {
     28956-               p2 = vim_strchr(p1 + 1, '*');   /* find second '*' */
     28957+               /* Use vim_strbyte() instead of vim_strchr() so that when
     28958+                * 'encoding' is dbcs it still works, don't find '*' in the
     28959+                * second byte. */
     28960+               p2 = vim_strbyte(p1 + 1, '*');  /* find second '*' */
     28961                if (p2 != NULL && p2 > p1 + 1)  /* skip "*" and "**" */
     28962                {
     28963                    for (s = p1 + 1; s < p2; ++s)
     28964@@ -6559,8 +6667,7 @@
    2765628965 struct sign
    2765728966 {
     
    2766328972     char_u     *sn_icon;       /* name of pixmap */
    2766428973 #ifdef FEAT_SIGN_ICONS
    27665 @@ -6572,7 +6651,7 @@
     28974@@ -6572,7 +6679,7 @@
    2766628975 };
    2766728976 
     
    2767228981 static int sign_cmd_idx __ARGS((char_u *begin_cmd, char_u *end_cmd));
    2767328982 static void sign_list_defined __ARGS((sign_T *sp));
    27674 @@ -6654,9 +6733,14 @@
     28983@@ -6647,16 +6754,21 @@
     28984        if (idx == SIGNCMD_LIST && *arg == NUL)
     28985        {
     28986            /* ":sign list": list all defined signs */
     28987-           for (sp = first_sign; sp != NULL; sp = sp->sn_next)
     28988+           for (sp = first_sign; sp != NULL && !got_int; sp = sp->sn_next)
     28989                sign_list_defined(sp);
     28990        }
     28991        else if (*arg == NUL)
    2767528992            EMSG(_("E156: Missing sign name"));
    2767628993        else
     
    2768729004            for (sp = first_sign; sp != NULL; sp = sp->sn_next)
    2768829005            {
    27689 @@ -6669,46 +6753,52 @@
     29006@@ -6669,46 +6781,52 @@
    2769029007                /* ":sign define {name} ...": define a sign */
    2769129008                if (sp == NULL)
     
    2776829085 
    2776929086                /* set values for a defined sign. */
    27770 @@ -6886,6 +6976,8 @@
     29087@@ -6886,6 +7004,8 @@
    2777129088                arg = skiptowhite(arg);
    2777229089                if (*arg != NUL)
     
    2777829095            {
    2777929096diff -Naur vim73.orig/src/ex_cmds.h vim73/src/ex_cmds.h
    27780 --- vim73.orig/src/ex_cmds.h    2012-02-15 21:57:45.057436051 +0000
    27781 +++ vim73/src/ex_cmds.h 2012-02-15 21:57:46.973486588 +0000
     29097--- vim73.orig/src/ex_cmds.h    2012-06-03 23:09:52.948007269 +0000
     29098+++ vim73/src/ex_cmds.h 2012-06-03 23:09:55.880085297 +0000
    2778229099@@ -102,7 +102,7 @@
    2778329100 EX(CMD_aboveleft,      "aboveleft",    ex_wrongmodifier,
     
    2778929106                        RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
    2779029107 EX(CMD_anoremenu,      "anoremenu",    ex_menu,
     29108@@ -304,7 +304,7 @@
     29109 EX(CMD_display,                "display",      ex_display,
     29110                        EXTRA|NOTRLCOM|TRLBAR|SBOXOK|CMDWIN),
     29111 EX(CMD_diffupdate,     "diffupdate",   ex_diffupdate,
     29112-                       TRLBAR),
     29113+                       BANG|TRLBAR),
     29114 EX(CMD_diffget,                "diffget",      ex_diffgetput,
     29115                        RANGE|EXTRA|TRLBAR|MODIFY),
     29116 EX(CMD_diffoff,                "diffoff",      ex_diffoff,
    2779129117@@ -788,7 +788,7 @@
    2779229118 EX(CMD_rubyfile,       "rubyfile",     ex_rubyfile,
     
    2781729143 EX(CMD_xit,            "xit",          ex_exit,
    2781829144diff -Naur vim73.orig/src/ex_cmds2.c vim73/src/ex_cmds2.c
    27819 --- vim73.orig/src/ex_cmds2.c   2012-02-15 21:57:45.061436156 +0000
    27820 +++ vim73/src/ex_cmds2.c        2012-02-15 21:57:46.933485534 +0000
     29145--- vim73.orig/src/ex_cmds2.c   2012-06-03 23:09:52.948007269 +0000
     29146+++ vim73/src/ex_cmds2.c        2012-06-03 23:09:55.780082635 +0000
    2782129147@@ -11,10 +11,6 @@
    2782229148  * ex_cmds2.c: some more functions for command line commands
     
    2788129207  */
    2788229208     void
    27883 @@ -1496,7 +1486,7 @@
     29209@@ -1496,9 +1486,10 @@
    2788429210     buf_T      *buf;
    2788529211     int                checkall;       /* may abandon all changed buffers */
     
    2788929215     int                ret;
    2789029216     buf_T      *buf2;
    27891  
    27892 @@ -1949,7 +1939,7 @@
     29217+    exarg_T     ea;
     29218 
     29219     dialog_msg(buff, _("Save changes to \"%s\"?"),
     29220                        (buf->b_fname != NULL) ?
     29221@@ -1508,13 +1499,19 @@
     29222     else
     29223        ret = vim_dialog_yesnocancel(VIM_QUESTION, NULL, buff, 1);
     29224 
     29225+    /* Init ea pseudo-structure, this is needed for the check_overwrite()
     29226+     * function. */
     29227+    ea.append = ea.forceit = FALSE;
     29228+
     29229     if (ret == VIM_YES)
     29230     {
     29231 #ifdef FEAT_BROWSE
     29232        /* May get file name, when there is none */
     29233        browse_save_fname(buf);
     29234 #endif
     29235-       if (buf->b_fname != NULL)   /* didn't hit Cancel */
     29236+       if (buf->b_fname != NULL && check_overwrite(&ea, buf,
     29237+                                   buf->b_fname, buf->b_ffname, FALSE) == OK)
     29238+           /* didn't hit Cancel */
     29239            (void)buf_write_all(buf, FALSE);
     29240     }
     29241     else if (ret == VIM_NO)
     29242@@ -1542,7 +1539,9 @@
     29243                /* May get file name, when there is none */
     29244                browse_save_fname(buf2);
     29245 #endif
     29246-               if (buf2->b_fname != NULL)   /* didn't hit Cancel */
     29247+               if (buf2->b_fname != NULL && check_overwrite(&ea, buf2,
     29248+                                 buf2->b_fname, buf2->b_ffname, FALSE) == OK)
     29249+                   /* didn't hit Cancel */
     29250                    (void)buf_write_all(buf2, FALSE);
     29251 #ifdef FEAT_AUTOCMD
     29252                /* an autocommand may have deleted the buffer */
     29253@@ -1579,6 +1578,26 @@
     29254                || forceit);
     29255 }
     29256 
     29257+static void add_bufnum __ARGS((int *bufnrs, int *bufnump, int nr));
     29258+
     29259+/*
     29260+ * Add a buffer number to "bufnrs", unless it's already there.
     29261+ */
     29262+    static void
     29263+add_bufnum(bufnrs, bufnump, nr)
     29264+    int            *bufnrs;
     29265+    int            *bufnump;
     29266+    int            nr;
     29267+{
     29268+    int i;
     29269+
     29270+    for (i = 0; i < *bufnump; ++i)
     29271+       if (bufnrs[i] == nr)
     29272+           return;
     29273+    bufnrs[*bufnump] = nr;
     29274+    *bufnump = *bufnump + 1;
     29275+}
     29276+
     29277 /*
     29278  * Return TRUE if any buffer was changed and cannot be abandoned.
     29279  * That changed buffer becomes the current buffer.
     29280@@ -1587,32 +1606,64 @@
     29281 check_changed_any(hidden)
     29282     int                hidden;         /* Only check hidden buffers */
     29283 {
     29284+    int                ret = FALSE;
     29285     buf_T      *buf;
     29286     int                save;
     29287+    int                i;
     29288+    int                bufnum = 0;
     29289+    int                bufcount = 0;
     29290+    int                *bufnrs;
     29291 #ifdef FEAT_WINDOWS
     29292+    tabpage_T   *tp;
     29293     win_T      *wp;
     29294 #endif
     29295 
     29296-    for (;;)
     29297+    for (buf = firstbuf; buf != NULL; buf = buf->b_next)
     29298+       ++bufcount;
     29299+
     29300+    if (bufcount == 0)
     29301+       return FALSE;
     29302+
     29303+    bufnrs = (int *)alloc(sizeof(int) * bufcount);
     29304+    if (bufnrs == NULL)
     29305+       return FALSE;
     29306+
     29307+    /* curbuf */
     29308+    bufnrs[bufnum++] = curbuf->b_fnum;
     29309+#ifdef FEAT_WINDOWS
     29310+    /* buf in curtab */
     29311+    FOR_ALL_WINDOWS(wp)
     29312+       if (wp->w_buffer != curbuf)
     29313+           add_bufnum(bufnrs, &bufnum, wp->w_buffer->b_fnum);
     29314+
     29315+    /* buf in other tab */
     29316+    for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
     29317+       if (tp != curtab)
     29318+           for (wp = tp->tp_firstwin; wp != NULL; wp = wp->w_next)
     29319+               add_bufnum(bufnrs, &bufnum, wp->w_buffer->b_fnum);
     29320+#endif
     29321+    /* any other buf */
     29322+    for (buf = firstbuf; buf != NULL; buf = buf->b_next)
     29323+       add_bufnum(bufnrs, &bufnum, buf->b_fnum);
     29324+
     29325+    for (i = 0; i < bufnum; ++i)
     29326     {
     29327-       /* check curbuf first: if it was changed we can't abandon it */
     29328-       if (!hidden && curbufIsChanged())
     29329-           buf = curbuf;
     29330-       else
     29331+       buf = buflist_findnr(bufnrs[i]);
     29332+       if (buf == NULL)
     29333+           continue;
     29334+       if ((!hidden || buf->b_nwindows == 0) && bufIsChanged(buf))
     29335        {
     29336-           for (buf = firstbuf; buf != NULL; buf = buf->b_next)
     29337-               if ((!hidden || buf->b_nwindows == 0) && bufIsChanged(buf))
     29338-                   break;
     29339+           /* Try auto-writing the buffer.  If this fails but the buffer no
     29340+           * longer exists it's not changed, that's OK. */
     29341+           if (check_changed(buf, p_awa, TRUE, FALSE, TRUE) && buf_valid(buf))
     29342+               break;      /* didn't save - still changes */
     29343        }
     29344-       if (buf == NULL)    /* No buffers changed */
     29345-           return FALSE;
     29346-
     29347-       /* Try auto-writing the buffer.  If this fails but the buffer no
     29348-        * longer exists it's not changed, that's OK. */
     29349-       if (check_changed(buf, p_awa, TRUE, FALSE, TRUE) && buf_valid(buf))
     29350-           break;          /* didn't save - still changes */
     29351     }
     29352 
     29353+    if (i >= bufnum)
     29354+       goto theend;
     29355+
     29356+    ret = TRUE;
     29357     exiting = FALSE;
     29358 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
     29359     /*
     29360@@ -1645,24 +1696,29 @@
     29361 #ifdef FEAT_WINDOWS
     29362     /* Try to find a window that contains the buffer. */
     29363     if (buf != curbuf)
     29364-       for (wp = firstwin; wp != NULL; wp = wp->w_next)
     29365+       FOR_ALL_TAB_WINDOWS(tp, wp)
     29366            if (wp->w_buffer == buf)
     29367            {
     29368-               win_goto(wp);
     29369+               goto_tabpage_win(tp, wp);
     29370 # ifdef FEAT_AUTOCMD
     29371                /* Paranoia: did autocms wipe out the buffer with changes? */
     29372                if (!buf_valid(buf))
     29373-                   return TRUE;
     29374+               {
     29375+                   goto theend;
     29376+               }
     29377 # endif
     29378-               break;
     29379+               goto buf_found;
     29380            }
     29381+buf_found:
     29382 #endif
     29383 
     29384     /* Open the changed buffer in the current window. */
     29385     if (buf != curbuf)
     29386        set_curbuf(buf, DOBUF_GOTO);
     29387 
     29388-    return TRUE;
     29389+theend:
     29390+    vim_free(bufnrs);
     29391+    return ret;
     29392 }
     29393 
     29394 /*
     29395@@ -1949,7 +2005,7 @@
    2789329396 }
    2789429397 
     
    2789929402  */
    2790029403     static int
    27901 @@ -2165,9 +2155,7 @@
     29404@@ -2165,9 +2221,7 @@
    2790229405        {
    2790329406            if (win_split(0, 0) == FAIL)
     
    2791029413        else
    2791129414 #endif
    27912 @@ -2946,11 +2934,7 @@
     29415@@ -2946,11 +3000,7 @@
    2791329416     proftime_T             wait_start;
    2791429417 #endif
     
    2792229425        return retval;
    2792329426     fname_exp = fix_fname(p);
    27924 @@ -3286,7 +3270,11 @@
     29427@@ -3286,7 +3336,11 @@
    2792529428 
    2792629429     for (i = 1; i <= script_items.ga_len && !got_int; ++i)
     
    2793129434+                                                   NameBuff, MAXPATHL, TRUE);
    2793229435+           smsg((char_u *)"%3d: %s", i, NameBuff);
    27933 +        }
     29436+       }
    2793429437 }
    2793529438 
    2793629439 # if defined(BACKSLASH_IN_FILENAME) || defined(PROTO)
    27937 @@ -3412,7 +3400,7 @@
     29440@@ -3412,7 +3466,7 @@
    2793829441 {
    2793929442     struct source_cookie *sp = (struct source_cookie *)cookie;
     
    2794429447 #ifdef FEAT_EVAL
    2794529448     /* If breakpoints have been added/deleted need to check for it. */
    27946 @@ -3451,28 +3439,40 @@
     29449@@ -3451,28 +3505,49 @@
    2794729450     {
    2794829451        /* compensate for the one line read-ahead */
     
    2797029473+           garray_T    ga;
    2797129474+
    27972 +           ga_init2(&ga, (int)sizeof(char_u), 200);
     29475+           ga_init2(&ga, (int)sizeof(char_u), 400);
    2797329476+           ga_concat(&ga, line);
    2797429477+           ga_concat(&ga, p + 1);
     
    2798229485+               if (*p != '\\')
    2798329486+                   break;
     29487+               /* Adjust the growsize to the current length to speed up
     29488+                * concatenating many lines. */
     29489+               if (ga.ga_len > 400)
     29490+               {
     29491+                   if (ga.ga_len > 8000)
     29492+                       ga.ga_growsize = 8000;
     29493+                   else
     29494+                       ga.ga_growsize = ga.ga_len;
     29495+               }
    2798429496+               ga_concat(&ga, p + 1);
    2798529497+           }
     
    2800029512        s = string_convert(&sp->conv, line, NULL);
    2800129513        if (s != NULL)
    28002 @@ -4166,11 +4166,90 @@
     29514@@ -4166,11 +4241,90 @@
    2800329515            /* Set v:lang, v:lc_time and v:ctype to the final result. */
    2800429516            set_lang_var();
     
    2809129603  * Function given to ExpandGeneric() to obtain the possible arguments of the
    2809229604  * ":language" command.
    28093 @@ -4186,7 +4265,25 @@
     29605@@ -4186,7 +4340,25 @@
    2809429606        return (char_u *)"ctype";
    2809529607     if (idx == 2)
     
    2811929631 
    2812029632diff -Naur vim73.orig/src/ex_docmd.c vim73/src/ex_docmd.c
    28121 --- vim73.orig/src/ex_docmd.c   2012-02-15 21:57:45.041435628 +0000
    28122 +++ vim73/src/ex_docmd.c        2012-02-15 21:57:46.965486377 +0000
     29633--- vim73.orig/src/ex_docmd.c   2012-06-03 23:09:52.924006631 +0000
     29634+++ vim73/src/ex_docmd.c        2012-06-03 23:09:55.824083805 +0000
    2812329635@@ -61,6 +61,7 @@
    2812429636 static char_u  *do_one_cmd __ARGS((char_u **, int, char_u *(*fgetline)(int, void *, int), void *cookie));
     
    2859730109 #endif
    2859830110 #if defined(FEAT_PROFILE)
    28599 @@ -4520,12 +4581,14 @@
     30111@@ -3859,8 +3920,16 @@
     30112 #endif
     30113        case CMD_behave:
     30114            xp->xp_context = EXPAND_BEHAVE;
     30115+           xp->xp_pattern = arg;
     30116            break;
     30117 
     30118+#if defined(FEAT_CMDHIST)
     30119+       case CMD_history:
     30120+           xp->xp_context = EXPAND_HISTORY;
     30121+           xp->xp_pattern = arg;
     30122+           break;
     30123+#endif
     30124+
     30125 #endif /* FEAT_CMDL_COMPL */
     30126 
     30127        default:
     30128@@ -4520,12 +4589,14 @@
    2860030129                else /* n == 2 */
    2860130130                {
     
    2861430143                        return FAIL;
    2861530144                }
    28616 @@ -4777,12 +4840,10 @@
     30145@@ -4777,12 +4848,10 @@
    2861730146 #ifdef FEAT_MBYTE
    2861830147     else if (STRNCMP(arg, "enc", 3) == 0)
     
    2863130160     }
    2863230161     else if (STRNCMP(arg, "bad", 3) == 0)
    28633 @@ -4894,7 +4955,7 @@
     30162@@ -4894,7 +4963,7 @@
    2863430163     map_clear(eap->cmd, eap->arg, TRUE, TRUE);
    2863530164 }
     
    2864030169 ex_autocmd(eap)
    2864130170     exarg_T    *eap;
    28642 @@ -4921,8 +4982,12 @@
     30171@@ -4921,8 +4990,12 @@
    2864330172 ex_doautocmd(eap)
    2864430173     exarg_T    *eap;
     
    2865530184 #endif
    2865630185 
    28657 @@ -5087,12 +5152,14 @@
     30186@@ -5087,12 +5160,14 @@
    2865830187 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
    2865930188            if ((p_confirm || cmdmod.confirm) && curbuf->b_fname != NULL)
     
    2867330202                if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 1) == VIM_YES)
    2867430203                    return OK;
    28675 @@ -5263,7 +5330,9 @@
     30204@@ -5262,8 +5337,11 @@
     30205 } command_complete[] =
    2867630206 {
    2867730207     {EXPAND_AUGROUP, "augroup"},
     30208+    {EXPAND_BEHAVE, "behave"},
    2867830209     {EXPAND_BUFFERS, "buffer"},
    2867930210+    {EXPAND_COLORS, "color"},
     
    2868330214     {EXPAND_CSCOPE, "cscope"},
    2868430215 #endif
    28685 @@ -5276,10 +5345,15 @@
     30216@@ -5276,10 +5354,18 @@
    2868630217     {EXPAND_EVENTS, "event"},
    2868730218     {EXPAND_EXPRESSION, "expression"},
     
    2869230223     {EXPAND_HELP, "help"},
    2869330224     {EXPAND_HIGHLIGHT, "highlight"},
     30225+#if defined(FEAT_CMDHIST)
     30226+    {EXPAND_HISTORY, "history"},
     30227+#endif
    2869430228+#if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
    28695 +        && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE))
     30229+       && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE))
    2869630230+    {EXPAND_LOCALES, "locale"},
    2869730231+#endif
     
    2869930233     {EXPAND_MENUS, "menu"},
    2870030234     {EXPAND_OWNSYNTAX, "syntax"},
    28701 @@ -5587,6 +5661,7 @@
     30235@@ -5587,6 +5673,7 @@
    2870230236     int            compl = EXPAND_NOTHING;
    2870330237     char_u  *compl_arg = NULL;
     
    2870730241     p = eap->arg;
    2870830242 
    28709 @@ -5612,6 +5687,7 @@
     30243@@ -5612,6 +5699,7 @@
    2871030244        return;
    2871130245     }
     
    2871530249     /* If there is nothing after the name, and no attributes were specified,
    2871630250      * we are listing commands
    28717 @@ -5626,6 +5702,13 @@
     30251@@ -5626,6 +5714,13 @@
    2871830252        EMSG(_("E183: User defined commands must start with an uppercase letter"));
    2871930253        return;
     
    2872930263        uc_add_command(name, end - name, p, argt, def, flags, compl, compl_arg,
    2873030264                                                                eap->forceit);
    28731 @@ -5888,7 +5971,14 @@
     30265@@ -5888,7 +5983,14 @@
    2873230266            result = STRLEN(eap->arg) + 2;
    2873330267            for (p = eap->arg; *p; ++p)
     
    2874530279            }
    2874630280 
    28747 @@ -5897,7 +5987,14 @@
     30281@@ -5897,7 +5999,14 @@
    2874830282                *buf++ = '"';
    2874930283                for (p = eap->arg; *p; ++p)
     
    2876130295                    *buf++ = *p;
    2876230296                }
    28763 @@ -6039,15 +6136,17 @@
     30297@@ -6039,15 +6148,17 @@
    2876430298                end = vim_strchr(start + 1, '>');
    2876530299            if (buf != NULL)
     
    2878230316                     * do_cmdline() doesn't handle that, so convert it back.
    2878330317                     * Also change K_SPECIAL KS_EXTRA KE_CSI into CSI. */
    28784 @@ -6439,7 +6538,7 @@
     30318@@ -6439,7 +6550,7 @@
    2878530319 {
    2878630320 # ifdef FEAT_CMDWIN
     
    2879130325 # endif
    2879230326        if (!text_locked()
    28793 @@ -6897,9 +6996,7 @@
     30327@@ -6897,9 +7008,7 @@
    2879430328 # ifdef FEAT_WINDOWS
    2879530329        if (win_split(0, 0) == FAIL)
     
    2880230336        /* When splitting the window, create a new alist.  Otherwise the
    2880330337         * existing one is overwritten. */
    28804 @@ -7026,7 +7123,7 @@
     30338@@ -7026,7 +7135,7 @@
    2880530339        old_arg_count = GARGCOUNT;
    2880630340        if (expand_wildcards(old_arg_count, old_arg_files,
     
    2881130345        {
    2881230346            alist_set(&global_alist, new_arg_file_count, new_arg_files,
    28813 @@ -7299,7 +7396,9 @@
     30347@@ -7299,7 +7408,9 @@
    2881430348                || cmdmod.browse
    2881530349 #  endif
     
    2882230356            do_check_scrollbind(FALSE);
    2882330357 # endif
    28824 @@ -8122,6 +8221,12 @@
     30358@@ -8122,6 +8233,12 @@
    2882530359     {
    2882630360        ui_delay(msec - done > 1000L ? 1000L : msec - done, TRUE);
     
    2883530369 }
    2883630370 
    28837 @@ -8193,7 +8298,7 @@
     30371@@ -8193,7 +8310,7 @@
    2883830372     p = skipwhite(p);
    2883930373     if (*p != NUL && *p != '"' && eap->nextcmd == NULL)
     
    2884430378        /* Pass flags on for ":vertical wincmd ]". */
    2884530379        postponed_split_flags = cmdmod.split;
    28846 @@ -8907,35 +9012,42 @@
     30380@@ -8907,35 +9024,42 @@
    2884730381                failed = TRUE;
    2884830382            if (eap->cmdidx == CMD_mksession)
     
    2891130445            }
    2891230446            else
    28913 @@ -8966,10 +9078,15 @@
     30447@@ -8966,10 +9090,15 @@
    2891430448        else if (eap->cmdidx == CMD_mksession)
    2891530449        {
     
    2893030464 #endif
    2893130465 #ifdef MKSESSION_NL
    28932 @@ -9295,7 +9412,7 @@
     30466@@ -9295,7 +9424,7 @@
    2893330467                                                                  && !got_int)
    2893430468     {
     
    2893930473 }
    2894030474 #endif
    28941 @@ -9393,7 +9510,7 @@
     30475@@ -9393,7 +9522,7 @@
    2894230476 ex_ptag(eap)
    2894330477     exarg_T    *eap;
     
    2894830482 }
    2894930483 
    28950 @@ -9525,17 +9642,23 @@
     30484@@ -9525,17 +9654,23 @@
    2895130485 #define SPEC_CFILE  4
    2895230486                    "<sfile>",          /* ":so" file name */
     
    2897630510     };
    2897730511 
    28978 @@ -9560,6 +9683,7 @@
     30512@@ -9560,6 +9695,7 @@
    2897930513  *       '<cWORD>' to WORD under the cursor
    2898030514  *       '<cfile>' to path name under the cursor
     
    2898430518  *       '<abuf>'  to buffer number for autocommand
    2898530519  *       '<amatch>' to matching name for autocommand
    28986 @@ -9591,10 +9715,7 @@
     30520@@ -9591,10 +9727,7 @@
    2898730521 #ifdef FEAT_MODIFY_FNAME
    2898830522     int                skip_mod = FALSE;
     
    2899530529     *errormsg = NULL;
    2899630530     if (escaped != NULL)
    28997 @@ -9653,14 +9774,7 @@
     30531@@ -9653,14 +9786,7 @@
    2899830532                    valid = 0;      /* Must have ":p:h" to be valid */
    2899930533                }
     
    2901030544 
    2901130545        case SPEC_HASH:         /* '#' or "#99": alternate file */
    29012 @@ -9783,6 +9897,15 @@
     30546@@ -9783,6 +9909,15 @@
    2901330547                    return NULL;
    2901430548                }
     
    2902630560        case SPEC_CLIENT:       /* Source of last submitted input */
    2902730561                sprintf((char *)strbuf, PRINTF_HEX_LONG_U,
    29028 @@ -9796,11 +9919,7 @@
     30562@@ -9796,11 +9931,7 @@
    2902930563        if (src[*usedlen] == '<')       /* remove the file name extension */
    2903030564        {
     
    2903830572        }
    2903930573 #ifdef FEAT_MODIFY_FNAME
    29040 @@ -10645,7 +10764,7 @@
     30574@@ -10645,7 +10776,7 @@
    2904130575     unsigned   *flagp;
    2904230576 {
     
    2904730581 
    2904830582     if (gap->ga_len == 0)
    29049 @@ -10660,11 +10779,19 @@
     30583@@ -10660,11 +10791,19 @@
    2905030584        {
    2905130585            if (fullname)
     
    2906930603     }
    2907030604     return put_eol(fd);
    29071 @@ -10707,7 +10834,7 @@
     30605@@ -10707,7 +10846,7 @@
    2907230606  * Write a file name to the session file.
    2907330607  * Takes care of the "slash" option in 'sessionoptions' and escapes special
     
    2907830612     static int
    2907930613 ses_put_fname(fd, name, flagp)
    29080 @@ -10716,49 +10843,32 @@
     30614@@ -10716,49 +10855,32 @@
    2908130615     unsigned   *flagp;
    2908230616 {
     
    2914830682 }
    2914930683 
    29150 @@ -10826,8 +10936,7 @@
     30684@@ -10826,8 +10948,7 @@
    2915130685            else if (vim_ispathsep(*p))
    2915230686            {
     
    2915830692                    *s++ = '-';
    2915930693                else
    29160 @@ -10910,7 +11019,7 @@
     30694@@ -10910,7 +11031,7 @@
    2916130695 
    2916230696 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) || defined(PROTO)
     
    2916730701  */
    2916830702     void
    29169 @@ -10921,7 +11030,7 @@
     30703@@ -10921,7 +11042,7 @@
    2917030704 {
    2917130705     if (fname == NULL)
     
    2917730711 
    2917830712diff -Naur vim73.orig/src/ex_getln.c vim73/src/ex_getln.c
    29179 --- vim73.orig/src/ex_getln.c   2012-02-15 21:57:45.065436261 +0000
    29180 +++ vim73/src/ex_getln.c        2012-02-15 21:57:46.881484161 +0000
     30713--- vim73.orig/src/ex_getln.c   2012-06-03 23:09:52.956007482 +0000
     30714+++ vim73/src/ex_getln.c        2012-06-03 23:09:55.884085403 +0000
     30715@@ -25,7 +25,7 @@
     30716     int                cmdlen;         /* number of chars in command line */
     30717     int                cmdpos;         /* current cursor position */
     30718     int                cmdspos;        /* cursor column on screen */
     30719-    int                cmdfirstc;      /* ':', '/', '?', '=' or NUL */
     30720+    int                cmdfirstc;      /* ':', '/', '?', '=', '>' or NUL */
     30721     int                cmdindent;      /* number of spaces before cmdline */
     30722     char_u     *cmdprompt;     /* message in front of cmdline */
     30723     int                cmdattr;        /* attributes for prompt */
    2918130724@@ -67,7 +67,7 @@
    2918230725 
     
    2918830731 static int     calc_hist_idx __ARGS((int histype, int num));
    2918930732 # endif
    29190 @@ -110,7 +110,7 @@
     30733@@ -110,7 +110,10 @@
    2919130734 static int     expand_showtail __ARGS((expand_T *xp));
    2919230735 #ifdef FEAT_CMDL_COMPL
     
    2919430737-static int     ExpandRTDir __ARGS((char_u *pat, int *num_file, char_u ***file, char *dirname));
    2919530738+static int     ExpandRTDir __ARGS((char_u *pat, int *num_file, char_u ***file, char *dirname[]));
     30739+# ifdef FEAT_CMDHIST
     30740+static char_u  *get_history_arg __ARGS((expand_T *xp, int idx));
     30741+# endif
    2919630742 # if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL)
    2919730743 static int     ExpandUserDefined __ARGS((expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file));
    2919830744 static int     ExpandUserList __ARGS((expand_T *xp, int *num_file, char_u ***file));
    29199 @@ -121,6 +121,14 @@
     30745@@ -121,6 +124,14 @@
    2920030746 static int     ex_window __ARGS((void));
    2920130747 #endif
     
    2921230758  * getcmdline() - accept a command line starting with firstc.
    2921330759  *
    29214 @@ -637,7 +645,11 @@
     30760@@ -637,7 +648,11 @@
    2921530761                }
    2921630762                else if (ccline.cmdpos > i)
     
    2922430770        }
    2922530771 
    29226 @@ -688,28 +700,35 @@
     30772@@ -688,28 +703,35 @@
    2922730773                    p = get_expr_line();
    2922830774                    --textlock;
     
    2927730823 #endif
    2927830824            else
    29279 @@ -1962,8 +1981,12 @@
     30825@@ -1833,8 +1855,11 @@
     30826 # endif
     30827                )
     30828            /* Always redraw the whole command line to fix shaping and
     30829-            * right-left typing.  Not efficient, but it works. */
     30830-           redrawcmd();
     30831+            * right-left typing.  Not efficient, but it works.
     30832+            * Do it only when there are no characters left to read
     30833+            * to avoid useless intermediate redraws. */
     30834+           if (vpeekc() == NUL)
     30835+               redrawcmd();
     30836 #endif
     30837     }
     30838 
     30839@@ -1962,8 +1987,12 @@
    2928030840 # endif
    2928130841     s = getcmdline(firstc, 1L, 0);
     
    2929230852     return s;
    2929330853 }
    29294 @@ -2342,15 +2365,31 @@
     30854@@ -2342,15 +2371,31 @@
    2929530855        windgoto(msg_row, msg_col);
    2929630856        pend = (char_u *)(line_ga.ga_data) + line_ga.ga_len;
     
    2933330893     }
    2933430894 
    29335 @@ -2843,6 +2882,7 @@
     30895@@ -2843,6 +2888,7 @@
    2933630896        {
    2933730897            msg_no_more = TRUE;
     
    2934130901            /* Avoid clearing the rest of the line too often. */
    2934230902            if (cmdline_row != i || ccline.overstrike)
    29343 @@ -3023,7 +3063,7 @@
     30903@@ -3023,7 +3069,7 @@
    2934430904            int     len;
    2934530905 
     
    2935030910 #ifdef FEAT_MBYTE
    2935130911                if (has_mbyte)
    29352 @@ -3041,7 +3081,7 @@
     30912@@ -3041,7 +3087,7 @@
    2935330913                    --w;
    2935430914                }
     
    2935930919                p += len;
    2936030920        }
    29361 @@ -3258,6 +3298,24 @@
     30921@@ -3258,6 +3304,24 @@
    2936230922     return check_abbr(c, ccline.cmdbuff, ccline.cmdpos, 0);
    2936330923 }
     
    2938430944  * Return FAIL if this is not an appropriate context in which to do
    2938530945  * completion of anything, return OK if it is (even if there are no matches).
    29386 @@ -3316,10 +3374,14 @@
     30946@@ -3316,10 +3380,14 @@
    2938730947            p2 = NULL;
    2938830948        else
     
    2940130961            /* longest match: make sure it is not shorter, happens with :help */
    2940230962            if (p2 != NULL && type == WILD_LONGEST)
    29403 @@ -3405,6 +3467,7 @@
     30963@@ -3396,6 +3464,7 @@
     30964  * mode = WILD_PREV:       use previous match in multiple match, wrap to first
     30965  * mode = WILD_ALL:        return all matches concatenated
     30966  * mode = WILD_LONGEST:            return longest matched part
     30967+ * mode = WILD_ALL_KEEP:    get all matches, keep matches
     30968  *
     30969  * options = WILD_LIST_NOTFOUND:    list entries without a match
     30970  * options = WILD_HOME_REPLACE:            do home_replace() for buffer names
     30971@@ -3405,6 +3474,7 @@
    2940430972  * options = WILD_KEEP_ALL:        don't remove 'wildignore' entries
    2940530973  * options = WILD_SILENT:          don't print warning messages
     
    2940930977  * The variables xp->xp_context and xp->xp_backslash must have been set!
    2941030978  */
    29411 @@ -3674,6 +3737,7 @@
     30979@@ -3518,7 +3588,8 @@
     30980            /*
     30981             * Check for matching suffixes in file names.
     30982             */
     30983-           if (mode != WILD_ALL && mode != WILD_LONGEST)
     30984+           if (mode != WILD_ALL && mode != WILD_ALL_KEEP
     30985+                                                     && mode != WILD_LONGEST)
     30986            {
     30987                if (xp->xp_numfiles)
     30988                    non_suf_match = xp->xp_numfiles;
     30989@@ -3674,6 +3745,7 @@
    2941230990     if (options & WILD_ESCAPE)
    2941330991     {
     
    2941730995                || xp->xp_context == EXPAND_BUFFERS
    2941830996                || xp->xp_context == EXPAND_DIRECTORIES)
    29419 @@ -4338,6 +4402,7 @@
     30997@@ -4338,6 +4410,7 @@
    2942030998     char_u     ***matches;     /* return: array of pointers to matches */
    2942130999 {
     
    2942531003     if (xp->xp_context == EXPAND_UNSUCCESSFUL)
    2942631004     {
    29427 @@ -4356,9 +4421,11 @@
     31005@@ -4356,9 +4429,11 @@
    2942831006     if (file_str == NULL)
    2942931007        return EXPAND_UNSUCCESSFUL;
     
    2943931017        *matchcount = 0;
    2944031018        *matches = NULL;
    29441 @@ -4410,7 +4477,7 @@
     31019@@ -4410,7 +4485,7 @@
    2944231020     char_u     *pat;
    2944331021     int                *num_file;
     
    2944831026 #ifdef FEAT_CMDL_COMPL
    2944931027     regmatch_T regmatch;
    29450 @@ -4464,6 +4531,9 @@
     31028@@ -4464,6 +4539,9 @@
    2945131029            flags |= (EW_FILE | EW_PATH);
    2945231030        else
     
    2945831036        ret = expand_wildcards_eval(&pat, num_file, file, flags);
    2945931037        if (free_pat)
    29460 @@ -4501,13 +4571,25 @@
     31038@@ -4501,13 +4579,25 @@
    2946131039            || xp->xp_context == EXPAND_TAGS_LISTFILES)
    2946231040        return expand_tags(xp->xp_context == EXPAND_TAGS, pat, num_file, file);
     
    2948831066     if (xp->xp_context == EXPAND_USER_LIST)
    2948931067        return ExpandUserList(xp, num_file, file);
    29490 @@ -4536,48 +4618,50 @@
     31068@@ -4536,48 +4626,53 @@
    2949131069            int         context;
    2949231070            char_u      *((*func)__ARGS((expand_T *, int)));
     
    2949931077+           {EXPAND_COMMANDS, get_command_name, FALSE, TRUE},
    2950031078+           {EXPAND_BEHAVE, get_behave_arg, TRUE, TRUE},
     31079+#ifdef FEAT_CMDHIST
     31080+           {EXPAND_HISTORY, get_history_arg, TRUE, TRUE},
     31081+#endif
    2950131082 #ifdef FEAT_USR_CMDS
    2950231083-           {EXPAND_USER_COMMANDS, get_user_commands, FALSE},
     
    2956031141        int     i;
    2956131142 
    29562 @@ -4591,7 +4675,8 @@
     31143@@ -4591,7 +4686,8 @@
    2956331144            {
    2956431145                if (tab[i].ic)
     
    2957031151            }
    2957131152     }
    29572 @@ -4613,13 +4698,14 @@
     31153@@ -4613,13 +4709,14 @@
    2957331154  * Returns OK when no problems encountered, FAIL for error (out of memory).
    2957431155  */
     
    2958631167     int                i;
    2958731168     int                count = 0;
    29588 @@ -4644,7 +4730,10 @@
     31169@@ -4644,7 +4741,10 @@
    2958931170            {
    2959031171                if (round)
     
    2959831179 #ifdef FEAT_MENU
    2959931180                    if (func == get_menu_names && str != NULL)
    29600 @@ -4676,7 +4765,16 @@
     31181@@ -4676,7 +4776,16 @@
    2960131182 
    2960231183     /* Sort the results.  Keep menu's in the specified order. */
     
    2961631197 #ifdef FEAT_CMDL_COMPL
    2961731198     /* Reset the variables used for special highlight names expansion, so that
    29618 @@ -4728,7 +4826,11 @@
     31199@@ -4728,7 +4837,11 @@
    2961931200                            || (pat[1] == '.' && vim_ispathsep(pat[2])))))
    2962031201        path = (char_u *)".";
     
    2962831209     /*
    2962931210      * Go over all directories in $PATH.  Expand matches in that directory and
    29630 @@ -4949,57 +5051,68 @@
     31211@@ -4949,57 +5062,68 @@
    2963131212 /*
    2963231213  * Expand color scheme, compiler or filetype names:
     
    2972731308 
    2972831309     *file = ga.ga_data;
    29729 @@ -5220,13 +5333,15 @@
     31310@@ -5127,6 +5251,34 @@
     31311     NULL
     31312 };
     31313 
     31314+#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
     31315+/*
     31316+ * Function given to ExpandGeneric() to obtain the possible first
     31317+ * arguments of the ":history command.
     31318+ */
     31319+    static char_u *
     31320+get_history_arg(xp, idx)
     31321+    expand_T   *xp UNUSED;
     31322+    int                idx;
     31323+{
     31324+    static char_u compl[2] = { NUL, NUL };
     31325+    char *short_names = ":=@>?/";
     31326+    int short_names_count = (int)STRLEN(short_names);
     31327+    int history_name_count = sizeof(history_names) / sizeof(char *) - 1;
     31328+
     31329+    if (idx < short_names_count)
     31330+    {
     31331+       compl[0] = (char_u)short_names[idx];
     31332+       return compl;
     31333+    }
     31334+    if (idx < short_names_count + history_name_count)
     31335+       return (char_u *)history_names[idx - short_names_count];
     31336+    if (idx == short_names_count + history_name_count)
     31337+       return (char_u *)"all";
     31338+    return NULL;
     31339+}
     31340+#endif
     31341+
     31342 /*
     31343  * init_history() - Initialize the command line history.
     31344  * Also used to re-allocate the history when the size changes.
     31345@@ -5220,13 +5372,15 @@
    2973031346  * If 'move_to_front' is TRUE, matching entry is moved to end of history.
    2973131347  */
     
    2974431360     if (hisidx[type] < 0)
    2974531361        return FALSE;
    29746 @@ -5235,7 +5350,12 @@
     31362@@ -5235,7 +5389,12 @@
    2974731363     {
    2974831364        if (history[type][i].hisstr == NULL)
     
    2975831374            if (!move_to_front)
    2975931375                return TRUE;
    29760 @@ -5329,7 +5449,7 @@
     31376@@ -5329,7 +5488,7 @@
    2976131377        }
    2976231378        last_maptick = -1;
     
    2976731383        if (++hisidx[histype] == hislen)
    2976831384            hisidx[histype] = 0;
    29769 @@ -5803,7 +5923,7 @@
     31385@@ -5803,7 +5962,7 @@
    2977031386                                                              hist[i].hisnum);
    2977131387                    if (vim_strsize(hist[i].hisstr) > (int)Columns - 10)
     
    2977631392                        STRCAT(IObuff, hist[i].hisstr);
    2977731393                    msg_outtrans(IObuff);
    29778 @@ -5907,8 +6027,10 @@
     31394@@ -5907,8 +6066,10 @@
    2977931395        val = viminfo_readstring(virp, 1, TRUE);
    2978031396        if (val != NULL && *val != NUL)
     
    2978831404                /* Need to re-allocate to append the separator byte. */
    2978931405                len = STRLEN(val);
    29790 @@ -5920,7 +6042,7 @@
     31406@@ -5920,7 +6081,7 @@
    2979131407                        /* Search entry: Move the separator from the first
    2979231408                         * column to after the NUL. */
     
    2979731413                    else
    2979831414                    {
    29799 @@ -6147,9 +6269,7 @@
     31415@@ -6147,9 +6308,7 @@
    2980031416     curwin->w_p_rl = cmdmsg_rl;
    2980131417     cmdmsg_rl = FALSE;
     
    2980831424 # ifdef FEAT_AUTOCMD
    2980931425     /* Do execute autocommands for setting the filetype (load syntax). */
    29810 @@ -6287,6 +6407,12 @@
     31426@@ -6287,6 +6446,12 @@
    2981131427            ccline.cmdbuff = vim_strsave((char_u *)"qa");
    2981231428            cmdwin_result = CAR;
     
    2982131437            ccline.cmdbuff = vim_strsave(ml_get_curline());
    2982231438        if (ccline.cmdbuff == NULL)
     31439@@ -6317,7 +6482,7 @@
     31440        /* win_close() may have already wiped the buffer when 'bh' is
     31441         * set to 'wipe' */
     31442        if (buf_valid(bp))
     31443-           close_buffer(NULL, bp, DOBUF_WIPE);
     31444+           close_buffer(NULL, bp, DOBUF_WIPE, FALSE);
     31445 
     31446        /* Restore window sizes. */
     31447        win_size_restore(&winsizes);
    2982331448diff -Naur vim73.orig/src/feature.h vim73/src/feature.h
    29824 --- vim73.orig/src/feature.h    2012-02-15 21:57:45.061436156 +0000
    29825 +++ vim73/src/feature.h 2012-02-15 21:57:46.553475509 +0000
     31449--- vim73.orig/src/feature.h    2012-06-03 23:09:52.952007375 +0000
     31450+++ vim73/src/feature.h 2012-06-03 23:09:55.760082103 +0000
    2982631451@@ -506,15 +506,6 @@
    2982731452 #endif
     
    2987831503 #endif
    2987931504 #if !defined(FEAT_MOUSE) && (defined(FEAT_MOUSE_TTY) || defined(FEAT_GUI))
     31505@@ -1312,3 +1316,11 @@
     31506 #ifdef FEAT_NORMAL
     31507 # define FEAT_PERSISTENT_UNDO
     31508 #endif
     31509+
     31510+/*
     31511+ * +filterpipe
     31512+ */
     31513+#if (defined(UNIX) && !defined(USE_SYSTEM)) \
     31514+           || (defined(WIN3264) && defined(FEAT_GUI_W32))
     31515+# define FEAT_FILTERPIPE
     31516+#endif
    2988031517diff -Naur vim73.orig/src/fileio.c vim73/src/fileio.c
    29881 --- vim73.orig/src/fileio.c     2012-02-15 21:57:45.041435628 +0000
    29882 +++ vim73/src/fileio.c  2012-02-15 21:57:46.961486271 +0000
     31518--- vim73.orig/src/fileio.c     2012-06-03 23:09:52.924006631 +0000
     31519+++ vim73/src/fileio.c  2012-06-03 23:09:55.800083168 +0000
    2988331520@@ -11,14 +11,6 @@
    2988431521  * fileio.c: read from and write to a file
     
    2999331630     /* When reloading a buffer put the cursor at the first line that is
    2999431631      * different. */
    29995 @@ -2658,13 +2648,17 @@
     31632@@ -2658,10 +2648,10 @@
    2999631633                                                            FALSE, NULL, eap);
    2999731634        if (msg_scrolled == n)
     
    3000631643 #endif
    3000731644 
    30008 +    /* Reset now, following writes should not omit the EOL.  Also, the line
    30009 +     * number will become invalid because of edits. */
    30010 +    curbuf->b_no_eol_lnum = 0;
    30011 +
    30012      if (recoverymode && error)
    30013         return FAIL;
    30014      return OK;
    30015 @@ -3202,6 +3196,9 @@
     31645@@ -3202,6 +3192,9 @@
    3001631646     int                    write_undo_file = FALSE;
    3001731647     context_sha256_T sha_ctx;
     
    3002331653     if (fname == NULL || *fname == NUL)        /* safety check */
    3002431654        return FAIL;
    30025 @@ -3345,8 +3342,22 @@
     31655@@ -3345,8 +3338,22 @@
    3002631656        }
    3002731657        else if (reset_changed && whole)
     
    3004831678 #ifdef FEAT_QUICKFIX
    3004931679                if (overwriting && bt_nofile(curbuf))
    30050 @@ -3799,13 +3810,7 @@
     31680@@ -3799,13 +3806,7 @@
    3005131681 
    3005231682        /* make sure we have a valid backup extension to use */
     
    3006231692            backup_ext = p_bex;
    3006331693 
    30064 @@ -4000,7 +4005,7 @@
     31694@@ -4000,7 +4001,7 @@
    3006531695 #ifdef HAS_BW_FLAGS
    3006631696                        write_info.bw_flags = FIO_NOCONVERT;
     
    3007131701                        {
    3007231702                            if (buf_write_bytes(&write_info) == FAIL)
    30073 @@ -4568,7 +4573,7 @@
     31703@@ -4568,7 +4569,7 @@
    3007431704        if (end == 0
    3007531705                || (lnum == end
     
    3008031710        {
    3008131711            ++lnum;                     /* written the line, count it */
    30082 @@ -4719,11 +4724,6 @@
     31712@@ -4719,11 +4720,6 @@
    3008331713 #endif
    3008431714     if (perm >= 0)             /* set perm. of new file same as old file */
     
    3009231722     /* Probably need to set the ACL before changing the user (can't set the
    3009331723      * ACL on a file the user doesn't own). */
    30094 @@ -4731,6 +4731,7 @@
     31724@@ -4731,6 +4727,7 @@
    3009531725        mch_set_acl(wfname, acl);
    3009631726 #endif
     
    3010031730        crypt_pop_state();
    3010131731 #endif
    30102 @@ -4813,7 +4814,7 @@
     31732@@ -4813,7 +4810,7 @@
    3010331733 #ifdef HAS_BW_FLAGS
    3010431734                        write_info.bw_flags = FIO_NOCONVERT;
     
    3010931739                            if (buf_write_bytes(&write_info) == FAIL)
    3011031740                                break;
    30111 @@ -4885,7 +4886,10 @@
     31741@@ -4885,7 +4882,10 @@
    3011231742 #ifdef FEAT_CRYPT
    3011331743        if (wb_flags & FIO_ENCRYPTED)
     
    3012131751        }
    3012231752 #endif
    30123 @@ -5094,8 +5098,6 @@
     31753@@ -5094,7 +5094,7 @@
    3012431754     {
    3012531755        aco_save_T      aco;
    3012631756 
    3012731757-       write_no_eol_lnum = 0;  /* in case it was set by the previous read */
    30128 -
     31758+       curbuf->b_no_eol_lnum = 0;  /* in case it was set by the previous read */
     31759 
    3012931760        /*
    3013031761         * Apply POST autocommands.
    30131          * Careful: The autocommands may call buf_write() recursively!
    30132 @@ -5330,7 +5332,7 @@
     31762@@ -5330,7 +5330,7 @@
    3013331763 
    3013431764 /*
     
    3013931769  * Return FAIL for failure, OK otherwise.
    3014031770  */
    30141 @@ -5702,16 +5704,8 @@
     31771@@ -5702,16 +5702,8 @@
    3014231772        crypt_encode(buf, len, buf);
    3014331773 #endif
     
    3015831788 
    3015931789 #ifdef FEAT_MBYTE
    30160 @@ -6024,15 +6018,19 @@
     31790@@ -6024,15 +6016,19 @@
    3016131791 shorten_fname1(full_path)
    3016231792     char_u     *full_path;
     
    3017931809 }
    3018031810 #endif
    30181 @@ -6259,19 +6257,17 @@
     31811@@ -6259,19 +6255,17 @@
    3018231812      */
    3018331813     for (ptr = retval + fnamelen; ptr > retval; mb_ptr_back(retval, ptr))
     
    3020331833        {
    3020431834            ++ptr;
    30205 @@ -6306,23 +6302,14 @@
     31835@@ -6306,23 +6300,14 @@
    3020631836        if (fname == NULL || *fname == NUL
    3020731837                                   || vim_ispathsep(fname[STRLEN(fname) - 1]))
     
    3022731857            if ((size_t)(s - ptr) > (size_t)8)
    3022831858            {
    30229 @@ -6334,13 +6321,8 @@
     31859@@ -6334,13 +6319,8 @@
    3023031860         * If the extension doesn't start with '.', and the file name
    3023131861         * doesn't have an extension yet, append a '.'
     
    3024131871         * If the extension doesn't start with '.', and there already is an
    3024231872         * extension, it may need to be truncated
    30243 @@ -6368,23 +6350,14 @@
     31873@@ -6368,23 +6348,14 @@
    3024431874     /*
    3024531875      * Prepend the dot.
     
    3026631896 #endif
    3026731897 
    30268 @@ -6552,6 +6525,21 @@
     31898@@ -6552,6 +6523,21 @@
    3026931899            use_tmp_file = TRUE;
    3027031900     }
     
    3028831918 #if defined(UNIX) || defined(CASE_INSENSITIVE_FILENAME)
    3028931919     if (use_tmp_file)
    30290 @@ -6662,8 +6650,8 @@
     31920@@ -6662,8 +6648,8 @@
    3029131921        return -1;
    3029231922     }
     
    3029931929            errmsg = _("E208: Error writing to \"%s\"");
    3030031930            break;
    30301 @@ -7024,7 +7012,7 @@
     31931@@ -7024,7 +7010,7 @@
    3030231932                    STRCAT(tbuf, mesg2);
    3030331933                }
     
    3030831938            }
    3030931939            else
    30310 @@ -7272,8 +7260,8 @@
     31940@@ -7272,8 +7258,8 @@
    3031131941 write_lnum_adjust(offset)
    3031231942     linenr_T   offset;
     
    3031931949 
    3032031950 #if defined(TEMPDIRNAMES) || defined(PROTO)
    30321 @@ -7475,7 +7463,10 @@
     31951@@ -7475,7 +7461,10 @@
    3032231952 
    3032331953     STRCPY(itmp, "");
     
    3033131961     buf4[2] = extra_char;   /* make it "VIa", "VIb", etc. */
    3033231962     if (GetTempFileName(szTempFile, buf4, 0, itmp) == 0)
    30333 @@ -7496,8 +7487,11 @@
     31963@@ -7496,8 +7485,11 @@
    3033431964 # else /* WIN3264 */
    3033531965 
     
    3034431974 #  else
    3034531975     char_u     *p;
    30346 @@ -7682,6 +7676,7 @@
     31976@@ -7682,6 +7674,7 @@
    3034731977     {"InsertChange",   EVENT_INSERTCHANGE},
    3034831978     {"InsertEnter",    EVENT_INSERTENTER},
     
    3035231982     {"QuickFixCmdPost",        EVENT_QUICKFIXCMDPOST},
    3035331983     {"QuickFixCmdPre", EVENT_QUICKFIXCMDPRE},
    30354 @@ -8744,6 +8739,8 @@
     31984@@ -8744,6 +8737,8 @@
    3035531985     int                retval;
    3035631986     aco_save_T aco;
     
    3036131991     /*
    3036231992      * This is a bit tricky: For some commands curwin->w_buffer needs to be
    30363 @@ -8760,11 +8757,15 @@
     31993@@ -8760,11 +8755,15 @@
    3036431994            aucmd_prepbuf(&aco, buf);
    3036531995 
     
    3038132011            /* restore the current window */
    3038232012            aucmd_restbuf(&aco);
    30383 @@ -8779,6 +8780,23 @@
     32013@@ -8779,6 +8778,23 @@
    3038432014 }
    3038532015 
     
    3040532035  * Search for a visible window containing the current buffer.  If there isn't
    3040632036  * one then use "aucmd_win".
    30407 @@ -8903,10 +8921,11 @@
     32037@@ -8903,10 +8919,11 @@
    3040832038                    if (tp != curtab)
    3040932039                        goto_tabpage_tp(tp);
     
    3041832048        /* Remove the window and frame from the tree of frames. */
    3041932049        (void)winframe_remove(curwin, &dummy, NULL);
    30420 @@ -9063,7 +9082,10 @@
     32050@@ -8965,6 +8982,10 @@
     32051                    && buf_valid(aco->new_curbuf)
     32052                    && aco->new_curbuf->b_ml.ml_mfp != NULL)
     32053            {
     32054+# if defined(FEAT_SYN_HL) || defined(FEAT_SPELL)
     32055+               if (curwin->w_s == &curbuf->b_s)
     32056+                   curwin->w_s = &aco->new_curbuf->b_s;
     32057+# endif
     32058                --curbuf->b_nwindows;
     32059                curbuf = aco->new_curbuf;
     32060                curwin->w_buffer = curbuf;
     32061@@ -9063,7 +9084,10 @@
    3042132062 {
    3042232063     int                state;
     
    3043032071            && !ins_compl_active()
    3043132072 #endif
    30432 @@ -9954,6 +9976,8 @@
     32073@@ -9094,6 +9118,15 @@
     32074     return (first_autopat[(int)EVENT_CURSORMOVEDI] != NULL);
     32075 }
     32076 
     32077+/*
     32078+ * Return TRUE when there is an InsertCharPre autocommand defined.
     32079+ */
     32080+    int
     32081+has_insertcharpre()
     32082+{
     32083+    return (first_autopat[(int)EVENT_INSERTCHARPRE] != NULL);
     32084+}
     32085+
     32086     static int
     32087 apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
     32088     event_T    event;
     32089@@ -9954,6 +9987,8 @@
    3043332090            if ((c == ';' || c == '>') && match == FALSE)
    3043432091            {
     
    3043932096                *pattern = c;       /* Restore the terminator */
    3044032097                type_start = pattern + 1;
    30441 @@ -10181,19 +10205,11 @@
     32098@@ -10181,19 +10216,11 @@
    3044232099                    ++p;
    3044332100                break;
     
    3045932116                break;
    3046032117            case '\\':
    30461 @@ -10304,3 +10320,55 @@
     32118@@ -10304,3 +10331,55 @@
    3046232119     }
    3046332120     return reg_pat;
     
    3051632173+#endif
    3051732174diff -Naur vim73.orig/src/fold.c vim73/src/fold.c
    30518 --- vim73.orig/src/fold.c       2012-02-15 21:57:45.057436051 +0000
    30519 +++ vim73/src/fold.c    2012-02-15 21:57:46.765481102 +0000
     32175--- vim73.orig/src/fold.c       2012-06-03 23:09:52.944007163 +0000
     32176+++ vim73/src/fold.c    2012-06-03 23:09:55.544076354 +0000
    3052032177@@ -1033,10 +1033,10 @@
    3052132178  * Init the fold info in a new window.
     
    3056032217            mch_memmove(fp, nfp, (size_t)(sizeof(fold_T) * moved));
    3056132218            vim_free(nfp);
     32219@@ -3289,7 +3292,8 @@
     32220 /* put_folds() {{{2 */
     32221 #if defined(FEAT_SESSION) || defined(PROTO)
     32222 static int put_folds_recurse __ARGS((FILE *fd, garray_T *gap, linenr_T off));
     32223-static int put_foldopen_recurse __ARGS((FILE *fd, garray_T *gap, linenr_T off));
     32224+static int put_foldopen_recurse __ARGS((FILE *fd, win_T *wp, garray_T *gap, linenr_T off));
     32225+static int put_fold_open_close __ARGS((FILE *fd, fold_T *fp, linenr_T off));
     32226 
     32227 /*
     32228  * Write commands to "fd" to restore the manual folds in window "wp".
     32229@@ -3309,7 +3313,7 @@
     32230 
     32231     /* If some folds are manually opened/closed, need to restore that. */
     32232     if (wp->w_fold_manual)
     32233-       return put_foldopen_recurse(fd, &wp->w_folds, (linenr_T)0);
     32234+       return put_foldopen_recurse(fd, wp, &wp->w_folds, (linenr_T)0);
     32235 
     32236     return OK;
     32237 }
     32238@@ -3349,12 +3353,14 @@
     32239  * Returns FAIL when writing failed.
     32240  */
     32241     static int
     32242-put_foldopen_recurse(fd, gap, off)
     32243+put_foldopen_recurse(fd, wp, gap, off)
     32244     FILE       *fd;
     32245+    win_T      *wp;
     32246     garray_T   *gap;
     32247     linenr_T   off;
     32248 {
     32249     int                i;
     32250+    int                level;
     32251     fold_T     *fp;
     32252 
     32253     fp = (fold_T *)gap->ga_data;
     32254@@ -3364,27 +3370,60 @@
     32255        {
     32256            if (fp->fd_nested.ga_len > 0)
     32257            {
     32258-               /* open/close nested folds while this fold is open */
     32259+               /* open nested folds while this fold is open */
     32260                if (fprintf(fd, "%ld", fp->fd_top + off) < 0
     32261                        || put_eol(fd) == FAIL
     32262                        || put_line(fd, "normal zo") == FAIL)
     32263                    return FAIL;
     32264-               if (put_foldopen_recurse(fd, &fp->fd_nested, off + fp->fd_top)
     32265+               if (put_foldopen_recurse(fd, wp, &fp->fd_nested,
     32266+                                                            off + fp->fd_top)
     32267                        == FAIL)
     32268                    return FAIL;
     32269+               /* close the parent when needed */
     32270+               if (fp->fd_flags == FD_CLOSED)
     32271+               {
     32272+                   if (put_fold_open_close(fd, fp, off) == FAIL)
     32273+                       return FAIL;
     32274+               }
     32275+           }
     32276+           else
     32277+           {
     32278+               /* Open or close the leaf according to the window foldlevel.
     32279+                * Do not close a leaf that is already closed, as it will close
     32280+                * the parent. */
     32281+               level = foldLevelWin(wp, off + fp->fd_top);
     32282+               if ((fp->fd_flags == FD_CLOSED && wp->w_p_fdl >= level)
     32283+                       || (fp->fd_flags != FD_CLOSED && wp->w_p_fdl < level))
     32284+               if (put_fold_open_close(fd, fp, off) == FAIL)
     32285+                   return FAIL;
     32286            }
     32287-           if (fprintf(fd, "%ld", fp->fd_top + off) < 0
     32288-                   || put_eol(fd) == FAIL
     32289-                   || fprintf(fd, "normal z%c",
     32290-                                   fp->fd_flags == FD_CLOSED ? 'c' : 'o') < 0
     32291-                   || put_eol(fd) == FAIL)
     32292-               return FAIL;
     32293        }
     32294        ++fp;
     32295     }
     32296 
     32297     return OK;
     32298 }
     32299+
     32300+/* put_fold_open_close() {{{2 */
     32301+/*
     32302+ * Write the open or close command to "fd".
     32303+ * Returns FAIL when writing failed.
     32304+ */
     32305+    static int
     32306+put_fold_open_close(fd, fp, off)
     32307+    FILE       *fd;
     32308+    fold_T     *fp;
     32309+    linenr_T   off;
     32310+{
     32311+    if (fprintf(fd, "%ld", fp->fd_top + off) < 0
     32312+           || put_eol(fd) == FAIL
     32313+           || fprintf(fd, "normal z%c",
     32314+                          fp->fd_flags == FD_CLOSED ? 'c' : 'o') < 0
     32315+           || put_eol(fd) == FAIL)
     32316+       return FAIL;
     32317+
     32318+    return OK;
     32319+}
     32320 #endif /* FEAT_SESSION */
     32321 
     32322 /* }}}1 */
    3056232323diff -Naur vim73.orig/src/getchar.c vim73/src/getchar.c
    30563 --- vim73.orig/src/getchar.c    2012-02-15 21:57:45.061436156 +0000
    30564 +++ vim73/src/getchar.c 2012-02-15 21:57:46.909484899 +0000
     32324--- vim73.orig/src/getchar.c    2012-06-03 23:09:52.952007375 +0000
     32325+++ vim73/src/getchar.c 2012-06-03 23:09:55.936086788 +0000
    3056532326@@ -418,12 +418,12 @@
    3056632327 
     
    3066032421     static int
    3066132422 read_redo(init, old_redo)
     32423@@ -697,7 +723,7 @@
     32424     int                                c;
     32425 #ifdef FEAT_MBYTE
     32426     int                                n;
     32427-    char_u                     buf[MB_MAXBYTES];
     32428+    char_u                     buf[MB_MAXBYTES + 1];
     32429     int                                i;
     32430 #endif
     32431 
     32432@@ -1046,7 +1072,7 @@
     32433     int            c;
     32434 {
     32435 #ifdef FEAT_MBYTE
     32436-    char_u     buf[MB_MAXBYTES];
     32437+    char_u     buf[MB_MAXBYTES + 1];
     32438 #else
     32439     char_u     buf[4];
     32440 #endif
    3066232441@@ -1506,9 +1532,6 @@
    3066332442     }
     
    3067032449  * Get the next input character.
    3067132450  * Can return a special key or a multi-byte character.
     32451@@ -1524,7 +1547,7 @@
     32452     int                c, c2;
     32453 #ifdef FEAT_MBYTE
     32454     int                n;
     32455-    char_u     buf[MB_MAXBYTES];
     32456+    char_u     buf[MB_MAXBYTES + 1];
     32457     int                i;
     32458 #endif
     32459 
    3067232460@@ -2171,7 +2194,7 @@
    3067332461                                        if (!timedout)
     
    3103932827     if (p_verbose > 0)
    3104032828        last_set_msg(mp->m_script_ID);
    31041 @@ -4478,12 +4526,25 @@
     32829@@ -4287,11 +4335,7 @@
     32830     int                scol;           /* starting column of the abbr. */
     32831     int                j;
     32832     char_u     *s;
     32833-#ifdef FEAT_MBYTE
     32834     char_u     tb[MB_MAXBYTES + 4];
     32835-#else
     32836-    char_u     tb[4];
     32837-#endif
     32838     mapblock_T *mp;
     32839 #ifdef FEAT_LOCALMAP
     32840     mapblock_T *mp2;
     32841@@ -4304,8 +4348,9 @@
     32842 
     32843     if (typebuf.tb_no_abbr_cnt)        /* abbrev. are not recursive */
     32844        return FALSE;
     32845-    if ((KeyNoremap & (RM_NONE|RM_SCRIPT)) != 0)
     32846-       /* no remapping implies no abbreviation */
     32847+
     32848+    /* no remapping implies no abbreviation, except for CTRL-] */
     32849+    if ((KeyNoremap & (RM_NONE|RM_SCRIPT)) != 0 && c != Ctrl_RSB)
     32850        return FALSE;
     32851 
     32852     /*
     32853@@ -4478,12 +4523,25 @@
    3104232854 {
    3104332855     char_u     *res;
     
    3106532877     /* Forbid changing text or using ":normal" to avoid most of the bad side
    3106632878      * effects.  Also restore the cursor position. */
    31067 @@ -4493,16 +4554,23 @@
     32879@@ -4493,16 +4551,23 @@
    3106832880 #endif
    3106932881     set_vim_var_char(c);  /* set v:char to the typed character */
     
    3109032902     vim_free(p);
    3109132903 
    31092 @@ -4995,19 +5063,21 @@
     32904@@ -4995,19 +5060,21 @@
    3109332905     sourcing_name = save_name;
    3109432906 }
     
    3111732929     int                hash;
    3111832930     int                len, minlen;
    31119 @@ -5062,7 +5132,17 @@
     32931@@ -5062,7 +5129,17 @@
    3112032932                            minlen = mp->m_keylen - 3;
    3112132933                    }
     
    3113632948        }
    3113732949diff -Naur vim73.orig/src/globals.h vim73/src/globals.h
    31138 --- vim73.orig/src/globals.h    2012-02-15 21:57:45.061436156 +0000
    31139 +++ vim73/src/globals.h 2012-02-15 21:57:46.945485849 +0000
     32950--- vim73.orig/src/globals.h    2012-06-03 23:09:52.952007375 +0000
     32951+++ vim73/src/globals.h 2012-06-03 23:09:55.404072629 +0000
    3114032952@@ -113,9 +113,9 @@
    3114132953  * When '$' is included in 'cpoptions' option set:
     
    3120733019 EXTERN short disallow_gui      INIT(= FALSE);
    3120833020diff -Naur vim73.orig/src/gui.c vim73/src/gui.c
    31209 --- vim73.orig/src/gui.c        2012-02-15 21:57:45.041435628 +0000
    31210 +++ vim73/src/gui.c     2012-02-15 21:57:46.561475721 +0000
     33021--- vim73.orig/src/gui.c        2012-06-03 23:09:52.924006631 +0000
     33022+++ vim73/src/gui.c     2012-06-03 23:09:55.908086042 +0000
    3121133023@@ -37,6 +37,24 @@
    3121233024 static void gui_set_bg_color __ARGS((char_u *name));
     
    3123433046 
    3123533047 /*
    31236 @@ -59,42 +77,47 @@
     33048@@ -59,42 +77,53 @@
    3123733049 gui_start()
    3123833050 {
     
    3128433096+#endif
    3128533097+    {
     33098+#ifdef FEAT_GUI_GTK
     33099+       /* If there is 'f' in 'guioptions' and specify -g argument,
     33100+        * gui_mch_init_check() was not called yet.  */
     33101+       if (gui_mch_init_check() != OK)
     33102+           exit(1);
     33103+#endif
    3128633104+       gui_attempt_start();
    3128733105+    }
     
    3130433122 #ifdef FEAT_TITLE
    3130533123        set_title_defaults();           /* set 'title' and 'icon' again */
    31306 @@ -103,101 +126,217 @@
     33124@@ -103,101 +132,223 @@
    3130733125 
    3130833126     vim_free(old_term);
     
    3144333261+           status = gui_read_child_pipe(pipefd[0]);
    3144433262+           if (status == GUI_CHILD_FAILED)
    31445             {
    31446 -               /* The read returns when the child closes the pipe (or when
    31447 -                * the child dies for some reason). */
    31448 -               close(pipefd[1]);
    31449 -               ignored = (int)read(pipefd[0], &dummy, (size_t)1);
    31450 -               close(pipefd[0]);
     33263+           {
    3145133264+               /* The child failed to start the GUI, so the caller must
    3145233265+                * continue. There may be more error information written
     
    3145933272+               EMSG(_("E852: The child process failed to start the GUI"));
    3146033273+               return;
     33274+           }
     33275+           else if (status == GUI_CHILD_IO_ERROR)
     33276            {
     33277-               /* The read returns when the child closes the pipe (or when
     33278-                * the child dies for some reason). */
     33279-               close(pipefd[1]);
     33280-               ignored = (int)read(pipefd[0], &dummy, (size_t)1);
     33281-               close(pipefd[0]);
     33282+               pipe_error = TRUE;
    3146133283            }
    31462 +           else if (status == GUI_CHILD_IO_ERROR)
    31463 +           {
    31464 +               pipe_error = TRUE;
    31465 +           }
    3146633284+           /* else GUI_CHILD_OK: parent exit */
    3146733285+       }
     
    3149633314+    }
    3149733315+    /* Child */
     33316+
     33317+#ifdef FEAT_GUI_GTK
     33318+    /* Call gtk_init_check() here after fork(). See gui_init_check(). */
     33319+    if (gui_mch_init_check() != OK)
     33320+       exit(1);
     33321+#endif
    3149833322+
    3149933323+# if defined(HAVE_SETSID) || defined(HAVE_SETPGID)
     
    3159033414  * Call this when vim starts up, whether or not the GUI is started
    3159133415  */
    31592 @@ -1392,7 +1531,7 @@
     33416@@ -291,7 +442,17 @@
     33417 #ifdef ALWAYS_USE_GUI
     33418     result = OK;
     33419 #else
     33420+# ifdef FEAT_GUI_GTK
     33421+    /*
     33422+     * Note: Don't call gtk_init_check() before fork, it will be called after
     33423+     * the fork. When calling it before fork, it make vim hang for a while.
     33424+     * See gui_do_fork().
     33425+     * Use a simpler check if the GUI window can probably be opened.
     33426+     */
     33427+    result = gui.dofork ? gui_mch_early_init_check() : gui_mch_init_check();
     33428+# else
     33429     result = gui_mch_init_check();
     33430+# endif
     33431 #endif
     33432     return result;
     33433 }
     33434@@ -1392,7 +1553,7 @@
    3159333435     if (!gui.shell_created)
    3159433436        return;
     
    3159933441      * number of characters that fit in the maximized window. */
    3160033442     if (!mustset && gui_mch_maximized())
    31601 @@ -2146,7 +2285,7 @@
     33443@@ -2146,7 +2307,7 @@
    3160233444 
    3160333445     if (highlight_mask & (HL_INVERSE | HL_STANDOUT))
     
    3160833450 #else
    3160933451        gui_mch_set_fg_color(bg_color);
    31610 @@ -2155,7 +2294,7 @@
     33452@@ -2155,7 +2316,7 @@
    3161133453     }
    3161233454     else
     
    3161733459 #else
    3161833460        gui_mch_set_fg_color(fg_color);
    31619 @@ -2183,7 +2322,7 @@
     33461@@ -2183,7 +2344,7 @@
    3162033462     if (back != 0 && ((draw_flags & DRAW_BOLD) || (highlight_mask & HL_ITALIC)))
    3162133463        return FAIL;
     
    3162633468      * For GTK2, we don't need a different font for italic style. */
    3162733469     if (hl_mask_todo & HL_ITALIC)
    31628 @@ -2352,7 +2491,7 @@
     33470@@ -2352,7 +2513,7 @@
    3162933471     if (draw_sign)
    3163033472        /* Draw the sign on top of the spaces. */
     
    3163533477     if (multi_sign)
    3163633478        netbeans_draw_multisign_indicator(gui.row);
    31637 @@ -2975,26 +3114,11 @@
     33479@@ -2975,26 +3136,11 @@
    3163833480            did_clip = TRUE;
    3163933481        }
     
    3166333505        /* Always allow pasting */
    3166433506        if (button != MOUSE_MIDDLE)
    31665 @@ -4893,7 +5017,7 @@
     33507@@ -4893,7 +5039,7 @@
    3166633508                if (STRLEN(p) > 2000)
    3166733509                    STRCPY(p + 2000 - 14, "...(truncated)");
     
    3167333515        ga_clear(&error_ga);
    3167433516diff -Naur vim73.orig/src/gui.h vim73/src/gui.h
    31675 --- vim73.orig/src/gui.h        2012-02-15 21:57:45.041435628 +0000
    31676 +++ vim73/src/gui.h     2012-02-15 21:57:46.177465593 +0000
     33517--- vim73.orig/src/gui.h        2012-06-03 23:09:52.924006631 +0000
     33518+++ vim73/src/gui.h     2012-06-03 23:09:54.376045272 +0000
    3167733519@@ -52,10 +52,6 @@
    3167833520 # include <SegLoad.h>*/
     
    3173033572     PtWidget_t *vimTextArea;           /* PtRaw */
    3173133573diff -Naur vim73.orig/src/gui_athena.c vim73/src/gui_athena.c
    31732 --- vim73.orig/src/gui_athena.c 2012-02-15 21:57:45.057436051 +0000
    31733 +++ vim73/src/gui_athena.c      2012-02-15 21:57:45.553449133 +0000
     33574--- vim73.orig/src/gui_athena.c 2012-06-03 23:09:52.944007163 +0000
     33575+++ vim73/src/gui_athena.c      2012-06-03 23:09:53.612024941 +0000
    3173433576@@ -2117,13 +2117,14 @@
    3173533577 }
     
    3174933591     char_u             *p, *next;
    3175033592diff -Naur vim73.orig/src/gui_gtk.c vim73/src/gui_gtk.c
    31751 --- vim73.orig/src/gui_gtk.c    2012-02-15 21:57:45.061436156 +0000
    31752 +++ vim73/src/gui_gtk.c 2012-02-15 21:57:46.177465593 +0000
    31753 @@ -1268,7 +1268,8 @@
     33593--- vim73.orig/src/gui_gtk.c    2012-06-03 23:09:52.952007375 +0000
     33594+++ vim73/src/gui_gtk.c 2012-06-03 23:09:55.776082529 +0000
     33595@@ -90,6 +90,11 @@
     33596 static void entry_activate_cb(GtkWidget *widget, gpointer data);
     33597 static void entry_changed_cb(GtkWidget *entry, GtkWidget *dialog);
     33598 static void find_replace_cb(GtkWidget *widget, gpointer data);
     33599+static void recent_func_log_func(
     33600+       const gchar *log_domain,
     33601+       GLogLevelFlags log_level,
     33602+       const gchar *message,
     33603+       gpointer user_data);
     33604 
     33605 #if defined(FEAT_TOOLBAR)
     33606 /*
     33607@@ -839,6 +844,8 @@
     33608     GtkWidget          *fc;
     33609 #endif
     33610     char_u             dirbuf[MAXPATHL];
     33611+    guint              log_handler;
     33612+    const gchar                *domain = "Gtk";
     33613 
     33614     title = CONVERT_TO_UTF8(title);
     33615 
     33616@@ -853,6 +860,11 @@
     33617     /* If our pointer is currently hidden, then we should show it. */
     33618     gui_mch_mousehide(FALSE);
     33619 
     33620+    /* Hack: The GTK file dialog warns when it can't access a new file, this
     33621+     * makes it shut up. http://bugzilla.gnome.org/show_bug.cgi?id=664587 */
     33622+    log_handler = g_log_set_handler(domain, G_LOG_LEVEL_WARNING,
     33623+                                                 recent_func_log_func, NULL);
     33624+
     33625 #ifdef USE_FILE_CHOOSER
     33626     /* We create the dialog each time, so that the button text can be "Open"
     33627      * or "Save" according to the action. */
     33628@@ -916,6 +928,7 @@
     33629     gtk_widget_show(gui.filedlg);
     33630     gtk_main();
     33631 #endif
     33632+    g_log_remove_handler(domain, log_handler);
     33633 
     33634     CONVERT_TO_UTF8_FREE(title);
     33635     if (gui.browse_fname == NULL)
     33636@@ -1268,7 +1281,8 @@
    3175433637               char_u   *message,   /* message text */
    3175533638               char_u   *buttons,   /* names of buttons */
     
    3176133644     GtkWidget  *dialog;
    3176233645     GtkWidget  *entry = NULL;
    31763 @@ -1287,6 +1288,9 @@
     33646@@ -1287,6 +1301,9 @@
    3176433647        entry = gtk_entry_new();
    3176533648        gtk_widget_show(entry);
     
    3177133654        gtk_entry_set_text(GTK_ENTRY(entry), (const char *)text);
    3177233655        CONVERT_TO_UTF8_FREE(text);
    31773 @@ -1387,7 +1391,7 @@
     33656@@ -1387,7 +1404,7 @@
    3177433657     gtk_menu_popup(GTK_MENU(menu->submenu_id),
    3177533658                   NULL, NULL,
     
    3178033663 
    3178133664 /* Ugly global variable to pass "mouse_pos" flag from gui_make_popup() to
    31782 @@ -1795,7 +1799,6 @@
     33665@@ -1795,7 +1812,6 @@
    3178333666     char_u             *repl_text;
    3178433667     gboolean           direction_down;
     
    3178833671     flags = (int)(long)data;       /* avoid a lint warning here */
    3178933672 
    31790 @@ -1821,7 +1824,7 @@
     33673@@ -1821,7 +1837,7 @@
    3179133674 
    3179233675     repl_text = CONVERT_FROM_UTF8(repl_text);
     
    3179733680     CONVERT_FROM_UTF8_FREE(find_text);
    3179833681 }
     33682@@ -1879,3 +1895,14 @@
     33683      * backwards compatibility anyway. */
     33684     do_cmdline_cmd((char_u *)"emenu ToolBar.FindHelp");
     33685 }
     33686+
     33687+    static void
     33688+recent_func_log_func(const gchar *log_domain UNUSED,
     33689+                    GLogLevelFlags log_level UNUSED,
     33690+                    const gchar *message UNUSED,
     33691+                    gpointer user_data UNUSED)
     33692+{
     33693+    /* We just want to suppress the warnings. */
     33694+    /* http://bugzilla.gnome.org/show_bug.cgi?id=664587 */
     33695+}
     33696+
    3179933697diff -Naur vim73.orig/src/gui_gtk_x11.c vim73/src/gui_gtk_x11.c
    31800 --- vim73.orig/src/gui_gtk_x11.c        2012-02-15 21:57:45.057436051 +0000
    31801 +++ vim73/src/gui_gtk_x11.c     2012-02-15 21:57:46.569475932 +0000
     33698--- vim73.orig/src/gui_gtk_x11.c        2012-06-03 23:09:52.948007269 +0000
     33699+++ vim73/src/gui_gtk_x11.c     2012-06-03 23:09:55.860084763 +0000
    3180233700@@ -86,7 +86,6 @@
    3180333701 
     
    3184333741     if (text == NULL || len <= 0)
    3184433742     {
    31845 @@ -1622,7 +1620,7 @@
     33743@@ -1416,7 +1414,29 @@
     33744 }
     33745 
     33746 /*
     33747- * Check if the GUI can be started.  Called before gvimrc is sourced.
     33748+ * Check if the GUI can be started.  Called before gvimrc is sourced and
     33749+ * before fork().
     33750+ * Return OK or FAIL.
     33751+ */
     33752+    int
     33753+gui_mch_early_init_check(void)
     33754+{
     33755+    char_u *p;
     33756+
     33757+    /* Guess that when $DISPLAY isn't set the GUI can't start. */
     33758+    p = mch_getenv((char_u *)"DISPLAY");
     33759+    if (p == NULL || *p == NUL)
     33760+    {
     33761+       gui.dying = TRUE;
     33762+       EMSG(_((char *)e_opendisp));
     33763+       return FAIL;
     33764+    }
     33765+    return OK;
     33766+}
     33767+
     33768+/*
     33769+ * Check if the GUI can be started.  Called before gvimrc is sourced but after
     33770+ * fork().
     33771  * Return OK or FAIL.
     33772  */
     33773     int
     33774@@ -1622,7 +1642,7 @@
    3184633775     int x, y;
    3184733776     int_u vim_modifiers;
     
    3185233781     /* Make sure we have focus now we've been selected */
    3185333782     if (gtk_socket_id != 0 && !GTK_WIDGET_HAS_FOCUS(widget))
    31854 @@ -1733,7 +1731,7 @@
     33783@@ -1733,7 +1753,7 @@
    3185533784     int x, y;
    3185633785     int_u vim_modifiers;
     
    3186133790     /* Remove any motion "machine gun" timers used for automatic further
    3186233791        extension of allocation areas if outside of the applications window
    31863 @@ -3083,7 +3081,7 @@
     33792@@ -3052,7 +3072,7 @@
     33793 
     33794     for (i = 0; i < (int)N_SELECTION_TARGETS; ++i)
     33795     {
     33796-       /* OpenOffice tries to use TARGET_HTML and fails when it doesn't
     33797+       /* OpenOffice tries to use TARGET_HTML and fails when we don't
     33798         * return something, instead of trying another target. Therefore only
     33799         * offer TARGET_HTML when it works. */
     33800        if (!clip_html && selection_targets[i].info == TARGET_HTML)
     33801@@ -3083,7 +3103,7 @@
    3186433802 
    3186533803     for (i = 0; i < (int)N_DND_TARGETS; ++i)
     
    3187033808        else
    3187133809            targets[j++] = dnd_targets[i];
    31872 @@ -3093,7 +3091,7 @@
     33810@@ -3093,7 +3113,7 @@
    3187333811     gtk_drag_dest_set(gui.drawarea,
    3187433812                      GTK_DEST_DEFAULT_ALL,
     
    3187933817 
    3188033818 /*
    31881 @@ -3902,6 +3900,21 @@
     33819@@ -3902,6 +3922,21 @@
    3188233820 }
    3188333821 
     
    3190133839  */
    3190233840     void
    31903 @@ -4411,14 +4424,9 @@
     33841@@ -4411,14 +4446,9 @@
    3190433842 
    3190533843     if (gui_mch_maximized())
     
    3191733855     else
    3191833856     {
    31919 @@ -5419,7 +5427,7 @@
     33857@@ -5419,7 +5449,7 @@
    3192033858        }
    3192133859 
     
    3192633864 #endif
    3192733865 
    31928 @@ -5654,7 +5662,7 @@
     33866@@ -5654,7 +5684,7 @@
    3192933867     int success;
    3193033868 
     
    3193633874 }
    3193733875diff -Naur vim73.orig/src/gui_mac.c vim73/src/gui_mac.c
    31938 --- vim73.orig/src/gui_mac.c    2012-02-15 21:57:45.041435628 +0000
    31939 +++ vim73/src/gui_mac.c 2012-02-15 21:57:46.661478358 +0000
     33876--- vim73.orig/src/gui_mac.c    2012-06-03 23:09:52.920006524 +0000
     33877+++ vim73/src/gui_mac.c 2012-06-03 23:09:55.024062516 +0000
    3194033878@@ -1480,7 +1480,7 @@
    3194133879  *
     
    3205933997 // of the tabs, not pointers to the tabs (which are invalid for a short time).
    3206033998diff -Naur vim73.orig/src/gui_motif.c vim73/src/gui_motif.c
    32061 --- vim73.orig/src/gui_motif.c  2012-02-15 21:57:45.057436051 +0000
    32062 +++ vim73/src/gui_motif.c       2012-02-15 21:57:45.557449238 +0000
     33999--- vim73.orig/src/gui_motif.c  2012-06-03 23:09:52.944007163 +0000
     34000+++ vim73/src/gui_motif.c       2012-06-03 23:09:53.616025047 +0000
    3206334001@@ -2549,13 +2549,14 @@
    3206434002 #endif
     
    3207834016     char_u             *p, *next;
    3207934017diff -Naur vim73.orig/src/gui_photon.c vim73/src/gui_photon.c
    32080 --- vim73.orig/src/gui_photon.c 2012-02-15 21:57:45.061436156 +0000
    32081 +++ vim73/src/gui_photon.c      2012-02-15 21:57:46.453472871 +0000
     34018--- vim73.orig/src/gui_photon.c 2012-06-03 23:09:52.952007375 +0000
     34019+++ vim73/src/gui_photon.c      2012-06-03 23:09:54.736054852 +0000
    3208234020@@ -32,9 +32,9 @@
    3208334021 #endif
     
    3524637184 
    3524737185diff -Naur vim73.orig/src/gui_riscos.c vim73/src/gui_riscos.c
    35248 --- vim73.orig/src/gui_riscos.c 2012-02-15 21:57:45.057436051 +0000
     37186--- vim73.orig/src/gui_riscos.c 2012-06-03 23:09:52.944007163 +0000
    3524937187+++ vim73/src/gui_riscos.c      1970-01-01 00:00:00.000000000 +0000
    3525037188@@ -1,3558 +0,0 @@
     
    3880840746-}
    3880940747diff -Naur vim73.orig/src/gui_riscos.h vim73/src/gui_riscos.h
    38810 --- vim73.orig/src/gui_riscos.h 2012-02-15 21:57:45.061436156 +0000
     40748--- vim73.orig/src/gui_riscos.h 2012-06-03 23:09:52.948007269 +0000
    3881140749+++ vim73/src/gui_riscos.h      1970-01-01 00:00:00.000000000 +0000
    3881240750@@ -1,32 +0,0 @@
     
    3884440782-void ro_open_main(int *block);
    3884540783diff -Naur vim73.orig/src/gui_w16.c vim73/src/gui_w16.c
    38846 --- vim73.orig/src/gui_w16.c    2012-02-15 21:57:45.057436051 +0000
    38847 +++ vim73/src/gui_w16.c 2012-02-15 21:57:46.877484055 +0000
     40784--- vim73.orig/src/gui_w16.c    2012-06-03 23:09:52.944007163 +0000
     40785+++ vim73/src/gui_w16.c 2012-06-03 23:09:55.320070394 +0000
    3884840786@@ -21,6 +21,12 @@
    3884940787  *
     
    3887040808     LPWORD     p, pnumitems;
    3887140809diff -Naur vim73.orig/src/gui_w32.c vim73/src/gui_w32.c
    38872 --- vim73.orig/src/gui_w32.c    2012-02-15 21:57:45.061436156 +0000
    38873 +++ vim73/src/gui_w32.c 2012-02-15 21:57:46.733480258 +0000
     40810--- vim73.orig/src/gui_w32.c    2012-06-03 23:09:52.952007375 +0000
     40811+++ vim73/src/gui_w32.c 2012-06-03 23:09:55.120065072 +0000
    3887440812@@ -289,13 +289,13 @@
    3887540813 
     
    3915441092 
    3915541093diff -Naur vim73.orig/src/gui_w48.c vim73/src/gui_w48.c
    39156 --- vim73.orig/src/gui_w48.c    2012-02-15 21:57:45.053435946 +0000
    39157 +++ vim73/src/gui_w48.c 2012-02-15 21:57:46.821482580 +0000
     41094--- vim73.orig/src/gui_w48.c    2012-06-03 23:09:52.940007057 +0000
     41095+++ vim73/src/gui_w48.c 2012-06-03 23:09:55.244068371 +0000
    3915841096@@ -328,6 +328,10 @@
    3915941097 static LRESULT _OnImeNotify(HWND hWnd, DWORD dwCommand, DWORD dwData);
     
    3935141289 
    3935241290diff -Naur vim73.orig/src/gui_x11.c vim73/src/gui_x11.c
    39353 --- vim73.orig/src/gui_x11.c    2012-02-15 21:57:45.041435628 +0000
    39354 +++ vim73/src/gui_x11.c 2012-02-15 21:57:45.353443858 +0000
     41291--- vim73.orig/src/gui_x11.c    2012-06-03 23:09:52.920006524 +0000
     41292+++ vim73/src/gui_x11.c 2012-06-03 23:09:53.348017915 +0000
    3935541293@@ -2895,6 +2895,11 @@
    3935641294            focus = gui.in_focus;
     
    3936641304         * char arrives, instead we use XtAppProcessEvent() to hang until an
    3936741305diff -Naur vim73.orig/src/gui_xmdlg.c vim73/src/gui_xmdlg.c
    39368 --- vim73.orig/src/gui_xmdlg.c  2012-02-15 21:57:45.057436051 +0000
    39369 +++ vim73/src/gui_xmdlg.c       2012-02-15 21:57:45.549449028 +0000
     41306--- vim73.orig/src/gui_xmdlg.c  2012-06-03 23:09:52.948007269 +0000
     41307+++ vim73/src/gui_xmdlg.c       2012-06-03 23:09:53.604024727 +0000
    3937041308@@ -688,7 +688,7 @@
    3937141309            do_dialog(VIM_ERROR,
     
    3938741325     else
    3938841326diff -Naur vim73.orig/src/hardcopy.c vim73/src/hardcopy.c
    39389 --- vim73.orig/src/hardcopy.c   2012-02-15 21:57:45.057436051 +0000
    39390 +++ vim73/src/hardcopy.c        2012-02-15 21:57:45.829456412 +0000
     41327--- vim73.orig/src/hardcopy.c   2012-06-03 23:09:52.948007269 +0000
     41328+++ vim73/src/hardcopy.c        2012-06-03 23:09:53.916033030 +0000
    3939141329@@ -1759,18 +1759,25 @@
    3939241330     char       *name;
     
    3964541583     void
    3964641584diff -Naur vim73.orig/src/if_cscope.c vim73/src/if_cscope.c
    39647 --- vim73.orig/src/if_cscope.c  2012-02-15 21:57:45.053435946 +0000
    39648 +++ vim73/src/if_cscope.c       2012-02-15 21:57:46.093463376 +0000
     41585--- vim73.orig/src/if_cscope.c  2012-06-03 23:09:52.940007057 +0000
     41586+++ vim73/src/if_cscope.c       2012-06-03 23:09:54.260042184 +0000
    3964941587@@ -13,16 +13,10 @@
    3965041588 
     
    3981141749 /*
    3981241750diff -Naur vim73.orig/src/if_lua.c vim73/src/if_lua.c
    39813 --- vim73.orig/src/if_lua.c     2012-02-15 21:57:45.041435628 +0000
    39814 +++ vim73/src/if_lua.c  2012-02-15 21:57:46.649478041 +0000
     41751--- vim73.orig/src/if_lua.c     2012-06-03 23:09:52.924006631 +0000
     41752+++ vim73/src/if_lua.c  2012-06-03 23:09:55.724081145 +0000
     41753@@ -1,4 +1,4 @@
     41754-/* vi:set ts=8 sts=4 sw=4:
     41755+/* vi:set ts=8 sts=4 sw=4 noet:
     41756  *
     41757  * VIM - Vi IMproved   by Bram Moolenaar
     41758  *
    3981541759@@ -9,12 +9,11 @@
    3981641760  * See README.txt for an overview of the Vim source code.
     
    3982841772 /* Only do the following when the feature is enabled.  Needed for "make
    3982941773  * depend". */
    39830 @@ -49,7 +48,7 @@
     41774@@ -22,15 +21,33 @@
     41775 
     41776 #define LUAVIM_CHUNKNAME "vim chunk"
     41777 #define LUAVIM_NAME "vim"
     41778+#define LUAVIM_EVALNAME "luaeval"
     41779+#define LUAVIM_EVALHEADER "local _A=select(1,...) return "
     41780 
     41781 typedef buf_T *luaV_Buffer;
     41782 typedef win_T *luaV_Window;
     41783+typedef dict_T *luaV_Dict;
     41784+typedef list_T *luaV_List;
     41785 typedef void (*msgfunc_T)(char_u *);
     41786 
     41787+static const char LUAVIM_DICT[] = "dict";
     41788+static const char LUAVIM_LIST[] = "list";
     41789 static const char LUAVIM_BUFFER[] = "buffer";
     41790 static const char LUAVIM_WINDOW[] = "window";
     41791 static const char LUAVIM_FREE[] = "luaV_free";
     41792+static const char LUAVIM_LUAEVAL[] = "luaV_luaeval";
     41793+static const char LUAVIM_SETREF[] = "luaV_setref";
     41794 
     41795+/* most functions are closures with a cache table as first upvalue;
     41796+ * get/setudata manage references to vim userdata in cache table through
     41797+ * object pointers (light userdata) */
     41798+#define luaV_getudata(L, v) \
     41799+    lua_pushlightuserdata((L), (void *) (v)); \
     41800+    lua_rawget((L), lua_upvalueindex(1))
     41801+#define luaV_setudata(L, v) \
     41802+    lua_pushlightuserdata((L), (void *) (v)); \
     41803+    lua_pushvalue((L), -2); \
     41804+    lua_rawset((L), lua_upvalueindex(1))
     41805 #define luaV_getfield(L, s) \
     41806     lua_pushlightuserdata((L), (void *)(s)); \
     41807     lua_rawget((L), LUA_REGISTRYINDEX)
     41808@@ -39,6 +56,15 @@
     41809 #define luaV_msg(L) luaV_msgfunc((L), (msgfunc_T) msg)
     41810 #define luaV_emsg(L) luaV_msgfunc((L), (msgfunc_T) emsg)
     41811 
     41812+static luaV_List *luaV_pushlist (lua_State *L, list_T *lis);
     41813+static luaV_Dict *luaV_pushdict (lua_State *L, dict_T *dic);
     41814+
     41815+#if LUA_VERSION_NUM <= 501
     41816+#define luaV_openlib(L, l, n) luaL_openlib(L, NULL, l, n)
     41817+#define luaL_typeerror luaL_typerror
     41818+#else
     41819+#define luaV_openlib luaL_setfuncs
     41820+#endif
     41821 
     41822 #ifdef DYNAMIC_LUA
     41823 
     41824@@ -49,38 +75,61 @@
    3983141825 # define symbol_from_dll dlsym
    3983241826 # define close_dll dlclose
     
    3983741831 # define close_dll FreeLibrary
    3983841832 #endif
    39839 @@ -101,6 +100,7 @@
    39840  #define lua_setfield dll_lua_setfield
     41833 
     41834 /* lauxlib */
     41835+#if LUA_VERSION_NUM <= 501
     41836 #define luaL_register dll_luaL_register
     41837+#define luaL_prepbuffer dll_luaL_prepbuffer
     41838+#define luaL_openlib dll_luaL_openlib
     41839 #define luaL_typerror dll_luaL_typerror
     41840+#define luaL_loadfile dll_luaL_loadfile
     41841+#define luaL_loadbuffer dll_luaL_loadbuffer
     41842+#else
     41843+#define luaL_prepbuffsize dll_luaL_prepbuffsize
     41844+#define luaL_setfuncs dll_luaL_setfuncs
     41845+#define luaL_loadfilex dll_luaL_loadfilex
     41846+#define luaL_loadbufferx dll_luaL_loadbufferx
     41847+#define luaL_argerror dll_luaL_argerror
     41848+#endif
     41849+#define luaL_checkany dll_luaL_checkany
     41850 #define luaL_checklstring dll_luaL_checklstring
     41851 #define luaL_checkinteger dll_luaL_checkinteger
     41852 #define luaL_optinteger dll_luaL_optinteger
     41853 #define luaL_checktype dll_luaL_checktype
     41854 #define luaL_error dll_luaL_error
     41855-#define luaL_loadfile dll_luaL_loadfile
     41856-#define luaL_loadbuffer dll_luaL_loadbuffer
     41857 #define luaL_newstate dll_luaL_newstate
     41858 #define luaL_buffinit dll_luaL_buffinit
     41859-#define luaL_prepbuffer dll_luaL_prepbuffer
     41860 #define luaL_addlstring dll_luaL_addlstring
     41861 #define luaL_pushresult dll_luaL_pushresult
     41862 /* lua */
     41863+#if LUA_VERSION_NUM <= 501
     41864+#define lua_tonumber dll_lua_tonumber
     41865+#define lua_tointeger dll_lua_tointeger
     41866+#define lua_call dll_lua_call
     41867+#define lua_pcall dll_lua_pcall
     41868+#else
     41869+#define lua_tonumberx dll_lua_tonumberx
     41870+#define lua_tointegerx dll_lua_tointegerx
     41871+#define lua_callk dll_lua_callk
     41872+#define lua_pcallk dll_lua_pcallk
     41873+#define lua_getglobal dll_lua_getglobal
     41874+#define lua_setglobal dll_lua_setglobal
     41875+#endif
     41876+#define lua_typename dll_lua_typename
     41877 #define lua_close dll_lua_close
     41878 #define lua_gettop dll_lua_gettop
     41879 #define lua_settop dll_lua_settop
     41880 #define lua_pushvalue dll_lua_pushvalue
     41881 #define lua_replace dll_lua_replace
     41882+#define lua_remove dll_lua_remove
     41883 #define lua_isnumber dll_lua_isnumber
     41884 #define lua_isstring dll_lua_isstring
     41885 #define lua_type dll_lua_type
     41886 #define lua_rawequal dll_lua_rawequal
     41887-#define lua_tonumber dll_lua_tonumber
     41888-#define lua_tointeger dll_lua_tointeger
     41889 #define lua_toboolean dll_lua_toboolean
     41890 #define lua_tolstring dll_lua_tolstring
     41891 #define lua_touserdata dll_lua_touserdata
     41892@@ -95,6 +144,7 @@
     41893 #define lua_pushlightuserdata dll_lua_pushlightuserdata
     41894 #define lua_getfield dll_lua_getfield
     41895 #define lua_rawget dll_lua_rawget
     41896+#define lua_rawgeti dll_lua_rawgeti
     41897 #define lua_createtable dll_lua_createtable
     41898 #define lua_newuserdata dll_lua_newuserdata
     41899 #define lua_getmetatable dll_lua_getmetatable
     41900@@ -102,8 +152,7 @@
    3984141901 #define lua_rawset dll_lua_rawset
    3984241902 #define lua_rawseti dll_lua_rawseti
    39843 +#define lua_remove dll_lua_remove
    3984441903 #define lua_setmetatable dll_lua_setmetatable
    39845  #define lua_call dll_lua_call
    39846  #define lua_pcall dll_lua_pcall
    39847 @@ -162,6 +162,7 @@
    39848  void (*dll_lua_setfield) (lua_State *L, int idx, const char *k);
     41904-#define lua_call dll_lua_call
     41905-#define lua_pcall dll_lua_pcall
     41906+#define lua_next dll_lua_next
     41907 /* libs */
     41908 #define luaopen_base dll_luaopen_base
     41909 #define luaopen_table dll_luaopen_table
     41910@@ -116,32 +165,57 @@
     41911 #define luaL_openlibs dll_luaL_openlibs
     41912 
     41913 /* lauxlib */
     41914+#if LUA_VERSION_NUM <= 501
     41915 void (*dll_luaL_register) (lua_State *L, const char *libname, const luaL_Reg *l);
     41916+char *(*dll_luaL_prepbuffer) (luaL_Buffer *B);
     41917+void (*dll_luaL_openlib) (lua_State *L, const char *libname, const luaL_Reg *l, int nup);
     41918 int (*dll_luaL_typerror) (lua_State *L, int narg, const char *tname);
     41919+int (*dll_luaL_loadfile) (lua_State *L, const char *filename);
     41920+int (*dll_luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz, const char *name);
     41921+#else
     41922+char *(*dll_luaL_prepbuffsize) (luaL_Buffer *B, size_t sz);
     41923+void (*dll_luaL_setfuncs) (lua_State *L, const luaL_Reg *l, int nup);
     41924+int (*dll_luaL_loadfilex) (lua_State *L, const char *filename, const char *mode);
     41925+int (*dll_luaL_loadbufferx) (lua_State *L, const char *buff, size_t sz, const char *name, const char *mode);
     41926+int (*dll_luaL_argerror) (lua_State *L, int numarg, const char *extramsg);
     41927+#endif
     41928+void (*dll_luaL_checkany) (lua_State *L, int narg);
     41929 const char *(*dll_luaL_checklstring) (lua_State *L, int numArg, size_t *l);
     41930 lua_Integer (*dll_luaL_checkinteger) (lua_State *L, int numArg);
     41931 lua_Integer (*dll_luaL_optinteger) (lua_State *L, int nArg, lua_Integer def);
     41932 void (*dll_luaL_checktype) (lua_State *L, int narg, int t);
     41933 int (*dll_luaL_error) (lua_State *L, const char *fmt, ...);
     41934-int (*dll_luaL_loadfile) (lua_State *L, const char *filename);
     41935-int (*dll_luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz, const char *name);
     41936 lua_State *(*dll_luaL_newstate) (void);
     41937 void (*dll_luaL_buffinit) (lua_State *L, luaL_Buffer *B);
     41938-char *(*dll_luaL_prepbuffer) (luaL_Buffer *B);
     41939 void (*dll_luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l);
     41940 void (*dll_luaL_pushresult) (luaL_Buffer *B);
     41941 /* lua */
     41942+#if LUA_VERSION_NUM <= 501
     41943+lua_Number (*dll_lua_tonumber) (lua_State *L, int idx);
     41944+lua_Integer (*dll_lua_tointeger) (lua_State *L, int idx);
     41945+void (*dll_lua_call) (lua_State *L, int nargs, int nresults);
     41946+int (*dll_lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc);
     41947+#else
     41948+lua_Number (*dll_lua_tonumberx) (lua_State *L, int idx, int *isnum);
     41949+lua_Integer (*dll_lua_tointegerx) (lua_State *L, int idx, int *isnum);
     41950+void (*dll_lua_callk) (lua_State *L, int nargs, int nresults, int ctx,
     41951+        lua_CFunction k);
     41952+int (*dll_lua_pcallk) (lua_State *L, int nargs, int nresults, int errfunc,
     41953+        int ctx, lua_CFunction k);
     41954+void (*dll_lua_getglobal) (lua_State *L, const char *var);
     41955+void (*dll_lua_setglobal) (lua_State *L, const char *var);
     41956+#endif
     41957+const char *(*dll_lua_typename) (lua_State *L, int tp);
     41958 void       (*dll_lua_close) (lua_State *L);
     41959 int (*dll_lua_gettop) (lua_State *L);
     41960 void (*dll_lua_settop) (lua_State *L, int idx);
     41961 void (*dll_lua_pushvalue) (lua_State *L, int idx);
     41962 void (*dll_lua_replace) (lua_State *L, int idx);
     41963+void (*dll_lua_remove) (lua_State *L, int idx);
     41964 int (*dll_lua_isnumber) (lua_State *L, int idx);
     41965 int (*dll_lua_isstring) (lua_State *L, int idx);
     41966 int (*dll_lua_type) (lua_State *L, int idx);
     41967 int (*dll_lua_rawequal) (lua_State *L, int idx1, int idx2);
     41968-lua_Number (*dll_lua_tonumber) (lua_State *L, int idx);
     41969-lua_Integer (*dll_lua_tointeger) (lua_State *L, int idx);
     41970 int (*dll_lua_toboolean) (lua_State *L, int idx);
     41971 const char *(*dll_lua_tolstring) (lua_State *L, int idx, size_t *len);
     41972 void *(*dll_lua_touserdata) (lua_State *L, int idx);
     41973@@ -156,6 +230,7 @@
     41974 void (*dll_lua_pushlightuserdata) (lua_State *L, void *p);
     41975 void (*dll_lua_getfield) (lua_State *L, int idx, const char *k);
     41976 void (*dll_lua_rawget) (lua_State *L, int idx);
     41977+void (*dll_lua_rawgeti) (lua_State *L, int idx, int n);
     41978 void (*dll_lua_createtable) (lua_State *L, int narr, int nrec);
     41979 void *(*dll_lua_newuserdata) (lua_State *L, size_t sz);
     41980 int (*dll_lua_getmetatable) (lua_State *L, int objindex);
     41981@@ -163,8 +238,7 @@
    3984941982 void (*dll_lua_rawset) (lua_State *L, int idx);
    3985041983 void (*dll_lua_rawseti) (lua_State *L, int idx, int n);
    39851 +void (*dll_lua_remove) (lua_State *L, int idx);
    3985241984 int (*dll_lua_setmetatable) (lua_State *L, int objindex);
    39853  void (*dll_lua_call) (lua_State *L, int nargs, int nresults);
    39854  int (*dll_lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc);
    39855 @@ -230,6 +231,7 @@
    39856      {"lua_setfield", (luaV_function) &dll_lua_setfield},
     41985-void (*dll_lua_call) (lua_State *L, int nargs, int nresults);
     41986-int (*dll_lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc);
     41987+int (*dll_lua_next) (lua_State *L, int idx);
     41988 /* libs */
     41989 int (*dll_luaopen_base) (lua_State *L);
     41990 int (*dll_luaopen_table) (lua_State *L);
     41991@@ -184,32 +258,55 @@
     41992 
     41993 static const luaV_Reg luaV_dll[] = {
     41994     /* lauxlib */
     41995+#if LUA_VERSION_NUM <= 501
     41996     {"luaL_register", (luaV_function) &dll_luaL_register},
     41997+    {"luaL_prepbuffer", (luaV_function) &dll_luaL_prepbuffer},
     41998+    {"luaL_openlib", (luaV_function) &dll_luaL_openlib},
     41999     {"luaL_typerror", (luaV_function) &dll_luaL_typerror},
     42000+    {"luaL_loadfile", (luaV_function) &dll_luaL_loadfile},
     42001+    {"luaL_loadbuffer", (luaV_function) &dll_luaL_loadbuffer},
     42002+#else
     42003+    {"luaL_prepbuffsize", (luaV_function) &dll_luaL_prepbuffsize},
     42004+    {"luaL_setfuncs", (luaV_function) &dll_luaL_setfuncs},
     42005+    {"luaL_loadfilex", (luaV_function) &dll_luaL_loadfilex},
     42006+    {"luaL_loadbufferx", (luaV_function) &dll_luaL_loadbufferx},
     42007+    {"luaL_argerror", (luaV_function) &dll_luaL_argerror},
     42008+#endif
     42009+    {"luaL_checkany", (luaV_function) &dll_luaL_checkany},
     42010     {"luaL_checklstring", (luaV_function) &dll_luaL_checklstring},
     42011     {"luaL_checkinteger", (luaV_function) &dll_luaL_checkinteger},
     42012     {"luaL_optinteger", (luaV_function) &dll_luaL_optinteger},
     42013     {"luaL_checktype", (luaV_function) &dll_luaL_checktype},
     42014     {"luaL_error", (luaV_function) &dll_luaL_error},
     42015-    {"luaL_loadfile", (luaV_function) &dll_luaL_loadfile},
     42016-    {"luaL_loadbuffer", (luaV_function) &dll_luaL_loadbuffer},
     42017     {"luaL_newstate", (luaV_function) &dll_luaL_newstate},
     42018     {"luaL_buffinit", (luaV_function) &dll_luaL_buffinit},
     42019-    {"luaL_prepbuffer", (luaV_function) &dll_luaL_prepbuffer},
     42020     {"luaL_addlstring", (luaV_function) &dll_luaL_addlstring},
     42021     {"luaL_pushresult", (luaV_function) &dll_luaL_pushresult},
     42022     /* lua */
     42023+#if LUA_VERSION_NUM <= 501
     42024+    {"lua_tonumber", (luaV_function) &dll_lua_tonumber},
     42025+    {"lua_tointeger", (luaV_function) &dll_lua_tointeger},
     42026+    {"lua_call", (luaV_function) &dll_lua_call},
     42027+    {"lua_pcall", (luaV_function) &dll_lua_pcall},
     42028+#else
     42029+    {"lua_tonumberx", (luaV_function) &dll_lua_tonumberx},
     42030+    {"lua_tointegerx", (luaV_function) &dll_lua_tointegerx},
     42031+    {"lua_callk", (luaV_function) &dll_lua_callk},
     42032+    {"lua_pcallk", (luaV_function) &dll_lua_pcallk},
     42033+    {"lua_getglobal", (luaV_function) &dll_lua_getglobal},
     42034+    {"lua_setglobal", (luaV_function) &dll_lua_setglobal},
     42035+#endif
     42036+    {"lua_typename", (luaV_function) &dll_lua_typename},
     42037     {"lua_close", (luaV_function) &dll_lua_close},
     42038     {"lua_gettop", (luaV_function) &dll_lua_gettop},
     42039     {"lua_settop", (luaV_function) &dll_lua_settop},
     42040     {"lua_pushvalue", (luaV_function) &dll_lua_pushvalue},
     42041     {"lua_replace", (luaV_function) &dll_lua_replace},
     42042+    {"lua_remove", (luaV_function) &dll_lua_remove},
     42043     {"lua_isnumber", (luaV_function) &dll_lua_isnumber},
     42044     {"lua_isstring", (luaV_function) &dll_lua_isstring},
     42045     {"lua_type", (luaV_function) &dll_lua_type},
     42046     {"lua_rawequal", (luaV_function) &dll_lua_rawequal},
     42047-    {"lua_tonumber", (luaV_function) &dll_lua_tonumber},
     42048-    {"lua_tointeger", (luaV_function) &dll_lua_tointeger},
     42049     {"lua_toboolean", (luaV_function) &dll_lua_toboolean},
     42050     {"lua_tolstring", (luaV_function) &dll_lua_tolstring},
     42051     {"lua_touserdata", (luaV_function) &dll_lua_touserdata},
     42052@@ -224,6 +321,7 @@
     42053     {"lua_pushlightuserdata", (luaV_function) &dll_lua_pushlightuserdata},
     42054     {"lua_getfield", (luaV_function) &dll_lua_getfield},
     42055     {"lua_rawget", (luaV_function) &dll_lua_rawget},
     42056+    {"lua_rawgeti", (luaV_function) &dll_lua_rawgeti},
     42057     {"lua_createtable", (luaV_function) &dll_lua_createtable},
     42058     {"lua_newuserdata", (luaV_function) &dll_lua_newuserdata},
     42059     {"lua_getmetatable", (luaV_function) &dll_lua_getmetatable},
     42060@@ -231,8 +329,7 @@
    3985742061     {"lua_rawset", (luaV_function) &dll_lua_rawset},
    3985842062     {"lua_rawseti", (luaV_function) &dll_lua_rawseti},
    39859 +    {"lua_remove", (luaV_function) &dll_lua_remove},
    3986042063     {"lua_setmetatable", (luaV_function) &dll_lua_setmetatable},
    39861      {"lua_call", (luaV_function) &dll_lua_call},
    39862      {"lua_pcall", (luaV_function) &dll_lua_pcall},
    39863 @@ -925,6 +927,31 @@
     42064-    {"lua_call", (luaV_function) &dll_lua_call},
     42065-    {"lua_pcall", (luaV_function) &dll_lua_pcall},
     42066+    {"lua_next", (luaV_function) &dll_lua_next},
     42067     /* libs */
     42068     {"luaopen_base", (luaV_function) &dll_luaopen_base},
     42069     {"luaopen_table", (luaV_function) &dll_luaopen_table},
     42070@@ -292,6 +389,16 @@
     42071 
     42072 #endif /* DYNAMIC_LUA */
     42073 
     42074+#if LUA_VERSION_NUM > 501
     42075+    static int
     42076+luaL_typeerror (lua_State *L, int narg, const char *tname)
     42077+{
     42078+    const char *msg = lua_pushfstring(L, "%s expected, got %s",
     42079+            tname, luaL_typename(L, narg));
     42080+    return luaL_argerror(L, narg, msg);
     42081+}
     42082+#endif
     42083+
     42084 
     42085 /* =======   Internal   ======= */
     42086 
     42087@@ -325,17 +432,35 @@
     42088 }
     42089 
     42090     static void *
     42091+luaV_checkcache(lua_State *L, void *p)
     42092+{
     42093+    luaV_getudata(L, p);
     42094+    if (lua_isnil(L, -1)) luaL_error(L, "invalid object");
     42095+    lua_pop(L, 1);
     42096+    return p;
     42097+}
     42098+
     42099+#define luaV_unbox(L,luatyp,ud) (*((luatyp *) lua_touserdata((L),(ud))))
     42100+
     42101+#define luaV_checkvalid(L,luatyp,ud) \
     42102+    luaV_checkcache((L), (void *) luaV_unbox((L),luatyp,(ud)))
     42103+
     42104+    static void *
     42105 luaV_checkudata(lua_State *L, int ud, const char *tname)
     42106 {
     42107     void *p = luaV_toudata(L, ud, tname);
     42108-    if (p == NULL) luaL_typerror(L, ud, tname);
     42109+    if (p == NULL) luaL_typeerror(L, ud, tname);
     42110     return p;
     42111 }
     42112 
     42113     static void
     42114 luaV_pushtypval(lua_State *L, typval_T *tv)
     42115 {
     42116-    if (tv == NULL) luaL_error(L, "null type");
     42117+    if (tv == NULL)
     42118+    {
     42119+       lua_pushnil(L);
     42120+       return;
     42121+    }
     42122     switch (tv->v_type)
     42123     {
     42124        case VAR_STRING:
     42125@@ -349,68 +474,70 @@
     42126            lua_pushnumber(L, (lua_Number) tv->vval.v_float);
     42127            break;
     42128 #endif
     42129-       case VAR_LIST: {
     42130-           list_T *l = tv->vval.v_list;
     42131+       case VAR_LIST:
     42132+           luaV_pushlist(L, tv->vval.v_list);
     42133+           break;
     42134+       case VAR_DICT:
     42135+           luaV_pushdict(L, tv->vval.v_dict);
     42136+           break;
     42137+       default:
     42138+           lua_pushnil(L);
     42139+    }
     42140+}
     42141 
     42142-           if (l != NULL)
     42143+/* converts lua value at 'pos' to typval 'tv' */
     42144+    static void
     42145+luaV_totypval (lua_State *L, int pos, typval_T *tv)
     42146+{
     42147+    switch(lua_type(L, pos)) {
     42148+       case LUA_TBOOLEAN:
     42149+           tv->v_type = VAR_NUMBER;
     42150+           tv->vval.v_number = (varnumber_T) lua_toboolean(L, pos);
     42151+           break;
     42152+       case LUA_TSTRING:
     42153+           tv->v_type = VAR_STRING;
     42154+           tv->vval.v_string = vim_strsave((char_u *) lua_tostring(L, pos));
     42155+           break;
     42156+       case LUA_TNUMBER:
     42157+#ifdef FEAT_FLOAT
     42158+           tv->v_type = VAR_FLOAT;
     42159+           tv->vval.v_float = (float_T) lua_tonumber(L, pos);
     42160+#else
     42161+           tv->v_type = VAR_NUMBER;
     42162+           tv->vval.v_number = (varnumber_T) lua_tointeger(L, pos);
     42163+#endif
     42164+           break;
     42165+       case LUA_TUSERDATA: {
     42166+           void *p = lua_touserdata(L, pos);
     42167+           if (lua_getmetatable(L, pos)) /* has metatable? */
     42168            {
     42169-               /* check cache */
     42170-               lua_pushlightuserdata(L, (void *) l);
     42171-               lua_rawget(L, LUA_ENVIRONINDEX);
     42172-               if (lua_isnil(L, -1)) /* not interned? */
     42173+               /* check list */
     42174+               luaV_getfield(L, LUAVIM_LIST);
     42175+               if (lua_rawequal(L, -1, -2))
     42176                {
     42177-                   listitem_T *li;
     42178-                   int n = 0;
     42179-                   lua_pop(L, 1); /* nil */
     42180-                   lua_newtable(L);
     42181-                   lua_pushlightuserdata(L, (void *) l);
     42182-                   lua_pushvalue(L, -2);
     42183-                   lua_rawset(L, LUA_ENVIRONINDEX);
     42184-                   for (li = l->lv_first; li != NULL; li = li->li_next)
     42185-                   {
     42186-                       luaV_pushtypval(L, &li->li_tv);
     42187-                       lua_rawseti(L, -2, ++n);
     42188-                   }
     42189+                   tv->v_type = VAR_LIST;
     42190+                   tv->vval.v_list = *((luaV_List *) p);
     42191+                   ++tv->vval.v_list->lv_refcount;
     42192+                   lua_pop(L, 2); /* MTs */
     42193+                   return;
     42194                }
     42195-           }
     42196-           else lua_pushnil(L);
     42197-           break;
     42198-                      }
     42199-       case VAR_DICT: {
     42200-           dict_T *d = tv->vval.v_dict;
     42201-
     42202-           if (d != NULL)
     42203-           {
     42204-               /* check cache */
     42205-               lua_pushlightuserdata(L, (void *) d);
     42206-               lua_rawget(L, LUA_ENVIRONINDEX);
     42207-               if (lua_isnil(L, -1)) /* not interned? */
     42208+               /* check dict */
     42209+               luaV_getfield(L, LUAVIM_DICT);
     42210+               if (lua_rawequal(L, -1, -3))
     42211                {
     42212-                   hashtab_T *ht = &d->dv_hashtab;
     42213-                   hashitem_T *hi;
     42214-                   int n = ht->ht_used; /* remaining items */
     42215-                   lua_pop(L, 1); /* nil */
     42216-                   lua_newtable(L);
     42217-                   lua_pushlightuserdata(L, (void *) d);
     42218-                   lua_pushvalue(L, -2);
     42219-                   lua_rawset(L, LUA_ENVIRONINDEX);
     42220-                   for (hi = ht->ht_array; n > 0; hi++)
     42221-                   {
     42222-                       if (!HASHITEM_EMPTY(hi))
     42223-                       {
     42224-                           dictitem_T *di = dict_lookup(hi);
     42225-                           luaV_pushtypval(L, &di->di_tv);
     42226-                           lua_setfield(L, -2, (char *) hi->hi_key);
     42227-                           n--;
     42228-                       }
     42229-                   }
     42230+                   tv->v_type = VAR_DICT;
     42231+                   tv->vval.v_dict = *((luaV_Dict *) p);
     42232+                   ++tv->vval.v_dict->dv_refcount;
     42233+                   lua_pop(L, 3); /* MTs */
     42234+                   return;
     42235                }
     42236+               lua_pop(L, 3); /* MTs */
     42237            }
     42238-           else lua_pushnil(L);
     42239            break;
     42240        }
     42241        default:
     42242-           luaL_error(L, "invalid type");
     42243+           tv->v_type = VAR_NUMBER;
     42244+           tv->vval.v_number = 0;
     42245     }
     42246 }
     42247 
     42248@@ -479,89 +606,508 @@
     42249     lua_pop(L, 2); /* original and modified strings */
     42250 }
     42251 
     42252+#define luaV_newtype(typ,tname,luatyp,luatname) \
     42253+       static luatyp * \
     42254+    luaV_new##tname (lua_State *L, typ *obj) \
     42255+    { \
     42256+       luatyp *o = (luatyp *) lua_newuserdata(L, sizeof(luatyp)); \
     42257+       *o = obj; \
     42258+       luaV_setudata(L, obj); /* cache[obj] = udata */ \
     42259+       luaV_getfield(L, luatname); \
     42260+       lua_setmetatable(L, -2); \
     42261+       return o; \
     42262+    }
     42263+
     42264+#define luaV_pushtype(typ,tname,luatyp) \
     42265+       static luatyp * \
     42266+    luaV_push##tname (lua_State *L, typ *obj) \
     42267+    { \
     42268+       luatyp *o = NULL; \
     42269+       if (obj == NULL) \
     42270+           lua_pushnil(L); \
     42271+       else { \
     42272+           luaV_getudata(L, obj); \
     42273+           if (lua_isnil(L, -1)) /* not interned? */ \
     42274+           { \
     42275+               lua_pop(L, 1); \
     42276+               o = luaV_new##tname(L, obj); \
     42277+           } \
     42278+           else \
     42279+               o = (luatyp *) lua_touserdata(L, -1); \
     42280+       } \
     42281+       return o; \
     42282+    }
     42283+
     42284+#define luaV_type_tostring(tname,luatname) \
     42285+       static int \
     42286+    luaV_##tname##_tostring (lua_State *L) \
     42287+    { \
     42288+       lua_pushfstring(L, "%s: %p", luatname, lua_touserdata(L, 1)); \
     42289+       return 1; \
     42290+    }
     42291 
     42292-/* =======   Buffer type   ======= */
     42293 
     42294-    static luaV_Buffer *
     42295-luaV_newbuffer(lua_State *L, buf_T *buf)
     42296+/* adapted from eval.c */
     42297+
     42298+#define listitem_alloc() (listitem_T *)alloc(sizeof(listitem_T))
     42299+
     42300+    static listitem_T *
     42301+list_find (list_T *l, long n)
     42302+{
     42303+    listitem_T *li;
     42304+    if (l == NULL || n < -l->lv_len || n >= l->lv_len)
     42305+       return NULL;
     42306+    if (n < 0) /* search backward? */
     42307+       for (li = l->lv_last; n < -1; li = li->li_prev)
     42308+           n++;
     42309+    else /* search forward */
     42310+       for (li = l->lv_first; n > 0; li = li->li_next)
     42311+           n--;
     42312+    return li;
     42313+}
     42314+
     42315+    static void
     42316+list_remove (list_T *l, listitem_T *li)
     42317 {
     42318-    luaV_Buffer *b = (luaV_Buffer *) lua_newuserdata(L, sizeof(luaV_Buffer));
     42319-    *b = buf;
     42320-    lua_pushlightuserdata(L, (void *) buf);
     42321-    lua_pushvalue(L, -2);
     42322-    lua_rawset(L, LUA_ENVIRONINDEX); /* env[buf] = udata */
     42323-    /* to avoid GC, store as key in env */
     42324-    lua_pushvalue(L, -1);
     42325-    lua_pushboolean(L, 1);
     42326-    lua_rawset(L, LUA_ENVIRONINDEX); /* env[udata] = true */
     42327-    /* set metatable */
     42328-    luaV_getfield(L, LUAVIM_BUFFER);
     42329+    listwatch_T *lw;
     42330+    --l->lv_len;
     42331+    /* fix watchers */
     42332+    for (lw = l->lv_watch; lw != NULL; lw = lw->lw_next)
     42333+       if (lw->lw_item == li)
     42334+           lw->lw_item = li->li_next;
     42335+    /* fix list pointers */
     42336+    if (li->li_next == NULL) /* last? */
     42337+       l->lv_last = li->li_prev;
     42338+    else
     42339+       li->li_next->li_prev = li->li_prev;
     42340+    if (li->li_prev == NULL) /* first? */
     42341+       l->lv_first = li->li_next;
     42342+    else
     42343+       li->li_prev->li_next = li->li_next;
     42344+    l->lv_idx_item = NULL;
     42345+}
     42346+
     42347+    static void
     42348+list_append(list_T *l, listitem_T *item)
     42349+{
     42350+    if (l->lv_last == NULL) /* empty list? */
     42351+       l->lv_first = item;
     42352+    else
     42353+       l->lv_last->li_next = item;
     42354+    item->li_prev = l->lv_last;
     42355+    item->li_next = NULL;
     42356+    l->lv_last = item;
     42357+    ++l->lv_len;
     42358+}
     42359+
     42360+    static int
     42361+list_insert_tv(list_T *l, typval_T *tv, listitem_T *item)
     42362+{
     42363+    listitem_T *ni = listitem_alloc();
     42364+
     42365+    if (ni == NULL)
     42366+       return FAIL;
     42367+    copy_tv(tv, &ni->li_tv);
     42368+    if (item == NULL)
     42369+       list_append(l, ni);
     42370+    else
     42371+    {
     42372+       ni->li_prev = item->li_prev;
     42373+       ni->li_next = item;
     42374+       if (item->li_prev == NULL)
     42375+       {
     42376+           l->lv_first = ni;
     42377+           ++l->lv_idx;
     42378+       }
     42379+       else
     42380+       {
     42381+           item->li_prev->li_next = ni;
     42382+           l->lv_idx_item = NULL;
     42383+       }
     42384+       item->li_prev = ni;
     42385+       ++l->lv_len;
     42386+    }
     42387+    return OK;
     42388+}
     42389+
     42390+/* set references */
     42391+
     42392+static void set_ref_in_tv (typval_T *tv, int copyID);
     42393+
     42394+    static void
     42395+set_ref_in_dict(dict_T *d, int copyID)
     42396+{
     42397+    hashtab_T *ht = &d->dv_hashtab;
     42398+    int n = ht->ht_used;
     42399+    hashitem_T *hi;
     42400+    for (hi = ht->ht_array; n > 0; ++hi)
     42401+       if (!HASHITEM_EMPTY(hi))
     42402+       {
     42403+           dictitem_T *di = dict_lookup(hi);
     42404+           set_ref_in_tv(&di->di_tv, copyID);
     42405+           --n;
     42406+       }
     42407+}
     42408+
     42409+    static void
     42410+set_ref_in_list(list_T *l, int copyID)
     42411+{
     42412+    listitem_T *li;
     42413+    for (li = l->lv_first; li != NULL; li = li->li_next)
     42414+       set_ref_in_tv(&li->li_tv, copyID);
     42415+}
     42416+
     42417+    static void
     42418+set_ref_in_tv(typval_T *tv, int copyID)
     42419+{
     42420+    if (tv->v_type == VAR_LIST)
     42421+    {
     42422+       list_T *l = tv->vval.v_list;
     42423+       if (l != NULL && l->lv_copyID != copyID)
     42424+       {
     42425+           l->lv_copyID = copyID;
     42426+           set_ref_in_list(l, copyID);
     42427+       }
     42428+    }
     42429+    else if (tv->v_type == VAR_DICT)
     42430+    {
     42431+       dict_T *d = tv->vval.v_dict;
     42432+       if (d != NULL && d->dv_copyID != copyID)
     42433+       {
     42434+           d->dv_copyID = copyID;
     42435+           set_ref_in_dict(d, copyID);
     42436+       }
     42437+    }
     42438+}
     42439+
     42440+
     42441+/* =======   List type   ======= */
     42442+
     42443+    static luaV_List *
     42444+luaV_newlist (lua_State *L, list_T *lis)
     42445+{
     42446+    luaV_List *l = (luaV_List *) lua_newuserdata(L, sizeof(luaV_List));
     42447+    *l = lis;
     42448+    lis->lv_refcount++; /* reference in Lua */
     42449+    luaV_setudata(L, lis); /* cache[lis] = udata */
     42450+    luaV_getfield(L, LUAVIM_LIST);
     42451     lua_setmetatable(L, -2);
     42452-    return b;
     42453+    return l;
     42454 }
     42455 
     42456-    static luaV_Buffer *
     42457-luaV_pushbuffer (lua_State *L, buf_T *buf)
     42458+luaV_pushtype(list_T, list, luaV_List)
     42459+luaV_type_tostring(list, LUAVIM_LIST)
     42460+
     42461+    static int
     42462+luaV_list_gc (lua_State *L)
     42463 {
     42464-    luaV_Buffer *b = NULL;
     42465-    if (buf == NULL)
     42466-       lua_pushnil(L);
     42467-    else {
     42468-       lua_pushlightuserdata(L, (void *) buf);
     42469-       lua_rawget(L, LUA_ENVIRONINDEX);
     42470-       if (lua_isnil(L, -1)) /* not interned? */
     42471+    list_unref(luaV_unbox(L, luaV_List, 1));
     42472+    return 0;
     42473+}
     42474+
     42475+    static int
     42476+luaV_list_len (lua_State *L)
     42477+{
     42478+    list_T *l = luaV_unbox(L, luaV_List, 1);
     42479+    lua_pushinteger(L, (l == NULL) ? 0 : (int) l->lv_len);
     42480+    return 1;
     42481+}
     42482+
     42483+    static int
     42484+luaV_list_iter (lua_State *L)
     42485+{
     42486+    listitem_T *li = (listitem_T *) lua_touserdata(L, lua_upvalueindex(2));
     42487+    if (li == NULL) return 0;
     42488+    luaV_pushtypval(L, &li->li_tv);
     42489+    lua_pushlightuserdata(L, (void *) li->li_next);
     42490+    lua_replace(L, lua_upvalueindex(2));
     42491+    return 1;
     42492+}
     42493+
     42494+    static int
     42495+luaV_list_call (lua_State *L)
     42496+{
     42497+    list_T *l = luaV_unbox(L, luaV_List, 1);
     42498+    lua_pushvalue(L, lua_upvalueindex(1)); /* pass cache table along */
     42499+    lua_pushlightuserdata(L, (void *) l->lv_first);
     42500+    lua_pushcclosure(L, luaV_list_iter, 2);
     42501+    return 1;
     42502+}
     42503+
     42504+    static int
     42505+luaV_list_index (lua_State *L)
     42506+{
     42507+    list_T *l = luaV_unbox(L, luaV_List, 1);
     42508+    if (lua_isnumber(L, 2)) /* list item? */
     42509+    {
     42510+       listitem_T *li = list_find(l, (long) luaL_checkinteger(L, 2));
     42511+       if (li == NULL)
     42512+           lua_pushnil(L);
     42513+       else
     42514+           luaV_pushtypval(L, &li->li_tv);
     42515+    }
     42516+    else if (lua_isstring(L, 2)) /* method? */
     42517+    {
     42518+       const char *s = lua_tostring(L, 2);
     42519+       if (strncmp(s, "add", 3) == 0
     42520+               || strncmp(s, "insert", 6) == 0
     42521+               || strncmp(s, "extend", 6) == 0)
     42522        {
     42523-           lua_pop(L, 1);
     42524-           b = luaV_newbuffer(L, buf);
     42525+           lua_getmetatable(L, 1);
     42526+           lua_getfield(L, -1, s);
     42527        }
     42528        else
     42529-           b = (luaV_Buffer *) lua_touserdata(L, -1);
     42530+           lua_pushnil(L);
     42531     }
     42532-    return b;
     42533+    else
     42534+       lua_pushnil(L);
     42535+    return 1;
     42536+}
     42537+
     42538+    static int
     42539+luaV_list_newindex (lua_State *L)
     42540+{
     42541+    list_T *l = luaV_unbox(L, luaV_List, 1);
     42542+    long n = (long) luaL_checkinteger(L, 2);
     42543+    listitem_T *li;
     42544+    if (l->lv_lock)
     42545+       luaL_error(L, "list is locked");
     42546+    li = list_find(l, n);
     42547+    if (li == NULL) return 0;
     42548+    if (lua_isnil(L, 3)) /* remove? */
     42549+    {
     42550+       list_remove(l, li);
     42551+       clear_tv(&li->li_tv);
     42552+       vim_free(li);
     42553+    }
     42554+    else
     42555+    {
     42556+       typval_T v;
     42557+       luaV_totypval(L, 3, &v);
     42558+       clear_tv(&li->li_tv);
     42559+       copy_tv(&v, &li->li_tv);
     42560+    }
     42561+    return 0;
     42562+}
     42563+
     42564+    static int
     42565+luaV_list_add (lua_State *L)
     42566+{
     42567+    luaV_List *lis = luaV_checkudata(L, 1, LUAVIM_LIST);
     42568+    list_T *l = (list_T *) luaV_checkcache(L, (void *) *lis);
     42569+    listitem_T *li;
     42570+    if (l->lv_lock)
     42571+       luaL_error(L, "list is locked");
     42572+    li = listitem_alloc();
     42573+    if (li != NULL)
     42574+    {
     42575+       typval_T v;
     42576+       lua_settop(L, 2);
     42577+       luaV_totypval(L, 2, &v);
     42578+       copy_tv(&v, &li->li_tv);
     42579+       list_append(l, li);
     42580+    }
     42581+    lua_settop(L, 1);
     42582+    return 1;
     42583+}
     42584+
     42585+    static int
     42586+luaV_list_insert (lua_State *L)
     42587+{
     42588+    luaV_List *lis = luaV_checkudata(L, 1, LUAVIM_LIST);
     42589+    list_T *l = (list_T *) luaV_checkcache(L, (void *) *lis);
     42590+    long pos = luaL_optlong(L, 3, 0);
     42591+    listitem_T *li = NULL;
     42592+    typval_T v;
     42593+    if (l->lv_lock)
     42594+       luaL_error(L, "list is locked");
     42595+    if (pos < l->lv_len)
     42596+    {
     42597+       li = list_find(l, pos);
     42598+       if (li == NULL)
     42599+           luaL_error(L, "invalid position");
     42600+    }
     42601+    lua_settop(L, 2);
     42602+    luaV_totypval(L, 2, &v);
     42603+    list_insert_tv(l, &v, li);
     42604+    lua_settop(L, 1);
     42605+    return 1;
     42606+}
     42607+
     42608+static const luaL_Reg luaV_List_mt[] = {
     42609+    {"__tostring", luaV_list_tostring},
     42610+    {"__gc", luaV_list_gc},
     42611+    {"__len", luaV_list_len},
     42612+    {"__call", luaV_list_call},
     42613+    {"__index", luaV_list_index},
     42614+    {"__newindex", luaV_list_newindex},
     42615+    {"add", luaV_list_add},
     42616+    {"insert", luaV_list_insert},
     42617+    {NULL, NULL}
     42618+};
     42619+
     42620+
     42621+/* =======   Dict type   ======= */
     42622+
     42623+    static luaV_Dict *
     42624+luaV_newdict (lua_State *L, dict_T *dic)
     42625+{
     42626+    luaV_Dict *d = (luaV_Dict *) lua_newuserdata(L, sizeof(luaV_Dict));
     42627+    *d = dic;
     42628+    dic->dv_refcount++; /* reference in Lua */
     42629+    luaV_setudata(L, dic); /* cache[dic] = udata */
     42630+    luaV_getfield(L, LUAVIM_DICT);
     42631+    lua_setmetatable(L, -2);
     42632+    return d;
     42633+}
     42634+
     42635+luaV_pushtype(dict_T, dict, luaV_Dict)
     42636+luaV_type_tostring(dict, LUAVIM_DICT)
     42637+
     42638+    static int
     42639+luaV_dict_gc (lua_State *L)
     42640+{
     42641+    dict_unref(luaV_unbox(L, luaV_Dict, 1));
     42642+    return 0;
     42643+}
     42644+
     42645+    static int
     42646+luaV_dict_len (lua_State *L)
     42647+{
     42648+    dict_T *d = luaV_unbox(L, luaV_Dict, 1);
     42649+    lua_pushinteger(L, (d == NULL) ? 0 : (int) d->dv_hashtab.ht_used);
     42650+    return 1;
     42651+}
     42652+
     42653+    static int
     42654+luaV_dict_iter (lua_State *L)
     42655+{
     42656+    hashitem_T *hi = (hashitem_T *) lua_touserdata(L, lua_upvalueindex(2));
     42657+    int n = lua_tointeger(L, lua_upvalueindex(3));
     42658+    dictitem_T *di;
     42659+    if (n <= 0) return 0;
     42660+    while (HASHITEM_EMPTY(hi)) hi++;
     42661+    di = dict_lookup(hi);
     42662+    lua_pushstring(L, (char *) hi->hi_key);
     42663+    luaV_pushtypval(L, &di->di_tv);
     42664+    lua_pushlightuserdata(L, (void *) (hi + 1));
     42665+    lua_replace(L, lua_upvalueindex(2));
     42666+    lua_pushinteger(L, n - 1);
     42667+    lua_replace(L, lua_upvalueindex(3));
     42668+    return 2;
     42669 }
     42670 
     42671-/* Buffer metamethods */
     42672+    static int
     42673+luaV_dict_call (lua_State *L)
     42674+{
     42675+    dict_T *d = luaV_unbox(L, luaV_Dict, 1);
     42676+    hashtab_T *ht = &d->dv_hashtab;
     42677+    lua_pushvalue(L, lua_upvalueindex(1)); /* pass cache table along */
     42678+    lua_pushlightuserdata(L, (void *) ht->ht_array);
     42679+    lua_pushinteger(L, ht->ht_used); /* # remaining items */
     42680+    lua_pushcclosure(L, luaV_dict_iter, 3);
     42681+    return 1;
     42682+}
     42683 
     42684     static int
     42685-luaV_buffer_tostring(lua_State *L)
     42686+luaV_dict_index (lua_State *L)
     42687 {
     42688-    lua_pushfstring(L, "%s: %p", LUAVIM_BUFFER, lua_touserdata(L, 1));
     42689+    dict_T *d = luaV_unbox(L, luaV_Dict, 1);
     42690+    char_u *key = (char_u *) luaL_checkstring(L, 2);
     42691+    dictitem_T *di = dict_find(d, key, -1);
     42692+    if (di == NULL)
     42693+       lua_pushnil(L);
     42694+    else
     42695+       luaV_pushtypval(L, &di->di_tv);
     42696     return 1;
     42697 }
     42698 
     42699     static int
     42700+luaV_dict_newindex (lua_State *L)
     42701+{
     42702+    dict_T *d = luaV_unbox(L, luaV_Dict, 1);
     42703+    char_u *key = (char_u *) luaL_checkstring(L, 2);
     42704+    dictitem_T *di;
     42705+    if (d->dv_lock)
     42706+       luaL_error(L, "dict is locked");
     42707+    di = dict_find(d, key, -1);
     42708+    if (di == NULL) /* non-existing key? */
     42709+    {
     42710+       if (lua_isnil(L, 3)) return 0;
     42711+       di = dictitem_alloc(key);
     42712+       if (di == NULL) return 0;
     42713+       if (dict_add(d, di) == FAIL)
     42714+       {
     42715+               vim_free(di);
     42716+               return 0;
     42717+       }
     42718+    }
     42719+    else
     42720+       clear_tv(&di->di_tv);
     42721+    if (lua_isnil(L, 3)) /* remove? */
     42722+    {
     42723+       hashitem_T *hi = hash_find(&d->dv_hashtab, di->di_key);
     42724+       hash_remove(&d->dv_hashtab, hi);
     42725+       dictitem_free(di);
     42726+    }
     42727+    else {
     42728+       typval_T v;
     42729+       luaV_totypval(L, 3, &v);
     42730+       copy_tv(&v, &di->di_tv);
     42731+    }
     42732+    return 0;
     42733+}
     42734+
     42735+static const luaL_Reg luaV_Dict_mt[] = {
     42736+    {"__tostring", luaV_dict_tostring},
     42737+    {"__gc", luaV_dict_gc},
     42738+    {"__len", luaV_dict_len},
     42739+    {"__call", luaV_dict_call},
     42740+    {"__index", luaV_dict_index},
     42741+    {"__newindex", luaV_dict_newindex},
     42742+    {NULL, NULL}
     42743+};
     42744+
     42745+
     42746+/* =======   Buffer type   ======= */
     42747+
     42748+luaV_newtype(buf_T, buffer, luaV_Buffer, LUAVIM_BUFFER)
     42749+luaV_pushtype(buf_T, buffer, luaV_Buffer)
     42750+luaV_type_tostring(buffer, LUAVIM_BUFFER)
     42751+
     42752+    static int
     42753 luaV_buffer_len(lua_State *L)
     42754 {
     42755-    luaV_Buffer *b = lua_touserdata(L, 1);
     42756-    lua_pushinteger(L, (*b)->b_ml.ml_line_count);
     42757+    buf_T *b = (buf_T *) luaV_checkvalid(L, luaV_Buffer, 1);
     42758+    lua_pushinteger(L, b->b_ml.ml_line_count);
     42759     return 1;
     42760 }
     42761 
     42762     static int
     42763 luaV_buffer_call(lua_State *L)
     42764 {
     42765-    luaV_Buffer *b = (luaV_Buffer *) lua_touserdata(L, 1);
     42766+    buf_T *b = (buf_T *) luaV_checkvalid(L, luaV_Buffer, 1);
     42767     lua_settop(L, 1);
     42768-    set_curbuf(*b, DOBUF_SPLIT);
     42769+    set_curbuf(b, DOBUF_SPLIT);
     42770     return 1;
     42771 }
     42772 
     42773     static int
     42774 luaV_buffer_index(lua_State *L)
     42775 {
     42776-    luaV_Buffer *b = (luaV_Buffer *) lua_touserdata(L, 1);
     42777+    buf_T *b = (buf_T *) luaV_checkvalid(L, luaV_Buffer, 1);
     42778     linenr_T n = (linenr_T) lua_tointeger(L, 2);
     42779-    if (n > 0 && n <= (*b)->b_ml.ml_line_count)
     42780-       luaV_pushline(L, *b, n);
     42781+    if (n > 0 && n <= b->b_ml.ml_line_count)
     42782+       luaV_pushline(L, b, n);
     42783     else if (lua_isstring(L, 2))
     42784     {
     42785        const char *s = lua_tostring(L, 2);
     42786        if (strncmp(s, "name", 4) == 0)
     42787-           lua_pushstring(L, (char *) (*b)->b_sfname);
     42788+           lua_pushstring(L, (char *) b->b_sfname);
     42789        else if (strncmp(s, "fname", 5) == 0)
     42790-           lua_pushstring(L, (char *) (*b)->b_ffname);
     42791+           lua_pushstring(L, (char *) b->b_ffname);
     42792        else if (strncmp(s, "number", 6) == 0)
     42793-           lua_pushinteger(L, (*b)->b_fnum);
     42794+           lua_pushinteger(L, b->b_fnum);
     42795        /* methods */
     42796        else if (strncmp(s,   "insert", 6) == 0
     42797                || strncmp(s, "next", 4) == 0
     42798@@ -582,17 +1128,17 @@
     42799     static int
     42800 luaV_buffer_newindex(lua_State *L)
     42801 {
     42802-    luaV_Buffer *b = (luaV_Buffer *) lua_touserdata(L, 1);
     42803+    buf_T *b = (buf_T *) luaV_checkvalid(L, luaV_Buffer, 1);
     42804     linenr_T n = (linenr_T) luaL_checkinteger(L, 2);
     42805 #ifdef HAVE_SANDBOX
     42806     luaV_checksandbox(L);
     42807 #endif
     42808-    if (n < 1 || n > (*b)->b_ml.ml_line_count)
     42809+    if (n < 1 || n > b->b_ml.ml_line_count)
     42810        luaL_error(L, "invalid line number");
     42811     if (lua_isnil(L, 3)) /* delete line */
     42812     {
     42813        buf_T *buf = curbuf;
     42814-       curbuf = *b;
     42815+       curbuf = b;
     42816        if (u_savedel(n, 1L) == FAIL)
     42817        {
     42818            curbuf = buf;
     42819@@ -605,7 +1151,7 @@
     42820        }
     42821        else {
     42822            deleted_lines_mark(n, 1L);
     42823-           if (*b == curwin->w_buffer) /* fix cursor in current window? */
     42824+           if (b == curwin->w_buffer) /* fix cursor in current window? */
     42825            {
     42826                if (curwin->w_cursor.lnum >= n)
     42827                {
     42828@@ -625,7 +1171,7 @@
     42829     else if (lua_isstring(L, 3)) /* update line */
     42830     {
     42831        buf_T *buf = curbuf;
     42832-       curbuf = *b;
     42833+       curbuf = b;
     42834        if (u_savesub(n) == FAIL)
     42835        {
     42836            curbuf = buf;
     42837@@ -638,7 +1184,7 @@
     42838        }
     42839        else changed_bytes(n, 0);
     42840        curbuf = buf;
     42841-       if (*b == curwin->w_buffer)
     42842+       if (b == curwin->w_buffer)
     42843            check_cursor_col();
     42844     }
     42845     else
     42846@@ -649,8 +1195,9 @@
     42847     static int
     42848 luaV_buffer_insert(lua_State *L)
     42849 {
     42850-    luaV_Buffer *b = luaV_checkudata(L, 1, LUAVIM_BUFFER);
     42851-    linenr_T last = (*b)->b_ml.ml_line_count;
     42852+    luaV_Buffer *lb = luaV_checkudata(L, 1, LUAVIM_BUFFER);
     42853+    buf_T *b = (buf_T *) luaV_checkcache(L, (void *) *lb);
     42854+    linenr_T last = b->b_ml.ml_line_count;
     42855     linenr_T n = (linenr_T) luaL_optinteger(L, 3, last);
     42856     buf_T *buf;
     42857     luaL_checktype(L, 2, LUA_TSTRING);
     42858@@ -662,7 +1209,7 @@
     42859     if (n > last) n = last;
     42860     /* insert */
     42861     buf = curbuf;
     42862-    curbuf = *b;
     42863+    curbuf = b;
     42864     if (u_save(n, n + 1) == FAIL)
     42865     {
     42866        curbuf = buf;
     42867@@ -684,7 +1231,8 @@
     42868 luaV_buffer_next(lua_State *L)
     42869 {
     42870     luaV_Buffer *b = luaV_checkudata(L, 1, LUAVIM_BUFFER);
     42871-    luaV_pushbuffer(L, (*b)->b_next);
     42872+    buf_T *buf = (buf_T *) luaV_checkcache(L, (void *) *b);
     42873+    luaV_pushbuffer(L, buf->b_next);
     42874     return 1;
     42875 }
     42876 
     42877@@ -692,7 +1240,8 @@
     42878 luaV_buffer_previous(lua_State *L)
     42879 {
     42880     luaV_Buffer *b = luaV_checkudata(L, 1, LUAVIM_BUFFER);
     42881-    luaV_pushbuffer(L, (*b)->b_prev);
     42882+    buf_T *buf = (buf_T *) luaV_checkcache(L, (void *) *b);
     42883+    luaV_pushbuffer(L, buf->b_prev);
     42884     return 1;
     42885 }
     42886 
     42887@@ -700,8 +1249,7 @@
     42888 luaV_buffer_isvalid(lua_State *L)
     42889 {
     42890     luaV_Buffer *b = luaV_checkudata(L, 1, LUAVIM_BUFFER);
     42891-    lua_pushlightuserdata(L, (void *) (*b));
     42892-    lua_rawget(L, LUA_ENVIRONINDEX);
     42893+    luaV_getudata(L, *b);
     42894     lua_pushboolean(L, !lua_isnil(L, -1));
     42895     return 1;
     42896 }
     42897@@ -722,78 +1270,36 @@
     42898 
     42899 /* =======   Window type   ======= */
     42900 
     42901-    static luaV_Window *
     42902-luaV_newwindow(lua_State *L, win_T *win)
     42903-{
     42904-    luaV_Window *w = (luaV_Window *) lua_newuserdata(L, sizeof(luaV_Window));
     42905-    *w = win;
     42906-    lua_pushlightuserdata(L, (void *) win);
     42907-    lua_pushvalue(L, -2);
     42908-    lua_rawset(L, LUA_ENVIRONINDEX); /* env[win] = udata */
     42909-    /* to avoid GC, store as key in env */
     42910-    lua_pushvalue(L, -1);
     42911-    lua_pushboolean(L, 1);
     42912-    lua_rawset(L, LUA_ENVIRONINDEX); /* env[udata] = true */
     42913-    /* set metatable */
     42914-    luaV_getfield(L, LUAVIM_WINDOW);
     42915-    lua_setmetatable(L, -2);
     42916-    return w;
     42917-}
     42918-
     42919-    static luaV_Window *
     42920-luaV_pushwindow(lua_State *L, win_T *win)
     42921-{
     42922-    luaV_Window *w = NULL;
     42923-    if (win == NULL)
     42924-       lua_pushnil(L);
     42925-    else {
     42926-       lua_pushlightuserdata(L, (void *) win);
     42927-       lua_rawget(L, LUA_ENVIRONINDEX);
     42928-       if (lua_isnil(L, -1)) /* not interned? */
     42929-       {
     42930-           lua_pop(L, 1);
     42931-           w = luaV_newwindow(L, win);
     42932-       }
     42933-       else w = (luaV_Window *) lua_touserdata(L, -1);
     42934-    }
     42935-    return w;
     42936-}
     42937-
     42938-/* Window metamethods */
     42939-
     42940-    static int
     42941-luaV_window_tostring(lua_State *L)
     42942-{
     42943-    lua_pushfstring(L, "%s: %p", LUAVIM_WINDOW, lua_touserdata(L, 1));
     42944-    return 1;
     42945-}
     42946+luaV_newtype(win_T, window, luaV_Window, LUAVIM_WINDOW)
     42947+luaV_pushtype(win_T, window, luaV_Window)
     42948+luaV_type_tostring(window, LUAVIM_WINDOW)
     42949 
     42950     static int
     42951 luaV_window_call(lua_State *L)
     42952 {
     42953-    luaV_Window *w = (luaV_Window *) lua_touserdata(L, 1);
     42954+    win_T *w = (win_T *) luaV_checkvalid(L, luaV_Window, 1);
     42955     lua_settop(L, 1);
     42956-    win_goto(*w);
     42957+    win_goto(w);
     42958     return 1;
     42959 }
     42960 
     42961     static int
     42962 luaV_window_index(lua_State *L)
     42963 {
     42964-    luaV_Window *w = (luaV_Window *) lua_touserdata(L, 1);
     42965+    win_T *w = (win_T *) luaV_checkvalid(L, luaV_Window, 1);
     42966     const char *s = luaL_checkstring(L, 2);
     42967     if (strncmp(s, "buffer", 6) == 0)
     42968-       luaV_pushbuffer(L, (*w)->w_buffer);
     42969+       luaV_pushbuffer(L, w->w_buffer);
     42970     else if (strncmp(s, "line", 4) == 0)
     42971-       lua_pushinteger(L, (*w)->w_cursor.lnum);
     42972+       lua_pushinteger(L, w->w_cursor.lnum);
     42973     else if (strncmp(s, "col", 3) == 0)
     42974-       lua_pushinteger(L, (*w)->w_cursor.col + 1);
     42975+       lua_pushinteger(L, w->w_cursor.col + 1);
     42976 #ifdef FEAT_VERTSPLIT
     42977     else if (strncmp(s, "width", 5) == 0)
     42978-       lua_pushinteger(L, W_WIDTH((*w)));
     42979+       lua_pushinteger(L, W_WIDTH(w));
     42980 #endif
     42981     else if (strncmp(s, "height", 6) == 0)
     42982-       lua_pushinteger(L, (*w)->w_height);
     42983+       lua_pushinteger(L, w->w_height);
     42984     /* methods */
     42985     else if (strncmp(s,   "next", 4) == 0
     42986            || strncmp(s, "previous", 8) == 0
     42987@@ -810,7 +1316,7 @@
     42988     static int
     42989 luaV_window_newindex (lua_State *L)
     42990 {
     42991-    luaV_Window *w = (luaV_Window *) lua_touserdata(L, 1);
     42992+    win_T *w = (win_T *) luaV_checkvalid(L, luaV_Window, 1);
     42993     const char *s = luaL_checkstring(L, 2);
     42994     int v = luaL_checkinteger(L, 3);
     42995     if (strncmp(s, "line", 4) == 0)
     42996@@ -818,9 +1324,9 @@
     42997 #ifdef HAVE_SANDBOX
     42998        luaV_checksandbox(L);
     42999 #endif
     43000-       if (v < 1 || v > (*w)->w_buffer->b_ml.ml_line_count)
     43001+       if (v < 1 || v > w->w_buffer->b_ml.ml_line_count)
     43002            luaL_error(L, "line out of range");
     43003-       (*w)->w_cursor.lnum = v;
     43004+       w->w_cursor.lnum = v;
     43005        update_screen(VALID);
     43006     }
     43007     else if (strncmp(s, "col", 3) == 0)
     43008@@ -828,7 +1334,7 @@
     43009 #ifdef HAVE_SANDBOX
     43010        luaV_checksandbox(L);
     43011 #endif
     43012-       (*w)->w_cursor.col = v - 1;
     43013+       w->w_cursor.col = v - 1;
     43014        update_screen(VALID);
     43015     }
     43016 #ifdef FEAT_VERTSPLIT
     43017@@ -838,7 +1344,7 @@
     43018 #ifdef FEAT_GUI
     43019        need_mouse_correct = TRUE;
     43020 #endif
     43021-       curwin = *w;
     43022+       curwin = w;
     43023        win_setwidth(v);
     43024        curwin = win;
     43025     }
     43026@@ -849,7 +1355,7 @@
     43027 #ifdef FEAT_GUI
     43028        need_mouse_correct = TRUE;
     43029 #endif
     43030-       curwin = *w;
     43031+       curwin = w;
     43032        win_setheight(v);
     43033        curwin = win;
     43034     }
     43035@@ -862,7 +1368,8 @@
     43036 luaV_window_next(lua_State *L)
     43037 {
     43038     luaV_Window *w = luaV_checkudata(L, 1, LUAVIM_WINDOW);
     43039-    luaV_pushwindow(L, (*w)->w_next);
     43040+    win_T *win = (win_T *) luaV_checkcache(L, (void *) *w);
     43041+    luaV_pushwindow(L, win->w_next);
     43042     return 1;
     43043 }
     43044 
     43045@@ -870,7 +1377,8 @@
     43046 luaV_window_previous(lua_State *L)
     43047 {
     43048     luaV_Window *w = luaV_checkudata(L, 1, LUAVIM_WINDOW);
     43049-    luaV_pushwindow(L, (*w)->w_prev);
     43050+    win_T *win = (win_T *) luaV_checkcache(L, (void *) *w);
     43051+    luaV_pushwindow(L, win->w_prev);
     43052     return 1;
     43053 }
     43054 
     43055@@ -878,8 +1386,7 @@
     43056 luaV_window_isvalid(lua_State *L)
     43057 {
     43058     luaV_Window *w = luaV_checkudata(L, 1, LUAVIM_WINDOW);
     43059-    lua_pushlightuserdata(L, (void *) (*w));
     43060-    lua_rawget(L, LUA_ENVIRONINDEX);
     43061+    luaV_getudata(L, *w);
     43062     lua_pushboolean(L, !lua_isnil(L, -1));
     43063     return 1;
     43064 }
     43065@@ -925,6 +1432,31 @@
    3986443066 }
    3986543067 
     
    3989343095 {
    3989443096     do_cmdline_cmd((char_u *) luaL_checkstring(L, 1));
    39895 @@ -1017,13 +1044,12 @@
     43097@@ -956,6 +1488,28 @@
     43098 }
     43099 
     43100     static int
     43101+luaV_list(lua_State *L)
     43102+{
     43103+    list_T *l = list_alloc();
     43104+    if (l == NULL)
     43105+       lua_pushnil(L);
     43106+    else
     43107+       luaV_newlist(L, l);
     43108+    return 1;
     43109+}
     43110+
     43111+    static int
     43112+luaV_dict(lua_State *L)
     43113+{
     43114+    dict_T *d = dict_alloc();
     43115+    if (d == NULL)
     43116+       lua_pushnil(L);
     43117+    else
     43118+       luaV_newdict(L, d);
     43119+    return 1;
     43120+}
     43121+
     43122+    static int
     43123 luaV_buffer(lua_State *L)
     43124 {
     43125     buf_T *buf;
     43126@@ -981,15 +1535,10 @@
     43127                    break;
     43128            }
     43129        }
     43130-       if (buf == NULL) /* not found? */
     43131-           lua_pushnil(L);
     43132-       else
     43133-           luaV_pushbuffer(L, buf);
     43134     }
     43135-    else {
     43136+    else
     43137        buf = (lua_toboolean(L, 1)) ? firstbuf : curbuf; /* first buffer? */
     43138-       luaV_pushbuffer(L, buf);
     43139-    }
     43140+    luaV_pushbuffer(L, buf);
     43141     return 1;
     43142 }
     43143 
     43144@@ -1002,59 +1551,62 @@
     43145        int n = lua_tointeger(L, 1);
     43146        for (win = firstwin; win != NULL; win = win->w_next, n--)
     43147            if (n == 1) break;
     43148-       if (win == NULL) /* not found? */
     43149-           lua_pushnil(L);
     43150-       else
     43151-           luaV_pushwindow(L, win);
     43152     }
     43153-    else {
     43154+    else
     43155        win = (lua_toboolean(L, 1)) ? firstwin : curwin; /* first window? */
     43156-       luaV_pushwindow(L, win);
     43157-    }
     43158+    luaV_pushwindow(L, win);
     43159     return 1;
     43160 }
     43161 
    3989643162     static int
    3989743163 luaV_open(lua_State *L)
     
    3990843174 }
    3990943175 
    39910 @@ -1083,6 +1109,11 @@
     43176     static int
     43177-luaV_isbuffer(lua_State *L)
     43178+luaV_type(lua_State *L)
     43179 {
     43180-    lua_pushboolean(L, luaV_toudata(L, 1, LUAVIM_BUFFER) != NULL);
     43181-    return 1;
     43182-}
     43183-
     43184-    static int
     43185-luaV_iswindow(lua_State *L)
     43186-{
     43187-    lua_pushboolean(L, luaV_toudata(L, 1, LUAVIM_WINDOW) != NULL);
     43188-    return 1;
     43189-}
     43190-
     43191-/* for freeing buffer and window objects; lightuserdata as arg */
     43192-    static int
     43193-luaV_free(lua_State *L)
     43194-{
     43195-    lua_pushvalue(L, 1); /* lightudata */
     43196-    lua_rawget(L, LUA_ENVIRONINDEX);
     43197-    if (!lua_isnil(L, -1))
     43198+    luaL_checkany(L, 1);
     43199+    if (lua_type(L, 1) == LUA_TUSERDATA) /* check vim udata? */
     43200     {
     43201-       lua_pushnil(L);
     43202-       lua_rawset(L, LUA_ENVIRONINDEX); /* env[udata] = nil */
     43203-       lua_pushnil(L);
     43204-       lua_rawset(L, LUA_ENVIRONINDEX); /* env[lightudata] = nil */
     43205+       lua_settop(L, 1);
     43206+       if (lua_getmetatable(L, 1))
     43207+       {
     43208+           luaV_getfield(L, LUAVIM_LIST);
     43209+           if (lua_rawequal(L, -1, 2))
     43210+           {
     43211+               lua_pushstring(L, "list");
     43212+               return 1;
     43213+           }
     43214+           luaV_getfield(L, LUAVIM_DICT);
     43215+           if (lua_rawequal(L, -1, 2))
     43216+           {
     43217+               lua_pushstring(L, "dict");
     43218+               return 1;
     43219+           }
     43220+           luaV_getfield(L, LUAVIM_BUFFER);
     43221+           if (lua_rawequal(L, -1, 2))
     43222+           {
     43223+               lua_pushstring(L, "buffer");
     43224+               return 1;
     43225+           }
     43226+           luaV_getfield(L, LUAVIM_WINDOW);
     43227+           if (lua_rawequal(L, -1, 2))
     43228+           {
     43229+               lua_pushstring(L, "window");
     43230+               return 1;
     43231+           }
     43232+       }
     43233     }
     43234-    return 0;
     43235+    lua_pushstring(L, luaL_typename(L, 1)); /* fallback */
     43236+    return 1;
     43237 }
     43238 
     43239 static const luaL_Reg luaV_module[] = {
     43240@@ -1062,37 +1614,128 @@
     43241     {"eval", luaV_eval},
     43242     {"beep", luaV_beep},
     43243     {"line", luaV_line},
     43244+    {"list", luaV_list},
     43245+    {"dict", luaV_dict},
     43246     {"buffer", luaV_buffer},
     43247     {"window", luaV_window},
     43248     {"open", luaV_open},
     43249-    {"isbuffer", luaV_isbuffer},
     43250-    {"iswindow", luaV_iswindow},
     43251+    {"type", luaV_type},
     43252     {NULL, NULL}
     43253 };
     43254 
     43255+/* for freeing list, dict, buffer and window objects; lightuserdata as arg */
     43256+    static int
     43257+luaV_free(lua_State *L)
     43258+{
     43259+    lua_pushnil(L);
     43260+    luaV_setudata(L, lua_touserdata(L, 1));
     43261+    return 0;
     43262+}
     43263+
     43264+    static int
     43265+luaV_luaeval (lua_State *L)
     43266+{
     43267+    luaL_Buffer b;
     43268+    size_t l;
     43269+    const char *str = lua_tolstring(L, 1, &l);
     43270+    typval_T *arg = (typval_T *) lua_touserdata(L, 2);
     43271+    typval_T *rettv = (typval_T *) lua_touserdata(L, 3);
     43272+    luaL_buffinit(L, &b);
     43273+    luaL_addlstring(&b, LUAVIM_EVALHEADER, sizeof(LUAVIM_EVALHEADER) - 1);
     43274+    luaL_addlstring(&b, str, l);
     43275+    luaL_pushresult(&b);
     43276+    str = lua_tolstring(L, -1, &l);
     43277+    if (luaL_loadbuffer(L, str, l, LUAVIM_EVALNAME)) /* compile error? */
     43278+    {
     43279+       luaV_emsg(L);
     43280+       return 0;
     43281+    }
     43282+    luaV_pushtypval(L, arg);
     43283+    if (lua_pcall(L, 1, 1, 0)) /* running error? */
     43284+    {
     43285+       luaV_emsg(L);
     43286+       return 0;
     43287+    }
     43288+    luaV_totypval(L, -1, rettv);
     43289+    return 0;
     43290+}
     43291+
     43292+    static int
     43293+luaV_setref (lua_State *L)
     43294+{
     43295+    int copyID = lua_tointeger(L, 1);
     43296+    typval_T tv;
     43297+    luaV_getfield(L, LUAVIM_LIST);
     43298+    luaV_getfield(L, LUAVIM_DICT);
     43299+    lua_pushnil(L);
     43300+    while (lua_next(L, lua_upvalueindex(1)) != 0) /* traverse cache table */
     43301+    {
     43302+       lua_getmetatable(L, -1);
     43303+       if (lua_rawequal(L, -1, 2)) /* list? */
     43304+       {
     43305+           tv.v_type = VAR_LIST;
     43306+           tv.vval.v_list = (list_T *) lua_touserdata(L, 4); /* key */
     43307+       }
     43308+       else if (lua_rawequal(L, -1, 3)) /* dict? */
     43309+       {
     43310+           tv.v_type = VAR_DICT;
     43311+           tv.vval.v_dict = (dict_T *) lua_touserdata(L, 4); /* key */
     43312+       }
     43313+       lua_pop(L, 2); /* metatable and value */
     43314+       set_ref_in_tv(&tv, copyID);
     43315+    }
     43316+    return 0;
     43317+}
     43318+
     43319     static int
     43320 luaopen_vim(lua_State *L)
     43321 {
     43322-    /* set environment */
     43323+    /* set cache table */
     43324     lua_newtable(L);
     43325     lua_newtable(L);
     43326-    lua_pushliteral(L, "v");
     43327+    lua_pushstring(L, "v");
     43328     lua_setfield(L, -2, "__mode");
     43329-    lua_setmetatable(L, -2);
     43330-    lua_replace(L, LUA_ENVIRONINDEX);
     43331+    lua_setmetatable(L, -2); /* cache is weak-valued */
    3991143332     /* print */
    3991243333     lua_pushcfunction(L, luaV_print);
     
    3991943340     /* free */
    3992043341     lua_pushlightuserdata(L, (void *) LUAVIM_FREE);
    39921      lua_pushcfunction(L, luaV_free);
     43342-    lua_pushcfunction(L, luaV_free);
     43343+    lua_pushvalue(L, 1); /* cache table */
     43344+    lua_pushcclosure(L, luaV_free, 1);
     43345+    lua_rawset(L, LUA_REGISTRYINDEX);
     43346+    /* luaeval */
     43347+    lua_pushlightuserdata(L, (void *) LUAVIM_LUAEVAL);
     43348+    lua_pushvalue(L, 1); /* cache table */
     43349+    lua_pushcclosure(L, luaV_luaeval, 1);
     43350+    lua_rawset(L, LUA_REGISTRYINDEX);
     43351+    /* setref */
     43352+    lua_pushlightuserdata(L, (void *) LUAVIM_SETREF);
     43353+    lua_pushvalue(L, 1); /* cache table */
     43354+    lua_pushcclosure(L, luaV_setref, 1);
     43355     lua_rawset(L, LUA_REGISTRYINDEX);
     43356     /* register */
     43357+    luaV_newmetatable(L, LUAVIM_LIST);
     43358+    lua_pushvalue(L, 1);
     43359+    luaV_openlib(L, luaV_List_mt, 1);
     43360+    luaV_newmetatable(L, LUAVIM_DICT);
     43361+    lua_pushvalue(L, 1);
     43362+    luaV_openlib(L, luaV_Dict_mt, 1);
     43363     luaV_newmetatable(L, LUAVIM_BUFFER);
     43364-    luaL_register(L, NULL, luaV_Buffer_mt);
     43365+    lua_pushvalue(L, 1); /* cache table */
     43366+    luaV_openlib(L, luaV_Buffer_mt, 1);
     43367     luaV_newmetatable(L, LUAVIM_WINDOW);
     43368-    luaL_register(L, NULL, luaV_Window_mt);
     43369-    luaL_register(L, LUAVIM_NAME, luaV_module);
     43370+    lua_pushvalue(L, 1); /* cache table */
     43371+    luaV_openlib(L, luaV_Window_mt, 1);
     43372+    lua_newtable(L); /* vim table */
     43373+    lua_pushvalue(L, 1); /* cache table */
     43374+    luaV_openlib(L, luaV_module, 1);
     43375+    lua_setglobal(L, LUAVIM_NAME);
     43376     return 0;
     43377 }
     43378 
     43379@@ -1123,7 +1766,7 @@
     43380 static lua_State *L = NULL;
     43381 
     43382     static int
     43383-lua_is_open(void)
     43384+lua_isopen(void)
     43385 {
     43386     return L != NULL;
     43387 }
     43388@@ -1131,7 +1774,7 @@
     43389     static int
     43390 lua_init(void)
     43391 {
     43392-    if (L == NULL)
     43393+    if (!lua_isopen())
     43394     {
     43395 #ifdef DYNAMIC_LUA
     43396        if (!lua_enabled(TRUE))
     43397@@ -1148,7 +1791,7 @@
     43398     void
     43399 lua_end(void)
     43400 {
     43401-    if (L != NULL)
     43402+    if (lua_isopen())
     43403     {
     43404        lua_close(L);
     43405        L = NULL;
     43406@@ -1191,7 +1834,7 @@
     43407     }
     43408     luaV_setrange(L, eap->line1, eap->line2);
     43409     luaL_buffinit(L, &b);
     43410-    luaL_addlstring(&b, "return function(line) ", 22); /* header */
     43411+    luaL_addlstring(&b, "return function(line, linenr) ", 30); /* header */
     43412     luaL_addlstring(&b, s, strlen(s));
     43413     luaL_addlstring(&b, " end", 4); /* footer */
     43414     luaL_pushresult(&b);
     43415@@ -1208,7 +1851,8 @@
     43416     {
     43417        lua_pushvalue(L, -1); /* function */
     43418        luaV_pushline(L, curbuf, l); /* current line as arg */
     43419-       if (lua_pcall(L, 1, 1, 0))
     43420+       lua_pushinteger(L, l); /* current line number as arg */
     43421+       if (lua_pcall(L, 2, 1, 0))
     43422        {
     43423            luaV_emsg(L);
     43424            break;
     43425@@ -1242,23 +1886,36 @@
     43426     }
     43427 }
     43428 
     43429-/* buffer */
     43430+#define luaV_freetype(typ,tname) \
     43431+       void \
     43432+    lua_##tname##_free(typ *o) \
     43433+    { \
     43434+       if (!lua_isopen()) return; \
     43435+       luaV_getfield(L, LUAVIM_FREE); \
     43436+       lua_pushlightuserdata(L, (void *) o); \
     43437+       lua_call(L, 1, 0); \
     43438+    }
     43439+
     43440+luaV_freetype(buf_T, buffer)
     43441+luaV_freetype(win_T, window)
     43442+
     43443     void
     43444-lua_buffer_free(buf_T *buf)
     43445+do_luaeval (char_u *str, typval_T *arg, typval_T *rettv)
     43446 {
     43447-    if (!lua_is_open()) return;
     43448-    luaV_getfield(L, LUAVIM_FREE);
     43449-    lua_pushlightuserdata(L, (void *) buf);
     43450-    lua_call(L, 1, 0);
     43451+    lua_init();
     43452+    luaV_getfield(L, LUAVIM_LUAEVAL);
     43453+    lua_pushstring(L, (char *) str);
     43454+    lua_pushlightuserdata(L, (void *) arg);
     43455+    lua_pushlightuserdata(L, (void *) rettv);
     43456+    lua_call(L, 3, 0);
     43457 }
     43458 
     43459-/* window */
     43460     void
     43461-lua_window_free(win_T *win)
     43462+set_ref_in_lua (int copyID)
     43463 {
     43464-    if (!lua_is_open()) return;
     43465-    luaV_getfield(L, LUAVIM_FREE);
     43466-    lua_pushlightuserdata(L, (void *) win);
     43467+    if (!lua_isopen()) return;
     43468+    luaV_getfield(L, LUAVIM_SETREF);
     43469+    lua_pushinteger(L, copyID);
     43470     lua_call(L, 1, 0);
     43471 }
     43472 
    3992243473diff -Naur vim73.orig/src/if_mzsch.c vim73/src/if_mzsch.c
    39923 --- vim73.orig/src/if_mzsch.c   2012-02-15 21:57:45.061436156 +0000
    39924 +++ vim73/src/if_mzsch.c        2012-02-15 21:57:46.957486165 +0000
     43474--- vim73.orig/src/if_mzsch.c   2012-06-03 23:09:52.952007375 +0000
     43475+++ vim73/src/if_mzsch.c        2012-06-03 23:09:55.416072949 +0000
    3992543476@@ -31,8 +31,6 @@
    3992643477  * depend". */
     
    4008143632 
    4008243633diff -Naur vim73.orig/src/if_ole.h vim73/src/if_ole.h
    40083 --- vim73.orig/src/if_ole.h     2012-02-15 21:57:45.041435628 +0000
    40084 +++ vim73/src/if_ole.h  2012-02-15 21:57:46.053462322 +0000
     43634--- vim73.orig/src/if_ole.h     2012-06-03 23:09:52.924006631 +0000
     43635+++ vim73/src/if_ole.h  2012-06-03 23:09:54.208040801 +0000
    4008543636@@ -46,8 +46,11 @@
    4008643637 /* header files for imported files */
     
    4009843649 #define __IVim_INTERFACE_DEFINED__
    4009943650diff -Naur vim73.orig/src/if_perl.xs vim73/src/if_perl.xs
    40100 --- vim73.orig/src/if_perl.xs   2012-02-15 21:57:45.053435946 +0000
    40101 +++ vim73/src/if_perl.xs        2012-02-15 21:57:46.949485954 +0000
     43651--- vim73.orig/src/if_perl.xs   2012-06-03 23:09:52.940007057 +0000
     43652+++ vim73/src/if_perl.xs        2012-06-03 23:09:55.604077952 +0000
    4010243653@@ -106,7 +106,7 @@
    4010343654 #define close_dll dlclose
     
    4020643757        if (safe == NULL || !SvTRUE(safe))
    4020743758            EMSG(_("E299: Perl evaluation forbidden in sandbox without the Safe module"));
    40208 @@ -1108,7 +1129,7 @@
     43759@@ -892,24 +913,6 @@
     43760 win_T *win_find_nr(int n) { return curwin; }
     43761 #endif
     43762 
     43763-XS(XS_VIM_Msg);
     43764-XS(XS_VIM_SetOption);
     43765-XS(XS_VIM_DoCommand);
     43766-XS(XS_VIM_Eval);
     43767-XS(XS_VIM_Buffers);
     43768-XS(XS_VIM_Windows);
     43769-XS(XS_VIWIN_DESTROY);
     43770-XS(XS_VIWIN_Buffer);
     43771-XS(XS_VIWIN_SetHeight);
     43772-XS(XS_VIWIN_Cursor);
     43773-XS(XS_VIBUF_DESTROY);
     43774-XS(XS_VIBUF_Name);
     43775-XS(XS_VIBUF_Number);
     43776-XS(XS_VIBUF_Count);
     43777-XS(XS_VIBUF_Get);
     43778-XS(XS_VIBUF_Set);
     43779-XS(XS_VIBUF_Delete);
     43780-XS(XS_VIBUF_Append);
     43781 XS(boot_VIM);
     43782 
     43783     static void
     43784@@ -1108,7 +1111,7 @@
    4020943785     VIWIN win
    4021043786 
     
    4021543791       EXTEND(sp, 2);
    4021643792       if (!win_valid(win))
    40217 @@ -1116,7 +1137,7 @@
     43793@@ -1116,7 +1119,7 @@
    4021843794       PUSHs(sv_2mortal(newSViv(win->w_cursor.lnum)));
    4021943795       PUSHs(sv_2mortal(newSViv(win->w_cursor.col)));
     
    4022443800       int lnum, col;
    4022543801 
    40226 @@ -1249,9 +1270,9 @@
     43802@@ -1249,9 +1252,9 @@
    4022743803        {
    4022843804            lnum = SvIV(ST(1));
     
    4023743813                count = -count;
    4023843814diff -Naur vim73.orig/src/if_py_both.h vim73/src/if_py_both.h
    40239 --- vim73.orig/src/if_py_both.h 2012-02-15 21:57:45.061436156 +0000
    40240 +++ vim73/src/if_py_both.h      2012-02-15 21:57:46.869483845 +0000
     43815--- vim73.orig/src/if_py_both.h 2012-06-03 23:09:52.948007269 +0000
     43816+++ vim73/src/if_py_both.h      2012-06-03 23:09:55.732081359 +0000
    4024143817@@ -12,6 +12,12 @@
    4024243818  * Common code for if_python.c and if_python3.c.
     
    4027643852 
    4027743853 #define PyErr_SetVim(str) PyErr_SetString(VimError, str)
    40278 @@ -62,10 +71,10 @@
     43854@@ -62,10 +71,15 @@
    4027943855 OutputWrite(PyObject *self, PyObject *args)
    4028043856 {
     
    4028643862-    if (!PyArg_ParseTuple(args, "s#", &str, &len))
    4028743863+    if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
     43864+       return NULL;
     43865+
     43866+    /* TODO: This works around a gcc optimizer problem and avoids Vim
     43867+     * from crashing.  Should find a real solution. */
     43868+    if (str == NULL)
    4028843869        return NULL;
    4028943870 
    4029043871     Py_BEGIN_ALLOW_THREADS
    40291 @@ -73,6 +82,7 @@
     43872@@ -73,6 +87,7 @@
    4029243873     writer((writefn)(error ? emsg : msg), (char_u *)str, len);
    4029343874     Python_Release_Vim();
     
    4029743878     Py_INCREF(Py_None);
    4029843879     return Py_None;
    40299 @@ -101,10 +111,10 @@
     43880@@ -101,10 +116,10 @@
    4030043881     for (i = 0; i < n; ++i)
    4030143882     {
     
    4031043891            Py_DECREF(list);
    4031143892            return NULL;
    40312 @@ -115,6 +125,7 @@
     43893@@ -115,6 +130,7 @@
    4031343894        writer((writefn)(error ? emsg : msg), (char_u *)str, len);
    4031443895        Python_Release_Vim();
     
    4031843899 
    4031943900     Py_DECREF(list);
    40320 @@ -122,52 +133,28 @@
     43901@@ -122,52 +138,28 @@
    4032143902     return Py_None;
    4032243903 }
     
    4034243923-    while (new_size < n)
    4034343924-       new_size += 80;
    40344 -
     43925+    /* do nothing */
     43926+    Py_INCREF(Py_None);
     43927+    return Py_None;
     43928+}
     43929 
    4034543930-    if (new_size != buffer_size)
    4034643931-    {
     
    4034843933-       if (new_buffer == NULL)
    4034943934-           return;
    40350 +    /* do nothing */
    40351 +    Py_INCREF(Py_None);
    40352 +    return Py_None;
    40353 +}
    4035443935 
    4035543936-       if (buffer)
     
    4035843939-           vim_free(buffer);
    4035943940-       }
    40360  
     43941-
    4036143942-       buffer = new_buffer;
    4036243943-       buffer_size = new_size;
     
    4038443965 
    4038543966     static void
    40386 @@ -175,30 +162,34 @@
     43967@@ -175,30 +167,34 @@
    4038743968 {
    4038843969     char_u *ptr;
     
    4043144012 
    4043244013 /***************/
    40433 @@ -543,7 +534,6 @@
     44014@@ -543,7 +539,6 @@
    4043444015     {
    4043544016        long lnum;
     
    4043944020        if (!PyArg_Parse(val, "(ll)", &lnum, &col))
    4044044021            return -1;
    40441 @@ -558,18 +548,15 @@
     44022@@ -558,18 +553,15 @@
    4044244023        if (VimErrorCheck())
    4044344024            return -1;
     
    4046144042     }
    4046244043     else if (strcmp(name, "height") == 0)
    40463 @@ -698,6 +685,7 @@
     44044@@ -698,6 +690,7 @@
    4046444045 {
    4046544046     const char *str;
     
    4046944050     PyInt i;
    4047044051     char *p;
    40471 @@ -708,8 +696,9 @@
     44052@@ -708,8 +701,9 @@
    4047244053        return NULL;
    4047344054     }
     
    4048144062     /*
    4048244063      * Error checking: String must not contain newlines, as we
    40483 @@ -748,6 +737,7 @@
     44064@@ -748,6 +742,7 @@
    4048444065     }
    4048544066 
     
    4048944070     return save;
    4049044071 }
    40491 @@ -834,7 +824,8 @@
     44072@@ -834,7 +829,8 @@
    4049244073     invalidate_botline();
    4049344074 }
     
    4049944080  * a Python string object. The object is checked for validity
    4050044081  * and correct format. Errors are returned as a value of FAIL.
    40501 @@ -925,6 +916,193 @@
     44082@@ -925,6 +921,193 @@
    4050244083     }
    4050344084 }
     
    4069344274 /* Insert a number of lines into the specified buffer after the specifed line.
    4069444275  * The line number is in Vim format (1-based). The lines to be inserted are
    40695 @@ -1130,6 +1308,40 @@
     44276@@ -1130,6 +1313,40 @@
    4069644277     return 0;
    4069744278 }
     
    4073444315     static PyObject *
    4073544316 RBAppend(BufferObject *self, PyObject *args, PyInt start, PyInt end, PyInt *new_end)
    40736 @@ -1267,6 +1479,9 @@
     44317@@ -1267,6 +1484,9 @@
    4073744318     {"append",     BufferAppend,       1,          "Append data to Vim buffer" },
    4073844319     {"mark",       BufferMark,         1,          "Return (row,col) representing position of named mark" },
     
    4074544326 
    4074644327diff -Naur vim73.orig/src/if_python.c vim73/src/if_python.c
    40747 --- vim73.orig/src/if_python.c  2012-02-15 21:57:45.041435628 +0000
    40748 +++ vim73/src/if_python.c       2012-02-15 21:57:46.377470867 +0000
     44328--- vim73.orig/src/if_python.c  2012-06-03 23:09:52.924006631 +0000
     44329+++ vim73/src/if_python.c       2012-06-03 23:09:54.636052191 +0000
    4074944330@@ -56,6 +56,10 @@
    4075044331 
     
    4115544736  *
    4115644737diff -Naur vim73.orig/src/if_python3.c vim73/src/if_python3.c
    41157 --- vim73.orig/src/if_python3.c 2012-02-15 21:57:45.053435946 +0000
    41158 +++ vim73/src/if_python3.c      2012-02-15 21:57:46.873483950 +0000
     44738--- vim73.orig/src/if_python3.c 2012-06-03 23:09:52.940007057 +0000
     44739+++ vim73/src/if_python3.c      2012-06-03 23:09:55.312070180 +0000
    4115944740@@ -22,8 +22,8 @@
    4116044741  * Adaptations to support both python3.x and python2.x
     
    4172145302     return result;
    4172245303diff -Naur vim73.orig/src/if_ruby.c vim73/src/if_ruby.c
    41723 --- vim73.orig/src/if_ruby.c    2012-02-15 21:57:45.057436051 +0000
    41724 +++ vim73/src/if_ruby.c 2012-02-15 21:57:46.305468968 +0000
     45304--- vim73.orig/src/if_ruby.c    2012-06-03 23:09:52.948007269 +0000
     45305+++ vim73/src/if_ruby.c 2012-06-03 23:09:55.752081889 +0000
    4172545306@@ -4,12 +4,17 @@
    4172645307  *
     
    4209445675     }
    4209545676     return str;
     45677@@ -1187,6 +1238,11 @@
     45678     return Qnil;
     45679 }
     45680 
     45681+static VALUE f_nop(VALUE self UNUSED)
     45682+{
     45683+    return Qnil;
     45684+}
     45685+
     45686 static VALUE f_p(int argc, VALUE *argv, VALUE self UNUSED)
     45687 {
     45688     int i;
     45689@@ -1208,6 +1264,7 @@
     45690 
     45691     rb_stdout = rb_obj_alloc(rb_cObject);
     45692     rb_define_singleton_method(rb_stdout, "write", vim_message, 1);
     45693+    rb_define_singleton_method(rb_stdout, "flush", f_nop, 0);
     45694     rb_define_global_function("p", f_p, -1);
     45695 }
     45696 
    4209645697diff -Naur vim73.orig/src/if_sniff.c vim73/src/if_sniff.c
    42097 --- vim73.orig/src/if_sniff.c   2012-02-15 21:57:45.041435628 +0000
    42098 +++ vim73/src/if_sniff.c        2012-02-15 21:57:45.469446917 +0000
     45698--- vim73.orig/src/if_sniff.c   2012-06-03 23:09:52.924006631 +0000
     45699+++ vim73/src/if_sniff.c        2012-06-03 23:09:53.508022172 +0000
    4209945700@@ -9,7 +9,6 @@
    4210045701 
     
    4210645707 # include <assert.h>
    4210745708diff -Naur vim73.orig/src/if_tcl.c vim73/src/if_tcl.c
    42108 --- vim73.orig/src/if_tcl.c     2012-02-15 21:57:45.041435628 +0000
    42109 +++ vim73/src/if_tcl.c  2012-02-15 21:57:46.289468547 +0000
    42110 @@ -74,7 +74,6 @@
     45709--- vim73.orig/src/if_tcl.c     2012-06-03 23:09:52.920006524 +0000
     45710+++ vim73/src/if_tcl.c  2012-06-03 23:09:55.492074972 +0000
     45711@@ -74,18 +74,18 @@
    4211145712 #endif
    4211245713 
     
    4211645717 
    4211745718 typedef struct
    42118 @@ -1885,14 +1884,14 @@
     45719 {
     45720     Tcl_Interp *interp;
     45721+    int exitvalue;
     45722     int range_start, range_end;
     45723     int lbase;
     45724     char *curbuf, *curwin;
     45725 } tcl_info;
     45726 
     45727-static tcl_info tclinfo = { NULL, 0, 0, 0, NULL, NULL };
     45728+static tcl_info tclinfo = { NULL, 0, 0, 0, 0, NULL, NULL };
     45729 
     45730 #define VAR_RANGE1     "::vim::range(start)"
     45731 #define VAR_RANGE2     "::vim::range(begin)"
     45732@@ -280,16 +280,19 @@
     45733  ****************************************************************************/
     45734 
     45735 /*
     45736- * Replace standard "exit" and "catch" commands.
     45737+ * Replace standard "exit" command.
     45738  *
     45739- * This is a design flaw in Tcl -  the standard "exit" command just calls
     45740- * exit() and kills the application.  It should return TCL_EXIT to the
     45741- * app, which then decides if it wants to terminate or not.  In our case,
     45742- * we just delete the Tcl interpreter (and create a new one with the next
     45743- * :tcl command).
     45744+ * Delete the Tcl interpreter; a new one will be created with the next
     45745+ * :tcl command). The exit code is saved (and retrieved in tclexit()).
     45746+ * Since Tcl's exit is never expected to return and this replacement
     45747+ * does, then (except for a trivial case) additional Tcl commands will
     45748+ * be run. Since the interpreter is now marked as deleted, an error
     45749+ * will be returned -- typically "attempt to call eval in deleted
     45750+ * interpreter". Hopefully, at this point, checks for TCL_ERROR take
     45751+ * place and control percolates back up to Vim -- but with this new error
     45752+ * string in the interpreter's result value. Therefore it would be
     45753+ * useless for this routine to return the exit code via Tcl_SetResult().
     45754  */
     45755-#define TCL_EXIT       5
     45756-
     45757     static int
     45758 exitcmd(dummy, interp, objc, objv)
     45759     ClientData dummy UNUSED;
     45760@@ -306,47 +309,12 @@
     45761                break;
     45762            /* FALLTHROUGH */
     45763        case 1:
     45764-           Tcl_SetObjResult(interp, Tcl_NewIntObj(value));
     45765-           return TCL_EXIT;
     45766-       default:
     45767-           Tcl_WrongNumArgs(interp, 1, objv, "?returnCode?");
     45768-    }
     45769-    return TCL_ERROR;
     45770-}
     45771+           tclinfo.exitvalue = value;
     45772 
     45773-    static int
     45774-catchcmd(dummy, interp, objc, objv)
     45775-    ClientData dummy UNUSED;
     45776-    Tcl_Interp *interp;
     45777-    int                objc;
     45778-    Tcl_Obj    *CONST objv[];
     45779-{
     45780-    char    *varname = NULL;
     45781-    int            result;
     45782-
     45783-    switch (objc)
     45784-    {
     45785-       case 3:
     45786-           varname = Tcl_GetStringFromObj(objv[2], NULL);
     45787-           /* fallthrough */
     45788-       case 2:
     45789-           Tcl_ResetResult(interp);
     45790-           Tcl_AllowExceptions(interp);
     45791-           result = Tcl_EvalObj(interp, objv[1]);
     45792-           if (result == TCL_EXIT)
     45793-               return result;
     45794-           if (varname)
     45795-           {
     45796-               if (Tcl_SetVar(interp, varname, Tcl_GetStringResult(interp), 0) == NULL)
     45797-               {
     45798-                   Tcl_SetResult(interp, "couldn't save command result in variable", TCL_STATIC);
     45799-                   return TCL_ERROR;
     45800-               }
     45801-           }
     45802-           Tcl_SetObjResult(interp, Tcl_NewIntObj(result));
     45803-           return TCL_OK;
     45804+           Tcl_DeleteInterp(interp);
     45805+           break;
     45806        default:
     45807-           Tcl_WrongNumArgs(interp, 1, objv, "command ?varName?");
     45808+           Tcl_WrongNumArgs(interp, 1, objv, "?returnCode?");
     45809     }
     45810     return TCL_ERROR;
     45811 }
     45812@@ -373,6 +341,7 @@
     45813 /*
     45814  *  "::vim::buffer list" - create a list of buffer commands.
     45815  *  "::vim::buffer {N}" - create buffer command for buffer N.
     45816+ *  "::vim::buffer exists {N}" - test if buffer N exists.
     45817  *  "::vim::buffer new" - create a new buffer (not implemented)
     45818  */
     45819     static int
     45820@@ -1664,7 +1633,7 @@
     45821 static Tcl_ChannelType channel_type =
     45822 {
     45823     "vimmessage",      /* typeName */
     45824-    NULL,              /* version */
     45825+    TCL_CHANNEL_VERSION_2, /* version */
     45826     channel_close,     /* closeProc */
     45827     channel_input,     /* inputProc */
     45828     channel_output,    /* outputProc */
     45829@@ -1679,6 +1648,8 @@
     45830     NULL,              /* flushProc */
     45831     NULL,              /* handlerProc */
     45832 #endif
     45833+/* The following should not be necessary since TCL_CHANNEL_VERSION_2 was
     45834+ * set above */
     45835 #ifdef TCL_CHANNEL_VERSION_3
     45836     NULL,              /* wideSeekProc */
     45837 #endif
     45838@@ -1742,7 +1713,9 @@
     45839        Tcl_Interp *interp;
     45840        static Tcl_Channel ch1, ch2;
     45841 
     45842-       /* replace stdout and stderr */
     45843+       /* Create replacement channels for stdout and stderr; this has to be
     45844+        * done each time an interpreter is created since the channels are closed
     45845+        * when the interpreter is deleted */
     45846        ch1 = Tcl_CreateChannel(&channel_type, "vimout", VIMOUT, TCL_WRITABLE);
     45847        ch2 = Tcl_CreateChannel(&channel_type, "vimerr", VIMERR, TCL_WRITABLE);
     45848        Tcl_SetStdChannel(ch1, TCL_STDOUT);
     45849@@ -1762,15 +1735,18 @@
     45850 #endif
     45851 
     45852        Tcl_SetChannelOption(interp, ch1, "-buffering", "line");
     45853+#ifdef WIN3264
     45854+       Tcl_SetChannelOption(interp, ch1, "-translation", "lf");
     45855+#endif
     45856        Tcl_SetChannelOption(interp, ch2, "-buffering", "line");
     45857+#ifdef WIN3264
     45858+       Tcl_SetChannelOption(interp, ch2, "-translation", "lf");
     45859+#endif
     45860 
     45861-       /* replace some standard Tcl commands */
     45862+       /* replace standard Tcl exit command */
     45863        Tcl_DeleteCommand(interp, "exit");
     45864        Tcl_CreateObjCommand(interp, "exit", exitcmd,
     45865            (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
     45866-       Tcl_DeleteCommand(interp, "catch");
     45867-       Tcl_CreateObjCommand(interp, "catch", catchcmd,
     45868-           (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
     45869 
     45870        /* new commands, in ::vim namespace */
     45871        Tcl_CreateObjCommand(interp, "::vim::buffer", buffercmd,
     45872@@ -1822,6 +1798,8 @@
     45873        tclinfo.range_end = row2tcl(eap->line2);
     45874        tclupdatevars();
     45875     }
     45876+
     45877+    tclinfo.exitvalue = 0;
     45878     return OK;
     45879 }
     45880 
     45881@@ -1885,30 +1863,23 @@
    4211945882 {
    4212045883     int newerr = OK;
    4212145884 
    4212245885-    if (error == TCL_EXIT )
    42123 +    if (error == TCL_EXIT)
     45886+    if (Tcl_InterpDeleted(tclinfo.interp)     /* True if we intercepted Tcl's exit command */
     45887+#if (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 5) || TCL_MAJOR_VERSION > 8
     45888+       || Tcl_LimitExceeded(tclinfo.interp)  /* True if the interpreter cannot continue */
     45889+#endif
     45890+       )
    4212445891     {
    42125         int retval;
     45892-       int retval;
    4212645893        char buf[50];
    42127         Tcl_Obj *robj;
    42128  
    42129         robj = Tcl_GetObjResult(tclinfo.interp);
     45894-       Tcl_Obj *robj;
     45895 
     45896-       robj = Tcl_GetObjResult(tclinfo.interp);
    4213045897-       if( Tcl_GetIntFromObj(tclinfo.interp, robj, &retval) != TCL_OK )
    42131 +       if (Tcl_GetIntFromObj(tclinfo.interp, robj, &retval) != TCL_OK)
     45898+       sprintf(buf, _("E572: exit code %d"), tclinfo.exitvalue);
     45899+       tclerrmsg(buf);
     45900+       if (tclinfo.exitvalue == 0)
    4213245901        {
    42133             EMSG(_("E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"));
    42134             newerr = FAIL;
    42135 @@ -1901,7 +1900,7 @@
    42136         {
    42137             sprintf(buf, _("E572: exit code %d"), retval);
    42138             tclerrmsg(buf);
     45902-           EMSG(_("E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"));
     45903-           newerr = FAIL;
     45904+           did_emsg = 0;
     45905+           newerr = OK;
     45906        }
     45907        else
     45908-       {
     45909-           sprintf(buf, _("E572: exit code %d"), retval);
     45910-           tclerrmsg(buf);
    4213945911-           if (retval == 0 )
    42140 +           if (retval == 0)
    42141             {
    42142                 did_emsg = 0;
    42143                 newerr = OK;
     45912-           {
     45913-               did_emsg = 0;
     45914-               newerr = OK;
     45915-           }
     45916-           else
     45917-               newerr = FAIL;
     45918-       }
     45919+           newerr = FAIL;
     45920 
     45921        tcldelthisinterp();
     45922     }
     45923@@ -2022,7 +1993,12 @@
     45924        Tcl_SetVar(tclinfo.interp, var_line, line, 0);
     45925        Tcl_AllowExceptions(tclinfo.interp);
     45926        err = Tcl_Eval(tclinfo.interp, script);
     45927-       if (err != TCL_OK)
     45928+       if (err != TCL_OK
     45929+           || Tcl_InterpDeleted(tclinfo.interp)
     45930+#if (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 5) || TCL_MAJOR_VERSION > 8
     45931+           || Tcl_LimitExceeded(tclinfo.interp)
     45932+#endif
     45933+          )
     45934            break;
     45935        line = (char *)Tcl_GetVar(tclinfo.interp, var_line, 0);
     45936        if (line)
    4214445937diff -Naur vim73.orig/src/integration.c vim73/src/integration.c
    42145 --- vim73.orig/src/integration.c        2012-02-15 21:57:45.061436156 +0000
    42146 +++ vim73/src/integration.c     2012-02-15 21:57:45.489447445 +0000
     45938--- vim73.orig/src/integration.c        2012-06-03 23:09:52.952007375 +0000
     45939+++ vim73/src/integration.c     2012-06-03 23:09:53.532022810 +0000
    4214745940@@ -33,7 +33,6 @@
    4214845941 #include <sys/un.h>
     
    4215445947 #include <sys/param.h>
    4215545948diff -Naur vim73.orig/src/keymap.h vim73/src/keymap.h
    42156 --- vim73.orig/src/keymap.h     2012-02-15 21:57:45.061436156 +0000
    42157 +++ vim73/src/keymap.h  2012-02-15 21:57:46.801482050 +0000
     45949--- vim73.orig/src/keymap.h     2012-06-03 23:09:52.948007269 +0000
     45950+++ vim73/src/keymap.h  2012-06-03 23:09:55.220067733 +0000
    4215845951@@ -92,13 +92,13 @@
    4215945952  */
     
    4219245985 #define K_TEAROFF      TERMCAP2KEY(KS_TEAROFF, KE_FILLER)
    4219345986diff -Naur vim73.orig/src/link.sh vim73/src/link.sh
    42194 --- vim73.orig/src/link.sh      2012-02-15 21:57:45.041435628 +0000
    42195 +++ vim73/src/link.sh   2012-02-15 21:57:45.325443119 +0000
     45987--- vim73.orig/src/link.sh      2012-06-03 23:09:52.924006631 +0000
     45988+++ vim73/src/link.sh   2012-06-03 23:09:53.304016743 +0000
    4219645989@@ -5,7 +5,7 @@
    4219745990 # libraries when they exist, but this doesn't mean they are needed for Vim.
     
    4223846031 #
    4223946032diff -Naur vim73.orig/src/macros.h vim73/src/macros.h
    42240 --- vim73.orig/src/macros.h     2012-02-15 21:57:45.061436156 +0000
    42241 +++ vim73/src/macros.h  2012-02-15 21:57:45.153438583 +0000
     46033--- vim73.orig/src/macros.h     2012-06-03 23:09:52.952007375 +0000
     46034+++ vim73/src/macros.h  2012-06-03 23:09:53.080010781 +0000
    4224246035@@ -285,3 +285,17 @@
    4224346036 #else
     
    4225946052+#endif
    4226046053diff -Naur vim73.orig/src/main.c vim73/src/main.c
    42261 --- vim73.orig/src/main.c       2012-02-15 21:57:45.041435628 +0000
    42262 +++ vim73/src/main.c    2012-02-15 21:57:46.957486165 +0000
     46054--- vim73.orig/src/main.c       2012-06-03 23:09:52.920006524 +0000
     46055+++ vim73/src/main.c    2012-06-03 23:09:55.792082954 +0000
    4226346056@@ -7,10 +7,6 @@
    4226446057  * See README.txt for an overview of the Vim source code.
     
    4236246155     exe_pre_commands(&params);
    4236346156 
    42364 @@ -940,7 +964,7 @@
     46157@@ -904,6 +928,18 @@
     46158     TIME_MSG("VimEnter autocommands");
     46159 #endif
     46160 
     46161+#if defined(FEAT_EVAL) && defined(FEAT_CLIPBOARD)
     46162+    /* Adjust default register name for "unnamed" in 'clipboard'. Can only be
     46163+     * done after the clipboard is available and all initial commands that may
     46164+     * modify the 'clipboard' setting have run; i.e. just before entering the
     46165+     * main loop. */
     46166+    {
     46167+       int default_regname = 0;
     46168+       adjust_clip_reg(&default_regname);
     46169+       set_reg_var(default_regname);
     46170+    }
     46171+#endif
     46172+
     46173 #if defined(FEAT_DIFF) && defined(FEAT_SCROLLBIND)
     46174     /* When a startup script or session file setup for diff'ing and
     46175      * scrollbind, sync the scrollbind now. */
     46176@@ -940,7 +976,7 @@
    4236546177     if (netbeansArg != NULL && strncmp("-nb", netbeansArg, 3) == 0)
    4236646178     {
     
    4237146183        if (gui.in_use)
    4237246184        {
    42373 @@ -958,18 +982,13 @@
     46185@@ -958,18 +994,13 @@
    4237446186 
    4237546187     /*
     
    4239246204 /*
    4239346205  * Main loop: Execute Normal mode commands until exiting Vim.
    42394 @@ -1009,6 +1028,7 @@
     46206@@ -1009,6 +1040,7 @@
    4239546207        skip_redraw = FALSE;
    4239646208        RedrawingDisabled = 0;
     
    4240046212        emsg_skip = 0;
    4240146213 # endif
    42402 @@ -1202,7 +1222,9 @@
     46214@@ -1202,7 +1234,9 @@
    4240346215                        || conceal_cursor_line(curwin)
    4240446216                        || need_cursor_line_redraw))
     
    4241146223                update_single_line(curwin, conceal_new_cursor_line);
    4241246224                curwin->w_valid &= ~VALID_CROW;
    42413 @@ -1432,6 +1454,7 @@
     46225@@ -1335,7 +1369,7 @@
     46226                {
     46227                    apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname,
     46228                                                    buf->b_fname, FALSE, buf);
     46229-                   buf->b_changedtick = -1;    /* note that we did it already */
     46230+                   buf->b_changedtick = -1;  /* note that we did it already */
     46231                    /* start all over, autocommands may mess up the lists */
     46232                    next_tp = first_tabpage;
     46233                    break;
     46234@@ -1432,6 +1466,7 @@
    4241446235     mch_exit(exitval);
    4241546236 }
     
    4241946240  * Get a (optional) count for a Vim argument.
    4242046241  */
    42421 @@ -2996,6 +3019,8 @@
     46242@@ -2996,6 +3031,8 @@
    4242246243 #endif
    4242346244 }
     
    4242846249  * Get an environment variable, and execute it as Ex commands.
    4242946250  * Returns FAIL if the environment variable was not executed, OK otherwise.
    42430 @@ -3035,7 +3060,7 @@
     46251@@ -3035,7 +3072,7 @@
    4243146252     return FAIL;
    4243246253 }
     
    4243746258  * Return TRUE if we are certain the user owns the file "fname".
    4243846259  * Used for ".vimrc" and ".exrc".
    42439 @@ -3093,6 +3118,7 @@
     46260@@ -3093,6 +3130,7 @@
    4244046261     mainerr(ME_ARG_MISSING, str);
    4244146262 }
     
    4244546266  * print a message with three spaces prepended and '\n' appended.
    4244646267  */
    42447 @@ -3270,11 +3296,6 @@
     46268@@ -3155,6 +3193,7 @@
     46269 #endif
     46270     main_msg(_("-v\t\t\tVi mode (like \"vi\")"));
     46271     main_msg(_("-e\t\t\tEx mode (like \"ex\")"));
     46272+    main_msg(_("-E\t\t\tImproved Ex mode"));
     46273     main_msg(_("-s\t\t\tSilent (batch) mode (only for \"ex\")"));
     46274 #ifdef FEAT_DIFF
     46275     main_msg(_("-d\t\t\tDiff mode (like \"vimdiff\")"));
     46276@@ -3270,11 +3309,6 @@
    4244846277     main_msg(_("+reverse\t\tDon't use reverse video (also: +rv)"));
    4244946278     main_msg(_("-xrm <resource>\tSet the specified resource"));
     
    4245746286     mch_msg(_("\nArguments recognised by gvim (GTK+ version):\n"));
    4245846287     main_msg(_("-font <font>\t\tUse <font> for normal text (also: -fn)"));
    42459 @@ -3292,7 +3313,10 @@
     46288@@ -3283,6 +3317,7 @@
     46289     main_msg(_("-display <display>\tRun vim on <display> (also: --display)"));
     46290     main_msg(_("--role <role>\tSet a unique role to identify the main window"));
     46291     main_msg(_("--socketid <xid>\tOpen Vim inside another GTK widget"));
     46292+    main_msg(_("--echo-wid\t\tMake gvim echo the Window ID on stdout"));
     46293 #endif
     46294 #ifdef FEAT_GUI_W32
     46295     main_msg(_("-P <parent title>\tOpen Vim inside parent application"));
     46296@@ -3292,7 +3327,10 @@
    4246046297 #ifdef FEAT_GUI_GNOME
    4246146298     /* Gnome gives extra messages for --help if we continue, but not for -h. */
     
    4246846305 #endif
    4246946306        mch_exit(0);
    42470 @@ -3313,6 +3337,8 @@
     46307@@ -3313,6 +3351,8 @@
    4247146308 }
    4247246309 #endif
     
    4247746314 static void time_diff __ARGS((struct timeval *then, struct timeval *now));
    4247846315 
    42479 @@ -3422,7 +3448,7 @@
     46316@@ -3422,7 +3462,7 @@
    4248046317 
    4248146318 #endif
     
    4248646323 /*
    4248746324  * Common code for the X command server and the Win32 command server.
    42488 @@ -3806,7 +3832,7 @@
     46325@@ -3806,7 +3846,7 @@
    4248946326     int                i;
    4249046327     char_u     *inicmd = NULL;
     
    4249546332     if (filec > 0 && filev[0][0] == '+')
    4249646333     {
    42497 @@ -3817,15 +3843,25 @@
     46334@@ -3817,15 +3857,25 @@
    4249846335     /* Check if we have at least one argument. */
    4249946336     if (filec <= 0)
     
    4252346360     ga_init2(&ga, 1, 100);
    4252446361     ga_concat(&ga, (char_u *)"<C-\\><C-N>:cd ");
    42525 @@ -3858,13 +3894,20 @@
     46362@@ -3858,13 +3908,20 @@
    4252646363        ga_concat(&ga, p);
    4252746364        vim_free(p);
     
    4254846385     {
    4254946386        /* Can't use <CR> after "inicmd", because an "startinsert" would cause
    42550 @@ -3881,6 +3924,32 @@
     46387@@ -3881,6 +3938,32 @@
    4255146388 }
    4255246389 
     
    4258146418  */
    4258246419     void
    42583 @@ -3991,32 +4060,7 @@
     46420@@ -3991,32 +4074,7 @@
    4258446421 # endif
    4258546422     return res;
     
    4261646453  * When FEAT_FKMAP is defined, also compile the Farsi source code.
    4261746454diff -Naur vim73.orig/src/mark.c vim73/src/mark.c
    42618 --- vim73.orig/src/mark.c       2012-02-15 21:57:45.049435840 +0000
    42619 +++ vim73/src/mark.c    2012-02-15 21:57:45.665452088 +0000
     46455--- vim73.orig/src/mark.c       2012-06-03 23:09:52.932006845 +0000
     46456+++ vim73/src/mark.c    2012-06-03 23:09:53.736028239 +0000
    4262046457@@ -1750,7 +1750,10 @@
    4262146458            {
     
    4263146468                        case '"': curbuf->b_last_cursor = pos; break;
    4263246469diff -Naur vim73.orig/src/mbyte.c vim73/src/mbyte.c
    42633 --- vim73.orig/src/mbyte.c      2012-02-15 21:57:45.053435946 +0000
    42634 +++ vim73/src/mbyte.c   2012-02-15 21:57:46.633477621 +0000
     46470--- vim73.orig/src/mbyte.c      2012-06-03 23:09:52.940007057 +0000
     46471+++ vim73/src/mbyte.c   2012-06-03 23:09:55.956087319 +0000
    4263546472@@ -132,6 +132,7 @@
    4263646473 static int dbcs_char2cells __ARGS((int c));
     
    4264146478 /*
    4264246479  * Lookup table to quickly get the length in bytes of a UTF-8 character from
     46480@@ -707,7 +708,7 @@
     46481             */
     46482            n = (i & 0x80) ? 2 : 1;
     46483 # else
     46484-           char buf[MB_MAXBYTES];
     46485+           char buf[MB_MAXBYTES + 1];
     46486 # ifdef X_LOCALE
     46487 #  ifndef mblen
     46488 #   define mblen _Xmblen
    4264346489@@ -837,6 +838,27 @@
    4264446490 }
     
    4273546581  * Get character at **pp and advance *pp to the next character.
    4273646582  * Note: composing characters are skipped!
     46583  */
     46584@@ -1871,7 +1953,7 @@
     46585 /*
     46586  * Convert the character at screen position "off" to a sequence of bytes.
     46587  * Includes the composing characters.
     46588- * "buf" must at least have the length MB_MAXBYTES.
     46589+ * "buf" must at least have the length MB_MAXBYTES + 1.
     46590  * Only to be used when ScreenLinesUC[off] != 0.
     46591  * Returns the produced number of bytes.
    4273746592  */
    4273846593@@ -2667,7 +2749,8 @@
     
    4278146636 
    4278246637 static convertStruct toLower[] =
    42783 @@ -3036,7 +3122,7 @@
     46638@@ -2863,7 +2949,7 @@
     46639 {
     46640        {0x61,0x7a,1,-32},
     46641        {0xb5,0xb5,-1,743},
     46642-       {0xe0,0xf6,1,-32},
     46643+       {0xe0,0xf6,1,-32},  /* 0xdf (German sharp s) is not upper-cased */
     46644        {0xf8,0xfe,1,-32},
     46645        {0xff,0xff,-1,121},
     46646        {0x101,0x12f,2,-1},
     46647@@ -3036,14 +3122,15 @@
    4278446648        return TOUPPER_LOC(a);
    4278546649 
     
    4279046654 
    4279146655     int
    42792 @@ -3069,7 +3155,7 @@
     46656 utf_islower(a)
     46657     int                a;
     46658 {
     46659-    return (utf_toupper(a) != a);
     46660+    /* German sharp s is lower case but has no upper case equivalent. */
     46661+    return (utf_toupper(a) != a) || a == 0xdf;
     46662 }
     46663 
     46664 /*
     46665@@ -3069,7 +3156,7 @@
    4279346666        return TOLOWER_LOC(a);
    4279446667 
     
    4279946672 
    4280046673     int
    42801 @@ -3079,6 +3165,80 @@
     46674@@ -3079,6 +3166,80 @@
    4280246675     return (utf_tolower(a) != a);
    4280346676 }
     
    4288046753  * Version of strnicmp() that handles multi-byte characters.
    4288146754  * Needed for Big5, Sjift-JIS and UTF-8 encoding.  Other DBCS encodings can
    42882 @@ -3092,46 +3252,21 @@
     46755@@ -3092,46 +3253,21 @@
    4288346756     char_u     *s1, *s2;
    4288446757     size_t     nn;
     
    4293746810            if (l <= 1)
    4293846811            {
    42939 @@ -3560,7 +3695,7 @@
     46812@@ -3560,7 +3696,7 @@
    4294046813     void
    4294146814 mb_adjust_cursor()
     
    4294646819 
    4294746820 /*
    42948 @@ -3568,7 +3703,8 @@
     46821@@ -3568,7 +3704,8 @@
    4294946822  * If it points to a tail byte it's moved backwards to the head byte.
    4295046823  */
     
    4295646829 {
    4295746830     char_u     *p;
    42958 @@ -3579,7 +3715,7 @@
     46831@@ -3579,7 +3716,7 @@
    4295946832 #endif
    4296046833            )
     
    4296546838 #ifdef FEAT_VIRTUALEDIT
    4296646839        /* Reset "coladd" when the cursor would be on the right half of a
    42967 @@ -4126,7 +4262,7 @@
     46840@@ -4126,7 +4263,7 @@
    4296846841        done = to - (char *)result;
    4296946842     }
     
    4297446847     return result;
    4297546848 }
    42976 @@ -4159,11 +4295,11 @@
     46849@@ -4159,11 +4296,11 @@
    4297746850 {
    4297846851     if (hIconvDLL != 0 && hMsvcrtDLL != 0)
     
    4298946862     {
    4299046863        /* Only give the message when 'verbose' is set, otherwise it might be
    42991 @@ -5058,6 +5194,10 @@
     46864@@ -4368,7 +4505,8 @@
     46865     vgetc_busy = TRUE;
     46866     showmode();
     46867     vgetc_busy = old_vgetc_busy;
     46868-    setcursor();
     46869+    if ((State & NORMAL) || (State & INSERT))
     46870+       setcursor();
     46871     out_flush();
     46872 }
     46873 
     46874@@ -5058,6 +5196,10 @@
    4299246875                /* We had a keypad key, and XIM tried to thieve it */
    4299346876                return FALSE;
     
    4300046883            return imresult;
    4300146884        }
    43002 @@ -5167,16 +5307,16 @@
     46885@@ -5167,16 +5309,16 @@
    4300346886     void
    4300446887 xim_set_preedit()
     
    4302246905     {
    4302346906        /* hide XIM cursor */
    43024 @@ -5554,12 +5694,12 @@
     46907@@ -5554,12 +5696,12 @@
    4302546908     void
    4302646909 xim_set_status_area()
     
    4303946922        if (input_style & XIMPreeditArea)
    4304046923diff -Naur vim73.orig/src/memfile.c vim73/src/memfile.c
    43041 --- vim73.orig/src/memfile.c    2012-02-15 21:57:45.053435946 +0000
    43042 +++ vim73/src/memfile.c 2012-02-15 21:57:45.949459578 +0000
     46924--- vim73.orig/src/memfile.c    2012-06-03 23:09:52.940007057 +0000
     46925+++ vim73/src/memfile.c 2012-06-03 23:09:54.088037608 +0000
    4304346926@@ -32,10 +32,6 @@
    4304446927  * file is opened.
     
    4345147334diff -Naur vim73.orig/src/memfile_test.c vim73/src/memfile_test.c
    4345247335--- vim73.orig/src/memfile_test.c       1970-01-01 00:00:00.000000000 +0000
    43453 +++ vim73/src/memfile_test.c    2012-02-15 21:57:45.721453564 +0000
     47336+++ vim73/src/memfile_test.c    2012-06-03 23:09:53.800029943 +0000
    4345447337@@ -0,0 +1,145 @@
    4345547338+/* vi:set ts=8 sts=4 sw=4:
     
    4359947482+}
    4360047483diff -Naur vim73.orig/src/memline.c vim73/src/memline.c
    43601 --- vim73.orig/src/memline.c    2012-02-15 21:57:45.053435946 +0000
    43602 +++ vim73/src/memline.c 2012-02-15 21:57:46.577476142 +0000
     47484--- vim73.orig/src/memline.c    2012-06-03 23:09:52.940007057 +0000
     47485+++ vim73/src/memline.c 2012-06-03 23:09:54.908059430 +0000
    4360347486@@ -42,10 +42,6 @@
    4360447487  *  mf_get().
     
    4388647769                        if (process_still_running && choice >= 4)
    4388747770diff -Naur vim73.orig/src/menu.c vim73/src/menu.c
    43888 --- vim73.orig/src/menu.c       2012-02-15 21:57:45.053435946 +0000
    43889 +++ vim73/src/menu.c    2012-02-15 21:57:45.789455357 +0000
     47771--- vim73.orig/src/menu.c       2012-06-03 23:09:52.940007057 +0000
     47772+++ vim73/src/menu.c    2012-06-03 23:09:53.876031965 +0000
    4389047773@@ -1394,7 +1394,8 @@
    4389147774     int                idx;
     
    4393347816                {
    4393447817diff -Naur vim73.orig/src/message.c vim73/src/message.c
    43935 --- vim73.orig/src/message.c    2012-02-15 21:57:45.065436261 +0000
    43936 +++ vim73/src/message.c 2012-02-15 21:57:46.837483000 +0000
     47818--- vim73.orig/src/message.c    2012-06-03 23:09:52.956007482 +0000
     47819+++ vim73/src/message.c 2012-06-03 23:09:55.664079548 +0000
    4393747820@@ -39,7 +39,6 @@
    4393847821 static void msg_screen_putchar __ARGS((int c, int attr));
     
    4418348066            {
    4418448067                p_extra = (char_u *)"";
    44185 @@ -2438,7 +2501,7 @@
     48068@@ -2285,6 +2348,16 @@
     48069 }
     48070 
     48071 /*
     48072+ * Mark the last message chunk as finishing the line.
     48073+ */
     48074+    void
     48075+msg_sb_eol()
     48076+{
     48077+    if (last_msgchunk != NULL)
     48078+       last_msgchunk->sb_eol = TRUE;
     48079+}
     48080+
     48081+/*
     48082  * Display a screen line from previously displayed text at row "row".
     48083  * Returns a pointer to the text for the next line (can be NULL).
     48084  */
     48085@@ -2438,7 +2511,7 @@
    4418648086 #ifdef FEAT_CON_DIALOG
    4418748087     int                retval = FALSE;
     
    4419248092     msgchunk_T *mp;
    4419348093     int                i;
    44194 @@ -2489,49 +2552,49 @@
     48094@@ -2489,49 +2562,49 @@
    4419548095        }
    4419648096 #endif
     
    4425148151            break;
    4425248152 
    44253 @@ -2584,9 +2647,9 @@
     48153@@ -2584,9 +2657,9 @@
    4425448154            continue;
    4425548155        }
     
    4426348163                /* go to start of last line */
    4426448164                if (mp_last == NULL)
    44265 @@ -2604,7 +2667,7 @@
     48165@@ -2604,7 +2677,7 @@
    4426648166                if (mp != NULL && mp->sb_prev != NULL)
    4426748167                {
     
    4427248172                        if (mp == NULL || mp->sb_prev == NULL)
    4427348173                            break;
    44274 @@ -2615,7 +2678,7 @@
     48174@@ -2615,7 +2688,7 @@
    4427548175                            mp_last = msg_sb_start(mp_last->sb_prev);
    4427648176                    }
     
    4428148181                    {
    4428248182                        /* display line at top */
    44283 @@ -2631,13 +2694,13 @@
     48183@@ -2631,13 +2704,13 @@
    4428448184                            ++msg_scrolled;
    4428548185                        }
     
    4429748197                    /* scroll up, display line at bottom */
    4429848198                    msg_scroll_up();
    44299 @@ -2645,11 +2708,11 @@
     48199@@ -2645,11 +2718,11 @@
    4430048200                    screen_fill((int)Rows - 2, (int)Rows - 1, 0,
    4430148201                                                   (int)Columns, ' ', ' ', 0);
     
    4431148211                /* displayed the requested text, more prompt again */
    4431248212                screen_fill((int)Rows - 1, (int)Rows, 0,
    44313 @@ -2659,7 +2722,7 @@
     48213@@ -2659,7 +2732,7 @@
    4431448214            }
    4431548215 
     
    4432048220 
    4432148221        break;
    44322 @@ -3019,12 +3082,9 @@
     48222@@ -3019,12 +3092,9 @@
    4432348223     if (redir_off)
    4432448224        return;
     
    4433648236     if (redirecting())
    4433748237     {
    44338 @@ -3038,9 +3098,12 @@
     48238@@ -3038,9 +3108,12 @@
    4433948239                    write_reg_contents(redir_reg, (char_u *)" ", -1, TRUE);
    4434048240                else if (redir_vname)
     
    4435048250            }
    4435148251        }
    44352 @@ -3052,13 +3115,16 @@
     48252@@ -3052,13 +3125,16 @@
    4435348253            var_redir_str(s, maxlen);
    4435448254 #endif
     
    4437048270                cur_col = 0;
    4437148271            else if (*s == '\t')
    44372 @@ -3076,7 +3142,7 @@
     48272@@ -3076,7 +3152,7 @@
    4437348273     int
    4437448274 redirecting()
     
    4437948279                          || redir_reg || redir_vname
    4438048280 #endif
    44381 @@ -3134,9 +3200,6 @@
     48281@@ -3134,9 +3210,6 @@
    4438248282        cmdline_row = msg_row;
    4438348283 }
     
    4438948289  * Called when 'verbosefile' is set: stop writing to the file.
    4439048290  */
    44391 @@ -3174,49 +3237,6 @@
     48291@@ -3174,49 +3247,6 @@
    4439248292 }
    4439348293 
     
    4443948339  * Use 'w' highlighting and may repeat the message after redrawing
    4444048340  */
    44441 @@ -3294,7 +3314,7 @@
     48341@@ -3294,7 +3324,7 @@
    4444248342  * different letter.
    4444348343  */
     
    4444848348     char_u     *title UNUSED;
    4444948349     char_u     *message;
    44450 @@ -3302,6 +3322,8 @@
     48350@@ -3302,6 +3332,8 @@
    4445148351     int                dfltbutton;
    4445248352     char_u     *textfield UNUSED;      /* IObuff for inputdialog(), NULL
     
    4445748357     int                oldState;
    4445848358     int                retval = 0;
    44459 @@ -3320,7 +3342,7 @@
     48359@@ -3320,7 +3352,7 @@
    4446048360     if (gui.in_use && vim_strchr(p_go, GO_CONDIALOG) == NULL)
    4446148361     {
     
    4446648366        need_wait_return = FALSE;
    4446748367        emsg_on_display = FALSE;
    44468 @@ -3367,6 +3389,13 @@
     48368@@ -3367,6 +3399,13 @@
    4446948369            default:            /* Could be a hotkey? */
    4447048370                if (c < 0)      /* special keys are ignored here */
     
    4448048380                c = MB_TOLOWER(c);
    4448148381                retval = 1;
    44482 @@ -3640,7 +3669,7 @@
     48382@@ -3640,7 +3679,7 @@
    4448348383     if (do_dialog(type,
    4448448384                title == NULL ? (char_u *)_("Question") : title,
     
    4448948389     return VIM_NO;
    4449048390 }
    44491 @@ -3655,7 +3684,7 @@
     48391@@ -3655,7 +3694,7 @@
    4449248392     switch (do_dialog(type,
    4449348393                title == NULL ? (char_u *)_("Question") : title,
     
    4449848398        case 1: return VIM_YES;
    4449948399        case 2: return VIM_NO;
    44500 @@ -3674,7 +3703,7 @@
     48400@@ -3674,7 +3713,7 @@
    4450148401                title == NULL ? (char_u *)"Question" : title,
    4450248402                message,
     
    4450848408        case 2: return VIM_NO;
    4450948409diff -Naur vim73.orig/src/misc1.c vim73/src/misc1.c
    44510 --- vim73.orig/src/misc1.c      2012-02-15 21:57:45.057436051 +0000
    44511 +++ vim73/src/misc1.c   2012-02-15 21:57:46.909484899 +0000
     48410--- vim73.orig/src/misc1.c      2012-06-03 23:09:52.944007163 +0000
     48411+++ vim73/src/misc1.c   2012-06-03 23:09:55.940086894 +0000
    4451248412@@ -363,7 +363,7 @@
    4451348413 
     
    4468748587 }
    4468848588 #endif
     48589@@ -1907,7 +1932,7 @@
     48590     int                c;
     48591 {
     48592 #if defined(FEAT_MBYTE) || defined(PROTO)
     48593-    char_u     buf[MB_MAXBYTES];
     48594+    char_u     buf[MB_MAXBYTES + 1];
     48595     int                n;
     48596 
     48597     n = (*mb_char2bytes)(c, buf);
    4468948598@@ -2919,7 +2944,7 @@
    4469048599     buf_T      *buf;
     
    4486848777                    p = pp;
    4486948778                    *mustfree = TRUE;
    44870 @@ -4549,25 +4608,21 @@
     48779@@ -4074,17 +4133,6 @@
     48780        {
     48781            vim_setenv((char_u *)"VIMRUNTIME", p);
     48782            didset_vimruntime = TRUE;
     48783-#ifdef FEAT_GETTEXT
     48784-           {
     48785-               char_u  *buf = concat_str(p, (char_u *)"/lang");
     48786-
     48787-               if (buf != NULL)
     48788-               {
     48789-                   bindtextdomain(VIMPACKAGE, (char *)buf);
     48790-                   vim_free(buf);
     48791-               }
     48792-           }
     48793-#endif
     48794        }
     48795        else
     48796        {
     48797@@ -4162,6 +4210,22 @@
     48798        putenv((char *)envbuf);
     48799     }
     48800 #endif
     48801+#ifdef FEAT_GETTEXT
     48802+    /*
     48803+     * When setting $VIMRUNTIME adjust the directory to find message
     48804+     * translations to $VIMRUNTIME/lang.
     48805+     */
     48806+    if (*val != NUL && STRICMP(name, "VIMRUNTIME") == 0)
     48807+    {
     48808+       char_u  *buf = concat_str(val, (char_u *)"/lang");
     48809+
     48810+       if (buf != NULL)
     48811+       {
     48812+           bindtextdomain(VIMPACKAGE, (char *)buf);
     48813+           vim_free(buf);
     48814+       }
     48815+    }
     48816+#endif
     48817 }
     48818 
     48819 #if defined(FEAT_CMDL_COMPL) || defined(PROTO)
     48820@@ -4549,25 +4613,21 @@
    4487148821 vim_ispathsep(c)
    4487248822     int c;
     
    4490248852 
    4490348853 #if defined(FEAT_SEARCHPATH) || defined(PROTO)
    44904 @@ -4907,7 +4962,7 @@
     48854@@ -4907,11 +4967,12 @@
    4490548855 static int     cin_islinecomment __ARGS((char_u *));
    4490648856 static int     cin_isterminated __ARGS((char_u *, int, int));
     
    4491148861 static int     cin_iselse __ARGS((char_u *));
    4491248862 static int     cin_isdo __ARGS((char_u *));
    44913 @@ -4923,6 +4978,7 @@
     48863 static int     cin_iswhileofdo __ARGS((char_u *, linenr_T, int));
     48864+static int     cin_is_if_for_while_before_offset __ARGS((char_u *line, int *poffset));
     48865 static int     cin_iswhileofdo_end __ARGS((int terminated, int ind_maxparen, int ind_maxcomment));
     48866 static int     cin_isbreak __ARGS((char_u *));
     48867 static int     cin_is_cpp_baseclass __ARGS((colnr_T *col));
     48868@@ -4923,6 +4984,7 @@
    4491448869 static int     corr_ind_maxparen __ARGS((int ind_maxparen, pos_T *startpos));
    4491548870 static int     find_last_paren __ARGS((char_u *l, int start, int end));
     
    4491948874 static int     ind_hash_comment = 0;   /* # starts a comment */
    4492048875 
    44921 @@ -4968,7 +5024,7 @@
     48876@@ -4968,7 +5030,7 @@
    4492248877 }
    4492348878 
     
    4492848883  */
    4492948884     static int
    44930 @@ -5101,6 +5157,9 @@
     48885@@ -5101,6 +5163,9 @@
    4493148886     if (STRNCMP(s, "typedef", 7) == 0 && !vim_isIDc(s[7]))
    4493248887        s = cin_skipcomment(s + 7);
     
    4493848893        return TRUE;
    4493948894 
    44940 @@ -5185,6 +5244,50 @@
     48895@@ -5185,6 +5250,50 @@
    4494148896     return (*(s = cin_skipcomment(s + i)) == ':' && s[1] != ':');
    4494248897 }
     
    4498948944  * Return a pointer to the first non-empty non-comment character after a ':'.
    4499048945  * Return NULL if not found.
    44991 @@ -5383,8 +5486,7 @@
     48946@@ -5383,8 +5492,7 @@
    4499248947 cin_ispreproc(s)
    4499348948     char_u *s;
     
    4499948954     return FALSE;
    4500048955 }
    45001 @@ -5444,8 +5546,11 @@
     48956@@ -5444,8 +5552,11 @@
    4500248957 }
    4500348958 
     
    4501248967  * both apply in order to determine initializations).
    4501348968  */
    45014 @@ -5455,21 +5560,35 @@
     48969@@ -5455,21 +5566,35 @@
    4501548970     int                incl_open;      /* include '{' at the end as terminator */
    4501648971     int                incl_comma;     /* recognize a trailing comma */
     
    4505149006        if (*s)
    4505249007            s++;
    45053 @@ -5485,21 +5604,41 @@
     49008@@ -5485,21 +5610,41 @@
    4505449009  * "sp" points to a string with the line.  When looking at other lines it must
    4505549010  * be restored to the line.  When it's NULL fetch lines here.
     
    4509449049     {
    4509549050        if (cin_iscomment(s))   /* ignore comments */
    45096 @@ -5525,18 +5664,38 @@
     49051@@ -5525,18 +5670,38 @@
    4509749052                retval = TRUE;
    4509849053            goto done;
     
    4513749092 
    4513849093 done:
    45139 @@ -5754,7 +5913,9 @@
     49094@@ -5607,6 +5772,52 @@
     49095 }
     49096 
     49097 /*
     49098+ * Check whether in "p" there is an "if", "for" or "while" before "*poffset".
     49099+ * Return 0 if there is none.
     49100+ * Otherwise return !0 and update "*poffset" to point to the place where the
     49101+ * string was found.
     49102+ */
     49103+    static int
     49104+cin_is_if_for_while_before_offset(line, poffset)
     49105+    char_u *line;
     49106+    int    *poffset;
     49107+{
     49108+    int offset = *poffset;
     49109+
     49110+    if (offset-- < 2)
     49111+       return 0;
     49112+    while (offset > 2 && vim_iswhite(line[offset]))
     49113+       --offset;
     49114+
     49115+    offset -= 1;
     49116+    if (!STRNCMP(line + offset, "if", 2))
     49117+       goto probablyFound;
     49118+
     49119+    if (offset >= 1)
     49120+    {
     49121+       offset -= 1;
     49122+       if (!STRNCMP(line + offset, "for", 3))
     49123+           goto probablyFound;
     49124+
     49125+       if (offset >= 2)
     49126+       {
     49127+           offset -= 2;
     49128+           if (!STRNCMP(line + offset, "while", 5))
     49129+               goto probablyFound;
     49130+       }
     49131+    }
     49132+    return 0;
     49133+
     49134+probablyFound:
     49135+    if (!offset || !vim_isIDc(line[offset - 1]))
     49136+    {
     49137+       *poffset = offset;
     49138+       return 1;
     49139+    }
     49140+    return 0;
     49141+}
     49142+
     49143+/*
     49144  * Return TRUE if we are at the end of a do-while.
     49145  *    do
     49146  *       nothing;
     49147@@ -5754,7 +5965,9 @@
    4514049148                continue;
    4514149149        }
     
    4514849156            if (s[1] == ':')
    4514949157            {
    45150 @@ -6008,7 +6169,7 @@
     49158@@ -5958,7 +6171,7 @@
     49159 
     49160 /*
     49161  * Find the matching '(', failing if it is in a comment.
     49162- * Return NULL of no match found.
     49163+ * Return NULL if no match found.
     49164  */
     49165     static pos_T *
     49166 find_match_paren(ind_maxparen, ind_maxcomment)     /* XXX */
     49167@@ -6008,7 +6221,7 @@
    4515149168 
    4515249169 /*
     
    4515749174     static int
    4515849175 find_last_paren(l, start, end)
    45159 @@ -6021,7 +6182,7 @@
     49176@@ -6021,7 +6234,7 @@
    4516049177 
    4516149178     curwin->w_cursor.col = 0;              /* default is start of line */
     
    4516649183        i = (int)(cin_skipcomment(l + i) - l); /* ignore parens in comments */
    4516749184        i = (int)(skip_string(l + i) - l);    /* ignore parens in quotes */
    45168 @@ -6222,6 +6383,11 @@
     49185@@ -6222,6 +6435,17 @@
    4516949186      */
    4517049187     int ind_keep_case_label = 0;
     
    4517549192+    int ind_cpp_namespace = 0;
    4517649193+
     49194+    /*
     49195+     * handle continuation lines containing conditions of if(), for() and
     49196+     * while()
     49197+     */
     49198+    int ind_if_for_while = 0;
     49199+
    4517749200     pos_T      cur_curpos;
    4517849201     int                amount;
    4517949202     int                scope_amount;
    45180 @@ -6262,8 +6428,10 @@
     49203@@ -6262,8 +6486,10 @@
    4518149204     int                n;
    4518249205     int                iscase;
     
    4518949212     for (options = curbuf->b_p_cino; *options; )
    4519049213     {
    45191 @@ -6335,6 +6503,7 @@
     49214@@ -6335,6 +6561,8 @@
    4519249215            case 'J': ind_js = n; break;
    4519349216            case 'l': ind_keep_case_label = n; break;
    4519449217            case '#': ind_hash_comment = n; break;
    4519549218+           case 'N': ind_cpp_namespace = n; break;
     49219+           case 'k': ind_if_for_while = n; break;
    4519649220        }
    4519749221        if (*options == ',')
    4519849222            ++options;
    45199 @@ -6424,6 +6593,8 @@
     49223@@ -6424,6 +6652,8 @@
    4520049224        /* find how indented the line beginning the comment is */
    4520149225        getvcol(curwin, trypos, &col, NULL, NULL);
     
    4520649230        p = curbuf->b_p_com;
    4520749231        while (*p != NUL)
    45208 @@ -6764,8 +6935,7 @@
     49232@@ -6636,6 +6866,33 @@
     49233        if (amount == -1)
     49234        {
     49235            int     ignore_paren_col = 0;
     49236+           int     is_if_for_while = 0;
     49237+
     49238+           if (ind_if_for_while)
     49239+           {
     49240+               /* Look for the outermost opening parenthesis on this line
     49241+                * and check whether it belongs to an "if", "for" or "while". */
     49242+
     49243+               pos_T       cursor_save = curwin->w_cursor;
     49244+               pos_T       outermost;
     49245+               char_u      *line;
     49246+
     49247+               trypos = &our_paren_pos;
     49248+               do {
     49249+                   outermost = *trypos;
     49250+                   curwin->w_cursor.lnum = outermost.lnum;
     49251+                   curwin->w_cursor.col = outermost.col;
     49252+
     49253+                   trypos = find_match_paren(ind_maxparen, ind_maxcomment);
     49254+               } while (trypos && trypos->lnum == outermost.lnum);
     49255+
     49256+               curwin->w_cursor = cursor_save;
     49257+
     49258+               line = ml_get(outermost.lnum);
     49259+
     49260+               is_if_for_while =
     49261+                   cin_is_if_for_while_before_offset(line, &outermost.col);
     49262+           }
     49263 
     49264            amount = skip_label(our_paren_pos.lnum, &look, ind_maxcomment);
     49265            look = skipwhite(look);
     49266@@ -6660,7 +6917,7 @@
     49267                curwin->w_cursor.lnum = save_lnum;
     49268                look = ml_get(our_paren_pos.lnum) + look_col;
     49269            }
     49270-           if (theline[0] == ')' || ind_unclosed == 0
     49271+           if (theline[0] == ')' || (ind_unclosed == 0 && is_if_for_while == 0)
     49272                    || (!ind_unclosed_noignore && *look == '('
     49273                                                    && ignore_paren_col == 0))
     49274            {
     49275@@ -6731,7 +6988,8 @@
     49276            {
     49277                /* Line up with the start of the matching paren line. */
     49278            }
     49279-           else if (ind_unclosed == 0 || (!ind_unclosed_noignore
     49280+           else if ((ind_unclosed == 0 && is_if_for_while == 0)
     49281+                    || (!ind_unclosed_noignore
     49282                                    && *look == '(' && ignore_paren_col == 0))
     49283            {
     49284                if (cur_amount != MAXCOL)
     49285@@ -6764,11 +7022,15 @@
    4520949286                {
    4521049287                    curwin->w_cursor.lnum = our_paren_pos.lnum;
     
    4521549292                        amount += ind_unclosed2;
    4521649293                    else
    45217                         amount += ind_unclosed;
    45218 @@ -6838,7 +7008,7 @@
     49294-                       amount += ind_unclosed;
     49295+                   {
     49296+                       if (is_if_for_while)
     49297+                           amount += ind_if_for_while;
     49298+                       else
     49299+                           amount += ind_unclosed;
     49300+                   }
     49301                }
     49302                /*
     49303                 * For a line starting with ')' use the minimum of the two
     49304@@ -6838,7 +7100,7 @@
    4521949305             *                  ldfd) {
    4522049306             *              }
     
    4522549311                amount = get_indent();
    4522649312            else
    45227 @@ -6901,11 +7071,24 @@
     49313@@ -6901,11 +7163,24 @@
    4522849314            if (start_brace == BRACE_IN_COL0)       /* '{' is in column 0 */
    4522949315            {
     
    4525049336                {
    4525149337                    /* Compensate for adding ind_open_extra later. */
    45252 @@ -7014,7 +7197,8 @@
     49338@@ -7014,7 +7289,8 @@
    4525349339                         * (it's a variable declaration).
    4525449340                         */
     
    4526049346                            /* if the line is terminated with another ','
    4526149347                             * it is a continued variable initialization.
    45262 @@ -7076,12 +7260,59 @@
     49348@@ -7076,12 +7352,59 @@
    4526349349                        else
    4526449350                            amount += ind_continuation;
     
    4532549411                    break;
    4532649412                }
    45327 @@ -7466,17 +7697,25 @@
     49413@@ -7466,17 +7789,25 @@
    4532849414 
    4532949415                        /*
     
    4535849444 
    4535949445                    /*
    45360 @@ -7757,8 +7996,8 @@
     49446@@ -7757,8 +8088,8 @@
    4536149447                         * If we're at the end of a block, skip to the start of
    4536249448                         * that block.
     
    4536949455                                                            != NULL) /* XXX */
    4537049456                        {
    45371 @@ -7820,7 +8059,9 @@
     49457@@ -7820,7 +8151,9 @@
    4537249458                && vim_strchr(theline, '}') == NULL
    4537349459                && !cin_ends_in(theline, (char_u *)":", NULL)
     
    4538049466        {
    4538149467            amount = ind_func_type;
    45382 @@ -7926,7 +8167,8 @@
     49468@@ -7926,7 +8259,8 @@
    4538349469                 * If the line looks like a function declaration, and we're
    4538449470                 * not in a comment, put it the left margin.
     
    4539049476                l = ml_get_curline();
    4539149477 
    45392 @@ -7947,11 +8189,35 @@
     49478@@ -7947,11 +8281,35 @@
    4539349479                    break;
    4539449480 
     
    4542749513                    amount = ind_param;
    4542849514                    break;
    45429 @@ -8856,11 +9122,15 @@
     49515@@ -8856,11 +9214,15 @@
    4543049516     }
    4543149517 
     
    4544449530        vim_free(buf);
    4544549531        return 0;
    45446 @@ -8928,7 +9198,10 @@
     49532@@ -8928,7 +9290,10 @@
    4544749533         * all entries found with "matchname". */
    4544849534        if ((p[0] != '.' || starts_with_dot)
     
    4545649542 #ifdef WIN3264
    4545749543            STRCPY(s, p);
    45458 @@ -9132,7 +9405,7 @@
     49544@@ -9096,6 +9461,7 @@
     49545 
     49546     /*
     49547      * Find the first part in the path name that contains a wildcard.
     49548+     * When EW_ICASE is set every letter is considered to be a wildcard.
     49549      * Copy it into "buf", including the preceding characters.
     49550      */
     49551     p = buf;
     49552@@ -9115,7 +9481,12 @@
     49553            s = p + 1;
     49554        }
     49555        else if (path_end >= path + wildoff
     49556-                        && vim_strchr((char_u *)"*?[{~$", *path_end) != NULL)
     49557+                        && (vim_strchr((char_u *)"*?[{~$", *path_end) != NULL
     49558+#ifndef CASE_INSENSITIVE_FILENAME
     49559+                            || ((flags & EW_ICASE)
     49560+                                              && isalpha(PTR2CHAR(path_end)))
     49561+#endif
     49562+                            ))
     49563            e = p;
     49564 #ifdef FEAT_MBYTE
     49565        if (has_mbyte)
     49566@@ -9132,7 +9503,7 @@
    4545949567     e = p;
    4546049568     *e = NUL;
     
    4546549573      * component. */
    4546649574     for (p = buf + wildoff; p < s; ++p)
    45467 @@ -9161,12 +9434,19 @@
     49575@@ -9161,12 +9532,19 @@
    4546849576 #ifdef CASE_INSENSITIVE_FILENAME
    4546949577     regmatch.rm_ic = TRUE;             /* Behave like Terminal.app */
     
    4548749595        vim_free(buf);
    4548849596        return 0;
    45489 @@ -9196,7 +9476,10 @@
     49597@@ -9196,7 +9574,10 @@
    4549049598            if (dp == NULL)
    4549149599                break;
     
    4549949607                STRCPY(s, dp->d_name);
    4550049608                len = STRLEN(buf);
    45501 @@ -9317,7 +9600,8 @@
     49609@@ -9317,7 +9698,8 @@
    4550249610            continue;  /* it's different when it's shorter */
    4550349611 
     
    4550949617     }
    4551049618 
    45511 @@ -9642,7 +9926,7 @@
     49619@@ -9642,7 +10024,7 @@
    4551249620     if (paths == NULL)
    4551349621        return 0;
     
    4551949627        return 0;
    4552049628diff -Naur vim73.orig/src/misc2.c vim73/src/misc2.c
    45521 --- vim73.orig/src/misc2.c      2012-02-15 21:57:45.061436156 +0000
    45522 +++ vim73/src/misc2.c   2012-02-15 21:57:46.805482156 +0000
     49629--- vim73.orig/src/misc2.c      2012-06-03 23:09:52.948007269 +0000
     49630+++ vim73/src/misc2.c   2012-06-03 23:09:55.524075823 +0000
    4552349631@@ -200,7 +200,6 @@
    4552449632        }
     
    4562849736 }
    4562949737 
     49738@@ -1160,7 +1173,7 @@
     49739     for (buf = firstbuf; buf != NULL; )
     49740     {
     49741        nextbuf = buf->b_next;
     49742-       close_buffer(NULL, buf, DOBUF_WIPE);
     49743+       close_buffer(NULL, buf, DOBUF_WIPE, FALSE);
     49744        if (buf_valid(buf))
     49745            buf = nextbuf;      /* didn't work, try next one */
     49746        else
    4563049747@@ -1223,7 +1236,7 @@
    4563149748 #endif
     
    4571549832  * "sep_chars".
    4571649833  * The part is copied into "buf[maxlen]".
    45717 @@ -2109,6 +2150,25 @@
     49834@@ -2023,24 +2064,22 @@
     49835     garray_T   *gap;
     49836     int                n;
     49837 {
     49838-    size_t     len;
     49839+    size_t     old_len;
     49840+    size_t     new_len;
     49841     char_u     *pp;
     49842 
     49843     if (gap->ga_maxlen - gap->ga_len < n)
     49844     {
     49845        if (n < gap->ga_growsize)
     49846            n = gap->ga_growsize;
     49847-       len = gap->ga_itemsize * (gap->ga_len + n);
     49848-       pp = alloc_clear((unsigned)len);
     49849+       new_len = gap->ga_itemsize * (gap->ga_len + n);
     49850+       pp = (gap->ga_data == NULL)
     49851+             ? alloc((unsigned)new_len) : vim_realloc(gap->ga_data, new_len);
     49852        if (pp == NULL)
     49853            return FAIL;
     49854+       old_len = gap->ga_itemsize * gap->ga_maxlen;
     49855+       vim_memset(pp + old_len, 0, new_len - old_len);
     49856        gap->ga_maxlen = gap->ga_len + n;
     49857-       if (gap->ga_data != NULL)
     49858-       {
     49859-           mch_memmove(pp, gap->ga_data,
     49860-                                     (size_t)(gap->ga_itemsize * gap->ga_len));
     49861-           vim_free(gap->ga_data);
     49862-       }
     49863        gap->ga_data = pp;
     49864     }
     49865     return OK;
     49866@@ -2109,6 +2148,25 @@
    4571849867     }
    4571949868 }
     
    4574149890  * functions that use lookup tables for various things, generally to do with
    4574249891  * special key codes.
    45743 @@ -2356,10 +2416,21 @@
     49892@@ -2356,10 +2414,21 @@
    4574449893     {'<',              (char_u *)"lt"},
    4574549894 
     
    4576349912     {K_LEFTMOUSE_NM,   (char_u *)"LeftMouseNM"},
    4576449913     {K_LEFTDRAG,       (char_u *)"LeftDrag"},
    45765 @@ -2698,6 +2769,7 @@
     49914@@ -2698,6 +2767,7 @@
    4576649915     int                bit;
    4576749916     int                key;
     
    4577149920     src = *srcp;
    4577249921     if (src[0] != '<')
    45773 @@ -2710,26 +2782,32 @@
     49922@@ -2710,26 +2780,32 @@
    4577449923        if (*bp == '-')
    4577549924        {
     
    4581549964        modifiers = 0x0;
    4581649965        for (bp = src + 1; bp < last_dash; bp++)
    45817 @@ -2748,16 +2826,32 @@
     49966@@ -2748,16 +2824,32 @@
    4581849967         */
    4581949968        if (bp >= last_dash)
     
    4585650005 
    4585750006            /*
    45858 @@ -3191,7 +3285,7 @@
     50007@@ -3131,17 +3223,31 @@
     50008            retval = mch_call_shell(cmd, opt);
     50009        else
     50010        {
     50011-           ncmd = alloc((unsigned)(STRLEN(cmd) + STRLEN(p_sxq) * 2 + 1));
     50012+           char_u *ecmd = cmd;
     50013+
     50014+           if (*p_sxe != NUL && STRCMP(p_sxq, "(") == 0)
     50015+           {
     50016+               ecmd = vim_strsave_escaped_ext(cmd, p_sxe, '^', FALSE);
     50017+               if (ecmd == NULL)
     50018+                   ecmd = cmd;
     50019+           }
     50020+           ncmd = alloc((unsigned)(STRLEN(ecmd) + STRLEN(p_sxq) * 2 + 1));
     50021            if (ncmd != NULL)
     50022            {
     50023                STRCPY(ncmd, p_sxq);
     50024-               STRCAT(ncmd, cmd);
     50025-               STRCAT(ncmd, p_sxq);
     50026+               STRCAT(ncmd, ecmd);
     50027+               /* When 'shellxquote' is ( append ).
     50028+                * When 'shellxquote' is "( append )". */
     50029+               STRCAT(ncmd, STRCMP(p_sxq, "(") == 0 ? (char_u *)")"
     50030+                          : STRCMP(p_sxq, "\"(") == 0 ? (char_u *)")\""
     50031+                          : p_sxq);
     50032                retval = mch_call_shell(ncmd, opt);
     50033                vim_free(ncmd);
     50034            }
     50035            else
     50036                retval = -1;
     50037+           if (ecmd != cmd)
     50038+               vim_free(ecmd);
     50039        }
     50040 #ifdef FEAT_GUI
     50041        --hold_gui_events;
     50042@@ -3191,7 +3297,7 @@
    4585950043 #if defined(FEAT_MBYTE) || defined(PROTO)
    4586050044 /*
     
    4586550049  */
    4586650050     int
    45867 @@ -3199,7 +3293,7 @@
     50051@@ -3199,7 +3305,7 @@
    4586850052     char_u     *b;
    4586950053     char_u     *p;
     
    4587450058 }
    4587550059 #endif
    45876 @@ -4210,6 +4304,8 @@
     50060@@ -4210,6 +4316,8 @@
    4587750061 static int ff_path_in_stoplist __ARGS((char_u *, int, char_u **));
    4587850062 #endif
     
    4588350067 /*
    4588450068  * if someone likes findfirst/findnext, here are the functions
    45885 @@ -4506,6 +4602,11 @@
     50069@@ -4506,6 +4614,11 @@
    4588650070        len = 0;
    4588750071        while (*wc_part != NUL)
     
    4589550079            {
    4589650080                ff_expand_buffer[len++] = *wc_part++;
    45897 @@ -4551,6 +4652,12 @@
     50081@@ -4551,6 +4664,12 @@
    4589850082     }
    4589950083 
     
    4590850092     add_pathsep(ff_expand_buffer);
    4590950093     STRCAT(ff_expand_buffer, search_ctx->ffsc_fix_path);
    45910 @@ -4597,9 +4704,8 @@
     50094@@ -4597,9 +4716,8 @@
    4591150095     {
    4591250096        if (r_ptr[0] == '\\' && r_ptr[1] == ';')
     
    4592050104            r_ptr++;
    4592150105        }
    45922 @@ -4858,10 +4964,13 @@
     50106@@ -4858,10 +4976,13 @@
    4592350107                        stackp->ffs_filearray_size = 0;
    4592450108                }
     
    4593550119                stackp->ffs_filearray_cur = 0;
    4593650120                stackp->ffs_stage = 0;
    45937 @@ -6443,3 +6552,23 @@
     50121@@ -6443,3 +6564,23 @@
    4593850122 #endif
    4593950123 
     
    4596050144+#endif
    4596150145diff -Naur vim73.orig/src/move.c vim73/src/move.c
    45962 --- vim73.orig/src/move.c       2012-02-15 21:57:45.041435628 +0000
    45963 +++ vim73/src/move.c    2012-02-15 21:57:46.885484267 +0000
     50146--- vim73.orig/src/move.c       2012-06-03 23:09:52.920006524 +0000
     50147+++ vim73/src/move.c    2012-06-03 23:09:55.652079228 +0000
    4596450148@@ -362,7 +362,7 @@
    4596550149 #endif
     
    4600050184            && !curwin->w_cline_folded
    4600150185 #endif
    46002 @@ -2846,6 +2846,7 @@
    46003      colnr_T    col =  curwin->w_cursor.col;
     50186@@ -2843,9 +2843,15 @@
     50187 do_check_cursorbind()
     50188 {
     50189     linenr_T   line = curwin->w_cursor.lnum;
     50190-    colnr_T    col =  curwin->w_cursor.col;
     50191+    colnr_T    col = curwin->w_cursor.col;
     50192+# ifdef FEAT_VIRTUALEDIT
     50193+    colnr_T    coladd = curwin->w_cursor.coladd;
     50194+# endif
     50195+    colnr_T    curswant = curwin->w_curswant;
     50196+    int                set_curswant = curwin->w_set_curswant;
    4600450197     win_T      *old_curwin = curwin;
    4600550198     buf_T      *old_curbuf = curbuf;
     
    4600850201     int                old_VIsual_select = VIsual_select;
    4600950202     int                old_VIsual_active = VIsual_active;
    46010 @@ -2875,16 +2876,22 @@
     50203@@ -2874,17 +2880,28 @@
     50204 # endif
    4601150205                curwin->w_cursor.lnum = line;
    4601250206            curwin->w_cursor.col = col;
     50207+# ifdef FEAT_VIRTUALEDIT
     50208+           curwin->w_cursor.coladd = coladd;
     50209+# endif
     50210+           curwin->w_curswant = curswant;
     50211+           curwin->w_set_curswant = set_curswant;
    4601350212 
    4601450213-           /* Make sure the cursor is in a valid position. */
     
    4603650235diff -Naur vim73.orig/src/msvc2010.bat vim73/src/msvc2010.bat
    4603750236--- vim73.orig/src/msvc2010.bat 1970-01-01 00:00:00.000000000 +0000
    46038 +++ vim73/src/msvc2010.bat      2012-02-15 21:57:46.085463166 +0000
     50237+++ vim73/src/msvc2010.bat      2012-06-03 23:09:54.252041972 +0000
    4603950238@@ -0,0 +1,7 @@
    4604050239+@echo off
     
    4604650245+call "%VS100COMNTOOLS%%vsvars32.bat"
    4604750246diff -Naur vim73.orig/src/netbeans.c vim73/src/netbeans.c
    46048 --- vim73.orig/src/netbeans.c   2012-02-15 21:57:45.061436156 +0000
    46049 +++ vim73/src/netbeans.c        2012-02-15 21:57:46.793481839 +0000
     50247--- vim73.orig/src/netbeans.c   2012-06-03 23:09:52.948007269 +0000
     50248+++ vim73/src/netbeans.c        2012-06-03 23:09:55.748081783 +0000
    4605050249@@ -14,12 +14,15 @@
    4605150250  * which are *between* characters, whereas vim uses line number
     
    4643750636                            ff_detected = EOL_DOS;
    4643850637                            --len;
    46439 @@ -1808,7 +1814,8 @@
    46440  
    46441                         /* Insert halfway a line.  For simplicity we assume we
    46442                          * need to append to the line. */
     50638@@ -1806,13 +1812,15 @@
     50639                        char_u *oldline = ml_get(lnum);
     50640                        char_u *newline;
     50641 
     50642-                       /* Insert halfway a line.  For simplicity we assume we
     50643-                        * need to append to the line. */
    4644350644-                       newline = alloc_check((unsigned)(STRLEN(oldline) + len + 1));
     50645+                       /* Insert halfway a line. */
    4644450646+                       newline = alloc_check(
    4644550647+                                      (unsigned)(STRLEN(oldline) + len + 1));
    4644650648                        if (newline != NULL)
    4644750649                        {
    46448                             STRCPY(newline, oldline);
    46449 @@ -1820,14 +1827,15 @@
     50650-                           STRCPY(newline, oldline);
     50651+                           mch_memmove(newline, oldline, (size_t)pos->col);
     50652+                           newline[pos->col] = NUL;
     50653                            STRCAT(newline, args);
     50654+                           STRCAT(newline, oldline + pos->col);
     50655                            ml_replace(lnum, newline, FALSE);
     50656                        }
     50657                    }
     50658@@ -1820,14 +1828,15 @@
    4645050659                    {
    4645150660                        /* Append a new line.  Not that we always do this,
     
    4646650675 
    4646750676                /* Adjust the marks below the inserted lines. */
    46468 @@ -1986,7 +1994,7 @@
     50677@@ -1986,7 +1995,7 @@
    4646950678                EMSG("E640: invalid buffer identifier in initDone");
    4647050679                return FAIL;
     
    4647550684            nb_set_curbuf(buf->bufp);
    4647650685 #if defined(FEAT_AUTOCMD)
    46477 @@ -2075,7 +2083,7 @@
     50686@@ -2075,7 +2084,7 @@
    4647850687                                             ECMD_HIDE + ECMD_OLDBUF, curwin);
    4647950688            buf->bufp = curbuf;
     
    4648450693            maketitle();
    4648550694 #endif
    46486 @@ -2103,7 +2111,7 @@
     50695@@ -2103,7 +2112,7 @@
    4648750696                exarg.forceit = FALSE;
    4648850697                dosetvisible = TRUE;
     
    4649350702 
    4649450703 #ifdef FEAT_GUI
    46495 @@ -2250,6 +2258,7 @@
     50704@@ -2250,6 +2259,7 @@
    4649650705            update_topline();           /* scroll to show the line */
    4649750706            update_screen(VALID);
     
    4650150710 #ifdef FEAT_GUI
    4650250711            if (gui.in_use)
    46503 @@ -2302,7 +2311,7 @@
     50712@@ -2302,7 +2312,7 @@
    4650450713                                                     buf->bufp->b_fnum, TRUE);
    4650550714            buf->bufp = NULL;
     
    4651050719        }
    4651150720        else if (streq((char *)cmd, "setStyle")) /* obsolete... */
    46512 @@ -2393,7 +2402,7 @@
     50721@@ -2393,7 +2403,7 @@
    4651350722                return FAIL;
    4651450723            }
     
    4651950728            cp = (char *)args;
    4652050729            serNum = strtol(cp, &cp, 10);
    46521 @@ -2441,7 +2450,7 @@
     50730@@ -2441,7 +2451,7 @@
    4652250731                nbdebug(("    invalid buffer identifier in removeAnno\n"));
    4652350732                return FAIL;
     
    4652850737            serNum = strtol(cp, &cp, 10);
    4652950738            args = (char_u *)cp;
    46530 @@ -2486,7 +2495,7 @@
     50739@@ -2486,7 +2496,7 @@
    4653150740            len = strtol(cp, NULL, 10);
    4653250741            args = (char_u *)cp;
     
    4653750746                nbdebug(("    no such start pos in %s, %ld\n", cmd, off));
    4653850747            else
    46539 @@ -2548,7 +2557,7 @@
     50748@@ -2548,7 +2558,7 @@
    4654050749            inAtomic = 0;
    4654150750            if (needupdate)
     
    4654650755            }
    4654750756 /* =====================================================================*/
    46548 @@ -2629,21 +2638,22 @@
     50757@@ -2629,21 +2639,22 @@
    4654950758         * Unrecognized command is ignored.
    4655050759         */
     
    4657350782 #ifdef FEAT_GUI
    4657450783        if (gui.in_use)
    46575 @@ -2773,6 +2783,16 @@
     50784@@ -2773,6 +2784,16 @@
    4657650785 ex_nbstart(eap)
    4657750786     exarg_T    *eap;
     
    4659050799 }
    4659150800 
    46592 @@ -2880,7 +2900,7 @@
     50801@@ -2880,7 +2901,7 @@
    4659350802     char_u     *text;
    4659450803     linenr_T   lnum;
     
    4659950808 
    4660050809     /* Don't do anything when 'ballooneval' is off, messages scrolled the
    46601 @@ -2894,15 +2914,20 @@
     50810@@ -2894,15 +2915,20 @@
    4660250811         * length. */
    4660350812        if (text != NULL && text[0] != NUL && STRLEN(text) < MAXPATHL)
     
    4662750836        vim_free(text);
    4662850837     }
    46629 @@ -2937,7 +2962,7 @@
     50838@@ -2937,7 +2963,7 @@
    4663050839     if (!NB_HAS_GUI || !NETBEANS_OPEN)
    4663150840        return;
     
    4663650845      * when there is input on the editor connection socket
    4663750846      */
    46638 @@ -3000,6 +3025,7 @@
     50847@@ -3000,6 +3026,7 @@
    4663950848     changed_window_setting();
    4664050849     update_screen(CLEAR);
     
    4664450853 #ifdef FEAT_GUI
    4664550854     if (gui.in_use)
    46646 @@ -3027,7 +3053,7 @@
     50855@@ -3027,7 +3054,7 @@
    4664750856     }
    4664850857 }
     
    4665350862  * Tell netbeans that the window was moved or resized.
    4665450863  */
    46655 @@ -3458,7 +3484,7 @@
     50864@@ -3458,7 +3485,7 @@
    4665650865     return FALSE;
    4665750866 }
     
    4666250871  * We have multiple signs to draw at the same location. Draw the
    4666350872  * multi-sign indicator instead. This is the Motif version.
    46664 @@ -3487,7 +3513,7 @@
     50873@@ -3487,7 +3514,7 @@
    4666550874     XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+3, y++);
    4666650875     XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+2, y);
     
    4667150880 #if defined(FEAT_GUI_GTK) && !defined(PROTO)
    4667250881 /*
    46673 @@ -3902,14 +3928,12 @@
     50882@@ -3902,14 +3929,12 @@
    4667450883     }
    4667550884     else
     
    4669250901 
    4669350902diff -Naur vim73.orig/src/normal.c vim73/src/normal.c
    46694 --- vim73.orig/src/normal.c     2012-02-15 21:57:45.061436156 +0000
    46695 +++ vim73/src/normal.c  2012-02-15 21:57:46.901484689 +0000
    46696 @@ -20,11 +20,14 @@
     50903--- vim73.orig/src/normal.c     2012-06-03 23:09:52.948007269 +0000
     50904+++ vim73/src/normal.c  2012-06-03 23:09:55.900085828 +0000
     50905@@ -20,15 +20,18 @@
    4669750906  */
    4669850907 static int     resel_VIsual_mode = NUL;        /* 'v', 'V', or Ctrl-V */
     
    4670850917+#endif
    4670950918 static int
    46710  # ifdef __BORLANDC__
    46711  _RTLENTRYF
     50919-# ifdef __BORLANDC__
     50920-_RTLENTRYF
     50921-# endif
     50922+#ifdef __BORLANDC__
     50923+    _RTLENTRYF
     50924+#endif
     50925                nv_compare __ARGS((const void *s1, const void *s2));
     50926 static int     find_command __ARGS((int cmdchar));
     50927 static void    op_colon __ARGS((oparg_T *oap));
    4671250928@@ -648,6 +651,14 @@
    4671350929     dont_scroll = FALSE;       /* allow scrolling here */
     
    4698451200            else
    4698551201                op_replace(oap, cap->nchar);
    46986 @@ -4501,6 +4577,7 @@
     51202@@ -2203,6 +2279,7 @@
     51203 {
     51204 #ifdef FEAT_EVAL
     51205     char_u     *(argv[1]);
     51206+    int                save_virtual_op = virtual_op;
     51207 
     51208     if (*p_opfunc == NUL)
     51209        EMSG(_("E774: 'operatorfunc' is empty"));
     51210@@ -2221,7 +2298,14 @@
     51211            argv[0] = (char_u *)"line";
     51212        else
     51213            argv[0] = (char_u *)"char";
     51214+
     51215+       /* Reset virtual_op so that 'virtualedit' can be changed in the
     51216+        * function. */
     51217+       virtual_op = MAYBE;
     51218+
     51219        (void)call_func_retnr(p_opfunc, 1, argv, FALSE);
     51220+
     51221+       virtual_op = save_virtual_op;
     51222     }
     51223 #else
     51224     EMSG(_("E775: Eval feature not available"));
     51225@@ -4501,6 +4585,7 @@
    4698751226                }
    4698851227                curwin->w_cursor.lnum++;
     
    4699251231        }
    4699351232       }
    46994 @@ -5666,8 +5743,13 @@
     51233@@ -5666,8 +5751,13 @@
    4699551234        else if (cmdchar == '#')
    4699651235            aux_ptr = (char_u *)(p_magic ? "/?.*~[^$\\" : "/?^$\\");
     
    4700851247            aux_ptr = (char_u *)"\\|\"\n*?[";
    4700951248 
    47010 @@ -7585,12 +7667,16 @@
     51249@@ -6980,7 +7070,18 @@
     51250            for (n = cap->count1; n > 0; --n)
     51251            {
     51252                State = REPLACE;
     51253-               ins_char(cap->nchar);
     51254+               if (cap->nchar == Ctrl_E || cap->nchar == Ctrl_Y)
     51255+               {
     51256+                   int c = ins_copychar(curwin->w_cursor.lnum
     51257+                                          + (cap->nchar == Ctrl_Y ? -1 : 1));
     51258+                   if (c != NUL)
     51259+                       ins_char(c);
     51260+                   else
     51261+                       /* will be decremented further down */
     51262+                       ++curwin->w_cursor.col;
     51263+               }
     51264+               else
     51265+                   ins_char(cap->nchar);
     51266                State = old_State;
     51267                if (cap->ncharC1 != 0)
     51268                    ins_char(cap->ncharC1);
     51269@@ -7002,7 +7103,15 @@
     51270                 * line will be changed.
     51271                 */
     51272                ptr = ml_get_buf(curbuf, curwin->w_cursor.lnum, TRUE);
     51273-               ptr[curwin->w_cursor.col] = cap->nchar;
     51274+               if (cap->nchar == Ctrl_E || cap->nchar == Ctrl_Y)
     51275+               {
     51276+                 int c = ins_copychar(curwin->w_cursor.lnum
     51277+                                          + (cap->nchar == Ctrl_Y ? -1 : 1));
     51278+                 if (c != NUL)
     51279+                   ptr[curwin->w_cursor.col] = c;
     51280+               }
     51281+               else
     51282+                   ptr[curwin->w_cursor.col] = cap->nchar;
     51283                if (p_sm && msg_silent == 0)
     51284                    showmatch(cap->nchar);
     51285                ++curwin->w_cursor.col;
     51286@@ -7551,13 +7660,9 @@
     51287     else                   /* start Visual mode */
     51288     {
     51289        check_visual_highlight();
     51290-       if (cap->count0)                    /* use previously selected part */
     51291+       if (cap->count0 > 0 && resel_VIsual_mode != NUL)
     51292        {
     51293-           if (resel_VIsual_mode == NUL)   /* there is none */
     51294-           {
     51295-               beep_flush();
     51296-               return;
     51297-           }
     51298+           /* use previously selected part */
     51299            VIsual = curwin->w_cursor;
     51300 
     51301            VIsual_active = TRUE;
     51302@@ -7585,12 +7690,16 @@
    4701151303            if (VIsual_mode == 'v')
    4701251304            {
     
    4702951321                curwin->w_curswant = MAXCOL;
    4703051322                coladvance((colnr_T)MAXCOL);
    47031 @@ -7599,7 +7685,7 @@
     51323@@ -7599,7 +7708,7 @@
    4703251324            {
    4703351325                validate_virtcol();
     
    4703851330            }
    4703951331            else
    47040 @@ -8524,7 +8610,7 @@
     51332@@ -7612,6 +7721,16 @@
     51333                /* start Select mode when 'selectmode' contains "cmd" */
     51334                may_start_select('c');
     51335            n_start_visual_mode(cap->cmdchar);
     51336+           if (VIsual_mode != 'V' && *p_sel == 'e')
     51337+               ++cap->count1;  /* include one more char */
     51338+           if (cap->count0 > 0 && --cap->count1 > 0)
     51339+           {
     51340+               /* With a count select that many characters or lines. */
     51341+               if (VIsual_mode == 'v' || VIsual_mode == Ctrl_V)
     51342+                   nv_right(cap);
     51343+               else if (VIsual_mode == 'V')
     51344+                   nv_down(cap);
     51345+           }
     51346        }
     51347     }
     51348 }
     51349@@ -8524,7 +8643,7 @@
    4704151350     else
    4704251351        curwin->w_curswant = 0;
     
    4704751356 }
    4704851357 
    47049 @@ -8736,7 +8822,7 @@
     51358@@ -8736,7 +8855,7 @@
    4705051359        {
    4705151360            --pp->col;
     
    4705651365        }
    4705751366        else if (pp->lnum > 1)
    47058 @@ -9261,7 +9347,7 @@
     51367@@ -9261,7 +9380,7 @@
    4705951368 # ifdef FEAT_CLIPBOARD
    4706051369            adjust_clip_reg(&regname);
     
    4706651375 # endif
    4706751376diff -Naur vim73.orig/src/ops.c vim73/src/ops.c
    47068 --- vim73.orig/src/ops.c        2012-02-15 21:57:45.053435946 +0000
    47069 +++ vim73/src/ops.c     2012-02-15 21:57:46.741480469 +0000
     51377--- vim73.orig/src/ops.c        2012-06-03 23:09:52.940007057 +0000
     51378+++ vim73/src/ops.c     2012-06-03 23:09:55.844084339 +0000
    4707051379@@ -1584,9 +1584,11 @@
    4707151380 adjust_clip_reg(rp)
     
    4709751406        if (*ptr == NUL && inindent(0))
    4709851407            oap->motion_type = MLINE;
    47099 @@ -1918,11 +1923,22 @@
     51408@@ -1715,9 +1720,14 @@
     51409                did_yank = TRUE;
     51410        }
     51411 
     51412-       /* Yank into small delete register when no register specified and the
     51413-        * delete is within one line. */
     51414-       if (oap->regname == 0 && oap->motion_type != MLINE
     51415+       /* Yank into small delete register when no named register specified
     51416+        * and the delete is within one line. */
     51417+       if ((
     51418+#ifdef FEAT_CLIPBOARD
     51419+            ((clip_unnamed & CLIP_UNNAMED) && oap->regname == '*') ||
     51420+            ((clip_unnamed & CLIP_UNNAMED_PLUS) && oap->regname == '+') ||
     51421+#endif
     51422+           oap->regname == 0) && oap->motion_type != MLINE
     51423                                                      && oap->line_count == 1)
     51424        {
     51425            oap->regname = '-';
     51426@@ -1918,38 +1928,66 @@
    4710051427                    curwin->w_cursor.coladd = 0;
    4710151428            }
     
    4712151448        else                            /* delete characters between lines */
    4712251449        {
    47123 @@ -1939,17 +1955,29 @@
     51450            pos_T   curpos;
     51451+           int     delete_last_line;
     51452 
     51453            /* save deleted and changed lines for undo */
     51454            if (u_save((linenr_T)(curwin->w_cursor.lnum - 1),
     51455                 (linenr_T)(curwin->w_cursor.lnum + oap->line_count)) == FAIL)
     51456                return FAIL;
     51457 
     51458+           delete_last_line = (oap->end.lnum == curbuf->b_ml.ml_line_count);
     51459            truncate_line(TRUE);        /* delete from cursor to end of line */
     51460 
     51461            curpos = curwin->w_cursor;  /* remember curwin->w_cursor */
    4712451462            ++curwin->w_cursor.lnum;
    4712551463            del_lines((long)(oap->line_count - 2), FALSE);
     
    4712951467-           (void)del_bytes((long)(oap->end.col + 1 - !oap->inclusive),
    4713051468-                                       !virtual_op, oap->op_type == OP_DELETE
     51469+           if (delete_last_line)
     51470+               oap->end.lnum = curbuf->b_ml.ml_line_count;
     51471+
    4713151472+           n = (oap->end.col + 1 - !oap->inclusive);
    47132 +           if (oap->inclusive && oap->end.lnum == curbuf->b_ml.ml_line_count
     51473+           if (oap->inclusive && delete_last_line
    4713351474+                   && n > (int)STRLEN(ml_get(oap->end.lnum)))
    4713451475+           {
     
    4715851499     }
    4715951500 
    47160 @@ -2842,6 +2870,9 @@
     51501@@ -2569,7 +2607,8 @@
     51502        firstline = ml_get(oap->start.lnum) + bd.textcol;
     51503        if (oap->op_type == OP_APPEND)
     51504            firstline += bd.textlen;
     51505-       if ((ins_len = (long)STRLEN(firstline) - pre_textlen) > 0)
     51506+       if (pre_textlen >= 0
     51507+                    && (ins_len = (long)STRLEN(firstline) - pre_textlen) > 0)
     51508        {
     51509            ins_text = vim_strnsave(firstline, (int)ins_len);
     51510            if (ins_text != NULL)
     51511@@ -2842,6 +2881,9 @@
    4716151512     char_u             *p;
    4716251513     char_u             *pnew;
     
    4716851519                                    /* check for read-only register */
    4716951520     if (oap->regname != 0 && !valid_yank_reg(oap->regname, TRUE))
    47170 @@ -3115,7 +3146,8 @@
     51521@@ -3000,6 +3042,8 @@
     51522                        }
     51523 #endif
     51524                    }
     51525+                   if (endcol == MAXCOL)
     51526+                       endcol = (colnr_T)STRLEN(p);
     51527                    if (startcol > endcol
     51528 #ifdef FEAT_VIRTUALEDIT
     51529                            || is_oneChar
     51530@@ -3008,8 +3052,6 @@
     51531                        bd.textlen = 0;
     51532                    else
     51533                    {
     51534-                       if (endcol == MAXCOL)
     51535-                           endcol = (colnr_T)STRLEN(p);
     51536                        bd.textlen = endcol - startcol + oap->inclusive;
     51537                    }
     51538                    bd.textstart = p + startcol;
     51539@@ -3115,7 +3157,8 @@
    4717151540      */
    4717251541     if (clip_star.available
     
    4717851547        if (curr != &(y_regs[STAR_REGISTER]))
    4717951548            /* Copy the text from register 0 to the clipboard register. */
    47180 @@ -3123,6 +3155,9 @@
     51549@@ -3123,6 +3166,9 @@
    4718151550 
    4718251551        clip_own_selection(&clip_star);
     
    4718851557 
    4718951558 # ifdef FEAT_X11
    47190 @@ -3130,12 +3165,18 @@
     51559@@ -3130,12 +3176,18 @@
    4719151560      * If we were yanking to the '+' register, send result to selection.
    4719251561      * Also copy to the '*' register, in case auto-select is off.
     
    4721051579            copy_yank_reg(&(y_regs[STAR_REGISTER]));
    4721151580            clip_own_selection(&clip_star);
    47212 @@ -3293,8 +3334,8 @@
     51581@@ -3293,8 +3345,8 @@
    4721351582        if (regname == '=')
    4721451583        {
     
    4722151590            {
    4722251591                y_size = 0;
    47223 @@ -3310,7 +3351,7 @@
     51592@@ -3310,7 +3362,7 @@
    4722451593                        if (y_array != NULL)
    4722551594                            *ptr = NUL;
     
    4723051599                        {
    4723151600                            y_type = MLINE;
    47232 @@ -3979,7 +4020,12 @@
     51601@@ -3979,7 +4031,12 @@
    4723351602     for (i = -1; i < NUM_REGISTERS && !got_int; ++i)
    4723451603     {
     
    4724451613 
    4724551614 #ifdef FEAT_CLIPBOARD
    47246 @@ -4153,9 +4199,10 @@
     51615@@ -4153,9 +4210,10 @@
    4724751616     int            save_undo;
    4724851617 {
     
    4725651625     int                endcurr2 = NUL;
    4725751626     int                currsize = 0;   /* size of the current line */
    47258 @@ -4181,7 +4228,7 @@
     51627@@ -4181,7 +4239,7 @@
    4725951628      */
    4726051629     for (t = 0; t < count; ++t)
     
    4726551634        {
    4726651635            curr = skipwhite(curr);
    47267 @@ -4265,10 +4312,10 @@
     51636@@ -4265,10 +4323,10 @@
    4726851637            copy_spaces(cend, (size_t)(spaces[t]));
    4726951638        }
     
    4727851647            curr = skipwhite(curr);
    4727951648        currsize = (int)STRLEN(curr);
    47280 @@ -4388,7 +4435,7 @@
     51649@@ -4388,7 +4446,7 @@
    4728151650 #endif
    4728251651 
     
    4728751656     void
    4728851657 op_format(oap, keep_cursor)
    47289 @@ -5712,7 +5759,9 @@
     51658@@ -5712,7 +5770,9 @@
    4729051659     }
    4729151660 }
     
    4729851667 clip_yank_selection(type, str, len, cbd)
    4729951668     int                type;
    47300 @@ -6069,9 +6118,6 @@
     51669@@ -6069,9 +6129,6 @@
    4730151670     if (yank_type == MBLOCK)
    4730251671        yank_type = MAUTO;
     
    4730851677 
    4730951678 # ifdef FEAT_CLIPBOARD
    47310 @@ -6092,13 +6138,14 @@
     51679@@ -6092,13 +6149,14 @@
    4731151680  * is appended.
    4731251681  */
     
    4732551694     long       start;
    4732651695     long       i;
    47327 @@ -6115,6 +6162,12 @@
     51696@@ -6115,6 +6173,12 @@
    4732851697     if (y_ptr->y_array == NULL)                /* NULL means empty register */
    4732951698        y_ptr->y_size = 0;
     
    4733851707      * Count the number of lines within the string
    4733951708      */
    47340 @@ -6261,7 +6314,7 @@
     51709@@ -6261,7 +6325,7 @@
    4734151710     *wc += words;
    4734251711 
     
    4734851717        chars += eol_size;
    4734951718diff -Naur vim73.orig/src/option.c vim73/src/option.c
    47350 --- vim73.orig/src/option.c     2012-02-15 21:57:45.061436156 +0000
    47351 +++ vim73/src/option.c  2012-02-15 21:57:46.969486483 +0000
     51719--- vim73.orig/src/option.c     2012-06-03 23:09:52.952007375 +0000
     51720+++ vim73/src/option.c  2012-06-03 23:09:55.676079868 +0000
    4735251721@@ -140,9 +140,6 @@
    4735351722 #define PV_MOD         OPT_BUF(BV_MOD)
     
    4737051739 #ifdef FEAT_TEXTOBJ
    4737151740 static char_u  *p_qe;
    47372 @@ -907,6 +901,13 @@
     51741@@ -439,17 +433,19 @@
     51742 #define P_RCLR         0x7000  /* clear and redraw all */
     51743 
     51744 #define P_COMMA                0x8000  /* comma separated list */
     51745-#define P_NODUP                0x10000L/* don't allow duplicate strings */
     51746-#define P_FLAGLIST     0x20000L/* list of single-char flags */
     51747+#define P_NODUP                0x10000L /* don't allow duplicate strings */
     51748+#define P_FLAGLIST     0x20000L /* list of single-char flags */
     51749 
     51750-#define P_SECURE       0x40000L/* cannot change in modeline or secure mode */
     51751-#define P_GETTEXT      0x80000L/* expand default value with _() */
     51752-#define P_NOGLOB       0x100000L/* do not use local value for global vimrc */
     51753-#define P_NFNAME       0x200000L/* only normal file name chars allowed */
     51754-#define P_INSECURE     0x400000L/* option was set from a modeline */
     51755-#define P_PRI_MKRC     0x800000L/* priority for :mkvimrc (setting option has
     51756+#define P_SECURE       0x40000L /* cannot change in modeline or secure mode */
     51757+#define P_GETTEXT      0x80000L /* expand default value with _() */
     51758+#define P_NOGLOB       0x100000L /* do not use local value for global vimrc */
     51759+#define P_NFNAME       0x200000L /* only normal file name chars allowed */
     51760+#define P_INSECURE     0x400000L /* option was set from a modeline */
     51761+#define P_PRI_MKRC     0x800000L /* priority for :mkvimrc (setting option has
     51762                                   side effects) */
     51763-#define P_NO_ML       0x1000000L/* not allowed in modeline */
     51764+#define P_NO_ML       0x1000000L /* not allowed in modeline */
     51765+#define P_CURSWANT    0x2000000L /* update curswant required; not needed when
     51766+                                 * there is a redraw flag */
     51767 
     51768 #define ISK_LATIN1  (char_u *)"@,48-57,_,192-255"
     51769 
     51770@@ -466,9 +462,9 @@
     51771 #if defined(FEAT_DIFF) || defined(FEAT_FOLDING) || defined(FEAT_SPELL) \
     51772        || defined(FEAT_VERTSPLIT) || defined(FEAT_CLIPBOARD) \
     51773        || defined(FEAT_INS_EXPAND) || defined(FEAT_SYN_HL) || defined(FEAT_CONCEAL)
     51774-# define HIGHLIGHT_INIT "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn"
     51775+# define HIGHLIGHT_INIT "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn"
     51776 #else
     51777-# define HIGHLIGHT_INIT "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,t:Title,v:Visual,w:WarningMsg,W:WildMenu,>:SignColumn,*:TabLine,#:TabLineSel,_:TabLineFill"
     51778+# define HIGHLIGHT_INIT "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,s:StatusLine,S:StatusLineNC,t:Title,v:Visual,w:WarningMsg,W:WildMenu,>:SignColumn,*:TabLine,#:TabLineSel,_:TabLineFill"
     51779 #endif
     51780 
     51781 /*
     51782@@ -485,7 +481,7 @@
     51783 #endif
     51784        options[] =
     51785 {
     51786-    {"aleph",      "al",   P_NUM|P_VI_DEF,
     51787+    {"aleph",      "al",   P_NUM|P_VI_DEF|P_CURSWANT,
     51788 #ifdef FEAT_RIGHTLEFT
     51789                            (char_u *)&p_aleph, PV_NONE,
     51790 #else
     51791@@ -507,7 +503,7 @@
     51792                            {(char_u *)FALSE, (char_u *)FALSE}
     51793 #endif
     51794                            SCRIPTID_INIT},
     51795-    {"arabic",     "arab", P_BOOL|P_VI_DEF|P_VIM,
     51796+    {"arabic",     "arab", P_BOOL|P_VI_DEF|P_VIM|P_CURSWANT,
     51797 #ifdef FEAT_ARABIC
     51798                            (char_u *)VAR_WIN, PV_ARAB,
     51799 #else
     51800@@ -784,7 +780,7 @@
     51801     {"columns",            "co",   P_NUM|P_NODEFAULT|P_NO_MKRC|P_VI_DEF|P_RCLR,
     51802                            (char_u *)&Columns, PV_NONE,
     51803                            {(char_u *)80L, (char_u *)0L} SCRIPTID_INIT},
     51804-    {"comments",    "com",  P_STRING|P_ALLOCED|P_VI_DEF|P_COMMA|P_NODUP,
     51805+    {"comments",    "com",  P_STRING|P_ALLOCED|P_VI_DEF|P_COMMA|P_NODUP|P_CURSWANT,
     51806 #ifdef FEAT_COMMENTS
     51807                            (char_u *)&p_com, PV_COM,
     51808                            {(char_u *)"s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-",
     51809@@ -794,7 +790,7 @@
     51810                            {(char_u *)0L, (char_u *)0L}
     51811 #endif
     51812                            SCRIPTID_INIT},
     51813-    {"commentstring", "cms", P_STRING|P_ALLOCED|P_VI_DEF,
     51814+    {"commentstring", "cms", P_STRING|P_ALLOCED|P_VI_DEF|P_CURSWANT,
     51815 #ifdef FEAT_FOLDING
     51816                            (char_u *)&p_cms, PV_CMS,
     51817                            {(char_u *)"/*%s*/", (char_u *)0L}
     51818@@ -907,6 +903,13 @@
    4737351819                            {(char_u *)0L, (char_u *)0L}
    4737451820 #endif
     
    4738451830 #ifdef FEAT_CSCOPE
    4738551831                            (char_u *)&p_cst, PV_NONE,
    47386 @@ -1901,14 +1902,8 @@
     51832@@ -952,7 +955,7 @@
     51833     {"debug",      NULL,   P_STRING|P_VI_DEF,
     51834                            (char_u *)&p_debug, PV_NONE,
     51835                            {(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
     51836-    {"define",     "def",  P_STRING|P_ALLOCED|P_VI_DEF,
     51837+    {"define",     "def",  P_STRING|P_ALLOCED|P_VI_DEF|P_CURSWANT,
     51838 #ifdef FEAT_FIND_ID
     51839                            (char_u *)&p_def, PV_DEF,
     51840                            {(char_u *)"^\\s*#\\s*define", (char_u *)0L}
     51841@@ -982,7 +985,7 @@
     51842                            (char_u *)NULL, PV_NONE,
     51843 #endif
     51844                            {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
     51845-    {"diffexpr",    "dex",  P_STRING|P_VI_DEF|P_SECURE,
     51846+    {"diffexpr",    "dex",  P_STRING|P_VI_DEF|P_SECURE|P_CURSWANT,
     51847 #if defined(FEAT_DIFF) && defined(FEAT_EVAL)
     51848                            (char_u *)&p_dex, PV_NONE,
     51849                            {(char_u *)"", (char_u *)0L}
     51850@@ -1098,7 +1101,7 @@
     51851                            {(char_u *)0L, (char_u *)0L}
     51852 #endif
     51853                            SCRIPTID_INIT},
     51854-    {"fileformat",  "ff",   P_STRING|P_ALLOCED|P_VI_DEF|P_RSTAT|P_NO_MKRC,
     51855+    {"fileformat",  "ff",   P_STRING|P_ALLOCED|P_VI_DEF|P_RSTAT|P_NO_MKRC|P_CURSWANT,
     51856                            (char_u *)&p_ff, PV_FF,
     51857                            {(char_u *)DFLT_FF, (char_u *)0L} SCRIPTID_INIT},
     51858     {"fileformats", "ffs",  P_STRING|P_VIM|P_COMMA|P_NODUP,
     51859@@ -1158,7 +1161,7 @@
     51860     {"foldlevel",   "fdl",  P_NUM|P_VI_DEF|P_RWIN,
     51861                            (char_u *)VAR_WIN, PV_FDL,
     51862                            {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
     51863-    {"foldlevelstart","fdls", P_NUM|P_VI_DEF,
     51864+    {"foldlevelstart","fdls", P_NUM|P_VI_DEF|P_CURSWANT,
     51865                            (char_u *)&p_fdls, PV_NONE,
     51866                            {(char_u *)-1L, (char_u *)0L} SCRIPTID_INIT},
     51867     {"foldmarker",  "fmr",  P_STRING|P_ALLOCED|P_VIM|P_VI_DEF|
     51868@@ -1175,7 +1178,7 @@
     51869     {"foldnestmax", "fdn",  P_NUM|P_VI_DEF|P_RWIN,
     51870                            (char_u *)VAR_WIN, PV_FDN,
     51871                            {(char_u *)20L, (char_u *)0L} SCRIPTID_INIT},
     51872-    {"foldopen",    "fdo",  P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
     51873+    {"foldopen",    "fdo",  P_STRING|P_VI_DEF|P_COMMA|P_NODUP|P_CURSWANT,
     51874                            (char_u *)&p_fdo, PV_NONE,
     51875                 {(char_u *)"block,hor,mark,percent,quickfix,search,tag,undo",
     51876                                                 (char_u *)0L} SCRIPTID_INIT},
     51877@@ -1740,7 +1743,7 @@
     51878     {"matchtime",   "mat",  P_NUM|P_VI_DEF,
     51879                            (char_u *)&p_mat, PV_NONE,
     51880                            {(char_u *)5L, (char_u *)0L} SCRIPTID_INIT},
     51881-    {"maxcombine",  "mco",  P_NUM|P_VI_DEF,
     51882+    {"maxcombine",  "mco",  P_NUM|P_VI_DEF|P_CURSWANT,
     51883 #ifdef FEAT_MBYTE
     51884                            (char_u *)&p_mco, PV_NONE,
     51885 #else
     51886@@ -1901,14 +1904,8 @@
    4738751887                            (char_u *)NULL, PV_NONE,
    4738851888                            {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
     
    4740051900                            (char_u *)&p_para, PV_NONE,
    4740151901                            {(char_u *)"IPLPPPQPP TPHPLIPpLpItpplpipbp",
    47402 @@ -2740,7 +2735,7 @@
     51902@@ -2278,6 +2275,15 @@
     51903                            (char_u *)"",
     51904 #endif
     51905                                (char_u *)0L} SCRIPTID_INIT},
     51906+    {"shellxescape", "sxe", P_STRING|P_VI_DEF|P_SECURE,
     51907+                           (char_u *)&p_sxe, PV_NONE,
     51908+                           {
     51909+#if defined(MSDOS) || defined(WIN16) || defined(WIN3264)
     51910+                           (char_u *)"\"&|<>()@^",
     51911+#else
     51912+                           (char_u *)"",
     51913+#endif
     51914+                               (char_u *)0L} SCRIPTID_INIT},
     51915     {"shiftround",  "sr",   P_BOOL|P_VI_DEF|P_VIM,
     51916                            (char_u *)&p_sr, PV_NONE,
     51917                            {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
     51918@@ -2706,7 +2712,7 @@
     51919                            {(char_u *)0L, (char_u *)0L}
     51920 #endif
     51921                            SCRIPTID_INIT},
     51922-    {"virtualedit", "ve",   P_STRING|P_COMMA|P_NODUP|P_VI_DEF|P_VIM,
     51923+    {"virtualedit", "ve",   P_STRING|P_COMMA|P_NODUP|P_VI_DEF|P_VIM|P_CURSWANT,
     51924 #ifdef FEAT_VIRTUALEDIT
     51925                            (char_u *)&p_ve, PV_NONE,
     51926                            {(char_u *)"", (char_u *)""}
     51927@@ -2740,7 +2746,7 @@
    4740351928                            (char_u *)&p_wc, PV_NONE,
    4740451929                            {(char_u *)(long)Ctrl_E, (char_u *)(long)TAB}
     
    4740951934                            {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
    4741051935     {"wildignore",  "wig",  P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
    47411 @@ -2750,6 +2745,9 @@
     51936@@ -2750,6 +2756,9 @@
    4741251937                            (char_u *)NULL, PV_NONE,
    4741351938 #endif
     
    4741951944 #ifdef FEAT_WILDMENU
    4742051945                            (char_u *)&p_wmnu, PV_NONE,
    47421 @@ -3843,6 +3841,8 @@
     51946@@ -3843,6 +3852,8 @@
    4742251947 # ifndef OS2   /* Always use bourne shell style redirection if we reach this */
    4742351948            if (       fnamecmp(p, "sh") == 0
     
    4742851953                    || fnamecmp(p, "zsh-beta") == 0
    4742951954                    || fnamecmp(p, "bash") == 0
    47430 @@ -3850,6 +3850,8 @@
     51955@@ -3850,6 +3861,8 @@
    4743151956                    || fnamecmp(p, "cmd") == 0
    4743251957                    || fnamecmp(p, "sh.exe") == 0
     
    4743751962                    || fnamecmp(p, "zsh-beta.exe") == 0
    4743851963                    || fnamecmp(p, "bash.exe") == 0
    47439 @@ -3881,7 +3883,8 @@
     51964@@ -3881,7 +3894,8 @@
    4744051965 
    4744151966 #if defined(MSDOS) || defined(WIN3264) || defined(OS2)
     
    4744751972      * set, but only if they have not been set before.  Default for p_shcf is
    4744851973      * "/c", for p_shq is "".  For "sh" like  shells it is changed here to
    47449 @@ -3918,6 +3921,42 @@
     51974@@ -3918,6 +3932,37 @@
    4745051975 #  endif
    4745151976 # endif
     
    4746351988+        * when executed.
    4746451989+        *
    47465 +        * To avoid this, use the /s argument in addition to /c to force the
    47466 +        * stripping behavior, and also set shellxquote to automatically
    47467 +        * surround the entire command in quotes (which get stripped as
    47468 +        * noted).
     51990+        * To avoid this, set shellxquote to surround the command in
     51991+        * parenthesis.  This appears to make most commands work, without
     51992+        * breaking commands that worked previously, such as
     51993+        * '"path with spaces/cmd" "a&b"'.
    4746951994+        */
    47470 +
    47471 +       /* Set shellxquote default to add the quotes to be stripped. */
    4747251995+       idx3 = findoption((char_u *)"sxq");
    4747351996+       if (idx3 >= 0 && !(options[idx3].flags & P_WAS_SET))
    4747451997+       {
    47475 +           p_sxq = (char_u *)"\"";
     51998+           p_sxq = (char_u *)"(";
    4747651999+           options[idx3].def_val[VI_DEFAULT] = p_sxq;
    4747752000+       }
    4747852001+
    47479 +       /* Set shellcmdflag default to always strip the quotes, note the order
    47480 +        * between /s and /c is important or cmd.exe will treat the /s as part
    47481 +        * of the command to be executed.  */
    4748252002+       idx3 = findoption((char_u *)"shcf");
    4748352003+       if (idx3 >= 0 && !(options[idx3].flags & P_WAS_SET))
    4748452004+       {
    47485 +           p_shcf = (char_u *)"/s /c";
     52005+           p_shcf = (char_u *)"/c";
    4748652006+           options[idx3].def_val[VI_DEFAULT] = p_shcf;
    4748752007+       }
     
    4749052010 
    4749152011 #ifdef FEAT_TITLE
    47492 @@ -4349,7 +4388,7 @@
     52012@@ -4349,7 +4394,7 @@
    4749352013                    p = find_termcode(key_name);
    4749452014                    if (p == NULL)
     
    4749952019                    }
    4750052020                    else
    47501 @@ -4565,6 +4604,31 @@
     52021@@ -4565,6 +4610,31 @@
    4750252022                                arg = errbuf;
    4750352023                            }
     
    4753152051                             * backwards compatibility with Vim 3.0.
    4753252052                             * Misuse errbuf[] for the resulting string.
    47533 @@ -4697,8 +4761,8 @@
     52053@@ -4697,8 +4767,8 @@
    4753452054                                                || s[i] == ','
    4753552055                                                || s[i] == NUL))
     
    4754252062                                    if (s > origval && s[-1] == '\\')
    4754352063                                        ++bs;
    47544 @@ -5275,9 +5339,6 @@
     52064@@ -5275,9 +5345,6 @@
    4754552065 #ifdef FEAT_AUTOCMD
    4754652066     check_string_option(&buf->b_p_ft);
     
    4755252072     check_string_option(&buf->b_p_cinw);
    4755352073 #endif
    47554 @@ -7037,6 +7098,9 @@
     52074@@ -6999,8 +7066,10 @@
     52075     }
     52076 #endif
     52077 
     52078-    if (curwin->w_curswant != MAXCOL)
     52079-       curwin->w_set_curswant = TRUE;  /* in case 'showbreak' changed */
     52080+    if (curwin->w_curswant != MAXCOL
     52081+                    && (options[opt_idx].flags & (P_CURSWANT | P_RCLR)) != 0)
     52082+       curwin->w_set_curswant = TRUE;
     52083+
     52084 #ifdef FEAT_GUI
     52085     /* check redraw when it's not a GUI option or the GUI is active. */
     52086     if (!redraw_gui_only || gui.in_use)
     52087@@ -7037,6 +7106,9 @@
    4755552088     int                i;
    4755652089     int                j = 0;
     
    4756252095     {
    4756352096        if (*s == '-' || *s == '+')
    47564 @@ -7304,7 +7368,7 @@
     52097@@ -7304,7 +7376,7 @@
    4756552098     static char_u *
    4756652099 check_clipboard_option()
     
    4757152104     int                new_autoselectml = FALSE;
    4757252105     int                new_html = FALSE;
    47573 @@ -7316,9 +7380,15 @@
     52106@@ -7316,9 +7388,15 @@
    4757452107     {
    4757552108        if (STRNCMP(p, "unnamed", 7) == 0 && (p[7] == ',' || p[7] == NUL))
     
    4758852121                                        && (p[10] == ',' || p[10] == NUL))
    4758952122        {
    47590 @@ -7483,6 +7553,31 @@
     52123@@ -7483,14 +7561,36 @@
    4759152124        compatible_set();
    4759252125     }
     
    4762052153     else if ((int *)varp == &curwin->w_p_list
    4762152154          || (int *)varp == &curwin->w_p_nu
    47622 @@ -7763,9 +7858,9 @@
     52155          || (int *)varp == &curwin->w_p_rnu)
     52156     {
     52157-       if (curwin->w_curswant != MAXCOL)
     52158-           curwin->w_set_curswant = TRUE;
     52159-
     52160        /* If 'number' is set, reset 'relativenumber'. */
     52161        /* If 'relativenumber' is set, reset 'number'. */
     52162        if ((int *)varp == &curwin->w_p_nu && curwin->w_p_nu)
     52163@@ -7735,8 +7835,6 @@
     52164     {
     52165        if (curwin->w_p_wrap)
     52166            curwin->w_leftcol = 0;
     52167-       if (curwin->w_curswant != MAXCOL)
     52168-           curwin->w_set_curswant = TRUE;
     52169     }
     52170 
     52171 #ifdef FEAT_WINDOWS
     52172@@ -7763,9 +7861,9 @@
    4762352173 #ifdef FEAT_BEVAL
    4762452174     else if ((int *)varp == &p_beval)
     
    4763252182     }
    4763352183 #endif
    47634 @@ -7798,6 +7893,10 @@
     52184@@ -7798,6 +7896,10 @@
    4763552185        /* Only de-activate it here, it will be enabled when changing mode. */
    4763652186        if (p_imdisable)
     
    4764352193 #endif
    4764452194 
    47645 @@ -8523,8 +8622,8 @@
     52195@@ -7959,31 +8061,8 @@
     52196            curbuf->b_p_imsearch = B_IMODE_USE_INSERT;
     52197 # endif
     52198        }
     52199-       if (curwin->w_curswant != MAXCOL)
     52200-           curwin->w_set_curswant = TRUE;
     52201     }
     52202 
     52203-    else if ((int *)varp == &p_arshape)
     52204-    {
     52205-       if (curwin->w_curswant != MAXCOL)
     52206-           curwin->w_set_curswant = TRUE;
     52207-    }
     52208-#endif
     52209-
     52210-#ifdef FEAT_LINEBREAK
     52211-    if ((int *)varp == &curwin->w_p_lbr)
     52212-    {
     52213-       if (curwin->w_curswant != MAXCOL)
     52214-           curwin->w_set_curswant = TRUE;
     52215-    }
     52216-#endif
     52217-
     52218-#ifdef FEAT_RIGHTLEFT
     52219-    if ((int *)varp == &curwin->w_p_rl)
     52220-    {
     52221-       if (curwin->w_curswant != MAXCOL)
     52222-           curwin->w_set_curswant = TRUE;
     52223-    }
     52224 #endif
     52225 
     52226     /*
     52227@@ -7993,7 +8072,9 @@
     52228     options[opt_idx].flags |= P_WAS_SET;
     52229 
     52230     comp_col();                            /* in case 'ruler' or 'showcmd' changed */
     52231-
     52232+    if (curwin->w_curswant != MAXCOL
     52233+                    && (options[opt_idx].flags & (P_CURSWANT | P_RCLR)) != 0)
     52234+       curwin->w_set_curswant = TRUE;
     52235     check_redraw(options[opt_idx].flags);
     52236 
     52237     return NULL;
     52238@@ -8508,8 +8589,9 @@
     52239     options[opt_idx].flags |= P_WAS_SET;
     52240 
     52241     comp_col();                            /* in case 'columns' or 'ls' changed */
     52242-    if (curwin->w_curswant != MAXCOL)
     52243-       curwin->w_set_curswant = TRUE;  /* in case 'tabstop' changed */
     52244+    if (curwin->w_curswant != MAXCOL
     52245+                    && (options[opt_idx].flags & (P_CURSWANT | P_RCLR)) != 0)
     52246+       curwin->w_set_curswant = TRUE;
     52247     check_redraw(options[opt_idx].flags);
     52248 
     52249     return errmsg;
     52250@@ -8523,8 +8605,8 @@
    4764652251     long_u     flags;
    4764752252 {
     
    4765452259 #ifdef FEAT_WINDOWS
    4765552260     if ((flags & P_RSTAT) || all)      /* mark all status lines dirty */
    47656 @@ -8535,7 +8634,7 @@
     52261@@ -8535,7 +8617,7 @@
    4765752262        changed_window_setting();
    4765852263     if (flags & P_RBUF)
     
    4766352268     else if (all)
    4766452269        redraw_all_later(NOT_VALID);
    47665 @@ -9172,7 +9271,7 @@
     52270@@ -9172,7 +9254,7 @@
    4766652271     int                expand;
    4766752272 {
     
    4767252277     if (fprintf(fd, "%s %s=", cmd, name) < 0)
    4767352278        return FAIL;
    47674 @@ -9190,9 +9289,16 @@
     52279@@ -9190,9 +9272,16 @@
    4767552280        }
    4767652281        else if (expand)
     
    4768952294        else if (put_escstr(fd, *valuep, 2) == FAIL)
    4769052295            return FAIL;
    47691 @@ -9645,9 +9751,6 @@
     52296@@ -9645,9 +9734,6 @@
    4769252297        case PV_MA:     return (char_u *)&(curbuf->b_p_ma);
    4769352298        case PV_MOD:    return (char_u *)&(curbuf->b_changed);
     
    4769952304 #ifdef FEAT_TEXTOBJ
    4770052305        case PV_QE:     return (char_u *)&(curbuf->b_p_qe);
    47701 @@ -9756,6 +9859,9 @@
     52306@@ -9756,6 +9842,9 @@
    4770252307 #ifdef FEAT_SCROLLBIND
    4770352308     to->wo_scb = from->wo_scb;
     
    4770952314     to->wo_spell = from->wo_spell;
    4771052315 #endif
    47711 @@ -9995,9 +10101,6 @@
     52316@@ -9995,9 +10084,6 @@
    4771252317            /* Don't copy 'filetype', it must be detected */
    4771352318            buf->b_p_ft = empty_option;
     
    4771952324 #if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
    4772052325            buf->b_p_cinw = vim_strsave(p_cinw);
    47721 @@ -10011,7 +10114,7 @@
     52326@@ -10011,7 +10097,7 @@
    4772252327            buf->b_p_smc = p_smc;
    4772352328 #endif
     
    4772852333            buf->b_s.b_p_spf = vim_strsave(p_spf);
    4772952334            buf->b_s.b_p_spl = vim_strsave(p_spl);
    47730 @@ -11284,16 +11387,19 @@
     52335@@ -10877,7 +10963,8 @@
     52336 shortmess(x)
     52337     int            x;
     52338 {
     52339-    return (   vim_strchr(p_shm, x) != NULL
     52340+    return p_shm != NULL &&
     52341+           (   vim_strchr(p_shm, x) != NULL
     52342            || (vim_strchr(p_shm, 'a') != NULL
     52343                && vim_strchr((char_u *)SHM_A, x) != NULL));
     52344 }
     52345@@ -11284,16 +11371,19 @@
    4773152346  * from when editing started (save_file_ff() called).
    4773252347  * Also when 'endofline' was changed and 'binary' is set, or when 'bomb' was
     
    4775252367        return FALSE;
    4775352368diff -Naur vim73.orig/src/option.h vim73/src/option.h
    47754 --- vim73.orig/src/option.h     2012-02-15 21:57:45.041435628 +0000
    47755 +++ vim73/src/option.h  2012-02-15 21:57:46.557475615 +0000
     52369--- vim73.orig/src/option.h     2012-06-03 23:09:52.920006524 +0000
     52370+++ vim73/src/option.h  2012-06-03 23:09:55.460074120 +0000
    4775652371@@ -33,7 +33,7 @@
    4775752372 #     ifdef EBCDIC
     
    4778652401 EXTERN char_u  *p_csqf;        /* 'cscopequickfix' */
    4778752402 #  define      CSQF_CMDS   "sgdctefi"
    47788 @@ -816,7 +819,7 @@
     52403@@ -709,6 +712,7 @@
     52404 #endif
     52405 EXTERN char_u  *p_shq;         /* 'shellquote' */
     52406 EXTERN char_u  *p_sxq;         /* 'shellxquote' */
     52407+EXTERN char_u  *p_sxe;         /* 'shellxescape' */
     52408 EXTERN char_u  *p_srr;         /* 'shellredir' */
     52409 #ifdef AMIGA
     52410 EXTERN long    p_st;           /* 'shelltype' */
     52411@@ -816,7 +820,7 @@
    4778952412 EXTERN char_u  *p_ttym;        /* 'ttymouse' */
    4779052413 EXTERN unsigned ttym_flags;
     
    4779552418 # define TTYM_XTERM            0x01
    4779652419 # define TTYM_XTERM2           0x02
    47797 @@ -824,6 +827,7 @@
     52420@@ -824,6 +828,7 @@
    4779852421 # define TTYM_NETTERM          0x08
    4779952422 # define TTYM_JSBTERM          0x10
     
    4780352426 EXTERN char_u  *p_udir;        /* 'undodir' */
    4780452427 EXTERN long    p_ul;           /* 'undolevels' */
    47805 @@ -854,7 +858,11 @@
     52428@@ -854,7 +859,11 @@
    4780652429 # define VE_ONEMORE    8
    4780752430 #endif
     
    4781652439 #ifdef FEAT_CMDL_COMPL
    4781752440 EXTERN char_u  *p_wop;         /* 'wildoptions' */
    47818 @@ -872,6 +880,7 @@
     52441@@ -872,6 +881,7 @@
    4781952442 EXTERN char_u  *p_ww;          /* 'whichwrap' */
    4782052443 EXTERN long    p_wc;           /* 'wildchar' */
     
    4782452447 #ifdef FEAT_WILDMENU
    4782552448 EXTERN int     p_wmnu;         /* 'wildmenu' */
    47826 @@ -979,9 +988,6 @@
     52449@@ -979,9 +989,6 @@
    4782752450     , BV_MOD
    4782852451     , BV_MPS
     
    4783552458 #endif
    4783652459diff -Naur vim73.orig/src/os_amiga.c vim73/src/os_amiga.c
    47837 --- vim73.orig/src/os_amiga.c   2012-02-15 21:57:45.041435628 +0000
    47838 +++ vim73/src/os_amiga.c        2012-02-15 21:57:46.553475509 +0000
     52460--- vim73.orig/src/os_amiga.c   2012-06-03 23:09:52.920006524 +0000
     52461+++ vim73/src/os_amiga.c        2012-06-03 23:09:54.876058577 +0000
    4783952462@@ -1022,7 +1022,7 @@
    4784052463 
     
    4784752470     id = (struct InfoData *)(((long)id_a + 3L) & ~3L);
    4784852471diff -Naur vim73.orig/src/os_mac_conv.c vim73/src/os_mac_conv.c
    47849 --- vim73.orig/src/os_mac_conv.c        2012-02-15 21:57:45.049435840 +0000
    47850 +++ vim73/src/os_mac_conv.c     2012-02-15 21:57:46.553475509 +0000
     52472--- vim73.orig/src/os_mac_conv.c        2012-06-03 23:09:52.932006845 +0000
     52473+++ vim73/src/os_mac_conv.c     2012-06-03 23:09:54.876058577 +0000
    4785152474@@ -14,6 +14,8 @@
    4785252475  */
     
    4786852491      * there is an incomplete byte sequence.  Only do up to 6 bytes to avoid
    4786952492diff -Naur vim73.orig/src/os_macosx.m vim73/src/os_macosx.m
    47870 --- vim73.orig/src/os_macosx.m  2012-02-15 21:57:45.057436051 +0000
    47871 +++ vim73/src/os_macosx.m       2012-02-15 21:57:46.161465170 +0000
     52493--- vim73.orig/src/os_macosx.m  2012-06-03 23:09:52.948007269 +0000
     52494+++ vim73/src/os_macosx.m       2012-06-03 23:09:54.356044740 +0000
    4787252495@@ -15,6 +15,11 @@
    4787352496     Error: MACOS 9 is no longer supported in Vim 7
     
    4793752560     int len = [string lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
    4793852561diff -Naur vim73.orig/src/os_msdos.c vim73/src/os_msdos.c
    47939 --- vim73.orig/src/os_msdos.c   2012-02-15 21:57:45.061436156 +0000
    47940 +++ vim73/src/os_msdos.c        2012-02-15 21:57:46.137464536 +0000
     52562--- vim73.orig/src/os_msdos.c   2012-06-03 23:09:52.952007375 +0000
     52563+++ vim73/src/os_msdos.c        2012-06-03 23:09:54.320043782 +0000
    4794152564@@ -21,7 +21,6 @@
    4794252565  * Some functions are also used for Win16 (MS-Windows 3.1).
     
    4797252595        /* Did we get anything? */
    4797352596diff -Naur vim73.orig/src/os_mswin.c vim73/src/os_mswin.c
    47974 --- vim73.orig/src/os_mswin.c   2012-02-15 21:57:45.061436156 +0000
    47975 +++ vim73/src/os_mswin.c        2012-02-15 21:57:46.605476881 +0000
     52597--- vim73.orig/src/os_mswin.c   2012-06-03 23:09:52.952007375 +0000
     52598+++ vim73/src/os_mswin.c        2012-06-03 23:09:54.944060388 +0000
    4797652599@@ -22,7 +22,6 @@
    4797752600 # endif
     
    4839653019 
    4839753020diff -Naur vim73.orig/src/os_qnx.c vim73/src/os_qnx.c
    48398 --- vim73.orig/src/os_qnx.c     2012-02-15 21:57:45.061436156 +0000
    48399 +++ vim73/src/os_qnx.c  2012-02-15 21:57:46.485473716 +0000
     53021--- vim73.orig/src/os_qnx.c     2012-06-03 23:09:52.948007269 +0000
     53022+++ vim73/src/os_qnx.c  2012-06-03 23:09:54.784056130 +0000
    4840053023@@ -24,10 +24,10 @@
    4840153024 #if defined(FEAT_GUI_PHOTON)
     
    4856253185 #endif
    4856353186diff -Naur vim73.orig/src/os_riscos.c vim73/src/os_riscos.c
    48564 --- vim73.orig/src/os_riscos.c  2012-02-15 21:57:45.053435946 +0000
     53187--- vim73.orig/src/os_riscos.c  2012-06-03 23:09:52.940007057 +0000
    4856553188+++ vim73/src/os_riscos.c       1970-01-01 00:00:00.000000000 +0000
    4856653189@@ -1,1292 +0,0 @@
     
    4985854481-}
    4985954482diff -Naur vim73.orig/src/os_riscos.h vim73/src/os_riscos.h
    49860 --- vim73.orig/src/os_riscos.h  2012-02-15 21:57:45.053435946 +0000
     54483--- vim73.orig/src/os_riscos.h  2012-06-03 23:09:52.940007057 +0000
    4986154484+++ vim73/src/os_riscos.h       1970-01-01 00:00:00.000000000 +0000
    4986254485@@ -1,166 +0,0 @@
     
    5002854651-#define mch_setenv(name, val, x) setenv(name, val, x)
    5002954652diff -Naur vim73.orig/src/os_unix.c vim73/src/os_unix.c
    50030 --- vim73.orig/src/os_unix.c    2012-02-15 21:57:45.053435946 +0000
    50031 +++ vim73/src/os_unix.c 2012-02-15 21:57:46.921485217 +0000
     54653--- vim73.orig/src/os_unix.c    2012-06-03 23:09:52.940007057 +0000
     54654+++ vim73/src/os_unix.c 2012-06-03 23:09:55.740081571 +0000
    5003254655@@ -154,6 +154,13 @@
    5003354656 
     
    5025454877 #endif
    5025554878 
    50256 @@ -3643,26 +3721,46 @@
     54879@@ -3643,26 +3721,43 @@
    5025754880     /* Nothing to do. */
    5025854881 }
     
    5026954892-append_ga_line(gap)
    5027054893-    garray_T   *gap;
    50271 +    static pid_t
    50272 +wait4pid(child, status)
    50273 +    pid_t      child;
    50274 +    waitstatus *status;
    50275  {
     54894-{
    5027654895-    /* Remove trailing CR. */
    5027754896-    if (gap->ga_len > 0
     
    5028254901-    ml_append(curwin->w_cursor.lnum++, gap->ga_data, 0, FALSE);
    5028354902-    gap->ga_len = 0;
     54903+    static pid_t
     54904+wait4pid(child, status)
     54905+    pid_t      child;
     54906+    waitstatus *status;
     54907+{
    5028454908+    pid_t wait_pid = 0;
    5028554909+
    5028654910+    while (wait_pid != child)
    5028754911+    {
    50288 +# ifdef _THREAD_SAFE
    50289 +       /* Ugly hack: when compiled with Python threads are probably
    50290 +        * used, in which case wait() sometimes hangs for no obvious
    50291 +        * reason.  Use waitpid() instead and loop (like the GUI). */
    50292 +#  ifdef __NeXT__
     54912+       /* When compiled with Python threads are probably used, in which case
     54913+        * wait() sometimes hangs for no obvious reason.  Use waitpid()
     54914+        * instead and loop (like the GUI). Also needed for other interfaces,
     54915+        * they might call system(). */
     54916+# ifdef __NeXT__
    5029354917+       wait_pid = wait4(child, status, WNOHANG, (struct rusage *)0);
    50294 +#  else
     54918+# else
    5029554919+       wait_pid = waitpid(child, status, WNOHANG);
    50296 +#  endif
     54920+# endif
    5029754921+       if (wait_pid == 0)
    5029854922+       {
     
    5030154925+           continue;
    5030254926+       }
    50303 +# else
    50304 +       wait_pid = wait(status);
    50305 +# endif
    5030654927+       if (wait_pid <= 0
    5030754928+# ifdef ECHILD
     
    5031754938     int
    5031854939 mch_call_shell(cmd, options)
    50319 @@ -3706,6 +3804,10 @@
     54940@@ -3706,6 +3801,10 @@
    5032054941     if (options & SHELL_COOKED)
    5032154942        settmode(TMODE_COOK);       /* set to normal mode */
     
    5032854949     if (cmd == NULL)
    5032954950        x = system(""); /* this starts an interactive shell in emx */
    50330 @@ -3795,6 +3897,7 @@
     54951@@ -3795,6 +3894,7 @@
    5033154952     int                retval = -1;
    5033254953     char       **argv = NULL;
     
    5033654957     char_u     *p;
    5033754958     int                inquote;
    50338 @@ -3814,13 +3917,17 @@
     54959@@ -3814,13 +3914,17 @@
    5033954960 # endif
    5034054961     int                did_settmode = FALSE;   /* settmode(TMODE_RAW) called */
     
    5035754978     /*
    5035854979      * Do this loop twice:
    50359 @@ -3851,6 +3958,19 @@
     54980@@ -3851,6 +3955,19 @@
    5036054981        }
    5036154982        if (argv == NULL)
     
    5037754998            if (argv == NULL)       /* out of memory */
    5037854999                goto error;
    50379 @@ -3858,9 +3978,27 @@
     55000@@ -3858,9 +3975,27 @@
    5038055001     }
    5038155002     if (cmd != NULL)
     
    5040655027     }
    5040755028     argv[argc] = NULL;
    50408 @@ -3885,11 +4023,21 @@
     55029@@ -3885,11 +4020,21 @@
    5040955030        if (p_guipty && !(options & (SHELL_READ|SHELL_WRITE)))
    5041055031        {
     
    5043255053        }
    5043355054        /*
    50434 @@ -4148,7 +4296,6 @@
     55055@@ -4148,7 +4293,6 @@
    5043555056 # ifdef FEAT_GUI
    5043655057                if (pty_master_fd >= 0)
     
    5044055061                    toshell_fd = dup(pty_master_fd);
    5044155062                }
    50442 @@ -4190,15 +4337,13 @@
     55063@@ -4190,15 +4334,13 @@
    5044355064                    {
    5044455065                        MSG_PUTS(_("\nCannot fork\n"));
     
    5045755078                        for (;;)
    5045855079                        {
    50459 @@ -4210,7 +4355,8 @@
     55080@@ -4210,7 +4352,8 @@
    5046055081                                len = write(toshell_fd, "", (size_t)1);
    5046155082                            else
     
    5046755088                                           s == NULL ? l
    5046855089                                              : (size_t)(s - (lp + written)));
    50469 @@ -4221,7 +4367,7 @@
     55090@@ -4221,7 +4364,7 @@
    5047055091                                 * should not have one. */
    5047155092                                if (lnum != curbuf->b_op_end.lnum
     
    5047655097                                                    curbuf->b_ml.ml_line_count
    5047755098                                                    || curbuf->b_p_eol)))
    50478 @@ -4243,7 +4389,7 @@
     55099@@ -4243,7 +4386,7 @@
    5047955100                        }
    5048055101                        _exit(0);
     
    5048555106                        close(toshell_fd);
    5048655107                        toshell_fd = -1;
    50487 @@ -4430,7 +4576,7 @@
     55108@@ -4430,7 +4573,7 @@
    5048855109                    ++noread_cnt;
    5048955110                    while (RealWaitForChar(fromshell_fd, 10L, NULL))
     
    5049455115                                + buffer_off, (size_t)(BUFLEN - buffer_off)
    5049555116 # else
    50496 @@ -4540,7 +4686,7 @@
     55117@@ -4540,7 +4683,7 @@
    5049755118                     * typed characters (otherwise we would lose typeahead).
    5049855119                     */
     
    5050355124                    wait_pid = waitpid(pid, &status, WNOHANG);
    5050455125 # endif
    50505 @@ -4564,10 +4710,10 @@
     55126@@ -4564,10 +4707,10 @@
    5050655127                    {
    5050755128                        append_ga_line(&ga);
     
    5051655137                }
    5051755138 
    50518 @@ -4589,38 +4735,24 @@
     55139@@ -4589,38 +4732,24 @@
    5051955140             * Don't wait if wait_pid was already set above, indicating the
    5052055141             * child already exited.
     
    5056755188            /*
    5056855189             * Set to raw mode right now, otherwise a CTRL-C after
    50569 @@ -4656,6 +4788,7 @@
     55190@@ -4656,6 +4785,7 @@
    5057055191        }
    5057155192     }
     
    5057555196 error:
    5057655197     if (!did_settmode)
    50577 @@ -4766,7 +4899,8 @@
     55198@@ -4766,7 +4896,8 @@
    5057855199 
    5057955200 /*
     
    5058555206  * Returns also, when a request from Sniff is waiting -- toni.
    5058655207  * Or when a Linux GPM mouse event is waiting.
    50587 @@ -5004,7 +5138,8 @@
     55208@@ -5004,7 +5135,8 @@
    5058855209        /*
    5058955210         * Select on ready for reading and exceptional condition (end of file).
     
    5059555216        FD_SET(fd, &rfds);
    5059655217 # if !defined(__QNX__) && !defined(__CYGWIN32__)
    50597 @@ -5064,6 +5199,21 @@
     55218@@ -5064,6 +5196,21 @@
    5059855219 # else
    5059955220        ret = select(maxfd + 1, &rfds, NULL, &efds, tvp);
     
    5061755238        if (ret == -1 && errno == ENOTSUP)
    5061855239        {
    50619 @@ -5071,7 +5221,7 @@
     55240@@ -5071,7 +5218,7 @@
    5062055241            FD_ZERO(&efds);
    5062155242            ret = 0;
     
    5062655247        if (ret == 0 && mzquantum_used)
    5062755248            /* loop if MzThreads must be scheduled and timeout occurred */
    50628 @@ -5693,6 +5843,7 @@
     55249@@ -5693,6 +5840,7 @@
    5062955250        if (shell_style == STYLE_PRINT && !did_find_nul)
    5063055251        {
     
    5063455255                did_find_nul = TRUE;
    5063555256            else
    50636 @@ -6562,7 +6713,7 @@
     55257@@ -6562,7 +6710,7 @@
    5063755258            xterm_hints.x = 2;
    5063855259        return TRUE;
     
    5064455265        return FALSE;
    5064555266diff -Naur vim73.orig/src/os_unix.h vim73/src/os_unix.h
    50646 --- vim73.orig/src/os_unix.h    2012-02-15 21:57:45.041435628 +0000
    50647 +++ vim73/src/os_unix.h 2012-02-15 21:57:45.669452193 +0000
     55267--- vim73.orig/src/os_unix.h    2012-06-03 23:09:52.920006524 +0000
     55268+++ vim73/src/os_unix.h 2012-06-03 23:09:53.744028453 +0000
    5064855269@@ -184,10 +184,6 @@
    5064955270 
     
    5065855279 #endif
    5065955280diff -Naur vim73.orig/src/os_win16.c vim73/src/os_win16.c
    50660 --- vim73.orig/src/os_win16.c   2012-02-15 21:57:45.041435628 +0000
    50661 +++ vim73/src/os_win16.c        2012-02-15 21:57:46.553475509 +0000
     55281--- vim73.orig/src/os_win16.c   2012-06-03 23:09:52.920006524 +0000
     55282+++ vim73/src/os_win16.c        2012-06-03 23:09:54.876058577 +0000
    5066255283@@ -20,13 +20,11 @@
    5066355284 # pragma warn -obs
     
    5068755308                    PostQuitMessage(msg.wParam);
    5068855309diff -Naur vim73.orig/src/os_win32.c vim73/src/os_win32.c
    50689 --- vim73.orig/src/os_win32.c   2012-02-15 21:57:45.065436261 +0000
    50690 +++ vim73/src/os_win32.c        2012-02-15 21:57:46.377470867 +0000
     55310--- vim73.orig/src/os_win32.c   2012-06-03 23:09:52.956007482 +0000
     55311+++ vim73/src/os_win32.c        2012-06-03 23:09:55.524075823 +0000
    5069155312@@ -20,7 +20,6 @@
    5069255313  * Roger Knobbe <rogerk@wonderware.com> did the initial port of Vim 3.0.
     
    5072055341 /* Win32 Console handles for input and output */
    5072155342 static HANDLE g_hConIn  = INVALID_HANDLE_VALUE;
    50722 @@ -206,42 +212,73 @@
     55343@@ -206,42 +212,96 @@
    5072355344 static int suppress_winsize = 1;       /* don't fiddle with console */
    5072455345 #endif
     
    5079155412+
    5079255413+/*
     55414+ * Unescape characters in "p" that appear in "escaped".
     55415+ */
     55416+    static void
     55417+unescape_shellxquote(char_u *p, char_u *escaped)
     55418+{
     55419+    int            l = (int)STRLEN(p);
     55420+    int            n;
     55421+
     55422+    while (*p != NUL)
     55423+    {
     55424+       if (*p == '^' && vim_strchr(escaped, p[1]) != NULL)
     55425+           mch_memmove(p, p + 1, l--);
     55426+#ifdef FEAT_MBYTE
     55427+       n = (*mb_ptr2len)(p);
     55428+#else
     55429+       n = 1;
     55430+#endif
     55431+       p += n;
     55432+       l -= n;
     55433+    }
     55434+}
     55435+
     55436+/*
    5079355437+ * Load library "name".
    5079455438+ */
     
    5081555459 
    5081655460 #if defined(DYNAMIC_GETTEXT) || defined(PROTO)
    50817 @@ -254,7 +291,7 @@
     55461@@ -254,7 +314,7 @@
    5081855462 static char *null_libintl_bindtextdomain(const char *, const char *);
    5081955463 static char *null_libintl_bind_textdomain_codeset(const char *, const char *);
     
    5082455468 char *(*dyn_libintl_textdomain)(const char *) = null_libintl_textdomain;
    5082555469 char *(*dyn_libintl_bindtextdomain)(const char *, const char *)
    50826 @@ -282,26 +319,16 @@
     55470@@ -282,26 +342,16 @@
    5082755471     if (hLibintlDLL)
    5082855472        return 1;
     
    5085755501     for (i = 0; libintl_entry[i].name != NULL
    5085855502                                         && libintl_entry[i].ptr != NULL; ++i)
    50859 @@ -398,6 +425,11 @@
     55503@@ -398,6 +448,11 @@
    5086055504 static PGNSECINFO pGetNamedSecurityInfo;
    5086155505 #endif
     
    5086955513  * Set g_PlatformId to VER_PLATFORM_WIN32_NT (NT) or
    5087055514  * VER_PLATFORM_WIN32_WINDOWS (Win95).
    50871 @@ -430,7 +462,7 @@
     55515@@ -430,7 +485,7 @@
    5087255516             * Seems like a lot of overhead to load/unload ADVAPI32.DLL each
    5087355517             * time we verify security...
     
    5087855522            {
    5087955523                pSetNamedSecurityInfo = (PSNSECINFO)GetProcAddress(advapi_lib,
    50880 @@ -448,6 +480,18 @@
     55524@@ -448,6 +503,18 @@
    5088155525            }
    5088255526        }
     
    5089755541     }
    5089855542 }
    50899 @@ -1615,6 +1659,35 @@
     55543@@ -1615,6 +1682,35 @@
    5090055544     return TRUE;
    5090155545 }
     
    5093355577 
    5093455578 /*
    50935 @@ -1627,6 +1700,9 @@
     55579@@ -1627,6 +1723,9 @@
    5093655580     extern int _fmode;
    5093755581 #endif
     
    5094355587      * for the timestamp test to work on removed floppies. */
    5094455588     SetErrorMode(SEM_FAILCRITICALERRORS);
    50945 @@ -1835,8 +1911,7 @@
     55589@@ -1835,8 +1934,7 @@
    5094655590        cb->BufferSize.X = cb->Info.dwSize.X;
    5094755591        cb->BufferSize.Y = cb->Info.dwSize.Y;
     
    5095355597        if (cb->Buffer == NULL)
    5095455598            return FALSE;
    50955 @@ -2103,6 +2178,9 @@
     55599@@ -2103,6 +2201,9 @@
    5095655600     extern int _fmode;
    5095755601 #endif
     
    5096355607      * for the timestamp test to work on removed floppies. */
    5096455608     SetErrorMode(SEM_FAILCRITICALERRORS);
    50965 @@ -2273,12 +2351,14 @@
     55609@@ -2273,12 +2374,14 @@
    5096655610     int                len)
    5096755611 {
     
    5097855622     flen = (int)STRLEN(name);
    5097955623     if (flen == 0 || flen > _MAX_PATH)
    50980 @@ -2323,12 +2403,19 @@
     55624@@ -2323,12 +2426,19 @@
    5098155625        }
    5098255626        *ptrue = NUL;
     
    5099955643        {
    5100055644            c = *porig;
    51001 @@ -2578,30 +2665,73 @@
     55645@@ -2578,30 +2688,73 @@
    5100255646 }
    5100355647 
     
    5107855722            /* Retry with non-wide function (for Windows 98). */
    5107955723            vim_free(wn);
    51080 @@ -2612,17 +2742,18 @@
     55724@@ -2612,17 +2765,18 @@
    5108155725 #endif
    5108255726        hFile = CreateFile(fname,       /* file name */
     
    5110255746     }
    5110355747 
    51104 @@ -3104,7 +3235,7 @@
     55748@@ -3104,7 +3258,7 @@
    5110555749  *    4. Prompt the user to press a key to close the console window
    5110655750  */
     
    5111155755     STARTUPINFO                si;
    5111255756     PROCESS_INFORMATION pi;
    51113 @@ -3120,9 +3251,10 @@
     55757@@ -3120,9 +3274,10 @@
    5111455758      * It's nicer to run a filter command in a minimized window, but in
    5111555759      * Windows 95 this makes the command MUCH slower.  We can't do it under
     
    5112355767        si.wShowWindow = SW_SHOWNORMAL;
    5112455768     si.cbReserved2 = 0;
    51125 @@ -3160,10 +3292,10 @@
     55769@@ -3160,10 +3315,10 @@
    5112655770        {
    5112755771            MSG msg;
     
    5113655780            if (WaitForSingleObject(pi.hProcess, delay) != WAIT_TIMEOUT)
    5113755781                break;
    51138 @@ -3208,6 +3340,494 @@
     55782@@ -3208,6 +3363,506 @@
    5113955783 
    5114055784     return ret;
     
    5135956003+    int            delay = 1;
    5136056004+    DWORD      buffer_off = 0; /* valid bytes in buffer[] */
     56005+    char       *p = NULL;
    5136156006+
    5136256007+    SECURITY_ATTRIBUTES saAttr;
     
    5139956044+       ga_init2(&ga, 1, BUFLEN);
    5140056045+
     56046+    if (cmd != NULL)
     56047+    {
     56048+       p = (char *)vim_strsave((char_u *)cmd);
     56049+       if (p != NULL)
     56050+           unescape_shellxquote((char_u *)p, p_sxe);
     56051+       else
     56052+           p = cmd;
     56053+    }
     56054+
    5140156055+    /* Now, run the command */
    5140256056+    CreateProcess(NULL,                        /* Executable name */
    51403 +                 cmd,                  /* Command to execute */
     56057+                 p,                    /* Command to execute */
    5140456058+                 NULL,                 /* Process security attributes */
    5140556059+                 NULL,                 /* Thread security attributes */
     
    5141656070+                 &pi);                 /* Process information */
    5141756071+
     56072+    if (p != cmd)
     56073+       vim_free(p);
    5141856074+
    5141956075+    /* Close our unused side of the pipes */
     
    5163156287 
    5163256288 # define mch_system(c, o) system(c)
    51633 @@ -3281,7 +3901,7 @@
    51634         char_u *newcmd;
    51635         long_u cmdlen =  (
     56289@@ -3278,84 +3933,147 @@
     56290     else
     56291     {
     56292        /* we use "command" or "cmd" to start the shell; slow but easy */
     56293-       char_u *newcmd;
     56294-       long_u cmdlen =  (
     56295-#ifdef FEAT_GUI_W32
     56296-               STRLEN(vimrun_path) +
     56297-#endif
     56298-               STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10);
     56299+       char_u  *newcmd = NULL;
     56300+       char_u  *cmdbase = cmd;
     56301+       long_u  cmdlen;
     56302+
     56303+       /* Skip a leading ", ( and "(. */
     56304+       if (*cmdbase == '"' )
     56305+           ++cmdbase;
     56306+       if (*cmdbase == '(')
     56307+           ++cmdbase;
     56308+
     56309+       if ((STRNICMP(cmdbase, "start", 5) == 0) && vim_iswhite(cmdbase[5]))
     56310+       {
     56311+           STARTUPINFO         si;
     56312+           PROCESS_INFORMATION pi;
     56313+           DWORD               flags = CREATE_NEW_CONSOLE;
     56314+           char_u              *p;
     56315+
     56316+           si.cb = sizeof(si);
     56317+           si.lpReserved = NULL;
     56318+           si.lpDesktop = NULL;
     56319+           si.lpTitle = NULL;
     56320+           si.dwFlags = 0;
     56321+           si.cbReserved2 = 0;
     56322+           si.lpReserved2 = NULL;
     56323+
     56324+           cmdbase = skipwhite(cmdbase + 5);
     56325+           if ((STRNICMP(cmdbase, "/min", 4) == 0)
     56326+                   && vim_iswhite(cmdbase[4]))
     56327+           {
     56328+               cmdbase = skipwhite(cmdbase + 4);
     56329+               si.dwFlags = STARTF_USESHOWWINDOW;
     56330+               si.wShowWindow = SW_SHOWMINNOACTIVE;
     56331+           }
     56332+           else if ((STRNICMP(cmdbase, "/b", 2) == 0)
     56333+                   && vim_iswhite(cmdbase[2]))
     56334+           {
     56335+               cmdbase = skipwhite(cmdbase + 2);
     56336+               flags = CREATE_NO_WINDOW;
     56337+               si.dwFlags = STARTF_USESTDHANDLES;
     56338+               si.hStdInput = CreateFile("\\\\.\\NUL", // File name
     56339+                   GENERIC_READ,                       // Access flags
     56340+                   0,                                  // Share flags
     56341+                   NULL,                               // Security att.
     56342+                   OPEN_EXISTING,                      // Open flags
     56343+                   FILE_ATTRIBUTE_NORMAL,              // File att.
     56344+                   NULL);                              // Temp file
     56345+               si.hStdOutput = si.hStdInput;
     56346+               si.hStdError = si.hStdInput;
     56347+           }
     56348 
     56349-       newcmd = lalloc(cmdlen, TRUE);
     56350-       if (newcmd != NULL)
     56351-       {
     56352-           char_u *cmdbase = (*cmd == '"' ? cmd + 1 : cmd);
     56353+           /* Remove a trailing ", ) and )" if they have a match
     56354+            * at the start of the command. */
     56355+           if (cmdbase > cmd)
     56356+           {
     56357+               p = cmdbase + STRLEN(cmdbase);
     56358+               if (p > cmdbase && p[-1] == '"' && *cmd == '"')
     56359+                   *--p = NUL;
     56360+               if (p > cmdbase && p[-1] == ')'
     56361+                       && (*cmd =='(' || cmd[1] == '('))
     56362+                   *--p = NUL;
     56363+           }
     56364 
     56365-           if ((STRNICMP(cmdbase, "start", 5) == 0) && vim_iswhite(cmdbase[5]))
     56366+           newcmd = cmdbase;
     56367+           unescape_shellxquote(cmdbase, p_sxe);
     56368+
     56369+           /*
     56370+            * If creating new console, arguments are passed to the
     56371+            * 'cmd.exe' as-is. If it's not, arguments are not treated
     56372+            * correctly for current 'cmd.exe'. So unescape characters in
     56373+            * shellxescape except '|' for avoiding to be treated as
     56374+            * argument to them. Pass the arguments to sub-shell.
     56375+            */
     56376+           if (flags != CREATE_NEW_CONSOLE)
     56377            {
     56378-               STARTUPINFO             si;
     56379-               PROCESS_INFORMATION     pi;
     56380-
     56381-               si.cb = sizeof(si);
     56382-               si.lpReserved = NULL;
     56383-               si.lpDesktop = NULL;
     56384-               si.lpTitle = NULL;
     56385-               si.dwFlags = 0;
     56386-               si.cbReserved2 = 0;
     56387-               si.lpReserved2 = NULL;
     56388-
     56389-               cmdbase = skipwhite(cmdbase + 5);
     56390-               if ((STRNICMP(cmdbase, "/min", 4) == 0)
     56391-                       && vim_iswhite(cmdbase[4]))
     56392-               {
     56393-                   cmdbase = skipwhite(cmdbase + 4);
     56394-                   si.dwFlags = STARTF_USESHOWWINDOW;
     56395-                   si.wShowWindow = SW_SHOWMINNOACTIVE;
     56396-               }
     56397+               char_u  *subcmd;
     56398+               char_u  *cmd_shell = mch_getenv("COMSPEC");
     56399 
     56400-               /* When the command is in double quotes, but 'shellxquote' is
     56401-                * empty, keep the double quotes around the command.
     56402-                * Otherwise remove the double quotes, they aren't needed
     56403-                * here, because we don't use a shell to run the command. */
     56404-               if (*cmd == '"' && *p_sxq == NUL)
     56405-               {
     56406-                   newcmd[0] = '"';
     56407-                   STRCPY(newcmd + 1, cmdbase);
     56408-               }
     56409-               else
     56410+               if (cmd_shell == NULL || *cmd_shell == NUL)
     56411+                   cmd_shell = default_shell();
     56412+
     56413+               subcmd = vim_strsave_escaped_ext(cmdbase, "|", '^', FALSE);
     56414+               if (subcmd != NULL)
     56415                {
     56416-                   STRCPY(newcmd, cmdbase);
     56417-                   if (*cmd == '"' && *newcmd != NUL)
     56418-                       newcmd[STRLEN(newcmd) - 1] = NUL;
     56419+                   /* make "cmd.exe /c arguments" */
     56420+                   cmdlen = STRLEN(cmd_shell) + STRLEN(subcmd) + 5;
     56421+                   newcmd = lalloc(cmdlen, TRUE);
     56422+                   if (newcmd != NULL)
     56423+                       vim_snprintf((char *)newcmd, cmdlen, "%s /c %s",
     56424+                                                      cmd_shell, subcmd);
     56425+                   else
     56426+                       newcmd = cmdbase;
     56427+                   vim_free(subcmd);
     56428                }
     56429+           }
     56430 
     56431-               /*
     56432-                * Now, start the command as a process, so that it doesn't
     56433-                * inherit our handles which causes unpleasant dangling swap
     56434-                * files if we exit before the spawned process
     56435-                */
     56436-               if (CreateProcess (NULL,        // Executable name
     56437-                       newcmd,                 // Command to execute
     56438-                       NULL,                   // Process security attributes
     56439-                       NULL,                   // Thread security attributes
     56440-                       FALSE,                  // Inherit handles
     56441-                       CREATE_NEW_CONSOLE,     // Creation flags
     56442-                       NULL,                   // Environment
     56443-                       NULL,                   // Current directory
     56444-                       &si,                    // Startup information
     56445-                       &pi))                   // Process information
     56446-                   x = 0;
     56447-               else
     56448-               {
     56449-                   x = -1;
     56450+           /*
     56451+            * Now, start the command as a process, so that it doesn't
     56452+            * inherit our handles which causes unpleasant dangling swap
     56453+            * files if we exit before the spawned process
     56454+            */
     56455+           if (CreateProcess(NULL,             // Executable name
     56456+                   newcmd,                     // Command to execute
     56457+                   NULL,                       // Process security attributes
     56458+                   NULL,                       // Thread security attributes
     56459+                   FALSE,                      // Inherit handles
     56460+                   flags,                      // Creation flags
     56461+                   NULL,                       // Environment
     56462+                   NULL,                       // Current directory
     56463+                   &si,                        // Startup information
     56464+                   &pi))                       // Process information
     56465+               x = 0;
     56466+           else
     56467+           {
     56468+               x = -1;
    5163656469 #ifdef FEAT_GUI_W32
    51637 -               STRLEN(vimrun_path) +
     56470-                   EMSG(_("E371: Command not found"));
     56471+               EMSG(_("E371: Command not found"));
     56472 #endif
     56473-               }
     56474-               /* Close the handles to the subprocess, so that it goes away */
     56475-               CloseHandle(pi.hThread);
     56476-               CloseHandle(pi.hProcess);
     56477            }
     56478-           else
     56479+
     56480+           if (newcmd != cmdbase)
     56481+               vim_free(newcmd);
     56482+
     56483+           if (si.hStdInput != NULL)
     56484+           {
     56485+               /* Close the handle to \\.\NUL */
     56486+               CloseHandle(si.hStdInput);
     56487+           }
     56488+           /* Close the handles to the subprocess, so that it goes away */
     56489+           CloseHandle(pi.hThread);
     56490+           CloseHandle(pi.hProcess);
     56491+       }
     56492+       else
     56493+       {
     56494+           cmdlen = (
     56495+#ifdef FEAT_GUI_W32
    5163856496+               (allowPiping && !p_stmp ? 0 : STRLEN(vimrun_path)) +
    51639  #endif
    51640                 STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10);
    51641  
    51642 @@ -3294,6 +3914,7 @@
     56497+#endif
     56498+               STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10);
     56499+
     56500+           newcmd = lalloc(cmdlen, TRUE);
     56501+           if (newcmd != NULL)
    5164356502            {
    51644                 STARTUPINFO             si;
    51645                 PROCESS_INFORMATION     pi;
    51646 +               DWORD                   flags = CREATE_NEW_CONSOLE;
    51647  
    51648                 si.cb = sizeof(si);
    51649                 si.lpReserved = NULL;
    51650 @@ -3311,6 +3932,22 @@
    51651                     si.dwFlags = STARTF_USESHOWWINDOW;
    51652                     si.wShowWindow = SW_SHOWMINNOACTIVE;
    51653                 }
    51654 +               else if ((STRNICMP(cmdbase, "/b", 2) == 0)
    51655 +                       && vim_iswhite(cmdbase[2]))
    51656 +               {
    51657 +                   cmdbase = skipwhite(cmdbase + 2);
    51658 +                   flags = CREATE_NO_WINDOW;
    51659 +                   si.dwFlags = STARTF_USESTDHANDLES;
    51660 +                   si.hStdInput = CreateFile("\\\\.\\NUL",     // File name
    51661 +                       GENERIC_READ,                           // Access flags
    51662 +                       0,                                      // Share flags
    51663 +                       NULL,                                   // Security att.
    51664 +                       OPEN_EXISTING,                          // Open flags
    51665 +                       FILE_ATTRIBUTE_NORMAL,                  // File att.
    51666 +                       NULL);                                  // Temp file
    51667 +                   si.hStdOutput = si.hStdInput;
    51668 +                   si.hStdError = si.hStdInput;
    51669 +               }
    51670  
    51671                 /* When the command is in double quotes, but 'shellxquote' is
    51672                  * empty, keep the double quotes around the command.
    51673 @@ -3338,7 +3975,7 @@
    51674                         NULL,                   // Process security attributes
    51675                         NULL,                   // Thread security attributes
    51676                         FALSE,                  // Inherit handles
    51677 -                       CREATE_NEW_CONSOLE,     // Creation flags
    51678 +                       flags,                  // Creation flags
    51679                         NULL,                   // Environment
    51680                         NULL,                   // Current directory
    51681                         &si,                    // Startup information
    51682 @@ -3351,6 +3988,11 @@
    51683                     EMSG(_("E371: Command not found"));
    51684  #endif
    51685                 }
    51686 +               if (si.hStdInput != NULL)
    51687 +               {
    51688 +                   /* Close the handle to \\.\NUL */
    51689 +                   CloseHandle(si.hStdInput);
    51690 +               }
    51691                 /* Close the handles to the subprocess, so that it goes away */
    51692                 CloseHandle(pi.hThread);
    51693                 CloseHandle(pi.hProcess);
    51694 @@ -3368,7 +4010,7 @@
     56503 #if defined(FEAT_GUI_W32)
     56504                if (need_vimrun_warning)
     56505@@ -3368,7 +4086,7 @@
    5169556506                            MB_ICONWARNING);
    5169656507                    need_vimrun_warning = FALSE;
     
    5170156512                     * window, which can be closed without killing Vim. */
    5170256513                    vim_snprintf((char *)newcmd, cmdlen, "%s%s%s %s %s",
    51703 @@ -3392,7 +4034,8 @@
     56514@@ -3381,8 +4099,8 @@
     56515                    vim_snprintf((char *)newcmd, cmdlen, "%s %s %s",
     56516                                                           p_sh, p_shcf, cmd);
     56517                x = mch_system((char *)newcmd, options);
     56518+               vim_free(newcmd);
     56519            }
     56520-           vim_free(newcmd);
     56521        }
     56522     }
     56523 
     56524@@ -3392,7 +4110,8 @@
    5170456525     /* Print the return value, unless "vimrun" was used. */
    5170556526     if (x != 0 && !(options & SHELL_SILENT) && !emsg_silent
     
    5171256533     {
    5171356534diff -Naur vim73.orig/src/os_win32.h vim73/src/os_win32.h
    51714 --- vim73.orig/src/os_win32.h   2012-02-15 21:57:45.053435946 +0000
    51715 +++ vim73/src/os_win32.h        2012-02-15 21:57:46.345470023 +0000
     56535--- vim73.orig/src/os_win32.h   2012-06-03 23:09:52.940007057 +0000
     56536+++ vim73/src/os_win32.h        2012-06-03 23:09:54.588050913 +0000
    5171656537@@ -191,5 +191,19 @@
    5171756538 #ifdef __BORLANDC__
     
    5173656557 #endif
    5173756558diff -Naur vim73.orig/src/popupmnu.c vim73/src/popupmnu.c
    51738 --- vim73.orig/src/popupmnu.c   2012-02-15 21:57:45.057436051 +0000
    51739 +++ vim73/src/popupmnu.c        2012-02-15 21:57:45.305442592 +0000
     56559--- vim73.orig/src/popupmnu.c   2012-06-03 23:09:52.948007269 +0000
     56560+++ vim73/src/popupmnu.c        2012-06-03 23:09:53.272015892 +0000
    5174056561@@ -558,8 +558,11 @@
    5174156562            win_T       *curwin_save = curwin;
     
    5175156572            g_do_tagpreview = 0;
    5175256573 
     56574diff -Naur vim73.orig/src/proto/buffer.pro vim73/src/proto/buffer.pro
     56575--- vim73.orig/src/proto/buffer.pro     2012-06-03 23:09:52.948007269 +0000
     56576+++ vim73/src/proto/buffer.pro  2012-06-03 23:09:55.472074438 +0000
     56577@@ -1,7 +1,7 @@
     56578 /* buffer.c */
     56579 int open_buffer __ARGS((int read_stdin, exarg_T *eap, int flags));
     56580 int buf_valid __ARGS((buf_T *buf));
     56581-void close_buffer __ARGS((win_T *win, buf_T *buf, int action));
     56582+void close_buffer __ARGS((win_T *win, buf_T *buf, int action, int abort_if_last));
     56583 void buf_clear_file __ARGS((buf_T *buf));
     56584 void buf_freeall __ARGS((buf_T *buf, int flags));
     56585 void goto_buffer __ARGS((exarg_T *eap, int start, int dir, int count));
     56586diff -Naur vim73.orig/src/proto/edit.pro vim73/src/proto/edit.pro
     56587--- vim73.orig/src/proto/edit.pro       2012-06-03 23:09:52.944007163 +0000
     56588+++ vim73/src/proto/edit.pro    2012-06-03 23:09:55.816083593 +0000
     56589@@ -39,4 +39,5 @@
     56590 int hkmap __ARGS((int c));
     56591 void ins_scroll __ARGS((void));
     56592 void ins_horscroll __ARGS((void));
     56593+int ins_copychar __ARGS((linenr_T lnum));
     56594 /* vim: set ft=c : */
    5175356595diff -Naur vim73.orig/src/proto/eval.pro vim73/src/proto/eval.pro
    51754 --- vim73.orig/src/proto/eval.pro       2012-02-15 21:57:45.057436051 +0000
    51755 +++ vim73/src/proto/eval.pro    2012-02-15 21:57:46.461473083 +0000
     56596--- vim73.orig/src/proto/eval.pro       2012-06-03 23:09:52.944007163 +0000
     56597+++ vim73/src/proto/eval.pro    2012-06-03 23:09:54.748055172 +0000
    5175656598@@ -23,6 +23,7 @@
    5175756599 list_T *eval_spell_expr __ARGS((char_u *badword, char_u *expr));
     
    5177056612 void dictitem_free __ARGS((dictitem_T *item));
    5177156613 int dict_add __ARGS((dict_T *d, dictitem_T *item));
     56614diff -Naur vim73.orig/src/proto/ex_cmds.pro vim73/src/proto/ex_cmds.pro
     56615--- vim73.orig/src/proto/ex_cmds.pro    2012-06-03 23:09:52.944007163 +0000
     56616+++ vim73/src/proto/ex_cmds.pro 2012-06-03 23:09:55.780082635 +0000
     56617@@ -23,6 +23,7 @@
     56618 void ex_update __ARGS((exarg_T *eap));
     56619 void ex_write __ARGS((exarg_T *eap));
     56620 int do_write __ARGS((exarg_T *eap));
     56621+int check_overwrite __ARGS((exarg_T *eap, buf_T *buf, char_u *fname, char_u *ffname, int other));
     56622 void ex_wnext __ARGS((exarg_T *eap));
     56623 void do_wqall __ARGS((exarg_T *eap));
     56624 int not_writing __ARGS((void));
    5177256625diff -Naur vim73.orig/src/proto/ex_cmds2.pro vim73/src/proto/ex_cmds2.pro
    51773 --- vim73.orig/src/proto/ex_cmds2.pro   2012-02-15 21:57:45.057436051 +0000
    51774 +++ vim73/src/proto/ex_cmds2.pro        2012-02-15 21:57:46.049462216 +0000
     56626--- vim73.orig/src/proto/ex_cmds2.pro   2012-06-03 23:09:52.944007163 +0000
     56627+++ vim73/src/proto/ex_cmds2.pro        2012-06-03 23:09:54.204040695 +0000
    5177556628@@ -83,5 +83,7 @@
    5177656629 char_u *get_mess_lang __ARGS((void));
     
    5178256635 /* vim: set ft=c : */
    5178356636diff -Naur vim73.orig/src/proto/ex_docmd.pro vim73/src/proto/ex_docmd.pro
    51784 --- vim73.orig/src/proto/ex_docmd.pro   2012-02-15 21:57:45.057436051 +0000
    51785 +++ vim73/src/proto/ex_docmd.pro        2012-02-15 21:57:46.877484055 +0000
     56637--- vim73.orig/src/proto/ex_docmd.pro   2012-06-03 23:09:52.944007163 +0000
     56638+++ vim73/src/proto/ex_docmd.pro        2012-06-03 23:09:55.316070287 +0000
    5178656639@@ -1,7 +1,7 @@
    5178756640 /* ex_docmd.c */
     
    5179456647 int checkforcmd __ARGS((char_u **pp, char *cmd, int len));
    5179556648diff -Naur vim73.orig/src/proto/ex_getln.pro vim73/src/proto/ex_getln.pro
    51796 --- vim73.orig/src/proto/ex_getln.pro   2012-02-15 21:57:45.057436051 +0000
    51797 +++ vim73/src/proto/ex_getln.pro        2012-02-15 21:57:46.049462216 +0000
     56649--- vim73.orig/src/proto/ex_getln.pro   2012-06-03 23:09:52.944007163 +0000
     56650+++ vim73/src/proto/ex_getln.pro        2012-06-03 23:09:54.204040695 +0000
    5179856651@@ -31,7 +31,7 @@
    5179956652 char_u *addstar __ARGS((char_u *fname, int len, int context));
     
    5180656659 int get_histtype __ARGS((char_u *name));
    5180756660diff -Naur vim73.orig/src/proto/fileio.pro vim73/src/proto/fileio.pro
    51808 --- vim73.orig/src/proto/fileio.pro     2012-02-15 21:57:45.057436051 +0000
    51809 +++ vim73/src/proto/fileio.pro  2012-02-15 21:57:46.965486377 +0000
     56661--- vim73.orig/src/proto/fileio.pro     2012-06-03 23:09:52.944007163 +0000
     56662+++ vim73/src/proto/fileio.pro  2012-06-03 23:09:55.536076142 +0000
    5181056663@@ -35,6 +35,7 @@
    5181156664 void do_autocmd __ARGS((char_u *arg, int forceit));
     
    5181656669 void aucmd_restbuf __ARGS((aco_save_T *aco));
    5181756670 int apply_autocmds __ARGS((event_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf));
    51818 @@ -54,4 +55,6 @@
     56671@@ -43,6 +44,7 @@
     56672 int trigger_cursorhold __ARGS((void));
     56673 int has_cursormoved __ARGS((void));
     56674 int has_cursormovedI __ARGS((void));
     56675+int has_insertcharpre __ARGS((void));
     56676 void block_autocmds __ARGS((void));
     56677 void unblock_autocmds __ARGS((void));
     56678 int has_autocmd __ARGS((event_T event, char_u *sfname, buf_T *buf));
     56679@@ -54,4 +56,6 @@
    5181956680 int match_file_pat __ARGS((char_u *pattern, regprog_T *prog, char_u *fname, char_u *sfname, char_u *tail, int allow_dirs));
    5182056681 int match_file_list __ARGS((char_u *list, char_u *sfname, char_u *ffname));
     
    5182456685 /* vim: set ft=c : */
    5182556686diff -Naur vim73.orig/src/proto/getchar.pro vim73/src/proto/getchar.pro
    51826 --- vim73.orig/src/proto/getchar.pro    2012-02-15 21:57:45.057436051 +0000
    51827 +++ vim73/src/proto/getchar.pro 2012-02-15 21:57:46.905484794 +0000
     56687--- vim73.orig/src/proto/getchar.pro    2012-06-03 23:09:52.944007163 +0000
     56688+++ vim73/src/proto/getchar.pro 2012-06-03 23:09:55.352071245 +0000
    5182856689@@ -4,8 +4,9 @@
    5182956690 char_u *get_inserted __ARGS((void));
     
    5185556716 /* vim: set ft=c : */
    5185656717diff -Naur vim73.orig/src/proto/gui_athena.pro vim73/src/proto/gui_athena.pro
    51857 --- vim73.orig/src/proto/gui_athena.pro 2012-02-15 21:57:45.057436051 +0000
    51858 +++ vim73/src/proto/gui_athena.pro      2012-02-15 21:57:45.565449449 +0000
     56718--- vim73.orig/src/proto/gui_athena.pro 2012-06-03 23:09:52.944007163 +0000
     56719+++ vim73/src/proto/gui_athena.pro      2012-06-03 23:09:53.620025153 +0000
    5185956720@@ -27,5 +27,5 @@
    5186056721 void gui_mch_set_scrollbar_colors __ARGS((scrollbar_T *sb));
     
    5186556726 /* vim: set ft=c : */
    5186656727diff -Naur vim73.orig/src/proto/gui_gtk.pro vim73/src/proto/gui_gtk.pro
    51867 --- vim73.orig/src/proto/gui_gtk.pro    2012-02-15 21:57:45.057436051 +0000
    51868 +++ vim73/src/proto/gui_gtk.pro 2012-02-15 21:57:45.565449449 +0000
     56728--- vim73.orig/src/proto/gui_gtk.pro    2012-06-03 23:09:52.944007163 +0000
     56729+++ vim73/src/proto/gui_gtk.pro 2012-06-03 23:09:53.620025153 +0000
    5186956730@@ -13,7 +13,7 @@
    5187056731 void gui_mch_destroy_scrollbar __ARGS((scrollbar_T *sb));
     
    5187756738 void gui_mch_find_dialog __ARGS((exarg_T *eap));
    5187856739diff -Naur vim73.orig/src/proto/gui_gtk_x11.pro vim73/src/proto/gui_gtk_x11.pro
    51879 --- vim73.orig/src/proto/gui_gtk_x11.pro        2012-02-15 21:57:45.057436051 +0000
    51880 +++ vim73/src/proto/gui_gtk_x11.pro     2012-02-15 21:57:46.349470129 +0000
    51881 @@ -20,6 +20,7 @@
     56740--- vim73.orig/src/proto/gui_gtk_x11.pro        2012-06-03 23:09:52.944007163 +0000
     56741+++ vim73/src/proto/gui_gtk_x11.pro     2012-06-03 23:09:55.860084763 +0000
     56742@@ -4,6 +4,7 @@
     56743 void gui_mch_set_blinking __ARGS((long waittime, long on, long off));
     56744 void gui_mch_stop_blink __ARGS((void));
     56745 void gui_mch_start_blink __ARGS((void));
     56746+int gui_mch_early_init_check __ARGS((void));
     56747 int gui_mch_init_check __ARGS((void));
     56748 void gui_mch_show_tabline __ARGS((int showit));
     56749 int gui_mch_showing_tabline __ARGS((void));
     56750@@ -20,6 +21,7 @@
    5188256751 void gui_mch_set_winpos __ARGS((int x, int y));
    5188356752 int gui_mch_maximized __ARGS((void));
     
    5188856757 void gui_mch_settitle __ARGS((char_u *title, char_u *icon));
    5188956758diff -Naur vim73.orig/src/proto/gui_mac.pro vim73/src/proto/gui_mac.pro
    51890 --- vim73.orig/src/proto/gui_mac.pro    2012-02-15 21:57:45.057436051 +0000
    51891 +++ vim73/src/proto/gui_mac.pro 2012-02-15 21:57:45.565449449 +0000
     56759--- vim73.orig/src/proto/gui_mac.pro    2012-06-03 23:09:52.944007163 +0000
     56760+++ vim73/src/proto/gui_mac.pro 2012-06-03 23:09:53.620025153 +0000
    5189256761@@ -81,7 +81,7 @@
    5189356762 int gui_mch_get_mouse_y __ARGS((void));
     
    5190056769 void gui_mch_show_tabline __ARGS((int showit));
    5190156770diff -Naur vim73.orig/src/proto/gui_motif.pro vim73/src/proto/gui_motif.pro
    51902 --- vim73.orig/src/proto/gui_motif.pro  2012-02-15 21:57:45.057436051 +0000
    51903 +++ vim73/src/proto/gui_motif.pro       2012-02-15 21:57:45.565449449 +0000
     56771--- vim73.orig/src/proto/gui_motif.pro  2012-06-03 23:09:52.944007163 +0000
     56772+++ vim73/src/proto/gui_motif.pro       2012-06-03 23:09:53.620025153 +0000
    5190456773@@ -29,7 +29,7 @@
    5190556774 void gui_mch_set_scrollbar_colors __ARGS((scrollbar_T *sb));
     
    5191256781 void gui_mch_show_toolbar __ARGS((int showit));
    5191356782diff -Naur vim73.orig/src/proto/gui_photon.pro vim73/src/proto/gui_photon.pro
    51914 --- vim73.orig/src/proto/gui_photon.pro 2012-02-15 21:57:45.057436051 +0000
    51915 +++ vim73/src/proto/gui_photon.pro      2012-02-15 21:57:45.565449449 +0000
     56783--- vim73.orig/src/proto/gui_photon.pro 2012-06-03 23:09:52.944007163 +0000
     56784+++ vim73/src/proto/gui_photon.pro      2012-06-03 23:09:53.620025153 +0000
    5191656785@@ -8,7 +8,7 @@
    5191756786 void gui_mch_update __ARGS((void));
     
    5192456793 void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height, int direction));
    5192556794diff -Naur vim73.orig/src/proto/gui_riscos.pro vim73/src/proto/gui_riscos.pro
    51926 --- vim73.orig/src/proto/gui_riscos.pro 2012-02-15 21:57:45.057436051 +0000
     56795--- vim73.orig/src/proto/gui_riscos.pro 2012-06-03 23:09:52.944007163 +0000
    5192756796+++ vim73/src/proto/gui_riscos.pro      1970-01-01 00:00:00.000000000 +0000
    5192856797@@ -1,66 +0,0 @@
     
    5199456863-/* vim: set ft=c : */
    5199556864diff -Naur vim73.orig/src/proto/gui_w16.pro vim73/src/proto/gui_w16.pro
    51996 --- vim73.orig/src/proto/gui_w16.pro    2012-02-15 21:57:45.057436051 +0000
    51997 +++ vim73/src/proto/gui_w16.pro 2012-02-15 21:57:45.565449449 +0000
     56865--- vim73.orig/src/proto/gui_w16.pro    2012-06-03 23:09:52.944007163 +0000
     56866+++ vim73/src/proto/gui_w16.pro 2012-06-03 23:09:53.620025153 +0000
    5199856867@@ -74,6 +74,6 @@
    5199956868 void gui_mch_add_menu_item __ARGS((vimmenu_T *menu, int idx));
     
    5200556874 /* vim: set ft=c : */
    5200656875diff -Naur vim73.orig/src/proto/gui_w32.pro vim73/src/proto/gui_w32.pro
    52007 --- vim73.orig/src/proto/gui_w32.pro    2012-02-15 21:57:45.057436051 +0000
    52008 +++ vim73/src/proto/gui_w32.pro 2012-02-15 21:57:45.565449449 +0000
     56876--- vim73.orig/src/proto/gui_w32.pro    2012-06-03 23:09:52.944007163 +0000
     56877+++ vim73/src/proto/gui_w32.pro 2012-06-03 23:09:53.620025153 +0000
    5200956878@@ -81,7 +81,7 @@
    5201056879 void gui_mch_add_menu_item __ARGS((vimmenu_T *menu, int idx));
     
    5201656885 void gui_mch_drawsign __ARGS((int row, int col, int typenr));
    5201756886 void *gui_mch_register_sign __ARGS((char_u *signfile));
     56887diff -Naur vim73.orig/src/proto/if_lua.pro vim73/src/proto/if_lua.pro
     56888--- vim73.orig/src/proto/if_lua.pro     2012-06-03 23:09:52.948007269 +0000
     56889+++ vim73/src/proto/if_lua.pro  2012-06-03 23:09:55.704080614 +0000
     56890@@ -6,4 +6,6 @@
     56891 void ex_luafile __ARGS((exarg_T *eap));
     56892 void lua_buffer_free __ARGS((buf_T *buf));
     56893 void lua_window_free __ARGS((win_T *win));
     56894+void do_luaeval __ARGS((char_u *str, typval_T *arg, typval_T *rettv));
     56895+void set_ref_in_lua __ARGS((int copyID));
     56896 /* vim: set ft=c : */
    5201856897diff -Naur vim73.orig/src/proto/if_mzsch.pro vim73/src/proto/if_mzsch.pro
    52019 --- vim73.orig/src/proto/if_mzsch.pro   2012-02-15 21:57:45.057436051 +0000
    52020 +++ vim73/src/proto/if_mzsch.pro        2012-02-15 21:57:46.957486165 +0000
     56898--- vim73.orig/src/proto/if_mzsch.pro   2012-06-03 23:09:52.944007163 +0000
     56899+++ vim73/src/proto/if_mzsch.pro        2012-06-03 23:09:55.416072949 +0000
    5202156900@@ -14,6 +14,7 @@
    5202256901 void mzvim_reset_timer __ARGS((void));
     
    5202956908 /* vim: set ft=c : */
    5203056909diff -Naur vim73.orig/src/proto/mbyte.pro vim73/src/proto/mbyte.pro
    52031 --- vim73.orig/src/proto/mbyte.pro      2012-02-15 21:57:45.057436051 +0000
    52032 +++ vim73/src/proto/mbyte.pro   2012-02-15 21:57:46.329469602 +0000
     56910--- vim73.orig/src/proto/mbyte.pro      2012-06-03 23:09:52.944007163 +0000
     56911+++ vim73/src/proto/mbyte.pro   2012-06-03 23:09:54.572050488 +0000
    5203356912@@ -2,6 +2,7 @@
    5203456913 int enc_canon_props __ARGS((char_u *name));
     
    5204956928 int mb_charlen_len __ARGS((char_u *str, int len));
    5205056929diff -Naur vim73.orig/src/proto/message.pro vim73/src/proto/message.pro
    52051 --- vim73.orig/src/proto/message.pro    2012-02-15 21:57:45.057436051 +0000
    52052 +++ vim73/src/proto/message.pro 2012-02-15 21:57:46.821482580 +0000
     56930--- vim73.orig/src/proto/message.pro    2012-06-03 23:09:52.944007163 +0000
     56931+++ vim73/src/proto/message.pro 2012-06-03 23:09:55.664079548 +0000
    5205356932@@ -4,7 +4,7 @@
    5205456933 int msg_attr __ARGS((char_u *s, int attr));
     
    5206856947 void str2specialbuf __ARGS((char_u *sp, char_u *buf, int len));
    5206956948 void msg_prt_line __ARGS((char_u *s, int list));
    52070 @@ -63,7 +64,7 @@
     56949@@ -44,6 +45,7 @@
     56950 void may_clear_sb_text __ARGS((void));
     56951 void clear_sb_text __ARGS((void));
     56952 void show_sb_text __ARGS((void));
     56953+void msg_sb_eol __ARGS((void));
     56954 int msg_use_printf __ARGS((void));
     56955 void mch_errmsg __ARGS((char *str));
     56956 void mch_msg __ARGS((char *str));
     56957@@ -63,7 +65,7 @@
    5207156958 int verbose_open __ARGS((void));
    5207256959 void give_warning __ARGS((char_u *message, int hl));
     
    5207856965 int vim_dialog_yesnocancel __ARGS((int type, char_u *title, char_u *message, int dflt));
    5207956966diff -Naur vim73.orig/src/proto/misc2.pro vim73/src/proto/misc2.pro
    52080 --- vim73.orig/src/proto/misc2.pro      2012-02-15 21:57:45.057436051 +0000
    52081 +++ vim73/src/proto/misc2.pro   2012-02-15 21:57:46.749480679 +0000
     56967--- vim73.orig/src/proto/misc2.pro      2012-06-03 23:09:52.944007163 +0000
     56968+++ vim73/src/proto/misc2.pro   2012-06-03 23:09:55.148065818 +0000
    5208256969@@ -14,6 +14,7 @@
    5208356970 linenr_T get_cursor_rel_lnum __ARGS((win_T *wp, linenr_T lnum));
     
    5211156998 /* vim: set ft=c : */
    5211256999diff -Naur vim73.orig/src/proto/option.pro vim73/src/proto/option.pro
    52113 --- vim73.orig/src/proto/option.pro     2012-02-15 21:57:45.057436051 +0000
    52114 +++ vim73/src/proto/option.pro  2012-02-15 21:57:45.573449661 +0000
     57000--- vim73.orig/src/proto/option.pro     2012-06-03 23:09:52.944007163 +0000
     57001+++ vim73/src/proto/option.pro  2012-06-03 23:09:53.628025365 +0000
    5211557002@@ -54,6 +54,6 @@
    5211657003 int option_was_set __ARGS((char_u *name));
     
    5212257009 /* vim: set ft=c : */
    5212357010diff -Naur vim73.orig/src/proto/os_riscos.pro vim73/src/proto/os_riscos.pro
    52124 --- vim73.orig/src/proto/os_riscos.pro  2012-02-15 21:57:45.057436051 +0000
     57011--- vim73.orig/src/proto/os_riscos.pro  2012-06-03 23:09:52.944007163 +0000
    5212557012+++ vim73/src/proto/os_riscos.pro       1970-01-01 00:00:00.000000000 +0000
    5212657013@@ -1,49 +0,0 @@
     
    5217557062-/* vim: set ft=c : */
    5217657063diff -Naur vim73.orig/src/proto/os_win32.pro vim73/src/proto/os_win32.pro
    52177 --- vim73.orig/src/proto/os_win32.pro   2012-02-15 21:57:45.057436051 +0000
    52178 +++ vim73/src/proto/os_win32.pro        2012-02-15 21:57:45.897458206 +0000
     57064--- vim73.orig/src/proto/os_win32.pro   2012-06-03 23:09:52.944007163 +0000
     57065+++ vim73/src/proto/os_win32.pro        2012-06-03 23:09:54.016035691 +0000
    5217957066@@ -1,4 +1,5 @@
    5218057067 /* os_win32.c */
     
    5219457081 int mch_nodetype __ARGS((char_u *name));
    5219557082diff -Naur vim73.orig/src/proto/term.pro vim73/src/proto/term.pro
    52196 --- vim73.orig/src/proto/term.pro       2012-02-15 21:57:45.057436051 +0000
    52197 +++ vim73/src/proto/term.pro    2012-02-15 21:57:46.913485005 +0000
     57083--- vim73.orig/src/proto/term.pro       2012-06-03 23:09:52.944007163 +0000
     57084+++ vim73/src/proto/term.pro    2012-06-03 23:09:55.364071565 +0000
    5219857085@@ -50,7 +50,7 @@
    5219957086 char_u *get_termcode __ARGS((int i));
     
    5220557092 int find_term_bykeys __ARGS((char_u *src));
    5220657093 void show_termcodes __ARGS((void));
     57094diff -Naur vim73.orig/src/proto/window.pro vim73/src/proto/window.pro
     57095--- vim73.orig/src/proto/window.pro     2012-06-03 23:09:52.944007163 +0000
     57096+++ vim73/src/proto/window.pro  2012-06-03 23:09:55.484074758 +0000
     57097@@ -1,13 +1,14 @@
     57098 /* window.c */
     57099 void do_window __ARGS((int nchar, long Prenum, int xchar));
     57100 int win_split __ARGS((int size, int flags));
     57101-int win_split_ins __ARGS((int size, int flags, win_T *newwin, int dir));
     57102+int win_split_ins __ARGS((int size, int flags, win_T *new_wp, int dir));
     57103 int win_valid __ARGS((win_T *win));
     57104 int win_count __ARGS((void));
     57105 int make_windows __ARGS((int count, int vertical));
     57106 void win_move_after __ARGS((win_T *win1, win_T *win2));
     57107 void win_equal __ARGS((win_T *next_curwin, int current, int dir));
     57108 void close_windows __ARGS((buf_T *buf, int keep_curwin));
     57109+int one_window __ARGS((void));
     57110 void win_close __ARGS((win_T *win, int free_buf));
     57111 void win_close_othertab __ARGS((win_T *win, int free_buf, tabpage_T *tp));
     57112 void win_free_all __ARGS((void));
    5220757113diff -Naur vim73.orig/src/proto.h vim73/src/proto.h
    52208 --- vim73.orig/src/proto.h      2012-02-15 21:57:45.053435946 +0000
    52209 +++ vim73/src/proto.h   2012-02-15 21:57:45.953459684 +0000
     57114--- vim73.orig/src/proto.h      2012-06-03 23:09:52.940007057 +0000
     57115+++ vim73/src/proto.h   2012-06-03 23:09:54.096037821 +0000
    5221057116@@ -62,9 +62,6 @@
    5221157117 # ifdef __BEOS__
     
    5222957135 #  endif
    5223057136diff -Naur vim73.orig/src/pty.c vim73/src/pty.c
    52231 --- vim73.orig/src/pty.c        2012-02-15 21:57:45.065436261 +0000
    52232 +++ vim73/src/pty.c     2012-02-15 21:57:46.821482580 +0000
     57137--- vim73.orig/src/pty.c        2012-06-03 23:09:52.952007375 +0000
     57138+++ vim73/src/pty.c     2012-06-03 23:09:55.244068371 +0000
    5223357139@@ -14,6 +14,10 @@
    5223457140  * It has been modified to work better with Vim.
     
    5228257188        close(f);
    5228357189diff -Naur vim73.orig/src/quickfix.c vim73/src/quickfix.c
    52284 --- vim73.orig/src/quickfix.c   2012-02-15 21:57:45.053435946 +0000
    52285 +++ vim73/src/quickfix.c        2012-02-15 21:57:46.797481944 +0000
    52286 @@ -126,6 +126,7 @@
     57190--- vim73.orig/src/quickfix.c   2012-06-03 23:09:52.940007057 +0000
     57191+++ vim73/src/quickfix.c        2012-06-03 23:09:55.964087533 +0000
     57192@@ -126,12 +126,14 @@
    5228757193 static win_T   *qf_find_win __ARGS((qf_info_T *qi));
    5228857194 static buf_T   *qf_find_buf __ARGS((qf_info_T *qi));
     
    5229257198 #endif
    5229357199 static char_u  *get_mef_name __ARGS((void));
    52294 @@ -561,6 +562,10 @@
     57200-static buf_T   *load_dummy_buffer __ARGS((char_u *fname));
     57201-static void    wipe_dummy_buffer __ARGS((buf_T *buf));
     57202-static void    unload_dummy_buffer __ARGS((buf_T *buf));
     57203+static void    restore_start_dir __ARGS((char_u *dirname_start));
     57204+static buf_T   *load_dummy_buffer __ARGS((char_u *fname, char_u *dirname_start, char_u *resulting_dir));
     57205+static void    wipe_dummy_buffer __ARGS((buf_T *buf, char_u *dirname_start));
     57206+static void    unload_dummy_buffer __ARGS((buf_T *buf, char_u *dirname_start));
     57207 static qf_info_T *ll_get_or_alloc_list __ARGS((win_T *));
     57208 
     57209 /* Quickfix window check helper macro */
     57210@@ -245,7 +247,7 @@
     57211                        {'t', "."},
     57212                        {'m', ".\\+"},
     57213                        {'r', ".*"},
     57214-                       {'p', "[- .]*"},
     57215+                       {'p', "[-       .]*"},
     57216                        {'v', "\\d\\+"},
     57217                        {'s', ".\\+"}
     57218                    };
     57219@@ -561,6 +563,10 @@
    5229557220            break;
    5229657221 
     
    5230357228            *efmp = NUL;
    5230457229 #ifdef USE_CRNL
    52305 @@ -894,8 +899,7 @@
     57230@@ -671,11 +677,23 @@
     57231                }
     57232                if ((i = (int)fmt_ptr->addr[7]) > 0)            /* %p */
     57233                {
     57234+                   char_u      *match_ptr;
     57235+
     57236                    if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
     57237                        continue;
     57238-                   col = (int)(regmatch.endp[i] - regmatch.startp[i] + 1);
     57239-                   if (*((char_u *)regmatch.startp[i]) != TAB)
     57240-                       use_viscol = TRUE;
     57241+                   col = 0;
     57242+                   for (match_ptr = regmatch.startp[i];
     57243+                                  match_ptr != regmatch.endp[i]; ++match_ptr)
     57244+                   {
     57245+                       ++col;
     57246+                       if (*match_ptr == TAB)
     57247+                       {
     57248+                           col += 7;
     57249+                           col -= col % 8;
     57250+                       }
     57251+                   }
     57252+                   ++col;
     57253+                   use_viscol = TRUE;
     57254                }
     57255                if ((i = (int)fmt_ptr->addr[8]) > 0)            /* %v */
     57256                {
     57257@@ -894,8 +912,7 @@
    5230657258     }
    5230757259     else
     
    5231357265     {
    5231457266        char_u *p = alloc((int)STRLEN(qf_title) + 2);
    52315 @@ -904,8 +908,6 @@
     57267@@ -904,8 +921,6 @@
    5231657268        if (p != NULL)
    5231757269            sprintf((char *)p, ":%s", (char *)qf_title);
     
    5232257274 
    5232357275 /*
    52324 @@ -1164,7 +1166,7 @@
     57276@@ -1164,7 +1179,7 @@
    5232557277 
    5232657278        /* When no valid entries are present in the list, qf_ptr points to
     
    5233157283     }
    5233257284 
    52333 @@ -1182,21 +1184,17 @@
     57285@@ -1182,21 +1197,17 @@
    5233457286     if (fname == NULL || *fname == NUL)                /* no file name */
    5233557287        return 0;
     
    5235757309                && (ptr = concat_fnames(directory, fname, TRUE)) != NULL)
    5235857310        {
    52359 @@ -1221,7 +1219,6 @@
     57311@@ -1221,7 +1232,6 @@
    5236057312            return fnum;
    5236157313        }
     
    5236557317 }
    5236657318 
    52367 @@ -1656,9 +1653,7 @@
     57319@@ -1656,9 +1666,7 @@
    5236857320            opened_window = TRUE;       /* close it when fail */
    5236957321            p_swb = empty_option;       /* don't split again */
     
    5237657328            {
    5237757329                /* The new window should use the location list from the
    52378 @@ -1847,8 +1842,10 @@
     57330@@ -1847,8 +1855,10 @@
    5237957331 #endif
    5238057332        if (print_message)
     
    5238957341                    qi->qf_lists[qi->qf_curlist].qf_count,
    5239057342                    qf_ptr->qf_cleared ? _(" (line deleted)") : "",
    52391 @@ -2125,6 +2122,7 @@
     57343@@ -2125,6 +2135,7 @@
    5239257344        --qi->qf_lists[idx].qf_count;
    5239357345     }
     
    5239757349 
    5239857350 /*
    52399 @@ -2244,6 +2242,7 @@
     57351@@ -2244,6 +2255,7 @@
    5240057352      * it if we have errors; otherwise, leave it closed.
    5240157353      */
     
    5240557357     {
    5240657358        if (win != NULL)
    52407 @@ -2333,9 +2332,7 @@
     57359@@ -2333,9 +2345,7 @@
    5240857360            win_goto(lastwin);
    5240957361        if (win_split(height, WSP_BELOW | WSP_NEWLOC) == FAIL)
     
    5241657368        if (eap->cmdidx == CMD_lopen || eap->cmdidx == CMD_lwindow)
    5241757369        {
    52418 @@ -2362,6 +2359,7 @@
     57370@@ -2362,6 +2372,7 @@
    5241957371            set_option_value((char_u *)"bt", 0L, (char_u *)"quickfix",
    5242057372                                                                   OPT_LOCAL);
     
    5242457376            curwin->w_p_diff = FALSE;
    5242557377 #endif
    52426 @@ -2390,8 +2388,7 @@
     57378@@ -2390,8 +2401,7 @@
    5242757379     qf_fill_buffer(qi);
    5242857380 
     
    5243457386     curwin->w_cursor.lnum = qi->qf_lists[qi->qf_curlist].qf_index;
    5243557387     curwin->w_cursor.col = 0;
    52436 @@ -2528,6 +2525,8 @@
     57388@@ -2528,6 +2538,8 @@
    5243757389     qf_info_T  *qi;
    5243857390 {
     
    5244357395 
    5244457396     /* Check if a buffer for the quickfix list exists.  Update it. */
    52445 @@ -2539,6 +2538,16 @@
     57397@@ -2539,6 +2551,16 @@
    5244657398 
    5244757399        qf_fill_buffer(qi);
     
    5246057412        aucmd_restbuf(&aco);
    5246157413 
    52462 @@ -2546,6 +2555,14 @@
     57414@@ -2546,6 +2568,14 @@
    5246357415     }
    5246457416 }
     
    5247557427  * Fill current buffer with quickfix errors, replacing any previous contents.
    5247657428  * curbuf must be the quickfix buffer!
    52477 @@ -2657,7 +2674,7 @@
     57429@@ -2657,7 +2687,7 @@
    5247857430 bt_quickfix(buf)
    5247957431     buf_T      *buf;
     
    5248457436 
    5248557437 /*
    52486 @@ -2668,8 +2685,8 @@
     57438@@ -2668,8 +2698,8 @@
    5248757439 bt_nofile(buf)
    5248857440     buf_T      *buf;
     
    5249557447 
    5249657448 /*
    52497 @@ -2679,7 +2696,7 @@
     57449@@ -2679,7 +2709,7 @@
    5249857450 bt_dontwrite(buf)
    5249957451     buf_T      *buf;
     
    5250457456 
    5250557457     int
    52506 @@ -2744,6 +2761,13 @@
     57458@@ -2744,6 +2774,13 @@
    5250757459 #ifdef FEAT_AUTOCMD
    5250857460     char_u     *au_name = NULL;
     
    5251857470     {
    5251957471        case CMD_make:      au_name = (char_u *)"make"; break;
    52520 @@ -2765,13 +2789,6 @@
     57472@@ -2765,13 +2802,6 @@
    5252157473     }
    5252257474 #endif
     
    5253257484        || eap->cmdidx == CMD_lgrepadd)
    5253357485        wp = curwin;
    52534 @@ -2819,17 +2836,21 @@
     57486@@ -2819,17 +2849,21 @@
    5253557487                                           (eap->cmdidx != CMD_grepadd
    5253657488                                            && eap->cmdidx != CMD_lgrepadd),
     
    5255857510     mch_remove(fname);
    5255957511     vim_free(fname);
    52560 @@ -3051,18 +3072,22 @@
     57512@@ -2974,11 +3008,28 @@
     57513 {
     57514     win_T      *wp = NULL;
     57515     qf_info_T  *qi = &ql_info;
     57516+#ifdef FEAT_AUTOCMD
     57517+    char_u     *au_name = NULL;
     57518+#endif
     57519 
     57520     if (eap->cmdidx == CMD_lfile || eap->cmdidx == CMD_lgetfile
     57521-       || eap->cmdidx == CMD_laddfile)
     57522+                                              || eap->cmdidx == CMD_laddfile)
     57523        wp = curwin;
     57524 
     57525+#ifdef FEAT_AUTOCMD
     57526+    switch (eap->cmdidx)
     57527+    {
     57528+       case CMD_cfile:     au_name = (char_u *)"cfile"; break;
     57529+       case CMD_cgetfile:  au_name = (char_u *)"cgetfile"; break;
     57530+       case CMD_caddfile:  au_name = (char_u *)"caddfile"; break;
     57531+       case CMD_lfile:     au_name = (char_u *)"lfile"; break;
     57532+       case CMD_lgetfile:  au_name = (char_u *)"lgetfile"; break;
     57533+       case CMD_laddfile:  au_name = (char_u *)"laddfile"; break;
     57534+       default: break;
     57535+    }
     57536+    if (au_name != NULL)
     57537+       apply_autocmds(EVENT_QUICKFIXCMDPRE, au_name, NULL, FALSE, curbuf);
     57538+#endif
     57539 #ifdef FEAT_BROWSE
     57540     if (cmdmod.browse)
     57541     {
     57542@@ -3010,10 +3061,22 @@
     57543                                  && (eap->cmdidx == CMD_cfile
     57544                                             || eap->cmdidx == CMD_lfile))
     57545     {
     57546+#ifdef FEAT_AUTOCMD
     57547+       if (au_name != NULL)
     57548+           apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, NULL, FALSE, curbuf);
     57549+#endif
     57550        if (wp != NULL)
     57551            qi = GET_LOC_LIST(wp);
     57552        qf_jump(qi, 0, 0, eap->forceit);        /* display first error */
     57553     }
     57554+
     57555+    else
     57556+    {
     57557+#ifdef FEAT_AUTOCMD
     57558+       if (au_name != NULL)
     57559+           apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, NULL, FALSE, curbuf);
     57560+#endif
     57561+    }
     57562 }
     57563 
     57564 /*
     57565@@ -3051,18 +3114,22 @@
    5256157566     int                flags = 0;
    5256257567     colnr_T    col;
     
    5258657591     }
    5258757592     if (au_name != NULL)
    52588 @@ -3130,6 +3155,11 @@
     57593@@ -3130,6 +3197,11 @@
    5258957594        goto theend;
    5259057595     }
     
    5259857603      * ":lcd %:p:h" changes the meaning of short path names. */
    5259957604     mch_dirname(dirname_start, MAXPATHL);
    52600 @@ -3366,6 +3396,8 @@
     57605@@ -3178,19 +3250,7 @@
     57606 
     57607            /* Load file into a buffer, so that 'fileencoding' is detected,
     57608             * autocommands applied, etc. */
     57609-           buf = load_dummy_buffer(fname);
     57610-
     57611-           /* When autocommands changed directory: go back.  We assume it was
     57612-            * ":lcd %:p:h". */
     57613-           mch_dirname(dirname_now, MAXPATHL);
     57614-           if (STRCMP(dirname_start, dirname_now) != 0)
     57615-           {
     57616-               exarg_T ea;
     57617-
     57618-               ea.arg = dirname_start;
     57619-               ea.cmdidx = CMD_lcd;
     57620-               ex_cd(&ea);
     57621-           }
     57622+           buf = load_dummy_buffer(fname, dirname_start, dirname_now);
     57623 
     57624            p_mls = save_mls;
     57625 #if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
     57626@@ -3261,7 +3321,7 @@
     57627                {
     57628                    /* Never keep a dummy buffer if there is another buffer
     57629                     * with the same name. */
     57630-                   wipe_dummy_buffer(buf);
     57631+                   wipe_dummy_buffer(buf, dirname_start);
     57632                    buf = NULL;
     57633                }
     57634                else if (!cmdmod.hide
     57635@@ -3277,12 +3337,12 @@
     57636                     * many swap files. */
     57637                    if (!found_match)
     57638                    {
     57639-                       wipe_dummy_buffer(buf);
     57640+                       wipe_dummy_buffer(buf, dirname_start);
     57641                        buf = NULL;
     57642                    }
     57643                    else if (buf != first_match_buf || (flags & VGR_NOJUMP))
     57644                    {
     57645-                       unload_dummy_buffer(buf);
     57646+                       unload_dummy_buffer(buf, dirname_start);
     57647                        buf = NULL;
     57648                    }
     57649                }
     57650@@ -3366,6 +3426,8 @@
    5260157651     }
    5260257652 
     
    5260757657     vim_free(regmatch.regprog);
    5260857658 }
    52609 @@ -3435,6 +3467,7 @@
     57659@@ -3426,15 +3488,51 @@
     57660 }
     57661 
     57662 /*
     57663- * Load file "fname" into a dummy buffer and return the buffer pointer.
     57664+ * Restore current working directory to "dirname_start" if they differ, taking
     57665+ * into account whether it is set locally or globally.
     57666+ */
     57667+    static void
     57668+restore_start_dir(dirname_start)
     57669+    char_u     *dirname_start;
     57670+{
     57671+    char_u *dirname_now = alloc(MAXPATHL);
     57672+
     57673+    if (NULL != dirname_now)
     57674+    {
     57675+       mch_dirname(dirname_now, MAXPATHL);
     57676+       if (STRCMP(dirname_start, dirname_now) != 0)
     57677+       {
     57678+           /* If the directory has changed, change it back by building up an
     57679+            * appropriate ex command and executing it. */
     57680+           exarg_T ea;
     57681+
     57682+           ea.arg = dirname_start;
     57683+           ea.cmdidx = (curwin->w_localdir == NULL) ? CMD_cd : CMD_lcd;
     57684+           ex_cd(&ea);
     57685+       }
     57686+    }
     57687+}
     57688+
     57689+/*
     57690+ * Load file "fname" into a dummy buffer and return the buffer pointer,
     57691+ * placing the directory resulting from the buffer load into the
     57692+ * "resulting_dir" pointer. "resulting_dir" must be allocated by the caller
     57693+ * prior to calling this function. Restores directory to "dirname_start" prior
     57694+ * to returning, if autocmds or the 'autochdir' option have changed it.
     57695+ *
     57696+ * If creating the dummy buffer does not fail, must call unload_dummy_buffer()
     57697+ * or wipe_dummy_buffer() later!
     57698+ *
     57699  * Returns NULL if it fails.
     57700- * Must call unload_dummy_buffer() or wipe_dummy_buffer() later!
     57701  */
     57702     static buf_T *
     57703-load_dummy_buffer(fname)
     57704+load_dummy_buffer(fname, dirname_start, resulting_dir)
    5261057705     char_u     *fname;
     57706+    char_u     *dirname_start;  /* in: old directory */
     57707+    char_u     *resulting_dir;  /* out: new directory */
    5261157708 {
    5261257709     buf_T      *newbuf;
     
    5261557712     aco_save_T aco;
    5261657713 
    52617 @@ -3471,15 +3504,19 @@
     57714@@ -3471,33 +3569,48 @@
    5261857715            failed = FALSE;
    5261957716            if (curbuf != newbuf)
     
    5263757734     }
    5263857735 
     57736+    /*
     57737+     * When autocommands/'autochdir' option changed directory: go back.
     57738+     * Let the caller know what the resulting dir was first, in case it is
     57739+     * important.
     57740+     */
     57741+    mch_dirname(resulting_dir, MAXPATHL);
     57742+    restore_start_dir(dirname_start);
     57743+
    5263957744     if (!buf_valid(newbuf))
    52640 @@ -3697,7 +3734,7 @@
     57745        return NULL;
     57746     if (failed)
     57747     {
     57748-       wipe_dummy_buffer(newbuf);
     57749+       wipe_dummy_buffer(newbuf, dirname_start);
     57750        return NULL;
     57751     }
     57752     return newbuf;
     57753 }
     57754 
     57755 /*
     57756- * Wipe out the dummy buffer that load_dummy_buffer() created.
     57757+ * Wipe out the dummy buffer that load_dummy_buffer() created. Restores
     57758+ * directory to "dirname_start" prior to returning, if autocmds or the
     57759+ * 'autochdir' option have changed it.
     57760  */
     57761     static void
     57762-wipe_dummy_buffer(buf)
     57763+wipe_dummy_buffer(buf, dirname_start)
     57764     buf_T      *buf;
     57765+    char_u     *dirname_start;
     57766 {
     57767     if (curbuf != buf)         /* safety check */
     57768     {
     57769@@ -3517,18 +3630,28 @@
     57770         * new aborting error, interrupt, or uncaught exception. */
     57771        leave_cleanup(&cs);
     57772 #endif
     57773+       /* When autocommands/'autochdir' option changed directory: go back. */
     57774+       restore_start_dir(dirname_start);
     57775     }
     57776 }
     57777 
     57778 /*
     57779- * Unload the dummy buffer that load_dummy_buffer() created.
     57780+ * Unload the dummy buffer that load_dummy_buffer() created. Restores
     57781+ * directory to "dirname_start" prior to returning, if autocmds or the
     57782+ * 'autochdir' option have changed it.
     57783  */
     57784     static void
     57785-unload_dummy_buffer(buf)
     57786+unload_dummy_buffer(buf, dirname_start)
     57787     buf_T      *buf;
     57788+    char_u     *dirname_start;
     57789 {
     57790     if (curbuf != buf)         /* safety check */
     57791-       close_buffer(NULL, buf, DOBUF_UNLOAD);
     57792+    {
     57793+       close_buffer(NULL, buf, DOBUF_UNLOAD, FALSE);
     57794+
     57795+       /* When autocommands/'autochdir' option changed directory: go back. */
     57796+       restore_start_dir(dirname_start);
     57797+    }
     57798 }
     57799 
     57800 #if defined(FEAT_EVAL) || defined(PROTO)
     57801@@ -3697,7 +3820,7 @@
    5264157802     }
    5264257803 
     
    5264757808     else
    5264857809        qi->qf_lists[qi->qf_curlist].qf_nonevalid = FALSE;
    52649 @@ -3841,16 +3878,35 @@
     57810@@ -3841,16 +3964,35 @@
    5265057811     qf_info_T  *qi = &ql_info;
    5265157812     int                new_qi = FALSE;
     
    5268757848     {
    5268857849        /* Find an existing help window */
    52689 @@ -3876,6 +3932,16 @@
     57850@@ -3876,6 +4018,16 @@
    5269057851     regmatch.rm_ic = FALSE;
    5269157852     if (regmatch.regprog != NULL)
     
    5270457865        qf_new_list(qi, *eap->cmdlinep);
    5270557866 
    52706 @@ -3910,21 +3976,33 @@
     57867@@ -3910,21 +4062,33 @@
    5270757868                        lnum = 1;
    5270857869                        while (!vim_fgets(IObuff, IOSIZE, fd) && !got_int)
     
    5274457905                                            FALSE,      /* vis_col */
    5274557906                                            NULL,       /* search pattern */
    52746 @@ -3934,9 +4012,17 @@
     57907@@ -3934,9 +4098,17 @@
    5274757908                                            ) == FAIL)
    5274857909                                {
     
    5276257923                            line_breakcheck();
    5276357924                        }
    52764 @@ -3946,7 +4032,12 @@
     57925@@ -3946,7 +4118,12 @@
    5276557926                FreeWild(fcount, fnames);
    5276657927            }
     
    5277557936        qi->qf_lists[qi->qf_curlist].qf_nonevalid = FALSE;
    5277657937        qi->qf_lists[qi->qf_curlist].qf_ptr =
    52777 @@ -3964,6 +4055,17 @@
     57938@@ -3964,6 +4141,17 @@
    5277857939     qf_update_buffer(qi);
    5277957940 #endif
     
    5279457955        qf_jump(qi, 0, 0, FALSE);
    5279557956diff -Naur vim73.orig/src/regexp.c vim73/src/regexp.c
    52796 --- vim73.orig/src/regexp.c     2012-02-15 21:57:45.065436261 +0000
    52797 +++ vim73/src/regexp.c  2012-02-15 21:57:46.277468229 +0000
     57957--- vim73.orig/src/regexp.c     2012-06-03 23:09:52.956007482 +0000
     57958+++ vim73/src/regexp.c  2012-06-03 23:09:54.512048891 +0000
    5279857959@@ -666,8 +666,12 @@
    5279957960 static void    regc __ARGS((int b));
     
    5318258343            can_f_submatch = FALSE;
    5318358344diff -Naur vim73.orig/src/screen.c vim73/src/screen.c
    53184 --- vim73.orig/src/screen.c     2012-02-15 21:57:45.061436156 +0000
    53185 +++ vim73/src/screen.c  2012-02-15 21:57:46.889484373 +0000
     58345--- vim73.orig/src/screen.c     2012-06-03 23:09:52.948007269 +0000
     58346+++ vim73/src/screen.c  2012-06-03 23:09:55.944087000 +0000
    5318658347@@ -764,9 +764,13 @@
    5318758348            doit = TRUE;
     
    5329058451                        sprintf((char *)extra, "%*ld ",
    5329158452                                                number_width(wp), num);
    53292 @@ -3559,7 +3564,7 @@
     58453@@ -3496,9 +3501,11 @@
     58454                    char_attr = hl_attr(HLF_N);
     58455 #ifdef FEAT_SYN_HL
     58456                    /* When 'cursorline' is set highlight the line number of
     58457-                    * the current line differently. */
     58458+                    * the current line differently.
     58459+                    * TODO: Can we use CursorLine instead of CursorLineNr
     58460+                    * when CursorLineNr isn't set? */
     58461                    if (wp->w_p_cul && lnum == wp->w_cursor.lnum)
     58462-                       char_attr = hl_combine_attr(hl_attr(HLF_CUL), char_attr);
     58463+                       char_attr = hl_attr(HLF_CLN);
     58464 #endif
     58465                }
     58466            }
     58467@@ -3559,7 +3566,7 @@
    5329358468        }
    5329458469 
     
    5329958474 #ifdef FEAT_DIFF
    5330058475                                   && filler_todo <= 0
    53301 @@ -4253,7 +4258,7 @@
     58476@@ -4253,7 +4260,7 @@
    5330258477                {
    5330358478                    /* tab amount depends on current column */
     
    5330858483                    mb_utf8 = FALSE;    /* don't draw as UTF-8 */
    5330958484 #endif
    53310 @@ -6436,6 +6441,8 @@
     58485@@ -5366,6 +5373,12 @@
     58486 # define CHAR_CELLS 1
     58487 #endif
     58488 
     58489+    /* Check for illegal row and col, just in case. */
     58490+    if (row >= Rows)
     58491+       row = Rows - 1;
     58492+    if (endcol > Columns)
     58493+       endcol = Columns;
     58494+
     58495 # ifdef FEAT_CLIPBOARD
     58496     clip_may_clear_selection(row, row);
     58497 # endif
     58498@@ -6436,6 +6449,8 @@
    5331158499     struct     stl_hlrec hltab[STL_MAX_ITEM];
    5331258500     struct     stl_hlrec tabtab[STL_MAX_ITEM];
     
    5331758505     /* setup environment for the task at hand */
    5331858506     if (wp == NULL)
    53319 @@ -6514,16 +6521,31 @@
     58507@@ -6514,16 +6529,31 @@
    5332058508     if (maxwidth <= 0)
    5332158509        return;
     
    5335258540     {
    5335358541 #ifdef FEAT_MBYTE
    53354 @@ -7827,15 +7849,15 @@
     58542@@ -6591,16 +6621,17 @@
     58543     int            row, col;
     58544     int            attr;
     58545 {
     58546-#ifdef FEAT_MBYTE
     58547     char_u     buf[MB_MAXBYTES + 1];
     58548 
     58549-    buf[(*mb_char2bytes)(c, buf)] = NUL;
     58550-#else
     58551-    char_u     buf[2];
     58552-
     58553-    buf[0] = c;
     58554-    buf[1] = NUL;
     58555+#ifdef FEAT_MBYTE
     58556+    if (has_mbyte)
     58557+       buf[(*mb_char2bytes)(c, buf)] = NUL;
     58558+    else
     58559 #endif
     58560+    {
     58561+       buf[0] = c;
     58562+       buf[1] = NUL;
     58563+    }
     58564     screen_puts(buf, row, col, attr);
     58565 }
     58566 
     58567@@ -7827,15 +7858,15 @@
    5335558568 
    5335658569 /*
     
    5337258585 }
    5337358586 
    53374 @@ -7850,8 +7872,8 @@
     58587@@ -7850,8 +7881,8 @@
    5337558588  * final size of the shell is needed.
    5337658589  */
     
    5338358596     int                    new_row, old_row;
    5338458597 #ifdef FEAT_GUI
    53385 @@ -8047,7 +8069,7 @@
     58598@@ -8047,7 +8078,7 @@
    5338658599             * (used when resizing the window at the "--more--" prompt or when
    5338758600             * executing an external command, for the GUI).
     
    5339258605                (void)vim_memset(new_ScreenLines + new_row * Columns,
    5339358606                                      ' ', (size_t)Columns * sizeof(schar_T));
    53394 @@ -8137,7 +8159,7 @@
     58607@@ -8137,7 +8168,7 @@
    5339558608     screen_Columns = Columns;
    5339658609 
     
    5340258615 #ifdef FEAT_GUI
    5340358616diff -Naur vim73.orig/src/search.c vim73/src/search.c
    53404 --- vim73.orig/src/search.c     2012-02-15 21:57:45.065436261 +0000
    53405 +++ vim73/src/search.c  2012-02-15 21:57:46.889484373 +0000
     58617--- vim73.orig/src/search.c     2012-06-03 23:09:52.956007482 +0000
     58618+++ vim73/src/search.c  2012-06-03 23:09:55.336070819 +0000
    5340658619@@ -1161,12 +1161,20 @@
    5340758620        {
     
    5359458807     static void
    5359558808diff -Naur vim73.orig/src/spell.c vim73/src/spell.c
    53596 --- vim73.orig/src/spell.c      2012-02-15 21:57:45.041435628 +0000
    53597 +++ vim73/src/spell.c   2012-02-15 21:57:46.785481629 +0000
     58809--- vim73.orig/src/spell.c      2012-06-03 23:09:52.924006631 +0000
     58810+++ vim73/src/spell.c   2012-06-03 23:09:55.960087426 +0000
    5359858811@@ -303,10 +303,6 @@
    5359958812  *                         few bytes as possible, see offset2bytes())
     
    5372358936        ga_clear(&buf->b_s.b_langp);
    5372458937 
    53725 @@ -4930,6 +4951,8 @@
     58938@@ -4700,8 +4721,6 @@
     58939        int_wordlist = NULL;
     58940     }
     58941 
     58942-    init_spell_chartab();
     58943-
     58944     vim_free(repl_to);
     58945     repl_to = NULL;
     58946     vim_free(repl_from);
     58947@@ -4930,6 +4949,8 @@
    5372658948 
    5372758949     sblock_T   *si_blocks;     /* memory blocks used */
     
    5373258954                                       compression limit */
    5373358955     wordnode_T *si_first_free; /* List of nodes that have been freed during
    53734 @@ -4951,7 +4974,7 @@
     58956@@ -4951,7 +4972,7 @@
    5373558957     char_u     *si_info;       /* info text chars or NULL  */
    5373658958     int                si_region_count; /* number of regions supported (1 when there
     
    5374158963 
    5374258964     garray_T   si_rep;         /* list of fromto_T entries from REP lines */
    53743 @@ -4997,7 +5020,6 @@
     58965@@ -4997,7 +5018,6 @@
    5374458966 static int str_equal __ARGS((char_u *s1, char_u        *s2));
    5374558967 static void add_fromto __ARGS((spellinfo_T *spin, garray_T *gap, char_u        *from, char_u *to));
     
    5374958971 static int spell_read_dic __ARGS((spellinfo_T *spin, char_u *fname, afffile_T *affile));
    5375058972 static int get_affix_flags __ARGS((afffile_T *affile, char_u *afflist));
    53751 @@ -5027,7 +5049,7 @@
     58973@@ -5027,7 +5047,7 @@
    5375258974 static int offset2bytes __ARGS((int nr, char_u *buf));
    5375358975 static int bytes2offset __ARGS((char_u **pp));
     
    5375858980 static void init_spellfile __ARGS((void));
    5375958981 
    53760 @@ -5456,21 +5478,25 @@
     58982@@ -5456,21 +5476,25 @@
    5376158983            }
    5376258984            else if (is_aff_rule(items, itemcnt, "COMPOUNDRULE", 2))
     
    5379559017            }
    5379659018            else if (is_aff_rule(items, itemcnt, "COMPOUNDWORDMAX", 2)
    53797 @@ -6270,7 +6296,7 @@
     59019@@ -6270,7 +6294,7 @@
    5379859020 
    5379959021     for (p = compflags; *p != NUL; )
     
    5380459026            *tp++ = *p++;
    5380559027        else
    53806 @@ -6299,7 +6325,7 @@
     59028@@ -6299,7 +6323,7 @@
    5380759029                    {
    5380859030                        check_renumber(spin);
     
    5381359035                    hash_add(&aff->af_comp, ci->ci_key);
    5381459036                }
    53815 @@ -6458,23 +6484,6 @@
     59037@@ -6458,23 +6482,6 @@
    5381659038 }
    5381759039 
     
    5383759059  */
    5383859060     static void
    53839 @@ -6930,7 +6939,7 @@
     59061@@ -6930,7 +6937,7 @@
    5384059062                            if (ae->ae_add == NULL)
    5384159063                                *newword = NUL;
     
    5384659068                            if (ae->ae_chop != NULL)
    5384759069                            {
    53848 @@ -6951,7 +6960,7 @@
     59070@@ -6951,7 +6958,7 @@
    5384959071                        else
    5385059072                        {
     
    5385559077                            {
    5385659078                                /* Remove chop string. */
    53857 @@ -7343,10 +7352,21 @@
     59079@@ -7343,10 +7350,21 @@
    5385859080 
    5385959081     if (bl == NULL || bl->sb_used + len > SBLOCKSIZE)
     
    5387959101        spin->si_blocks = bl;
    5388059102        bl->sb_used = 0;
    53881 @@ -7361,6 +7381,7 @@
     59103@@ -7361,6 +7379,7 @@
    5388259104 
    5388359105 /*
     
    5388759109     static char_u *
    5388859110 getroom_save(spin, s)
    53889 @@ -7395,6 +7416,7 @@
     59111@@ -7395,6 +7414,7 @@
    5389059112 
    5389159113 /*
     
    5389559117     static wordnode_T *
    5389659118 wordtree_alloc(spin)
    53897 @@ -7679,6 +7701,7 @@
     59119@@ -7679,6 +7699,7 @@
    5389859120 /*
    5389959121  * Get a wordnode_T, either from the list of previously freed nodes or
     
    5390359125     static wordnode_T *
    5390459126 get_wordnode(spin)
    53905 @@ -7696,7 +7719,8 @@
     59127@@ -7696,7 +7717,8 @@
    5390659128        --spin->si_free_count;
    5390759129     }
     
    5391359135     return n;
    5391459136 }
    53915 @@ -8548,7 +8572,7 @@
     59137@@ -8548,7 +8570,7 @@
    5391659138     spellinfo_T        *spin;
    5391759139     char_u     *wfname;
     
    5392259144     slang_T    *slang;
    5392359145     int                free_slang = FALSE;
    53924 @@ -8612,13 +8636,17 @@
     59146@@ -8612,13 +8634,17 @@
    5392559147      * Write the .sug file.
    5392659148      * Make the file name by changing ".spl" to ".sug".
     
    5394159163        slang_free(slang);
    5394259164     free_blocks(spin->si_blocks);
    53943 @@ -9057,15 +9085,15 @@
     59165@@ -9057,15 +9083,15 @@
    5394459166  * and ".spl" is appended to make the output file name.
    5394559167  */
     
    5396159183     int                incount;
    5396259184     afffile_T  *(afile[8]);
    53963 @@ -9093,6 +9121,10 @@
     59185@@ -9093,6 +9119,10 @@
    5396459186     innames = &fnames[1];
    5396559187     incount = fcount - 1;
     
    5397259194     {
    5397359195        len = (int)STRLEN(fnames[0]);
    53974 @@ -9102,32 +9134,32 @@
     59196@@ -9102,32 +9132,32 @@
    5397559197             * "path/en.latin1.add.spl". */
    5397659198            innames = &fnames[0];
     
    5401359235     }
    5401459236 
    54015 @@ -9141,17 +9173,21 @@
     59237@@ -9141,17 +9171,21 @@
    5401659238     {
    5401759239        /* Check for overwriting before doing things that may take a lot of
     
    5403859260         * Init the aff and dic pointers.
    5403959261         * Get the region names if there are more than 2 arguments.
    54040 @@ -9167,7 +9203,7 @@
     59262@@ -9167,7 +9201,7 @@
    5404159263                                                || innames[i][len - 3] != '_')
    5404259264                {
     
    5404759269                spin.si_region_name[i * 2] = TOLOWER_ASC(innames[i][len - 2]);
    5404859270                spin.si_region_name[i * 2 + 1] =
    54049 @@ -9184,7 +9220,7 @@
     59271@@ -9184,7 +9218,7 @@
    5405059272                || spin.si_prefroot == NULL)
    5405159273        {
     
    5405659278 
    5405759279        /* When not producing a .add.spl file clear the character table when
    54058 @@ -9205,7 +9241,7 @@
     59280@@ -9205,7 +9239,7 @@
    5405959281            spin.si_conv.vc_type = CONV_NONE;
    5406059282            spin.si_region = 1 << i;
     
    5406559287            {
    5406659288                /* Read the .aff file.  Will init "spin->si_conv" based on the
    54067 @@ -9216,7 +9252,7 @@
     59289@@ -9216,7 +9250,7 @@
    5406859290                else
    5406959291                {
     
    5407459296                    if (spell_read_dic(&spin, fname, afile[i]) == FAIL)
    5407559297                        error = TRUE;
    54076 @@ -9298,6 +9334,10 @@
     59298@@ -9298,6 +9332,10 @@
    5407759299            spell_make_sugfile(&spin, wfname);
    5407859300 
     
    5408559307 
    5408659308 /*
    54087 @@ -9350,7 +9390,7 @@
     59309@@ -9350,7 +9388,7 @@
    5408859310     buf_T      *buf = NULL;
    5408959311     int                new_spf = FALSE;
     
    5409459316     long       fpos, fpos_next = 0;
    5409559317     int                i;
    54096 @@ -9380,6 +9420,9 @@
     59318@@ -9380,6 +9418,9 @@
    5409759319            EMSG2(_(e_notset), "spellfile");
    5409859320            return;
     
    5410459326        for (spf = curwin->w_s->b_p_spf, i = 1; *spf != NUL; ++i)
    5410559327        {
    54106 @@ -9389,6 +9432,7 @@
     59328@@ -9389,6 +9430,7 @@
    5410759329            if (*spf == NUL)
    5410859330            {
     
    5411259334            }
    5411359335        }
    54114 @@ -9400,6 +9444,7 @@
     59336@@ -9400,6 +9442,7 @@
    5411559337        if (buf != NULL && bufIsChanged(buf))
    5411659338        {
     
    5412059342        }
    5412159343 
    54122 @@ -9494,6 +9539,7 @@
     59344@@ -9494,6 +9537,7 @@
    5412359345 
    5412459346        redraw_all_later(SOME_VALID);
     
    5412859350 
    5412959351 /*
    54130 @@ -9502,7 +9548,7 @@
     59352@@ -9502,7 +9546,7 @@
    5413159353     static void
    5413259354 init_spellfile()
     
    5413759359     char_u     *fname;
    5413859360     char_u     *rtp;
    54139 @@ -9512,6 +9558,10 @@
     59361@@ -9512,6 +9556,10 @@
    5414059362 
    5414159363     if (*curwin->w_s->b_p_spl != NUL && curwin->w_s->b_langp.ga_len > 0)
     
    5414859370         * is a path separator remember the start of the tail. */
    5414959371        for (lend = curwin->w_s->b_p_spl; *lend != NUL
    54150 @@ -9530,7 +9580,8 @@
     59372@@ -9530,7 +9578,8 @@
    5415159373            if (aspath)
    5415259374                /* Use directory of an entry with path, e.g., for
     
    5415859380                /* Copy the path from 'runtimepath' to buf[]. */
    5415959381                copy_option_part(&rtp, buf, MAXPATHL, ",");
    54160 @@ -9539,13 +9590,14 @@
     59382@@ -9539,13 +9588,14 @@
    5416159383                /* Use the first language name from 'spelllang' and the
    5416259384                 * encoding used in the first loaded .spl file. */
     
    5417559397 
    5417659398                    l = (int)STRLEN(buf);
    54177 @@ -9553,7 +9605,8 @@
     59399@@ -9553,7 +9603,8 @@
    5417859400                                 "/%.*s", (int)(lend - lstart), lstart);
    5417959401                }
     
    5418559407                        fname != NULL
    5418659408                          && strstr((char *)gettail(fname), ".ascii.") != NULL
    54187 @@ -9563,6 +9616,8 @@
     59409@@ -9563,6 +9614,8 @@
    5418859410            }
    5418959411            aspath = FALSE;
     
    5419459416 }
    5419559417 
    54196 @@ -9837,10 +9892,7 @@
     59418@@ -9837,10 +9890,7 @@
    5419759419        {
    5419859420            /* be quick for ASCII */
     
    5420559427        else
    5420659428        {
    54207 @@ -9848,10 +9900,7 @@
     59429@@ -9848,10 +9898,7 @@
    5420859430            if (c < 256 ? wp->w_s->b_spell_ismw[c]
    5420959431                    : (wp->w_s->b_spell_ismw_mb != NULL
     
    5421659438 
    5421759439        c = mb_ptr2char(s);
    54218 @@ -10223,7 +10272,7 @@
     59440@@ -10223,7 +10270,7 @@
    5421959441 
    5422059442            /* The suggested word may replace only part of the bad word, add
     
    5422559447                vim_strncpy(wcopy + stp->st_wordlen,
    5422659448                                               sug.su_badptr + stp->st_orglen,
    54227 @@ -11130,7 +11179,7 @@
     59449@@ -11130,7 +11177,7 @@
    5422859450            c = *s++;
    5422959451 
     
    5423459456        if (enc_latin1like && c == 0xdf)
    5423559457        {
    54236 @@ -13124,7 +13173,7 @@
     59458@@ -13124,7 +13171,7 @@
    5423759459        pbad = badsound2;
    5423859460     }
     
    5424359465        /* Add part of the bad word to the good word, so that we soundfold
    5424459466         * what replaces the bad word. */
    54245 @@ -13811,11 +13860,8 @@
     59467@@ -13645,7 +13692,7 @@
     59468 {
     59469     int                m1, m2;
     59470 #ifdef FEAT_MBYTE
     59471-    char_u     buf[MB_MAXBYTES];
     59472+    char_u     buf[MB_MAXBYTES + 1];
     59473     hashitem_T  *hi;
     59474 
     59475     if (c1 >= 256)
     59476@@ -13811,11 +13858,8 @@
    5424659477                    su->su_sfmaxscore = cleanup_suggestions(gap,
    5424759478                                      su->su_sfmaxscore, SUG_CLEAN_COUNT(su));
     
    5425559486        }
    5425659487     }
    54257 @@ -13840,7 +13886,7 @@
     59488@@ -13840,7 +13884,7 @@
    5425859489     for (i = gap->ga_len - 1; i >= 0; --i)
    5425959490     {
     
    5426459495        vim_strncpy(longword + len, su->su_badptr + stp[i].st_orglen,
    5426559496                                                               MAXWLEN - len);
    54266 @@ -14186,7 +14232,7 @@
     59497@@ -14186,7 +14230,7 @@
    5426759498        *t = NUL;
    5426859499     }
     
    5427359504     smp = (salitem_T *)slang->sl_sal.ga_data;
    5427459505 
     59506@@ -14448,13 +14492,15 @@
     59507     int                p0 = -333;
     59508     int                c0;
     59509     int                did_white = FALSE;
     59510+    int                wordlen;
     59511+
     59512 
     59513     /*
     59514      * Convert the multi-byte string to a wide-character string.
     59515      * Remove accents, if wanted.  We actually remove all non-word characters.
     59516      * But keep white space.
     59517      */
     59518-    n = 0;
     59519+    wordlen = 0;
     59520     for (s = inword; *s != NUL; )
     59521     {
     59522        t = s;
     59523@@ -14475,12 +14521,12 @@
     59524                    continue;
     59525            }
     59526        }
     59527-       word[n++] = c;
     59528+       word[wordlen++] = c;
     59529     }
     59530-    word[n] = NUL;
     59531+    word[wordlen] = NUL;
     59532 
     59533     /*
     59534-     * This comes from Aspell phonet.cpp.
     59535+     * This algorithm comes from Aspell phonet.cpp.
     59536      * Converted from C++ to C.  Added support for multi-byte chars.
     59537      * Changed to keep spaces.
     59538      */
     59539@@ -14665,7 +14711,7 @@
     59540                            }
     59541                        if (k > k0)
     59542                            mch_memmove(word + i + k0, word + i + k,
     59543-                                   sizeof(int) * (STRLEN(word + i + k) + 1));
     59544+                                   sizeof(int) * (wordlen - (i + k) + 1));
     59545 
     59546                        /* new "actual letter" */
     59547                        c = word[i];
     59548@@ -14693,7 +14739,7 @@
     59549                            if (c != NUL)
     59550                                wres[reslen++] = c;
     59551                            mch_memmove(word, word + i + 1,
     59552-                                   sizeof(int) * (STRLEN(word + i + 1) + 1));
     59553+                                      sizeof(int) * (wordlen - (i + 1) + 1));
     59554                            i = 0;
     59555                            z0 = 1;
     59556                        }
    5427559557diff -Naur vim73.orig/src/structs.h vim73/src/structs.h
    54276 --- vim73.orig/src/structs.h    2012-02-15 21:57:45.041435628 +0000
    54277 +++ vim73/src/structs.h 2012-02-15 21:57:46.873483950 +0000
     59558--- vim73.orig/src/structs.h    2012-06-03 23:09:52.924006631 +0000
     59559+++ vim73/src/structs.h 2012-06-03 23:09:55.316070287 +0000
    5427859560@@ -378,6 +378,35 @@
    5427959561 typedef long               blocknr_T;
     
    5441959701     PtWidget_t *submenu_id;
    5442059702diff -Naur vim73.orig/src/syntax.c vim73/src/syntax.c
    54421 --- vim73.orig/src/syntax.c     2012-02-15 21:57:45.057436051 +0000
    54422 +++ vim73/src/syntax.c  2012-02-15 21:57:46.789481734 +0000
     59703--- vim73.orig/src/syntax.c     2012-06-03 23:09:52.948007269 +0000
     59704+++ vim73/src/syntax.c  2012-06-03 23:09:55.912086149 +0000
    5442359705@@ -68,6 +68,8 @@
    5442459706 
     
    5467659958  *  Highlighting stuff               *
    5467759959  **************************************/
    54678 @@ -7600,10 +7641,10 @@
     59960@@ -6475,8 +6516,6 @@
     59961             "DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red"),
     59962 #endif
     59963 #ifdef FEAT_INS_EXPAND
     59964-       CENT("PmenuThumb cterm=reverse",
     59965-            "PmenuThumb cterm=reverse gui=reverse"),
     59966        CENT("PmenuSbar ctermbg=Grey",
     59967             "PmenuSbar ctermbg=Grey guibg=Grey"),
     59968 #endif
     59969@@ -6499,6 +6538,8 @@
     59970             "Directory term=bold ctermfg=DarkBlue guifg=Blue"),
     59971        CENT("LineNr term=underline ctermfg=Brown",
     59972             "LineNr term=underline ctermfg=Brown guifg=Brown"),
     59973+       CENT("CursorLineNr term=bold ctermfg=Brown",
     59974+            "CursorLineNr term=bold ctermfg=Brown gui=bold guifg=Brown"),
     59975        CENT("MoreMsg term=bold ctermfg=DarkGreen",
     59976             "MoreMsg term=bold ctermfg=DarkGreen gui=bold guifg=SeaGreen"),
     59977        CENT("Question term=standout ctermfg=DarkGreen",
     59978@@ -6516,10 +6557,12 @@
     59979             "SpellLocal term=underline ctermbg=Cyan guisp=DarkCyan gui=undercurl"),
     59980 #endif
     59981 #ifdef FEAT_INS_EXPAND
     59982-       CENT("Pmenu ctermbg=LightMagenta",
     59983-            "Pmenu ctermbg=LightMagenta guibg=LightMagenta"),
     59984-       CENT("PmenuSel ctermbg=LightGrey",
     59985-            "PmenuSel ctermbg=LightGrey guibg=Grey"),
     59986+       CENT("PmenuThumb ctermbg=Black",
     59987+            "PmenuThumb ctermbg=Black guibg=Black"),
     59988+       CENT("Pmenu ctermbg=LightMagenta ctermfg=Black",
     59989+            "Pmenu ctermbg=LightMagenta ctermfg=Black guibg=LightMagenta"),
     59990+       CENT("PmenuSel ctermbg=LightGrey ctermfg=Black",
     59991+            "PmenuSel ctermbg=LightGrey ctermfg=Black guibg=Grey"),
     59992 #endif
     59993        CENT("SpecialKey term=bold ctermfg=DarkBlue",
     59994             "SpecialKey term=bold ctermfg=DarkBlue guifg=Blue"),
     59995@@ -6585,6 +6628,8 @@
     59996             "Directory term=bold ctermfg=LightCyan guifg=Cyan"),
     59997        CENT("LineNr term=underline ctermfg=Yellow",
     59998             "LineNr term=underline ctermfg=Yellow guifg=Yellow"),
     59999+       CENT("CursorLineNr term=bold ctermfg=Yellow",
     60000+            "CursorLineNr term=bold ctermfg=Yellow gui=bold guifg=Yellow"),
     60001        CENT("MoreMsg term=bold ctermfg=LightGreen",
     60002             "MoreMsg term=bold ctermfg=LightGreen gui=bold guifg=SeaGreen"),
     60003        CENT("Question term=standout ctermfg=LightGreen",
     60004@@ -6604,10 +6649,12 @@
     60005             "SpellLocal term=underline ctermbg=Cyan guisp=Cyan gui=undercurl"),
     60006 #endif
     60007 #ifdef FEAT_INS_EXPAND
     60008-       CENT("Pmenu ctermbg=Magenta",
     60009-            "Pmenu ctermbg=Magenta guibg=Magenta"),
     60010-       CENT("PmenuSel ctermbg=DarkGrey",
     60011-            "PmenuSel ctermbg=DarkGrey guibg=DarkGrey"),
     60012+       CENT("PmenuThumb ctermbg=White",
     60013+            "PmenuThumb ctermbg=White guibg=White"),
     60014+       CENT("Pmenu ctermbg=Magenta ctermfg=Black",
     60015+            "Pmenu ctermbg=Magenta ctermfg=Black guibg=Magenta"),
     60016+       CENT("PmenuSel ctermbg=DarkGrey ctermfg=Black",
     60017+            "PmenuSel ctermbg=DarkGrey ctermfg=Black guibg=DarkGrey"),
     60018 #endif
     60019        CENT("Title term=bold ctermfg=LightMagenta",
     60020             "Title term=bold ctermfg=LightMagenta gui=bold guifg=Magenta"),
     60021@@ -7600,10 +7647,10 @@
    5467960022                /*
    5468060023                 * Copy characters from arg[] to buf[], translating <> codes.
     
    5468960032                    else                    /* copy as normal char */
    5469060033                        buf[off++] = *p++;
    54691 @@ -8545,8 +8586,8 @@
     60034@@ -8545,8 +8592,8 @@
    5469260035                if (iarg & hl_attr_table[i])
    5469360036                {
     
    5470060043                }
    5470160044            }
    54702 @@ -8965,6 +9006,13 @@
     60045@@ -8965,6 +9012,13 @@
    5470360046        highlight_ga.ga_growsize = 10;
    5470460047     }
     
    5471460057      * Make room for at least one other syntax_highlight entry.
    5471560058      */
     60059@@ -9422,7 +9476,7 @@
     60060     int            cnt;
     60061     int            attr;
     60062 {
     60063-    msg_puts_attr((char_u *)("N \bI \b!  \b" + cnt / 11), attr);
     60064+    msg_puts_attr((char_u *)&("N \bI \b!  \b"[cnt / 11]), attr);
     60065     msg_clr_eos();
     60066     out_flush();
     60067     ui_delay(cnt == 99 ? 40L : (long)cnt * 50L, FALSE);
    5471660068diff -Naur vim73.orig/src/tag.c vim73/src/tag.c
    54717 --- vim73.orig/src/tag.c        2012-02-15 21:57:45.053435946 +0000
    54718 +++ vim73/src/tag.c     2012-02-15 21:57:46.789481734 +0000
     60069--- vim73.orig/src/tag.c        2012-06-03 23:09:52.940007057 +0000
     60070+++ vim73/src/tag.c     2012-06-03 23:09:55.200067199 +0000
    5471960071@@ -11,10 +11,6 @@
    5472060072  * Code to handle tags and the tag stack
     
    5548360835 /*
    5548460836diff -Naur vim73.orig/src/term.c vim73/src/term.c
    55485 --- vim73.orig/src/term.c       2012-02-15 21:57:45.061436156 +0000
    55486 +++ vim73/src/term.c    2012-02-15 21:57:46.913485005 +0000
     60837--- vim73.orig/src/term.c       2012-06-03 23:09:52.952007375 +0000
     60838+++ vim73/src/term.c    2012-06-03 23:09:55.364071565 +0000
    5548760839@@ -52,7 +52,7 @@
    5548860840 
     
    5585461206     return -1;
    5585561207diff -Naur vim73.orig/src/termlib.c vim73/src/termlib.c
    55856 --- vim73.orig/src/termlib.c    2012-02-15 21:57:45.041435628 +0000
    55857 +++ vim73/src/termlib.c 2012-02-15 21:57:45.957459790 +0000
     61208--- vim73.orig/src/termlib.c    2012-06-03 23:09:52.924006631 +0000
     61209+++ vim73/src/termlib.c 2012-06-03 23:09:54.100037927 +0000
    5585861210@@ -13,7 +13,7 @@
    5585961211 #include "vim.h"
     
    5586661218 
    5586761219diff -Naur vim73.orig/src/testdir/Make_amiga.mak vim73/src/testdir/Make_amiga.mak
    55868 --- vim73.orig/src/testdir/Make_amiga.mak       2012-02-15 21:57:45.045435734 +0000
    55869 +++ vim73/src/testdir/Make_amiga.mak    2012-02-15 21:57:46.537475088 +0000
    55870 @@ -27,7 +27,9 @@
     61220--- vim73.orig/src/testdir/Make_amiga.mak       2012-06-03 23:09:52.928006738 +0000
     61221+++ vim73/src/testdir/Make_amiga.mak    2012-06-03 23:09:55.708080720 +0000
     61222@@ -13,6 +13,7 @@
     61223 # test25       uses symbolic link
     61224 # test27       can't edit file with "*"
     61225 # test52       only for Win32
     61226+# test85       no Lua interface
     61227 
     61228 SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
     61229                test7.out test8.out test9.out \
     61230@@ -27,7 +28,9 @@
    5587161231                test56.out test57.out test58.out test59.out test60.out \
    5587261232                test61.out test62.out test63.out test64.out test65.out \
     
    5587561235+               test71.out test72.out test73.out test74.out test75.out \
    5587661236+               test76.out test77.out test78.out test79.out test80.out \
    55877 +               test81.out test82.out test83.out
     61237+               test81.out test82.out test83.out test84.out
    5587861238 
    5587961239 .SUFFIXES: .in .out
    5588061240 
    55881 @@ -120,3 +122,13 @@
     61241@@ -120,3 +123,14 @@
    5588261242 test71.out: test71.in
    5588361243 test72.out: test72.in
     
    5589361253+test82.out: test82.in
    5589461254+test83.out: test83.in
     61255+test84.out: test84.in
    5589561256diff -Naur vim73.orig/src/testdir/Make_dos.mak vim73/src/testdir/Make_dos.mak
    55896 --- vim73.orig/src/testdir/Make_dos.mak 2012-02-15 21:57:45.045435734 +0000
    55897 +++ vim73/src/testdir/Make_dos.mak      2012-02-15 21:57:46.537475088 +0000
    55898 @@ -27,7 +27,9 @@
     61257--- vim73.orig/src/testdir/Make_dos.mak 2012-06-03 23:09:52.928006738 +0000
     61258+++ vim73/src/testdir/Make_dos.mak      2012-06-03 23:09:55.732081359 +0000
     61259@@ -27,7 +27,10 @@
    5589961260                test30.out test31.out test32.out test33.out test34.out \
    5590061261                test37.out test38.out test39.out test40.out test41.out \
     
    5590361264+               test68.out test69.out test71.out test72.out test73.out \
    5590461265+               test74.out test75.out test76.out test77.out test78.out \
    55905 +               test79.out test80.out test81.out test82.out test83.out
     61266+               test79.out test80.out test81.out test82.out test83.out \
     61267+               test84.out test85.out
    5590661268 
    5590761269 SCRIPTS32 =    test50.out test70.out
    5590861270 
     61271@@ -49,7 +52,8 @@
     61272 
     61273 fixff:
     61274        -$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=dos|upd" +q *.in *.ok
     61275-       -$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=unix|upd" +q dotest.in
     61276+       -$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=unix|upd" +q \
     61277+               dotest.in test60.ok test71.ok test74.ok
     61278 
     61279 clean:
     61280        -del *.out
    5590961281diff -Naur vim73.orig/src/testdir/Make_ming.mak vim73/src/testdir/Make_ming.mak
    55910 --- vim73.orig/src/testdir/Make_ming.mak        2012-02-15 21:57:45.045435734 +0000
    55911 +++ vim73/src/testdir/Make_ming.mak     2012-02-15 21:57:46.537475088 +0000
    55912 @@ -47,7 +47,9 @@
     61282--- vim73.orig/src/testdir/Make_ming.mak        2012-06-03 23:09:52.928006738 +0000
     61283+++ vim73/src/testdir/Make_ming.mak     2012-06-03 23:09:55.732081359 +0000
     61284@@ -47,7 +47,10 @@
    5591361285                test30.out test31.out test32.out test33.out test34.out \
    5591461286                test37.out test38.out test39.out test40.out test41.out \
     
    5591761289+               test68.out test69.out test71.out test72.out test73.out \
    5591861290+               test74.out test75.out test76.out test77.out test78.out \
    55919 +               test79.out test80.out test81.out test82.out test83.out
     61291+               test79.out test80.out test81.out test82.out test83.out \
     61292+               test84.out test85.out
    5592061293 
    5592161294 SCRIPTS32 =    test50.out test70.out
    5592261295 
     61296@@ -72,6 +75,8 @@
     61297 
     61298 fixff:
     61299        -$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=dos|upd" +q *.in *.ok
     61300+       -$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=unix|upd" +q \
     61301+               dotest.in test60.ok test71.ok test74.ok
     61302 
     61303 clean:
     61304        -$(DEL) *.out
    5592361305diff -Naur vim73.orig/src/testdir/Make_os2.mak vim73/src/testdir/Make_os2.mak
    55924 --- vim73.orig/src/testdir/Make_os2.mak 2012-02-15 21:57:45.045435734 +0000
    55925 +++ vim73/src/testdir/Make_os2.mak      2012-02-15 21:57:46.537475088 +0000
    55926 @@ -27,7 +27,9 @@
     61306--- vim73.orig/src/testdir/Make_os2.mak 2012-06-03 23:09:52.928006738 +0000
     61307+++ vim73/src/testdir/Make_os2.mak      2012-06-03 23:09:55.708080720 +0000
     61308@@ -13,6 +13,7 @@
     61309 # test25       uses symbolic link
     61310 # test27       can't edit file with "*" in file name
     61311 # test52       only for Win32
     61312+# test85       no Lua interface
     61313 
     61314 SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
     61315                test7.out test8.out test9.out \
     61316@@ -27,7 +28,9 @@
    5592761317                test56.out test57.out test58.out test59.out test60.out \
    5592861318                test61.out test62.out test63.out test64.out test65.out \
     
    5593161321+               test71.out test72.out test73.out test74.out test75.out \
    5593261322+               test76.out test77.out test78.out test79.out test80.out \
    55933 +               test81.out test82.out test83.out
     61323+               test81.out test82.out test83.out test84.out
    5593461324 
    5593561325 .SUFFIXES: .in .out
    5593661326 
    5593761327diff -Naur vim73.orig/src/testdir/Make_vms.mms vim73/src/testdir/Make_vms.mms
    55938 --- vim73.orig/src/testdir/Make_vms.mms 2012-02-15 21:57:45.045435734 +0000
    55939 +++ vim73/src/testdir/Make_vms.mms      2012-02-15 21:57:46.537475088 +0000
     61328--- vim73.orig/src/testdir/Make_vms.mms 2012-06-03 23:09:52.932006845 +0000
     61329+++ vim73/src/testdir/Make_vms.mms      2012-06-03 23:09:55.708080720 +0000
    5594061330@@ -4,7 +4,7 @@
    5594161331 # Authors:     Zoltan Arpadffy, <arpadffy@polarhome.com>
     
    5594361333 #
    5594461334-# Last change:  2010 Aug 04
    55945 +# Last change:  2011 Jul 15
     61335+# Last change:  2012 Apr 05
    5594661336 #
    5594761337 # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
     
    5595461344+        test71.out test72.out test74.out test75.out test76.out \
    5595561345+        test77.out test78.out test79.out test80.out test81.out \
    55956 +        test82.out test83.out
     61346+        test82.out test83.out test84.out
    5595761347 
    5595861348 # Known problems:
    5595961349 # Test 30: a problem around mac format - unknown reason
     61350@@ -87,6 +89,7 @@
     61351 # with too many dots).
     61352 #
     61353 # Test 72: unknown reason
     61354+# Test 85: no Lua interface
     61355 
     61356 .IFDEF WANT_GUI
     61357 SCRIPT_GUI = test16.out
    5596061358diff -Naur vim73.orig/src/testdir/Makefile vim73/src/testdir/Makefile
    55961 --- vim73.orig/src/testdir/Makefile     2012-02-15 21:57:45.045435734 +0000
    55962 +++ vim73/src/testdir/Makefile  2012-02-15 21:57:46.537475088 +0000
     61359--- vim73.orig/src/testdir/Makefile     2012-06-03 23:09:52.932006845 +0000
     61360+++ vim73/src/testdir/Makefile  2012-06-03 23:09:55.708080720 +0000
    5596361361@@ -10,6 +10,7 @@
    5596461362 #   This will make testing about 10 times as slow.
     
    5596961367                test7.out test8.out test9.out test10.out test11.out \
    5597061368                test12.out  test13.out test14.out test15.out test17.out \
    55971 @@ -23,7 +24,9 @@
     61369@@ -23,7 +24,10 @@
    5597261370                test54.out test55.out test56.out test57.out test58.out \
    5597361371                test59.out test60.out test61.out test62.out test63.out \
     
    5597661374+               test69.out test70.out test71.out test72.out test73.out \
    5597761375+               test74.out test75.out test76.out test77.out test78.out \
    55978 +               test79.out test80.out test81.out test82.out test83.out
     61376+               test79.out test80.out test81.out test82.out test83.out \
     61377+               test84.out test85.out
    5597961378 
    5598061379 SCRIPTS_GUI = test16.out
    5598161380 
    55982 @@ -44,7 +47,7 @@
     61381@@ -44,7 +48,7 @@
    5598361382 $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG)
    5598461383 
     
    5598961388 test1.out: test1.in
    5599061389        -rm -f $*.failed tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X* viminfo
    55991 @@ -69,7 +72,7 @@
     61390@@ -69,7 +73,7 @@
    5599261391                  fi \
    5599361392                else echo $* NO OUTPUT >>test.log; \
     
    5599961398 
    5600061399diff -Naur vim73.orig/src/testdir/main.aap vim73/src/testdir/main.aap
    56001 --- vim73.orig/src/testdir/main.aap     2012-02-15 21:57:45.045435734 +0000
    56002 +++ vim73/src/testdir/main.aap  2012-02-15 21:57:45.245441010 +0000
     61400--- vim73.orig/src/testdir/main.aap     2012-06-03 23:09:52.924006631 +0000
     61401+++ vim73/src/testdir/main.aap  2012-06-03 23:09:53.184013549 +0000
    5600361402@@ -13,7 +13,7 @@
    5600461403                test33.out test34.out test35.out test36.out test37.out
     
    5601061409 ScriptsGUI = test16.out
    5601161410 
     61411diff -Naur vim73.orig/src/testdir/test1.in vim73/src/testdir/test1.in
     61412--- vim73.orig/src/testdir/test1.in     2012-06-03 23:09:52.928006738 +0000
     61413+++ vim73/src/testdir/test1.in  2012-06-03 23:09:55.708080720 +0000
     61414@@ -15,6 +15,7 @@
     61415 be set like small.vim above.  mbyte.vim is sourced by tests that require the
     61416 +multi_byte feature.
     61417 Similar logic is applied to the +mzscheme feature, using mzscheme.vim.
     61418+Similar logic is applied to the +lua feature, using lua.vim.
     61419 
     61420 STARTTEST
     61421 :" Write a single line to test.out to check if testing works at all.
     61422@@ -28,10 +29,17 @@
     61423 qa!
     61424 :w! mbyte.vim
     61425 :w! mzscheme.vim
     61426+:w! lua.vim
     61427+:"
     61428 :" If +multi_byte feature supported, make mbyte.vim empty.
     61429 :if has("multi_byte") | sp another | w! mbyte.vim | q | endif
     61430+:"
     61431 :" If +mzscheme feature supported, make mzscheme.vim empty.
     61432 :if has("mzscheme") | sp another | w! mzscheme.vim | q | endif
     61433+:"
     61434+:" If +lua feature supported, make lua.vim empty.
     61435+:if has("lua") | sp another | w! lua.vim | q | endif
     61436+:"
     61437 :" If +eval feature supported quit here, leaving tiny.vim and small.vim empty.
     61438 :" Otherwise write small.vim to skip the test.
     61439 :if 1 | q! | endif
    5601261440diff -Naur vim73.orig/src/testdir/test10.in vim73/src/testdir/test10.in
    56013 --- vim73.orig/src/testdir/test10.in    2012-02-15 21:57:45.045435734 +0000
    56014 +++ vim73/src/testdir/test10.in 2012-02-15 21:57:46.353470235 +0000
    56015 @@ -2,9 +2,19 @@
     61441--- vim73.orig/src/testdir/test10.in    2012-06-03 23:09:52.928006738 +0000
     61442+++ vim73/src/testdir/test10.in 2012-06-03 23:09:55.964087533 +0000
     61443@@ -2,56 +2,113 @@
    5601661444 
    5601761445 STARTTEST
     
    5602561453 :/start of testfile/,/end of testfile/w! Xtestfile
    5602661454-:cf Xerrorfile
     61455-rA
     61456+:set efm+==%f=\\,\ line\ %l%*\\D%v%*[^\ ]\ %m
     61457+:set efm^=%AError\ in\ \"%f\"\ at\ line\ %l:,%Z%p^,%C%m
    5602761458+:cf Xerrorfile2
    5602861459+:clast
     
    5603061461+:let a=w:quickfix_title
    5603161462+:wincmd p
    56032 +gR=a
     61463+lgR=a
    5603361464
    5603461465+:cf Xerrorfile1
    56035  rA
     61466+grA
    5603661467 :cn
    56037  rB
    56038 @@ -14,13 +24,18 @@
    56039  rD
     61468-rB
     61469+gRLINE 6, COL 19
    5604061470 :cn
    56041  rE
     61471-rC
     61472+gRNO COLUMN SPECIFIED
     61473 :cn
     61474-rD
     61475+gRAGAIN NO COLUMN
     61476 :cn
     61477-rE
     61478+gRCOL 1
    5604261479+:cn
     61480+gRCOL 2
     61481+:cn
     61482+gRCOL 10
     61483+:cn
     61484+gRVCOL 10
     61485+:cn
     61486+grI
     61487+:cn
     61488+gR. SPACE POINTER
     61489+:cn
     61490+gR. DOT POINTER
     61491+:cn
     61492+gR. DASH POINTER
     61493+:cn
     61494+gR. TAB-SPACE POINTER
     61495+:clast
     61496+:cprev
     61497+:cprev
    5604361498+:wincmd w
    5604461499+:let a=w:quickfix_title
    5604561500+:wincmd p
    56046 +gR=a
     61501+lgR=a
    5604761502
    5604861503 :w! test.out             " Write contents of this file
     
    5605361508 "Xtestfile", line 4.12: 1506-045 (S) Undeclared identifier fd_set.
    5605461509-"Xtestfile", line 7 col 19; this is an error
    56055 +"Xtestfile", line 7 col 19; this is an error
     61510+"Xtestfile", line 6 col 19; this is an error
    5605661511 gcc -c -DHAVE_CONFIsing-prototypes -I/usr/X11R6/include  version.c
    56057  Xtestfile:13: parse error before `asd'
     61512-Xtestfile:13: parse error before `asd'
     61513+Xtestfile:9: parse error before `asd'
    5605861514 make: *** [vim] Error 1
    56059 @@ -30,6 +45,8 @@
    56060  "Xtestfile", linenr 19: yet another problem
     61515-in file "Xtestfile" linenr 16: there is an error
     61516+in file "Xtestfile" linenr 10: there is an error
     61517 
     61518 2 returned
     61519-"Xtestfile", linenr 19: yet another problem
     61520+"Xtestfile", line 11 col 1; this is an error
     61521+"Xtestfile", line 12 col 2; this is another error
     61522+"Xtestfile", line 14:10; this is an error in column 10
     61523+=Xtestfile=, line 15:10; this is another error, but in vcol 10 this time
     61524+"Xtestfile", linenr 16: yet another problem
     61525+Error in "Xtestfile" at line 17:
     61526+x should be a dot
     61527+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line 17
     61528+            ^
     61529+Error in "Xtestfile" at line 18:
     61530+x should be a dot
     61531+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line 18
     61532+.............^
     61533+Error in "Xtestfile" at line 19:
     61534+x should be a dot
     61535+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line 19
     61536+--------------^
     61537+Error in "Xtestfile" at line 20:
     61538+x should be a dot
     61539+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line 20
     61540+              ^
    5606161541 
    5606261542 Does anyone know what is the problem and how to correction it?
     
    5606661546 
    5606761547 start of testfile
    56068 diff -Naur vim73.orig/src/testdir/test10.ok vim73/src/testdir/test10.ok
    56069 --- vim73.orig/src/testdir/test10.ok    2012-02-15 21:57:45.045435734 +0000
    56070 +++ vim73/src/testdir/test10.ok 2012-02-15 21:57:46.353470235 +0000
    56071 @@ -18,6 +18,6 @@
    56072  line 18 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    56073  Eine 19 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    56074  line 20 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61548-line 2  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61549-line 3  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61550-line 4  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61551-line 5  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61552-line 6  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61553-line 7  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61554-line 8  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61555-line 9  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61556-line 10 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61557-line 11 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61558-line 12 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61559-line 13 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61560-line 14 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61561-line 15 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61562-line 16 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61563-line 17 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61564-line 18 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61565-line 19 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61566-line 20 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    5607561567-line 21 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    5607661568-line 22 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    56077 +line 21 :cf Xerrorfile1xxxxxxxxxxxxxxx
    56078 +line 22 :cf Xerrorfile2xxxxxxxxxxxxxxx
     61569+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line  2
     61570+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line  3
     61571+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line  4
     61572+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line  5
     61573+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line  6
     61574+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line  7
     61575+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line  8
     61576+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line  9
     61577+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line 10
     61578+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line 11
     61579+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line 12
     61580+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line 13
     61581+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line 14
     61582+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line 15
     61583+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line 16
     61584+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line 17
     61585+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line 18
     61586+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line 19
     61587+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line 20
     61588+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line 21
     61589+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line 22
     61590 end of testfile
     61591diff -Naur vim73.orig/src/testdir/test10.ok vim73/src/testdir/test10.ok
     61592--- vim73.orig/src/testdir/test10.ok    2012-06-03 23:09:52.928006738 +0000
     61593+++ vim73/src/testdir/test10.ok 2012-06-03 23:09:55.964087533 +0000
     61594@@ -1,23 +1,23 @@
     61595 start of testfile
     61596-line 2  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61597-line 3  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61598-line 4  xxxAxxxxxxxxxxxxxxxxxxxxxxxxxx
     61599-line 5  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61600-line 6  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61601-line 7  xxxxxxxxxxBxxxxxxxxxxxxxxxxxxx
     61602-line 8  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61603-line 9  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61604-line 10 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61605-line 11 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61606-line 12 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61607-Cine 13 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61608-line 14 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61609-line 15 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61610-Dine 16 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61611-line 17 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61612-line 18 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61613-Eine 19 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61614-line 20 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61615-line 21 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61616-line 22 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     61617+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line  2
     61618+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line  3
     61619+       xxxxxxxxxxAxxxxxxxxxxxxxxxxxxx    line  4
     61620+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line  5
     61621+       xxxxxxxxxxxxxxxxxLINE 6, COL 19   line  6
     61622+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line  7
     61623+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line  8
     61624+       NO COLUMN SPECIFIEDxxxxxxxxxxx    line  9
     61625+       AGAIN NO COLUMNxxxxxxxxxxxxxxx    line 10
     61626+COL 1  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line 11
     61627+       COL 2xxxxxxxxxxxxxxxxxxxxxxxxx    line 12
     61628+       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line 13
     61629+       xxxxxxxxCOL 10xxxxxxxxxxxxxxxx    line 14
     61630+       xVCOL 10xxxxxxxxxxxxxxxxxxxxxx    line 15
     61631+       Ixxxxxxxxxxxxxxxxxxxxxxxxxxxxx    line 16
     61632+       xxxx. SPACE POINTERxxxxxxxxxxx    line 17
     61633+       xxxxx. DOT POINTERxxxxxxxxxxxx    line 18
     61634+       xxxxxx. DASH POINTERxxxxxxxxxx    line 19
     61635+       xxxxxxx. TAB-SPACE POINTERxxxx    line 20
     61636+       xxxxxxxx:cf Xerrorfile1xxxxxxx    line 21
     61637+       xxxxxxxx:cf Xerrorfile2xxxxxxx    line 22
    5607961638 end of testfile
    5608061639diff -Naur vim73.orig/src/testdir/test19.in vim73/src/testdir/test19.in
    56081 --- vim73.orig/src/testdir/test19.in    2012-02-15 21:57:45.045435734 +0000
    56082 +++ vim73/src/testdir/test19.in 2012-02-15 21:57:46.425472133 +0000
     61640--- vim73.orig/src/testdir/test19.in    2012-06-03 23:09:52.928006738 +0000
     61641+++ vim73/src/testdir/test19.in 2012-06-03 23:09:54.700053894 +0000
    5608361642@@ -1,6 +1,7 @@
    5608461643 Tests for "r<Tab>" with 'smarttab' and 'expandtab' set/not set.
     
    5610261661 
    5610361662diff -Naur vim73.orig/src/testdir/test19.ok vim73/src/testdir/test19.ok
    56104 --- vim73.orig/src/testdir/test19.ok    2012-02-15 21:57:45.045435734 +0000
    56105 +++ vim73/src/testdir/test19.ok 2012-02-15 21:57:46.421472027 +0000
     61663--- vim73.orig/src/testdir/test19.ok    2012-06-03 23:09:52.928006738 +0000
     61664+++ vim73/src/testdir/test19.ok 2012-06-03 23:09:54.696053787 +0000
    5610661665@@ -5,3 +5,5 @@
    5610761666     a cde
     
    5611161670+        x
    5611261671diff -Naur vim73.orig/src/testdir/test3.in vim73/src/testdir/test3.in
    56113 --- vim73.orig/src/testdir/test3.in     2012-02-15 21:57:45.045435734 +0000
    56114 +++ vim73/src/testdir/test3.in  2012-02-15 21:57:46.689479097 +0000
     61672--- vim73.orig/src/testdir/test3.in     2012-06-03 23:09:52.932006845 +0000
     61673+++ vim73/src/testdir/test3.in  2012-06-03 23:09:55.716080932 +0000
    5611561674@@ -299,18 +299,25 @@
    5611661675 
     
    5623661795 2kdd]]=][
    5623761796 ENDTEST
    56238 @@ -1315,6 +1399,412 @@
     61797@@ -1315,6 +1399,626 @@
    5623961798 }
    5624061799 
     
    5641261971+                       foo(0);
    5641361972+baz();
     61973+}
     61974+
     61975+STARTTEST
     61976+:set cino=k2s,(0
     61977+2kdd3j=][
     61978+ENDTEST
     61979+
     61980+void func(void)
     61981+{
     61982+       if (condition1
     61983+       && condition2)
     61984+       action();
     61985+       function(argument1
     61986+       && argument2);
     61987+
     61988+       if (c1 && (c2 ||
     61989+       c3))
     61990+       foo;
     61991+       if (c1 &&
     61992+       (c2 || c3))
     61993+       {
     61994+       }
     61995+
     61996+       if (   c1
     61997+       && (      c2
     61998+       || c3))
     61999+       foo;
     62000+       func( c1
     62001+       && (     c2
     62002+       || c3))
     62003+       foo;
     62004+}
     62005+
     62006+STARTTEST
     62007+:set cino=k2s,(s
     62008+2kdd3j=][
     62009+ENDTEST
     62010+
     62011+void func(void)
     62012+{
     62013+       if (condition1
     62014+       && condition2)
     62015+       action();
     62016+       function(argument1
     62017+       && argument2);
     62018+
     62019+       if (c1 && (c2 ||
     62020+       c3))
     62021+       foo;
     62022+       if (c1 &&
     62023+       (c2 || c3))
     62024+       {
     62025+       }
     62026+
     62027+       if (   c1
     62028+       && (      c2
     62029+       || c3))
     62030+       foo;
     62031+       func(   c1
     62032+       && (      c2
     62033+       || c3))
     62034+       foo;
     62035+}
     62036+
     62037+STARTTEST
     62038+:set cino=k2s,(s,U1
     62039+2kdd3j=][
     62040+ENDTEST
     62041+
     62042+void func(void)
     62043+{
     62044+       if (condition1
     62045+       && condition2)
     62046+       action();
     62047+       function(argument1
     62048+       && argument2);
     62049+
     62050+       if (c1 && (c2 ||
     62051+       c3))
     62052+       foo;
     62053+       if (c1 &&
     62054+       (c2 || c3))
     62055+       {
     62056+       }
     62057+       if (c123456789
     62058+       && (c22345
     62059+       || c3))
     62060+       printf("foo\n");
     62061+
     62062+       c = c1 &&
     62063+       (
     62064+       c2 ||
     62065+       c3
     62066+       ) && c4;
     62067+}
     62068+
     62069+STARTTEST
     62070+:set cino=k2s,(0,W4
     62071+2kdd3j=][
     62072+ENDTEST
     62073+
     62074+void func(void)
     62075+{
     62076+       if (condition1
     62077+       && condition2)
     62078+       action();
     62079+       function(argument1
     62080+       && argument2);
     62081+
     62082+       if (c1 && (c2 ||
     62083+       c3))
     62084+       foo;
     62085+       if (c1 &&
     62086+       (c2 || c3))
     62087+       {
     62088+       }
     62089+       if (c123456789
     62090+       && (c22345
     62091+       || c3))
     62092+       printf("foo\n");
     62093+
     62094+       if (   c1
     62095+       && (   c2
     62096+       || c3))
     62097+       foo;
     62098+
     62099+       a_long_line(
     62100+       argument,
     62101+       argument);
     62102+       a_short_line(argument,
     62103+       argument);
     62104+}
     62105+
     62106+STARTTEST
     62107+:set cino=k2s,u2
     62108+2kdd3j=][
     62109+ENDTEST
     62110+
     62111+void func(void)
     62112+{
     62113+       if (condition1
     62114+       && condition2)
     62115+       action();
     62116+       function(argument1
     62117+       && argument2);
     62118+
     62119+       if (c1 && (c2 ||
     62120+       c3))
     62121+       foo;
     62122+       if (c1 &&
     62123+       (c2 || c3))
     62124+       {
     62125+       }
     62126+       if (c123456789
     62127+       && (c22345
     62128+       || c3))
     62129+       printf("foo\n");
     62130+}
     62131+
     62132+STARTTEST
     62133+:set cino=k2s,(0,w1
     62134+2kdd3j=][
     62135+ENDTEST
     62136+
     62137+void func(void)
     62138+{
     62139+       if (condition1
     62140+       && condition2)
     62141+       action();
     62142+       function(argument1
     62143+       && argument2);
     62144+
     62145+       if (c1 && (c2 ||
     62146+       c3))
     62147+       foo;
     62148+       if (c1 &&
     62149+       (c2 || c3))
     62150+       {
     62151+       }
     62152+       if (c123456789
     62153+       && (c22345
     62154+       || c3))
     62155+       printf("foo\n");
     62156+
     62157+       if (   c1
     62158+       && (      c2
     62159+       || c3))
     62160+       foo;
     62161+       func(   c1
     62162+       && (      c2
     62163+       || c3))
     62164+       foo;
     62165+}
     62166+
     62167+STARTTEST
     62168+:set cino=k2,(s
     62169+2kdd3j=][
     62170+ENDTEST
     62171+
     62172+void func(void)
     62173+{
     62174+       if (condition1
     62175+         && condition2)
     62176+               action();
     62177+       function(argument1
     62178+               && argument2);
     62179+
     62180+       if (c1 && (c2 ||
     62181+                 c3))
     62182+               foo;
     62183+       if (c1 &&
     62184+         (c2 || c3))
     62185+       {
     62186+       }
    5641462187+}
    5641562188+
     
    5665062423 ENDTEST
    5665162424diff -Naur vim73.orig/src/testdir/test3.ok vim73/src/testdir/test3.ok
    56652 --- vim73.orig/src/testdir/test3.ok     2012-02-15 21:57:45.045435734 +0000
    56653 +++ vim73/src/testdir/test3.ok  2012-02-15 21:57:46.689479097 +0000
     62425--- vim73.orig/src/testdir/test3.ok     2012-06-03 23:09:52.924006631 +0000
     62426+++ vim73/src/testdir/test3.ok  2012-06-03 23:09:55.716080932 +0000
    5665462427@@ -299,6 +299,13 @@
    5665562428        maybe
     
    5675362526 foo()
    5675462527 {
    56755 @@ -1183,3 +1263,346 @@
     62528@@ -1183,3 +1263,532 @@
    5675662529                foo;
    5675762530 }
     
    5690262675+                       foo(0);
    5690362676+       baz();
     62677+}
     62678+
     62679+
     62680+void func(void)
     62681+{
     62682+       if (condition1
     62683+                       && condition2)
     62684+               action();
     62685+       function(argument1
     62686+                        && argument2);
     62687+
     62688+       if (c1 && (c2 ||
     62689+                               c3))
     62690+               foo;
     62691+       if (c1 &&
     62692+                       (c2 || c3))
     62693+       {
     62694+       }
     62695+
     62696+       if (   c1
     62697+                       && (      c2
     62698+                                         || c3))
     62699+               foo;
     62700+       func( c1
     62701+                 && (     c2
     62702+                                  || c3))
     62703+               foo;
     62704+}
     62705+
     62706+
     62707+void func(void)
     62708+{
     62709+       if (condition1
     62710+                       && condition2)
     62711+               action();
     62712+       function(argument1
     62713+               && argument2);
     62714+
     62715+       if (c1 && (c2 ||
     62716+                               c3))
     62717+               foo;
     62718+       if (c1 &&
     62719+                       (c2 || c3))
     62720+       {
     62721+       }
     62722+
     62723+       if (   c1
     62724+                       && (      c2
     62725+                               || c3))
     62726+               foo;
     62727+       func(   c1
     62728+               && (      c2
     62729+                       || c3))
     62730+               foo;
     62731+}
     62732+
     62733+
     62734+void func(void)
     62735+{
     62736+       if (condition1
     62737+                       && condition2)
     62738+               action();
     62739+       function(argument1
     62740+               && argument2);
     62741+
     62742+       if (c1 && (c2 ||
     62743+                               c3))
     62744+               foo;
     62745+       if (c1 &&
     62746+                       (c2 || c3))
     62747+       {
     62748+       }
     62749+       if (c123456789
     62750+                       && (c22345
     62751+                               || c3))
     62752+               printf("foo\n");
     62753+
     62754+       c = c1 &&
     62755+               (
     62756+                       c2 ||
     62757+                       c3
     62758+               ) && c4;
     62759+}
     62760+
     62761+
     62762+void func(void)
     62763+{
     62764+       if (condition1
     62765+                       && condition2)
     62766+               action();
     62767+       function(argument1
     62768+                        && argument2);
     62769+
     62770+       if (c1 && (c2 ||
     62771+                               c3))
     62772+               foo;
     62773+       if (c1 &&
     62774+                       (c2 || c3))
     62775+       {
     62776+       }
     62777+       if (c123456789
     62778+                       && (c22345
     62779+                               || c3))
     62780+               printf("foo\n");
     62781+
     62782+       if (   c1
     62783+                       && (   c2
     62784+                                  || c3))
     62785+               foo;
     62786+
     62787+       a_long_line(
     62788+               argument,
     62789+               argument);
     62790+       a_short_line(argument,
     62791+                                argument);
     62792+}
     62793+
     62794+
     62795+void func(void)
     62796+{
     62797+       if (condition1
     62798+                       && condition2)
     62799+               action();
     62800+       function(argument1
     62801+                       && argument2);
     62802+
     62803+       if (c1 && (c2 ||
     62804+                         c3))
     62805+               foo;
     62806+       if (c1 &&
     62807+                       (c2 || c3))
     62808+       {
     62809+       }
     62810+       if (c123456789
     62811+                       && (c22345
     62812+                         || c3))
     62813+               printf("foo\n");
     62814+}
     62815+
     62816+
     62817+void func(void)
     62818+{
     62819+       if (condition1
     62820+                       && condition2)
     62821+               action();
     62822+       function(argument1
     62823+                        && argument2);
     62824+
     62825+       if (c1 && (c2 ||
     62826+                               c3))
     62827+               foo;
     62828+       if (c1 &&
     62829+                       (c2 || c3))
     62830+       {
     62831+       }
     62832+       if (c123456789
     62833+                       && (c22345
     62834+                               || c3))
     62835+               printf("foo\n");
     62836+
     62837+       if (   c1
     62838+                       && (      c2
     62839+                               || c3))
     62840+               foo;
     62841+       func(   c1
     62842+                && (      c2
     62843+                        || c3))
     62844+               foo;
     62845+}
     62846+
     62847+
     62848+void func(void)
     62849+{
     62850+       if (condition1
     62851+         && condition2)
     62852+               action();
     62853+       function(argument1
     62854+               && argument2);
     62855+
     62856+       if (c1 && (c2 ||
     62857+                 c3))
     62858+               foo;
     62859+       if (c1 &&
     62860+         (c2 || c3))
     62861+       {
     62862+       }
    5690462863+}
    5690562864+
     
    5710163060+
    5710263061diff -Naur vim73.orig/src/testdir/test31.in vim73/src/testdir/test31.in
    57103 --- vim73.orig/src/testdir/test31.in    2012-02-15 21:57:45.045435734 +0000
    57104 +++ vim73/src/testdir/test31.in 2012-02-15 21:57:46.973486588 +0000
     63062--- vim73.orig/src/testdir/test31.in    2012-06-03 23:09:52.928006738 +0000
     63063+++ vim73/src/testdir/test31.in 2012-06-03 23:09:55.440073587 +0000
    5710563064@@ -63,6 +63,12 @@
    5710663065 :" write "testtext 1"
     
    5711763076 
    5711863077diff -Naur vim73.orig/src/testdir/test31.ok vim73/src/testdir/test31.ok
    57119 --- vim73.orig/src/testdir/test31.ok    2012-02-15 21:57:45.045435734 +0000
    57120 +++ vim73/src/testdir/test31.ok 2012-02-15 21:57:46.973486588 +0000
     63078--- vim73.orig/src/testdir/test31.ok    2012-06-03 23:09:52.928006738 +0000
     63079+++ vim73/src/testdir/test31.ok 2012-06-03 23:09:55.440073587 +0000
    5712163080@@ -9,3 +9,4 @@
    5712263081 testtext 1
     
    5712563084+testtext 2 2 2
    5712663085diff -Naur vim73.orig/src/testdir/test34.ok vim73/src/testdir/test34.ok
    57127 --- vim73.orig/src/testdir/test34.ok    2012-02-15 21:57:45.045435734 +0000
    57128 +++ vim73/src/testdir/test34.ok 2012-02-15 21:57:46.545475298 +0000
     63086--- vim73.orig/src/testdir/test34.ok    2012-06-03 23:09:52.928006738 +0000
     63087+++ vim73/src/testdir/test34.ok 2012-06-03 23:09:54.864058259 +0000
    5712963088@@ -1,5 +1,5 @@
    5713063089 xxx4asdf fail nop ok 9 333
     
    5713563094 2. two
    5713663095diff -Naur vim73.orig/src/testdir/test43.in vim73/src/testdir/test43.in
    57137 --- vim73.orig/src/testdir/test43.in    2012-02-15 21:57:45.045435734 +0000
    57138 +++ vim73/src/testdir/test43.in 2012-02-15 21:57:46.857483528 +0000
     63096--- vim73.orig/src/testdir/test43.in    2012-06-03 23:09:52.928006738 +0000
     63097+++ vim73/src/testdir/test43.in 2012-06-03 23:09:55.288069543 +0000
    5713963098@@ -1,6 +1,7 @@
    5714063099 Tests for regexp with various magic settings.
     
    5716563124+
    5716663125diff -Naur vim73.orig/src/testdir/test43.ok vim73/src/testdir/test43.ok
    57167 --- vim73.orig/src/testdir/test43.ok    2012-02-15 21:57:45.045435734 +0000
    57168 +++ vim73/src/testdir/test43.ok 2012-02-15 21:57:46.737480364 +0000
     63126--- vim73.orig/src/testdir/test43.ok    2012-06-03 23:09:52.932006845 +0000
     63127+++ vim73/src/testdir/test43.ok 2012-06-03 23:09:55.132065390 +0000
    5716963128@@ -6,3 +6,6 @@
    5717063129 6 x aa$ x
     
    5717563134+
    5717663135diff -Naur vim73.orig/src/testdir/test44.in vim73/src/testdir/test44.in
    57177 --- vim73.orig/src/testdir/test44.in    2012-02-15 21:57:45.045435734 +0000
    57178 +++ vim73/src/testdir/test44.in 2012-02-15 21:57:46.277468229 +0000
     63136--- vim73.orig/src/testdir/test44.in    2012-06-03 23:09:52.928006738 +0000
     63137+++ vim73/src/testdir/test44.in 2012-06-03 23:09:54.512048891 +0000
    5717963138@@ -27,6 +27,8 @@
    5718063139 x/\%U12345678
     
    5719963158ẇẘ xẋẍ yÜÿŷẏẙỳỷỹ zźŌşƶẑẕ
    5720063159diff -Naur vim73.orig/src/testdir/test44.ok vim73/src/testdir/test44.ok
    57201 --- vim73.orig/src/testdir/test44.ok    2012-02-15 21:57:45.045435734 +0000
    57202 +++ vim73/src/testdir/test44.ok 2012-02-15 21:57:46.277468229 +0000
     63160--- vim73.orig/src/testdir/test44.ok    2012-06-03 23:09:52.924006631 +0000
     63161+++ vim73/src/testdir/test44.ok 2012-06-03 23:09:54.512048891 +0000
    5720363162@@ -14,6 +14,8 @@
    5720463163 e y
     
    5721663175 ×
    5721763176diff -Naur vim73.orig/src/testdir/test49.vim vim73/src/testdir/test49.vim
    57218 --- vim73.orig/src/testdir/test49.vim   2012-02-15 21:57:45.045435734 +0000
    57219 +++ vim73/src/testdir/test49.vim        2012-02-15 21:57:45.181439321 +0000
     63177--- vim73.orig/src/testdir/test49.vim   2012-06-03 23:09:52.928006738 +0000
     63178+++ vim73/src/testdir/test49.vim        2012-06-03 23:09:53.108011527 +0000
    5722063179@@ -1,6 +1,6 @@
    5722163180 " Vim script language tests
     
    5723663195                endif
    5723763196diff -Naur vim73.orig/src/testdir/test55.in vim73/src/testdir/test55.in
    57238 --- vim73.orig/src/testdir/test55.in    2012-02-15 21:57:45.045435734 +0000
    57239 +++ vim73/src/testdir/test55.in 2012-02-15 21:57:45.345443648 +0000
    57240 @@ -342,7 +342,18 @@
     63197--- vim73.orig/src/testdir/test55.in    2012-06-03 23:09:52.924006631 +0000
     63198+++ vim73/src/testdir/test55.in 2012-06-03 23:09:55.840084233 +0000
     63199@@ -342,7 +342,36 @@
    5724163200 :$put =(d == d)
    5724263201 :$put =(l != deepcopy(l))
     
    5725263211+:$put =(l == lcopy)
    5725363212+:$put =(dict4 == dict4copy)
     63213+:"
     63214+:" Pass the same List to extend()
     63215+:let l = [1, 2, 3, 4, 5]
     63216+:call extend(l, l)
     63217+:$put =string(l)
     63218+:"
     63219+:" Pass the same Dict to extend()
     63220+:let d = { 'a': {'b': 'B'}}
     63221+:call extend(d, d)
     63222+:$put =string(d)
     63223+:"
     63224+:" Pass the same Dict to extend() with "error"
     63225+:try
     63226+:  call extend(d, d, "error")
     63227+:catch
     63228+:  $put =v:exception[:15] . v:exception[-1:-1]
     63229+:endtry
     63230+:$put =string(d)
    5725463231 :endfun
    5725563232+:"
     
    5725863235 :delfunc Test
    5725963236diff -Naur vim73.orig/src/testdir/test55.ok vim73/src/testdir/test55.ok
    57260 --- vim73.orig/src/testdir/test55.ok    2012-02-15 21:57:45.045435734 +0000
    57261 +++ vim73/src/testdir/test55.ok 2012-02-15 21:57:45.345443648 +0000
    57262 @@ -109,3 +109,5 @@
     63237--- vim73.orig/src/testdir/test55.ok    2012-06-03 23:09:52.924006631 +0000
     63238+++ vim73/src/testdir/test55.ok 2012-06-03 23:09:55.840084233 +0000
     63239@@ -109,3 +109,9 @@
    5726363240 1
    5726463241 0
     
    5726663243+1
    5726763244+1
     63245+[1, 2, 3, 4, 5, 1, 2, 3, 4, 5]
     63246+{'a': {'b': 'B'}}
     63247+Vim(call):E737: a
     63248+{'a': {'b': 'B'}}
    5726863249diff -Naur vim73.orig/src/testdir/test57.in vim73/src/testdir/test57.in
    57269 --- vim73.orig/src/testdir/test57.in    2012-02-15 21:57:45.045435734 +0000
    57270 +++ vim73/src/testdir/test57.in 2012-02-15 21:57:45.237440799 +0000
     63250--- vim73.orig/src/testdir/test57.in    2012-06-03 23:09:52.928006738 +0000
     63251+++ vim73/src/testdir/test57.in 2012-06-03 23:09:53.168013125 +0000
    5727163252@@ -53,15 +53,19 @@
    5727263253 t02: numeric
     
    5729163272 b321b
    5729263273diff -Naur vim73.orig/src/testdir/test57.ok vim73/src/testdir/test57.ok
    57293 --- vim73.orig/src/testdir/test57.ok    2012-02-15 21:57:45.045435734 +0000
    57294 +++ vim73/src/testdir/test57.ok 2012-02-15 21:57:45.237440799 +0000
     63274--- vim73.orig/src/testdir/test57.ok    2012-06-03 23:09:52.928006738 +0000
     63275+++ vim73/src/testdir/test57.ok 2012-06-03 23:09:53.168013125 +0000
    5729563276@@ -21,6 +21,10 @@
    5729663277 a
     
    5730563286 b123
    5730663287diff -Naur vim73.orig/src/testdir/test61.in vim73/src/testdir/test61.in
    57307 --- vim73.orig/src/testdir/test61.in    2012-02-15 21:57:45.045435734 +0000
    57308 +++ vim73/src/testdir/test61.in 2012-02-15 21:57:45.137438160 +0000
     63288--- vim73.orig/src/testdir/test61.in    2012-06-03 23:09:52.928006738 +0000
     63289+++ vim73/src/testdir/test61.in 2012-06-03 23:09:53.052010037 +0000
    5730963290@@ -4,6 +4,10 @@
    5731063291 Also tests :earlier and :later.
     
    5731863299 Gx:set ul=100
    5731963300 x:set ul=100
     63301diff -Naur vim73.orig/src/testdir/test62.in vim73/src/testdir/test62.in
     63302--- vim73.orig/src/testdir/test62.in    2012-06-03 23:09:52.928006738 +0000
     63303+++ vim73/src/testdir/test62.in 2012-06-03 23:09:55.584077418 +0000
     63304@@ -49,6 +49,49 @@
     63305 :tabclose
     63306 :call append(line('$'), test_status)
     63307 :"
     63308+:if has('gui') || has('clientserver')
     63309+:" Test for ":tab drop exist-file" to keep current window.
     63310+:sp test1
     63311+:tab drop test1
     63312+:let test_status = 'tab drop 1: fail'
     63313+:if tabpagenr('$') == 1 && winnr('$') == 2 && winnr() == 1
     63314+:    let test_status = 'tab drop 1: pass'
     63315+:endif
     63316+:close
     63317+:call append(line('$'), test_status)
     63318+:"
     63319+:"
     63320+:" Test for ":tab drop new-file" to keep current window of tabpage 1.
     63321+:split
     63322+:tab drop newfile
     63323+:let test_status = 'tab drop 2: fail'
     63324+:if tabpagenr('$') == 2 && tabpagewinnr(1, '$') == 2 && tabpagewinnr(1) == 1
     63325+:    let test_status = 'tab drop 2: pass'
     63326+:endif
     63327+:tabclose
     63328+:q
     63329+:call append(line('$'), test_status)
     63330+:"
     63331+:"
     63332+:" Test for ":tab drop multi-opend-file" to keep current tabpage and window.
     63333+:new test1
     63334+:tabnew
     63335+:new test1
     63336+:tab drop test1
     63337+:let test_status = 'tab drop 3: fail'
     63338+:if tabpagenr() == 2 && tabpagewinnr(2, '$') == 2 && tabpagewinnr(2) == 1
     63339+:    let test_status = 'tab drop 3: pass'
     63340+:endif
     63341+:tabclose
     63342+:q
     63343+:call append(line('$'), test_status)
     63344+:else
     63345+:" :drop not supported
     63346+:call append(line('$'), 'tab drop 1: pass')
     63347+:call append(line('$'), 'tab drop 2: pass')
     63348+:call append(line('$'), 'tab drop 3: pass')
     63349+:endif
     63350+:"
     63351 :"
     63352 :/^Results/,$w! test.out
     63353 :qa!
     63354diff -Naur vim73.orig/src/testdir/test62.ok vim73/src/testdir/test62.ok
     63355--- vim73.orig/src/testdir/test62.ok    2012-06-03 23:09:52.928006738 +0000
     63356+++ vim73/src/testdir/test62.ok 2012-06-03 23:09:55.512075502 +0000
     63357@@ -5,3 +5,6 @@
     63358 this is tab page 4
     63359 gettabvar: pass
     63360 settabvar: pass
     63361+tab drop 1: pass
     63362+tab drop 2: pass
     63363+tab drop 3: pass
    5732063364diff -Naur vim73.orig/src/testdir/test65.in vim73/src/testdir/test65.in
    57321 --- vim73.orig/src/testdir/test65.in    2012-02-15 21:57:45.045435734 +0000
    57322 +++ vim73/src/testdir/test65.in 2012-02-15 21:57:46.669478570 +0000
     63365--- vim73.orig/src/testdir/test65.in    2012-06-03 23:09:52.928006738 +0000
     63366+++ vim73/src/testdir/test65.in 2012-06-03 23:09:55.036062835 +0000
    5732363367@@ -1,4 +1,4 @@
    5732463368-Test for floating point.
     
    5735263396 
    5735363397diff -Naur vim73.orig/src/testdir/test65.ok vim73/src/testdir/test65.ok
    57354 --- vim73.orig/src/testdir/test65.ok    2012-02-15 21:57:45.045435734 +0000
    57355 +++ vim73/src/testdir/test65.ok 2012-02-15 21:57:46.669478570 +0000
     63398--- vim73.orig/src/testdir/test65.ok    2012-06-03 23:09:52.928006738 +0000
     63399+++ vim73/src/testdir/test65.ok 2012-06-03 23:09:55.036062835 +0000
    5735663400@@ -54,3 +54,20 @@
    5735763401 float2nr
     
    5737663420+0
    5737763421diff -Naur vim73.orig/src/testdir/test68.in vim73/src/testdir/test68.in
    57378 --- vim73.orig/src/testdir/test68.in    2012-02-15 21:57:45.045435734 +0000
    57379 +++ vim73/src/testdir/test68.in 2012-02-15 21:57:45.205439954 +0000
     63422--- vim73.orig/src/testdir/test68.in    2012-06-03 23:09:52.928006738 +0000
     63423+++ vim73/src/testdir/test68.in 2012-06-03 23:09:53.136012273 +0000
    5738063424@@ -51,6 +51,17 @@
    5738163425 }
     
    5739763441 ENDTEST
    5739863442diff -Naur vim73.orig/src/testdir/test68.ok vim73/src/testdir/test68.ok
    57399 --- vim73.orig/src/testdir/test68.ok    2012-02-15 21:57:45.045435734 +0000
    57400 +++ vim73/src/testdir/test68.ok 2012-02-15 21:57:45.205439954 +0000
     63443--- vim73.orig/src/testdir/test68.ok    2012-06-03 23:09:52.928006738 +0000
     63444+++ vim73/src/testdir/test68.ok 2012-06-03 23:09:53.136012273 +0000
    5740163445@@ -33,3 +33,6 @@
    5740263446 #a b
     
    5740763451+
    5740863452diff -Naur vim73.orig/src/testdir/test72.in vim73/src/testdir/test72.in
    57409 --- vim73.orig/src/testdir/test72.in    2012-02-15 21:57:45.045435734 +0000
    57410 +++ vim73/src/testdir/test72.in 2012-02-15 21:57:46.729480152 +0000
     63453--- vim73.orig/src/testdir/test72.in    2012-06-03 23:09:52.928006738 +0000
     63454+++ vim73/src/testdir/test72.in 2012-06-03 23:09:55.120065072 +0000
    5741163455@@ -51,6 +51,12 @@
    5741263456 :e Xtestfile
     
    5742363467 :set undofile cm=zip
    5742463468diff -Naur vim73.orig/src/testdir/test72.ok vim73/src/testdir/test72.ok
    57425 --- vim73.orig/src/testdir/test72.ok    2012-02-15 21:57:45.045435734 +0000
    57426 +++ vim73/src/testdir/test72.ok 2012-02-15 21:57:46.729480152 +0000
     63469--- vim73.orig/src/testdir/test72.ok    2012-06-03 23:09:52.924006631 +0000
     63470+++ vim73/src/testdir/test72.ok 2012-06-03 23:09:55.120065072 +0000
    5742763471@@ -7,6 +7,16 @@
    5742863472 eight
     
    5744463488diff -Naur vim73.orig/src/testdir/test74.in vim73/src/testdir/test74.in
    5744563489--- vim73.orig/src/testdir/test74.in    1970-01-01 00:00:00.000000000 +0000
    57446 +++ vim73/src/testdir/test74.in 2012-02-15 21:57:45.245441010 +0000
     63490+++ vim73/src/testdir/test74.in 2012-06-03 23:09:53.184013549 +0000
    5744763491@@ -0,0 +1,36 @@
    5744863492+" Tests for storing global variables in the .viminfo file vim: set ft=vim:
     
    5748463528diff -Naur vim73.orig/src/testdir/test74.ok vim73/src/testdir/test74.ok
    5748563529--- vim73.orig/src/testdir/test74.ok    1970-01-01 00:00:00.000000000 +0000
    57486 +++ vim73/src/testdir/test74.ok 2012-02-15 21:57:45.245441010 +0000
     63530+++ vim73/src/testdir/test74.ok 2012-06-03 23:09:53.184013549 +0000
    5748763531@@ -0,0 +1,5 @@
    5748863532+
     
    5749363537diff -Naur vim73.orig/src/testdir/test75.in vim73/src/testdir/test75.in
    5749463538--- vim73.orig/src/testdir/test75.in    1970-01-01 00:00:00.000000000 +0000
    57495 +++ vim73/src/testdir/test75.in 2012-02-15 21:57:46.373470762 +0000
     63539+++ vim73/src/testdir/test75.in 2012-06-03 23:09:54.628051978 +0000
    5749663540@@ -0,0 +1,22 @@
    5749763541+" Tests for functions.
     
    5751963563diff -Naur vim73.orig/src/testdir/test75.ok vim73/src/testdir/test75.ok
    5752063564--- vim73.orig/src/testdir/test75.ok    1970-01-01 00:00:00.000000000 +0000
    57521 +++ vim73/src/testdir/test75.ok 2012-02-15 21:57:46.373470762 +0000
     63565+++ vim73/src/testdir/test75.ok 2012-06-03 23:09:54.628051978 +0000
    5752263566@@ -0,0 +1,5 @@
    5752363567+is<F4>foo
     
    5752863572diff -Naur vim73.orig/src/testdir/test76.in vim73/src/testdir/test76.in
    5752963573--- vim73.orig/src/testdir/test76.in    1970-01-01 00:00:00.000000000 +0000
    57530 +++ vim73/src/testdir/test76.in 2012-02-15 21:57:45.333443330 +0000
     63574+++ vim73/src/testdir/test76.in 2012-06-03 23:09:53.316017063 +0000
    5753163575@@ -0,0 +1,46 @@
    5753263576+Tests for completefunc/omnifunc. vim: set ft=vim :
     
    5757863622diff -Naur vim73.orig/src/testdir/test76.ok vim73/src/testdir/test76.ok
    5757963623--- vim73.orig/src/testdir/test76.ok    1970-01-01 00:00:00.000000000 +0000
    57580 +++ vim73/src/testdir/test76.ok 2012-02-15 21:57:45.333443330 +0000
     63624+++ vim73/src/testdir/test76.ok 2012-06-03 23:09:53.316017063 +0000
    5758163625@@ -0,0 +1,4 @@
    5758263626++++
     
    5758663630diff -Naur vim73.orig/src/testdir/test77.in vim73/src/testdir/test77.in
    5758763631--- vim73.orig/src/testdir/test77.in    1970-01-01 00:00:00.000000000 +0000
    57588 +++ vim73/src/testdir/test77.in 2012-02-15 21:57:45.725453670 +0000
    57589 @@ -0,0 +1,27 @@
     63632+++ vim73/src/testdir/test77.in 2012-06-03 23:09:55.796083061 +0000
     63633@@ -0,0 +1,29 @@
    5759063634+Inserts 2 million lines with consecutive integers starting from 1
    5759163635+(essentially, the output of GNU's seq 1 2000000), writes them to Xtest
     
    5761163655+ggdd
    5761263656+:w! Xtest
    57613 +:!cksum Xtest > test.out
     63657+:r !cksum Xtest
     63658+:s/\s/ /g
     63659+:.w! test.out
    5761463660+:qa!
    5761563661+ENDTEST
     
    5761763663diff -Naur vim73.orig/src/testdir/test77.ok vim73/src/testdir/test77.ok
    5761863664--- vim73.orig/src/testdir/test77.ok    1970-01-01 00:00:00.000000000 +0000
    57619 +++ vim73/src/testdir/test77.ok 2012-02-15 21:57:45.725453670 +0000
     63665+++ vim73/src/testdir/test77.ok 2012-06-03 23:09:53.804030049 +0000
    5762063666@@ -0,0 +1 @@
    5762163667+3678979763 14888896 Xtest
    5762263668diff -Naur vim73.orig/src/testdir/test78.in vim73/src/testdir/test78.in
    5762363669--- vim73.orig/src/testdir/test78.in    1970-01-01 00:00:00.000000000 +0000
    57624 +++ vim73/src/testdir/test78.in 2012-02-15 21:57:46.233467068 +0000
     63670+++ vim73/src/testdir/test78.in 2012-06-03 23:09:54.456047401 +0000
    5762563671@@ -0,0 +1,46 @@
    5762663672+Inserts 10000 lines with text to fill the swap file with two levels of pointer
     
    5767263718diff -Naur vim73.orig/src/testdir/test78.ok vim73/src/testdir/test78.ok
    5767363719--- vim73.orig/src/testdir/test78.ok    1970-01-01 00:00:00.000000000 +0000
    57674 +++ vim73/src/testdir/test78.ok 2012-02-15 21:57:46.113463904 +0000
     63720+++ vim73/src/testdir/test78.ok 2012-06-03 23:09:54.288042929 +0000
    5767563721@@ -0,0 +1,3 @@
    5767663722+recovery start
     
    5767963725diff -Naur vim73.orig/src/testdir/test79.in vim73/src/testdir/test79.in
    5768063726--- vim73.orig/src/testdir/test79.in    1970-01-01 00:00:00.000000000 +0000
    57681 +++ vim73/src/testdir/test79.in 2012-02-15 21:57:46.153464960 +0000
     63727+++ vim73/src/testdir/test79.in 2012-06-03 23:09:54.348044528 +0000
    5768263728@@ -0,0 +1,213 @@
    5768363729+Test for *sub-replace-special* and *sub-replace-expression* on :substitute.
     
    5790763953diff -Naur vim73.orig/src/testdir/test79.ok vim73/src/testdir/test79.ok
    5790863954--- vim73.orig/src/testdir/test79.ok    1970-01-01 00:00:00.000000000 +0000
    57909 +++ vim73/src/testdir/test79.ok 2012-02-15 21:57:46.153464960 +0000
     63955+++ vim73/src/testdir/test79.ok 2012-06-03 23:09:54.348044528 +0000
    5791063956@@ -0,0 +1,118 @@
    5791163957+Results of test71:
     
    5803164077diff -Naur vim73.orig/src/testdir/test80.in vim73/src/testdir/test80.in
    5803264078--- vim73.orig/src/testdir/test80.in    1970-01-01 00:00:00.000000000 +0000
    58033 +++ vim73/src/testdir/test80.in 2012-02-15 21:57:46.153464960 +0000
     64079+++ vim73/src/testdir/test80.in 2012-06-03 23:09:54.348044528 +0000
    5803464080@@ -0,0 +1,150 @@
    5803564081+Test for *sub-replace-special* and *sub-replace-expression* on substitue().
     
    5819664242diff -Naur vim73.orig/src/testdir/test80.ok vim73/src/testdir/test80.ok
    5819764243--- vim73.orig/src/testdir/test80.ok    1970-01-01 00:00:00.000000000 +0000
    58198 +++ vim73/src/testdir/test80.ok 2012-02-15 21:57:46.153464960 +0000
     64244+++ vim73/src/testdir/test80.ok 2012-06-03 23:09:54.348044528 +0000
    5819964245@@ -0,0 +1,101 @@
    5820064246+Results of test72:
     
    5831964365diff -Naur vim73.orig/src/testdir/test81.in vim73/src/testdir/test81.in
    5832064366--- vim73.orig/src/testdir/test81.in    1970-01-01 00:00:00.000000000 +0000
    58321 +++ vim73/src/testdir/test81.in 2012-02-15 21:57:46.233467068 +0000
     64367+++ vim73/src/testdir/test81.in 2012-06-03 23:09:54.456047401 +0000
    5832264368@@ -0,0 +1,22 @@
    5832364369+Test for t movement command and 'cpo-;' setting
     
    5834564391diff -Naur vim73.orig/src/testdir/test81.ok vim73/src/testdir/test81.ok
    5834664392--- vim73.orig/src/testdir/test81.ok    1970-01-01 00:00:00.000000000 +0000
    58347 +++ vim73/src/testdir/test81.ok 2012-02-15 21:57:46.249467491 +0000
     64393+++ vim73/src/testdir/test81.ok 2012-06-03 23:09:54.476047933 +0000
    5834864394@@ -0,0 +1,6 @@
    5834964395+aaa two
     
    5835564401diff -Naur vim73.orig/src/testdir/test82.in vim73/src/testdir/test82.in
    5835664402--- vim73.orig/src/testdir/test82.in    1970-01-01 00:00:00.000000000 +0000
    58357 +++ vim73/src/testdir/test82.in 2012-02-15 21:57:46.249467491 +0000
     64403+++ vim73/src/testdir/test82.in 2012-06-03 23:09:54.480048039 +0000
    5835864404@@ -0,0 +1,93 @@
    5835964405+Tests for case-insensitive UTF-8 comparisons (utf_strnicmp() in mbyte.c)
     
    5845264498diff -Naur vim73.orig/src/testdir/test82.ok vim73/src/testdir/test82.ok
    5845364499--- vim73.orig/src/testdir/test82.ok    1970-01-01 00:00:00.000000000 +0000
    58454 +++ vim73/src/testdir/test82.ok 2012-02-15 21:57:46.253467597 +0000
     64500+++ vim73/src/testdir/test82.ok 2012-06-03 23:09:54.480048039 +0000
    5845564501@@ -0,0 +1,2 @@
    5845664502+3732 checks passed
     
    5845864504diff -Naur vim73.orig/src/testdir/test83-tags2 vim73/src/testdir/test83-tags2
    5845964505--- vim73.orig/src/testdir/test83-tags2 1970-01-01 00:00:00.000000000 +0000
    58460 +++ vim73/src/testdir/test83-tags2      2012-02-15 21:57:46.537475088 +0000
     64506+++ vim73/src/testdir/test83-tags2      2012-06-03 23:09:54.856058047 +0000
    5846164507@@ -0,0 +1,2 @@
    5846264508+!_TAG_FILE_ENCODING    cp932   //
    58463 +‚`‚a‚b      Xtags2.txt      /‚`‚a‚b
     64509+‚`‚a‚b Xtags2.txt      /‚`‚a‚b
    5846464510diff -Naur vim73.orig/src/testdir/test83-tags3 vim73/src/testdir/test83-tags3
    5846564511--- vim73.orig/src/testdir/test83-tags3 1970-01-01 00:00:00.000000000 +0000
    58466 +++ vim73/src/testdir/test83-tags3      2012-02-15 21:57:46.537475088 +0000
     64512+++ vim73/src/testdir/test83-tags3      2012-06-03 23:09:54.856058047 +0000
    5846764513@@ -0,0 +1,102 @@
    5846864514+!_TAG_FILE_SORTED      1       //
    5846964515+!_TAG_FILE_ENCODING    cp932   //
    58470 +abc1   Xtags3.txt      /‚`‚a‚b
    58471 +abc2   Xtags3.txt      /‚`‚a‚b
    58472 +abc3   Xtags3.txt      /‚`‚a‚b
    58473 +abc4   Xtags3.txt      /‚`‚a‚b
    58474 +abc5   Xtags3.txt      /‚`‚a‚b
    58475 +abc6   Xtags3.txt      /‚`‚a‚b
    58476 +abc7   Xtags3.txt      /‚`‚a‚b
    58477 +abc8   Xtags3.txt      /‚`‚a‚b
    58478 +abc9   Xtags3.txt      /‚`‚a‚b
    58479 +abc10  Xtags3.txt      /‚`‚a‚b
    58480 +abc11  Xtags3.txt      /‚`‚a‚b
    58481 +abc12  Xtags3.txt      /‚`‚a‚b
    58482 +abc13  Xtags3.txt      /‚`‚a‚b
    58483 +abc14  Xtags3.txt      /‚`‚a‚b
    58484 +abc15  Xtags3.txt      /‚`‚a‚b
    58485 +abc16  Xtags3.txt      /‚`‚a‚b
    58486 +abc17  Xtags3.txt      /‚`‚a‚b
    58487 +abc18  Xtags3.txt      /‚`‚a‚b
    58488 +abc19  Xtags3.txt      /‚`‚a‚b
    58489 +abc20  Xtags3.txt      /‚`‚a‚b
    58490 +abc21  Xtags3.txt      /‚`‚a‚b
    58491 +abc22  Xtags3.txt      /‚`‚a‚b
    58492 +abc23  Xtags3.txt      /‚`‚a‚b
    58493 +abc24  Xtags3.txt      /‚`‚a‚b
    58494 +abc25  Xtags3.txt      /‚`‚a‚b
    58495 +abc26  Xtags3.txt      /‚`‚a‚b
    58496 +abc27  Xtags3.txt      /‚`‚a‚b
    58497 +abc28  Xtags3.txt      /‚`‚a‚b
    58498 +abc29  Xtags3.txt      /‚`‚a‚b
    58499 +abc30  Xtags3.txt      /‚`‚a‚b
    58500 +abc31  Xtags3.txt      /‚`‚a‚b
    58501 +abc32  Xtags3.txt      /‚`‚a‚b
    58502 +abc33  Xtags3.txt      /‚`‚a‚b
    58503 +abc34  Xtags3.txt      /‚`‚a‚b
    58504 +abc35  Xtags3.txt      /‚`‚a‚b
    58505 +abc36  Xtags3.txt      /‚`‚a‚b
    58506 +abc37  Xtags3.txt      /‚`‚a‚b
    58507 +abc38  Xtags3.txt      /‚`‚a‚b
    58508 +abc39  Xtags3.txt      /‚`‚a‚b
    58509 +abc40  Xtags3.txt      /‚`‚a‚b
    58510 +abc41  Xtags3.txt      /‚`‚a‚b
    58511 +abc42  Xtags3.txt      /‚`‚a‚b
    58512 +abc43  Xtags3.txt      /‚`‚a‚b
    58513 +abc44  Xtags3.txt      /‚`‚a‚b
    58514 +abc45  Xtags3.txt      /‚`‚a‚b
    58515 +abc46  Xtags3.txt      /‚`‚a‚b
    58516 +abc47  Xtags3.txt      /‚`‚a‚b
    58517 +abc48  Xtags3.txt      /‚`‚a‚b
    58518 +abc49  Xtags3.txt      /‚`‚a‚b
    58519 +abc50  Xtags3.txt      /‚`‚a‚b
    58520 +abc51  Xtags3.txt      /‚`‚a‚b
    58521 +abc52  Xtags3.txt      /‚`‚a‚b
    58522 +abc53  Xtags3.txt      /‚`‚a‚b
    58523 +abc54  Xtags3.txt      /‚`‚a‚b
    58524 +abc55  Xtags3.txt      /‚`‚a‚b
    58525 +abc56  Xtags3.txt      /‚`‚a‚b
    58526 +abc57  Xtags3.txt      /‚`‚a‚b
    58527 +abc58  Xtags3.txt      /‚`‚a‚b
    58528 +abc59  Xtags3.txt      /‚`‚a‚b
    58529 +abc60  Xtags3.txt      /‚`‚a‚b
    58530 +abc61  Xtags3.txt      /‚`‚a‚b
    58531 +abc62  Xtags3.txt      /‚`‚a‚b
    58532 +abc63  Xtags3.txt      /‚`‚a‚b
    58533 +abc64  Xtags3.txt      /‚`‚a‚b
    58534 +abc65  Xtags3.txt      /‚`‚a‚b
    58535 +abc66  Xtags3.txt      /‚`‚a‚b
    58536 +abc67  Xtags3.txt      /‚`‚a‚b
    58537 +abc68  Xtags3.txt      /‚`‚a‚b
    58538 +abc69  Xtags3.txt      /‚`‚a‚b
    58539 +abc70  Xtags3.txt      /‚`‚a‚b
    58540 +abc71  Xtags3.txt      /‚`‚a‚b
    58541 +abc72  Xtags3.txt      /‚`‚a‚b
    58542 +abc73  Xtags3.txt      /‚`‚a‚b
    58543 +abc74  Xtags3.txt      /‚`‚a‚b
    58544 +abc75  Xtags3.txt      /‚`‚a‚b
    58545 +abc76  Xtags3.txt      /‚`‚a‚b
    58546 +abc77  Xtags3.txt      /‚`‚a‚b
    58547 +abc78  Xtags3.txt      /‚`‚a‚b
    58548 +abc79  Xtags3.txt      /‚`‚a‚b
    58549 +abc80  Xtags3.txt      /‚`‚a‚b
    58550 +abc81  Xtags3.txt      /‚`‚a‚b
    58551 +abc82  Xtags3.txt      /‚`‚a‚b
    58552 +abc83  Xtags3.txt      /‚`‚a‚b
    58553 +abc84  Xtags3.txt      /‚`‚a‚b
    58554 +abc85  Xtags3.txt      /‚`‚a‚b
    58555 +abc86  Xtags3.txt      /‚`‚a‚b
    58556 +abc87  Xtags3.txt      /‚`‚a‚b
    58557 +abc88  Xtags3.txt      /‚`‚a‚b
    58558 +abc89  Xtags3.txt      /‚`‚a‚b
    58559 +abc90  Xtags3.txt      /‚`‚a‚b
    58560 +abc91  Xtags3.txt      /‚`‚a‚b
    58561 +abc92  Xtags3.txt      /‚`‚a‚b
    58562 +abc93  Xtags3.txt      /‚`‚a‚b
    58563 +abc94  Xtags3.txt      /‚`‚a‚b
    58564 +abc95  Xtags3.txt      /‚`‚a‚b
    58565 +abc96  Xtags3.txt      /‚`‚a‚b
    58566 +abc97  Xtags3.txt      /‚`‚a‚b
    58567 +abc98  Xtags3.txt      /‚`‚a‚b
    58568 +abc99  Xtags3.txt      /‚`‚a‚b
    58569 +abc100 Xtags3.txt      /‚`‚a‚b
     64516+abc1   Xtags3.txt      /‚`‚a‚b
     64517+abc2   Xtags3.txt      /‚`‚a‚b
     64518+abc3   Xtags3.txt      /‚`‚a‚b
     64519+abc4   Xtags3.txt      /‚`‚a‚b
     64520+abc5   Xtags3.txt      /‚`‚a‚b
     64521+abc6   Xtags3.txt      /‚`‚a‚b
     64522+abc7   Xtags3.txt      /‚`‚a‚b
     64523+abc8   Xtags3.txt      /‚`‚a‚b
     64524+abc9   Xtags3.txt      /‚`‚a‚b
     64525+abc10  Xtags3.txt      /‚`‚a‚b
     64526+abc11  Xtags3.txt      /‚`‚a‚b
     64527+abc12  Xtags3.txt      /‚`‚a‚b
     64528+abc13  Xtags3.txt      /‚`‚a‚b
     64529+abc14  Xtags3.txt      /‚`‚a‚b
     64530+abc15  Xtags3.txt      /‚`‚a‚b
     64531+abc16  Xtags3.txt      /‚`‚a‚b
     64532+abc17  Xtags3.txt      /‚`‚a‚b
     64533+abc18  Xtags3.txt      /‚`‚a‚b
     64534+abc19  Xtags3.txt      /‚`‚a‚b
     64535+abc20  Xtags3.txt      /‚`‚a‚b
     64536+abc21  Xtags3.txt      /‚`‚a‚b
     64537+abc22  Xtags3.txt      /‚`‚a‚b
     64538+abc23  Xtags3.txt      /‚`‚a‚b
     64539+abc24  Xtags3.txt      /‚`‚a‚b
     64540+abc25  Xtags3.txt      /‚`‚a‚b
     64541+abc26  Xtags3.txt      /‚`‚a‚b
     64542+abc27  Xtags3.txt      /‚`‚a‚b
     64543+abc28  Xtags3.txt      /‚`‚a‚b
     64544+abc29  Xtags3.txt      /‚`‚a‚b
     64545+abc30  Xtags3.txt      /‚`‚a‚b
     64546+abc31  Xtags3.txt      /‚`‚a‚b
     64547+abc32  Xtags3.txt      /‚`‚a‚b
     64548+abc33  Xtags3.txt      /‚`‚a‚b
     64549+abc34  Xtags3.txt      /‚`‚a‚b
     64550+abc35  Xtags3.txt      /‚`‚a‚b
     64551+abc36  Xtags3.txt      /‚`‚a‚b
     64552+abc37  Xtags3.txt      /‚`‚a‚b
     64553+abc38  Xtags3.txt      /‚`‚a‚b
     64554+abc39  Xtags3.txt      /‚`‚a‚b
     64555+abc40  Xtags3.txt      /‚`‚a‚b
     64556+abc41  Xtags3.txt      /‚`‚a‚b
     64557+abc42  Xtags3.txt      /‚`‚a‚b
     64558+abc43  Xtags3.txt      /‚`‚a‚b
     64559+abc44  Xtags3.txt      /‚`‚a‚b
     64560+abc45  Xtags3.txt      /‚`‚a‚b
     64561+abc46  Xtags3.txt      /‚`‚a‚b
     64562+abc47  Xtags3.txt      /‚`‚a‚b
     64563+abc48  Xtags3.txt      /‚`‚a‚b
     64564+abc49  Xtags3.txt      /‚`‚a‚b
     64565+abc50  Xtags3.txt      /‚`‚a‚b
     64566+abc51  Xtags3.txt      /‚`‚a‚b
     64567+abc52  Xtags3.txt      /‚`‚a‚b
     64568+abc53  Xtags3.txt      /‚`‚a‚b
     64569+abc54  Xtags3.txt      /‚`‚a‚b
     64570+abc55  Xtags3.txt      /‚`‚a‚b
     64571+abc56  Xtags3.txt      /‚`‚a‚b
     64572+abc57  Xtags3.txt      /‚`‚a‚b
     64573+abc58  Xtags3.txt      /‚`‚a‚b
     64574+abc59  Xtags3.txt      /‚`‚a‚b
     64575+abc60  Xtags3.txt      /‚`‚a‚b
     64576+abc61  Xtags3.txt      /‚`‚a‚b
     64577+abc62  Xtags3.txt      /‚`‚a‚b
     64578+abc63  Xtags3.txt      /‚`‚a‚b
     64579+abc64  Xtags3.txt      /‚`‚a‚b
     64580+abc65  Xtags3.txt      /‚`‚a‚b
     64581+abc66  Xtags3.txt      /‚`‚a‚b
     64582+abc67  Xtags3.txt      /‚`‚a‚b
     64583+abc68  Xtags3.txt      /‚`‚a‚b
     64584+abc69  Xtags3.txt      /‚`‚a‚b
     64585+abc70  Xtags3.txt      /‚`‚a‚b
     64586+abc71  Xtags3.txt      /‚`‚a‚b
     64587+abc72  Xtags3.txt      /‚`‚a‚b
     64588+abc73  Xtags3.txt      /‚`‚a‚b
     64589+abc74  Xtags3.txt      /‚`‚a‚b
     64590+abc75  Xtags3.txt      /‚`‚a‚b
     64591+abc76  Xtags3.txt      /‚`‚a‚b
     64592+abc77  Xtags3.txt      /‚`‚a‚b
     64593+abc78  Xtags3.txt      /‚`‚a‚b
     64594+abc79  Xtags3.txt      /‚`‚a‚b
     64595+abc80  Xtags3.txt      /‚`‚a‚b
     64596+abc81  Xtags3.txt      /‚`‚a‚b
     64597+abc82  Xtags3.txt      /‚`‚a‚b
     64598+abc83  Xtags3.txt      /‚`‚a‚b
     64599+abc84  Xtags3.txt      /‚`‚a‚b
     64600+abc85  Xtags3.txt      /‚`‚a‚b
     64601+abc86  Xtags3.txt      /‚`‚a‚b
     64602+abc87  Xtags3.txt      /‚`‚a‚b
     64603+abc88  Xtags3.txt      /‚`‚a‚b
     64604+abc89  Xtags3.txt      /‚`‚a‚b
     64605+abc90  Xtags3.txt      /‚`‚a‚b
     64606+abc91  Xtags3.txt      /‚`‚a‚b
     64607+abc92  Xtags3.txt      /‚`‚a‚b
     64608+abc93  Xtags3.txt      /‚`‚a‚b
     64609+abc94  Xtags3.txt      /‚`‚a‚b
     64610+abc95  Xtags3.txt      /‚`‚a‚b
     64611+abc96  Xtags3.txt      /‚`‚a‚b
     64612+abc97  Xtags3.txt      /‚`‚a‚b
     64613+abc98  Xtags3.txt      /‚`‚a‚b
     64614+abc99  Xtags3.txt      /‚`‚a‚b
     64615+abc100 Xtags3.txt      /‚`‚a‚b
    5857064616diff -Naur vim73.orig/src/testdir/test83.in vim73/src/testdir/test83.in
    5857164617--- vim73.orig/src/testdir/test83.in    1970-01-01 00:00:00.000000000 +0000
    58572 +++ vim73/src/testdir/test83.in 2012-02-15 21:57:46.709479625 +0000
     64618+++ vim73/src/testdir/test83.in 2012-06-03 23:09:55.088064220 +0000
    5857364619@@ -0,0 +1,76 @@
    5857464620+Tests for tag search with !_TAG_FILE_ENCODING.
     
    5860964655+:set tags=test83-tags2
    5861064656+:let v:errmsg = ''
    58611 +:tag /.
    58612 +:if v:errmsg =~ 'E426:' || getline('.') != ''
     64657+:tag /.
     64658+:if v:errmsg =~ 'E426:' || getline('.') != ''
    5861364659+: close
    5861464660+: put ='case2: failed'
     
    5862364669+:let v:errmsg = ''
    5862464670+:tag abc50
    58625 +:if v:errmsg =~ 'E426:' || getline('.') != ''
     64671+:if v:errmsg =~ 'E426:' || getline('.') != ''
    5862664672+: close
    5862764673+: put ='case3: failed'
     
    5863964685+
    5864064686+text for tags2
    58641 +
     64687+
    5864264688+
    5864364689+text for tags3
    58644 +
     64690+
    5864564691+
    5864664692+tags1
     
    5865064696diff -Naur vim73.orig/src/testdir/test83.ok vim73/src/testdir/test83.ok
    5865164697--- vim73.orig/src/testdir/test83.ok    1970-01-01 00:00:00.000000000 +0000
    58652 +++ vim73/src/testdir/test83.ok 2012-02-15 21:57:46.537475088 +0000
     64698+++ vim73/src/testdir/test83.ok 2012-06-03 23:09:54.856058047 +0000
    5865364699@@ -0,0 +1,4 @@
    5865464700+Results of test83
     
    5865664702+case2: ok
    5865764703+case3: ok
     64704diff -Naur vim73.orig/src/testdir/test84.in vim73/src/testdir/test84.in
     64705--- vim73.orig/src/testdir/test84.in    1970-01-01 00:00:00.000000000 +0000
     64706+++ vim73/src/testdir/test84.in 2012-06-03 23:09:55.680079974 +0000
     64707@@ -0,0 +1,35 @@
     64708+Tests for curswant not changing when setting an option
     64709+
     64710+STARTTEST
     64711+:so small.vim
     64712+:/^start target options$/+1,/^end target options$/-1 yank
     64713+:let target_option_names = split(@0)
     64714+:function TestCurswant(option_name)
     64715+:  normal! ggf8j
     64716+:  let curswant_before = winsaveview().curswant
     64717+:  execute 'let' '&'.a:option_name '=' '&'.a:option_name
     64718+:  let curswant_after = winsaveview().curswant
     64719+:  return [a:option_name, curswant_before, curswant_after]
     64720+:endfunction
     64721+:
     64722+:new
     64723+:put =['1234567890', '12345']
     64724+:1 delete _
     64725+:let result = []
     64726+:for option_name in target_option_names
     64727+:  call add(result, TestCurswant(option_name))
     64728+:endfor
     64729+:
     64730+:new
     64731+:put =map(copy(result), 'join(v:val, '' '')')
     64732+:1 delete _
     64733+:write test.out
     64734+:
     64735+:qall!
     64736+ENDTEST
     64737+
     64738+start target options
     64739+       tabstop
     64740+       timeoutlen
     64741+       ttimeoutlen
     64742+end target options
     64743diff -Naur vim73.orig/src/testdir/test84.ok vim73/src/testdir/test84.ok
     64744--- vim73.orig/src/testdir/test84.ok    1970-01-01 00:00:00.000000000 +0000
     64745+++ vim73/src/testdir/test84.ok 2012-06-03 23:09:55.680079974 +0000
     64746@@ -0,0 +1,3 @@
     64747+tabstop 7 4
     64748+timeoutlen 7 7
     64749+ttimeoutlen 7 7
     64750diff -Naur vim73.orig/src/testdir/test85.in vim73/src/testdir/test85.in
     64751--- vim73.orig/src/testdir/test85.in    1970-01-01 00:00:00.000000000 +0000
     64752+++ vim73/src/testdir/test85.in 2012-06-03 23:09:55.708080720 +0000
     64753@@ -0,0 +1,42 @@
     64754+Test for Lua interface and luaeval() function
     64755+
     64756+STARTTEST
     64757+:so small.vim
     64758+:so lua.vim
     64759+:set nocompatible viminfo+=nviminfo
     64760+:lua l = vim.list():add"item0":add"dictionary with list OK":add"item2"
     64761+:lua h = vim.dict(); h.list = l
     64762+:call garbagecollect()
     64763+/^1
     64764+:" change buffer contents
     64765+:lua curbuf = vim.buffer()
     64766+:lua curline = vim.eval"line('.')"
     64767+:lua curbuf[curline] = "1 changed line 1"
     64768+:" scalar test
     64769+:let tmp_string = luaeval('"string"')
     64770+:let tmp_1000 = luaeval('1000')
     64771+:if printf("%s%.0f", tmp_string, tmp_1000) == "string1000"
     64772+:let scalar_res = "OK"
     64773+:else
     64774+:let scalar_res = "FAILED"
     64775+:endif
     64776+:call append(search("^1"), "scalar test " . scalar_res)
     64777+:" dictionary containing a list
     64778+:let tmp = luaeval("h").list[1]
     64779+:/^2/put =tmp
     64780+:" circular list (at the same time test lists containing lists)
     64781+:lua l[2] = l
     64782+:let l2 = luaeval("h").list
     64783+:if l2[2] == l2
     64784+:let res = "OK"
     64785+:else
     64786+:let res = "FAILED"
     64787+:endif
     64788+:call setline(search("^3"), "circular test " . res)
     64789+:?^1?,$w! test.out
     64790+:qa!
     64791+ENDTEST
     64792+
     64793+1 line 1
     64794+2 line 2
     64795+3 line 3
     64796diff -Naur vim73.orig/src/testdir/test85.ok vim73/src/testdir/test85.ok
     64797--- vim73.orig/src/testdir/test85.ok    1970-01-01 00:00:00.000000000 +0000
     64798+++ vim73/src/testdir/test85.ok 2012-06-03 23:09:55.708080720 +0000
     64799@@ -0,0 +1,5 @@
     64800+1 changed line 1
     64801+scalar test OK
     64802+2 line 2
     64803+dictionary with list OK
     64804+circular test OK
    5865864805diff -Naur vim73.orig/src/typemap vim73/src/typemap
    58659 --- vim73.orig/src/typemap      2012-02-15 21:57:45.041435628 +0000
    58660 +++ vim73/src/typemap   2012-02-15 21:57:46.949485954 +0000
     64806--- vim73.orig/src/typemap      2012-06-03 23:09:52.924006631 +0000
     64807+++ vim73/src/typemap   2012-06-03 23:09:55.408072735 +0000
    5866164808@@ -6,7 +6,7 @@
    5866264809 T_VIOBJNOMUNGE
     
    5866964816        }
    5867064817diff -Naur vim73.orig/src/ui.c vim73/src/ui.c
    58671 --- vim73.orig/src/ui.c 2012-02-15 21:57:45.041435628 +0000
    58672 +++ vim73/src/ui.c      2012-02-15 21:57:46.953486059 +0000
     64818--- vim73.orig/src/ui.c 2012-06-03 23:09:52.920006524 +0000
     64819+++ vim73/src/ui.c      2012-06-03 23:09:55.412072842 +0000
    5867364820@@ -58,7 +58,7 @@
    5867464821 #endif
     
    5891665063     return OK;
    5891765064diff -Naur vim73.orig/src/undo.c vim73/src/undo.c
    58918 --- vim73.orig/src/undo.c       2012-02-15 21:57:45.061436156 +0000
    58919 +++ vim73/src/undo.c    2012-02-15 21:57:46.637477726 +0000
     65065--- vim73.orig/src/undo.c       2012-06-03 23:09:52.952007375 +0000
     65066+++ vim73/src/undo.c    2012-06-03 23:09:55.916086255 +0000
    5892065067@@ -81,10 +81,6 @@
    5892165068 #define UH_MAGIC 0x18dade      /* value for uh_magic when in use */
     
    5894765094                if (len < UF_START_MAGIC_LEN
    5894865095                      || memcmp(mbuf, UF_START_MAGIC, UF_START_MAGIC_LEN) != 0)
    58949 @@ -1861,6 +1857,7 @@
     65096@@ -1539,6 +1535,7 @@
     65097        /* For systems that support ACL: get the ACL from the original file. */
     65098        acl = mch_get_acl(buf->b_ffname);
     65099        mch_set_acl(file_name, acl);
     65100+       mch_free_acl(acl);
     65101     }
     65102 #endif
     65103 
     65104@@ -1861,6 +1858,7 @@
    5895065105     curbuf->b_u_seq_cur = seq_cur;
    5895165106     curbuf->b_u_time_cur = seq_time;
     
    5895565110     curbuf->b_u_synced = TRUE;
    5895665111     vim_free(uhp_table);
    58957 @@ -2794,7 +2791,7 @@
     65112@@ -2794,7 +2792,7 @@
    5895865113                                                                uhp->uh_time);
    5895965114            if (uhp->uh_save_nr > 0)
     
    5896465119                vim_snprintf_add((char *)IObuff, IOSIZE,
    5896565120                                                   "  %3ld", uhp->uh_save_nr);
    58966 @@ -2849,7 +2846,7 @@
     65121@@ -2849,7 +2847,7 @@
    5896765122        sort_strings((char_u **)ga.ga_data, ga.ga_len);
    5896865123 
     
    5897365128        for (i = 0; i < ga.ga_len && !got_int; ++i)
    5897465129        {
    58975 @@ -2879,7 +2876,15 @@
     65130@@ -2879,7 +2877,15 @@
    5897665131     if (time(NULL) - tt >= 100)
    5897765132     {
     
    5899065145     else
    5899165146 #endif
    58992 @@ -3299,7 +3304,7 @@
     65147@@ -3299,7 +3305,7 @@
    5899365148 #ifdef FEAT_QUICKFIX
    5899465149            !bt_dontwrite(buf) &&
     
    5899965154 
    5900065155     int
    59001 @@ -3309,7 +3314,7 @@
     65156@@ -3309,7 +3315,7 @@
    5900265157 #ifdef FEAT_QUICKFIX
    5900365158        !bt_dontwrite(curbuf) &&
     
    5900965164 #if defined(FEAT_EVAL) || defined(PROTO)
    5901065165diff -Naur vim73.orig/src/version.c vim73/src/version.c
    59011 --- vim73.orig/src/version.c    2012-02-15 21:57:45.049435840 +0000
    59012 +++ vim73/src/version.c 2012-02-15 21:57:46.973486588 +0000
     65166--- vim73.orig/src/version.c    2012-06-03 23:09:52.932006845 +0000
     65167+++ vim73/src/version.c 2012-06-03 23:09:55.964087533 +0000
    5901365168@@ -379,6 +379,11 @@
    5901465169 # else
     
    5903565190        "+path_extra",
    5903665191 #else
    59037 @@ -715,6 +715,894 @@
     65192@@ -715,127 +715,1200 @@
    5903865193 static int included_patches[] =
    5903965194 {   /* Add new patch number below this line */
    5904065195 /**/
    59041 +    444,
    59042 +/**/
    59043 +    443,
    59044 +/**/
    59045 +    442,
    59046 +/**/
    59047 +    441,
    59048 +/**/
    59049 +    440,
    59050 +/**/
    59051 +    439,
    59052 +/**/
    59053 +    438,
    59054 +/**/
    59055 +    437,
    59056 +/**/
    59057 +    436,
    59058 +/**/
    59059 +    435,
    59060 +/**/
    59061 +    434,
    59062 +/**/
    59063 +    433,
    59064 +/**/
    59065 +    432,
    59066 +/**/
    59067 +    431,
    59068 +/**/
    59069 +    430,
    59070 +/**/
    59071 +    429,
    59072 +/**/
    59073 +    428,
    59074 +/**/
    59075 +    427,
    59076 +/**/
    59077 +    426,
    59078 +/**/
    59079 +    425,
    59080 +/**/
    59081 +    424,
    59082 +/**/
    59083 +    423,
    59084 +/**/
    59085 +    422,
    59086 +/**/
    59087 +    421,
    59088 +/**/
    59089 +    420,
    59090 +/**/
    59091 +    419,
    59092 +/**/
    59093 +    418,
    59094 +/**/
    59095 +    417,
    59096 +/**/
    59097 +    416,
    59098 +/**/
    59099 +    415,
    59100 +/**/
    59101 +    414,
    59102 +/**/
    59103 +    413,
    59104 +/**/
    59105 +    412,
    59106 +/**/
    59107 +    411,
    59108 +/**/
    59109 +    410,
    59110 +/**/
    59111 +    409,
    59112 +/**/
    59113 +    408,
    59114 +/**/
    59115 +    407,
    59116 +/**/
    59117 +    406,
    59118 +/**/
    59119 +    405,
    59120 +/**/
    59121 +    404,
    59122 +/**/
    59123 +    403,
    59124 +/**/
    59125 +    402,
    59126 +/**/
    59127 +    401,
    59128 +/**/
    59129 +    400,
    59130 +/**/
    59131 +    399,
    59132 +/**/
    59133 +    398,
    59134 +/**/
    59135 +    397,
    59136 +/**/
    59137 +    396,
    59138 +/**/
    59139 +    395,
    59140 +/**/
    59141 +    394,
    59142 +/**/
    59143 +    393,
    59144 +/**/
    59145 +    392,
    59146 +/**/
    59147 +    391,
    59148 +/**/
    59149 +    390,
    59150 +/**/
    59151 +    389,
    59152 +/**/
    59153 +    388,
    59154 +/**/
    59155 +    387,
    59156 +/**/
    59157 +    386,
    59158 +/**/
    59159 +    385,
    59160 +/**/
    59161 +    384,
    59162 +/**/
    59163 +    383,
    59164 +/**/
    59165 +    382,
    59166 +/**/
    59167 +    381,
    59168 +/**/
    59169 +    380,
    59170 +/**/
    59171 +    379,
    59172 +/**/
    59173 +    378,
    59174 +/**/
    59175 +    377,
    59176 +/**/
    59177 +    376,
    59178 +/**/
    59179 +    375,
    59180 +/**/
    59181 +    374,
    59182 +/**/
    59183 +    373,
    59184 +/**/
    59185 +    372,
    59186 +/**/
    59187 +    371,
    59188 +/**/
    59189 +    370,
    59190 +/**/
    59191 +    369,
    59192 +/**/
    59193 +    368,
    59194 +/**/
    59195 +    367,
    59196 +/**/
    59197 +    366,
    59198 +/**/
    59199 +    365,
    59200 +/**/
    59201 +    364,
    59202 +/**/
    59203 +    363,
    59204 +/**/
    59205 +    362,
    59206 +/**/
    59207 +    361,
    59208 +/**/
    59209 +    360,
    59210 +/**/
    59211 +    359,
    59212 +/**/
    59213 +    358,
    59214 +/**/
    59215 +    357,
    59216 +/**/
    59217 +    356,
    59218 +/**/
    59219 +    355,
    59220 +/**/
    59221 +    354,
    59222 +/**/
    59223 +    353,
    59224 +/**/
    59225 +    352,
    59226 +/**/
    59227 +    351,
    59228 +/**/
    59229 +    350,
    59230 +/**/
    59231 +    349,
    59232 +/**/
    59233 +    348,
    59234 +/**/
    59235 +    347,
    59236 +/**/
    59237 +    346,
    59238 +/**/
    59239 +    345,
    59240 +/**/
    59241 +    344,
    59242 +/**/
    59243 +    343,
    59244 +/**/
    59245 +    342,
    59246 +/**/
    59247 +    341,
    59248 +/**/
    59249 +    340,
    59250 +/**/
    59251 +    339,
    59252 +/**/
    59253 +    338,
    59254 +/**/
    59255 +    337,
    59256 +/**/
    59257 +    336,
    59258 +/**/
    59259 +    335,
    59260 +/**/
    59261 +    334,
    59262 +/**/
    59263 +    333,
    59264 +/**/
    59265 +    332,
    59266 +/**/
    59267 +    331,
    59268 +/**/
    59269 +    330,
    59270 +/**/
    59271 +    329,
    59272 +/**/
    59273 +    328,
    59274 +/**/
    59275 +    327,
    59276 +/**/
    59277 +    326,
    59278 +/**/
    59279 +    325,
    59280 +/**/
    59281 +    324,
    59282 +/**/
    59283 +    323,
    59284 +/**/
    59285 +    322,
    59286 +/**/
    59287 +    321,
    59288 +/**/
    59289 +    320,
    59290 +/**/
    59291 +    319,
    59292 +/**/
    59293 +    318,
    59294 +/**/
    59295 +    317,
    59296 +/**/
    59297 +    316,
    59298 +/**/
    59299 +    315,
    59300 +/**/
    59301 +    314,
    59302 +/**/
    59303 +    313,
    59304 +/**/
    59305 +    312,
    59306 +/**/
    59307 +    311,
    59308 +/**/
    59309 +    310,
    59310 +/**/
    59311 +    309,
    59312 +/**/
    59313 +    308,
    59314 +/**/
    59315 +    307,
    59316 +/**/
    59317 +    306,
    59318 +/**/
    59319 +    305,
    59320 +/**/
    59321 +    304,
    59322 +/**/
    59323 +    303,
    59324 +/**/
    59325 +    302,
    59326 +/**/
    59327 +    301,
    59328 +/**/
    59329 +    300,
    59330 +/**/
    59331 +    299,
    59332 +/**/
    59333 +    298,
    59334 +/**/
    59335 +    297,
    59336 +/**/
    59337 +    296,
    59338 +/**/
    59339 +    295,
    59340 +/**/
    59341 +    294,
    59342 +/**/
    59343 +    293,
    59344 +/**/
    59345 +    292,
    59346 +/**/
    59347 +    291,
    59348 +/**/
    59349 +    290,
    59350 +/**/
    59351 +    289,
    59352 +/**/
    59353 +    288,
    59354 +/**/
    59355 +    287,
    59356 +/**/
    59357 +    286,
    59358 +/**/
    59359 +    285,
    59360 +/**/
    59361 +    284,
    59362 +/**/
    59363 +    283,
    59364 +/**/
    59365 +    282,
    59366 +/**/
    59367 +    281,
    59368 +/**/
    59369 +    280,
    59370 +/**/
    59371 +    279,
    59372 +/**/
    59373 +    278,
    59374 +/**/
    59375 +    277,
    59376 +/**/
    59377 +    276,
    59378 +/**/
    59379 +    275,
    59380 +/**/
    59381 +    274,
    59382 +/**/
    59383 +    273,
    59384 +/**/
    59385 +    272,
    59386 +/**/
    59387 +    271,
    59388 +/**/
    59389 +    270,
    59390 +/**/
    59391 +    269,
    59392 +/**/
    59393 +    268,
    59394 +/**/
    59395 +    267,
    59396 +/**/
    59397 +    266,
    59398 +/**/
    59399 +    265,
    59400 +/**/
    59401 +    264,
    59402 +/**/
    59403 +    263,
    59404 +/**/
    59405 +    262,
    59406 +/**/
    59407 +    261,
    59408 +/**/
    59409 +    260,
    59410 +/**/
    59411 +    259,
    59412 +/**/
    59413 +    258,
    59414 +/**/
    59415 +    257,
    59416 +/**/
    59417 +    256,
    59418 +/**/
    59419 +    255,
    59420 +/**/
    59421 +    254,
    59422 +/**/
    59423 +    253,
    59424 +/**/
    59425 +    252,
    59426 +/**/
    59427 +    251,
    59428 +/**/
    59429 +    250,
    59430 +/**/
    59431 +    249,
    59432 +/**/
    59433 +    248,
    59434 +/**/
    59435 +    247,
    59436 +/**/
    59437 +    246,
    59438 +/**/
    59439 +    245,
    59440 +/**/
    59441 +    244,
    59442 +/**/
    59443 +    243,
    59444 +/**/
    59445 +    242,
    59446 +/**/
    59447 +    241,
    59448 +/**/
    59449 +    240,
    59450 +/**/
    59451 +    239,
    59452 +/**/
    59453 +    238,
    59454 +/**/
    59455 +    237,
    59456 +/**/
    59457 +    236,
    59458 +/**/
    59459 +    235,
    59460 +/**/
    59461 +    234,
    59462 +/**/
    59463 +    233,
    59464 +/**/
    59465 +    232,
    59466 +/**/
    59467 +    231,
    59468 +/**/
    59469 +    230,
    59470 +/**/
    59471 +    229,
    59472 +/**/
    59473 +    228,
    59474 +/**/
    59475 +    227,
    59476 +/**/
    59477 +    226,
    59478 +/**/
    59479 +    225,
    59480 +/**/
    59481 +    224,
    59482 +/**/
    59483 +    223,
    59484 +/**/
    59485 +    222,
    59486 +/**/
    59487 +    221,
    59488 +/**/
    59489 +    220,
    59490 +/**/
    59491 +    219,
    59492 +/**/
    59493 +    218,
    59494 +/**/
    59495 +    217,
    59496 +/**/
    59497 +    216,
    59498 +/**/
    59499 +    215,
    59500 +/**/
    59501 +    214,
    59502 +/**/
    59503 +    213,
    59504 +/**/
    59505 +    212,
    59506 +/**/
    59507 +    211,
    59508 +/**/
    59509 +    210,
    59510 +/**/
    59511 +    209,
    59512 +/**/
    59513 +    208,
    59514 +/**/
    59515 +    207,
    59516 +/**/
    59517 +    206,
    59518 +/**/
    59519 +    205,
    59520 +/**/
    59521 +    204,
    59522 +/**/
    59523 +    203,
    59524 +/**/
    59525 +    202,
    59526 +/**/
    59527 +    201,
    59528 +/**/
    59529 +    200,
    59530 +/**/
    59531 +    199,
    59532 +/**/
    59533 +    198,
    59534 +/**/
    59535 +    197,
    59536 +/**/
    59537 +    196,
    59538 +/**/
    59539 +    195,
    59540 +/**/
    59541 +    194,
    59542 +/**/
    59543 +    193,
    59544 +/**/
    59545 +    192,
    59546 +/**/
    59547 +    191,
    59548 +/**/
    59549 +    190,
    59550 +/**/
    59551 +    189,
    59552 +/**/
    59553 +    188,
    59554 +/**/
    59555 +    187,
    59556 +/**/
    59557 +    186,
    59558 +/**/
    59559 +    185,
    59560 +/**/
    59561 +    184,
    59562 +/**/
    59563 +    183,
    59564 +/**/
    59565 +    182,
    59566 +/**/
    59567 +    181,
    59568 +/**/
    59569 +    180,
    59570 +/**/
    59571 +    179,
    59572 +/**/
    59573 +    178,
    59574 +/**/
    59575 +    177,
    59576 +/**/
    59577 +    176,
    59578 +/**/
    59579 +    175,
    59580 +/**/
    59581 +    174,
    59582 +/**/
    59583 +    173,
    59584 +/**/
    59585 +    172,
    59586 +/**/
    59587 +    171,
    59588 +/**/
    59589 +    170,
    59590 +/**/
    59591 +    169,
    59592 +/**/
    59593 +    168,
    59594 +/**/
    59595 +    167,
    59596 +/**/
    59597 +    166,
    59598 +/**/
    59599 +    165,
    59600 +/**/
    59601 +    164,
    59602 +/**/
    59603 +    163,
    59604 +/**/
    59605 +    162,
    59606 +/**/
    59607 +    161,
    59608 +/**/
    59609 +    160,
    59610 +/**/
    59611 +    159,
    59612 +/**/
    59613 +    158,
    59614 +/**/
    59615 +    157,
    59616 +/**/
    59617 +    156,
    59618 +/**/
    59619 +    155,
    59620 +/**/
    59621 +    154,
    59622 +/**/
    59623 +    153,
    59624 +/**/
    59625 +    152,
    59626 +/**/
    59627 +    151,
    59628 +/**/
    59629 +    150,
    59630 +/**/
    59631 +    149,
    59632 +/**/
    59633 +    148,
    59634 +/**/
    59635 +    147,
    59636 +/**/
    59637 +    146,
    59638 +/**/
    59639 +    145,
    59640 +/**/
    59641 +    144,
    59642 +/**/
    59643 +    143,
    59644 +/**/
    59645 +    142,
    59646 +/**/
    59647 +    141,
    59648 +/**/
    59649 +    140,
    59650 +/**/
    59651 +    139,
    59652 +/**/
    59653 +    138,
    59654 +/**/
    59655 +    137,
    59656 +/**/
    59657 +    136,
    59658 +/**/
    59659 +    135,
    59660 +/**/
    59661 +    134,
    59662 +/**/
    59663 +    133,
    59664 +/**/
    59665 +    132,
    59666 +/**/
    59667 +    131,
    59668 +/**/
    59669 +    130,
    59670 +/**/
    59671 +    129,
    59672 +/**/
    59673 +    128,
    59674 +/**/
    59675 +    127,
    59676 +/**/
    59677 +    126,
    59678 +/**/
    59679 +    125,
    59680 +/**/
    59681 +    124,
    59682 +/**/
    59683 +    123,
    59684 +/**/
    59685 +    122,
    59686 +/**/
    59687 +    121,
    59688 +/**/
    59689 +    120,
    59690 +/**/
    59691 +    119,
    59692 +/**/
    59693 +    118,
    59694 +/**/
    59695 +    117,
    59696 +/**/
    59697 +    116,
    59698 +/**/
    59699 +    115,
    59700 +/**/
    59701 +    114,
    59702 +/**/
    59703 +    113,
    59704 +/**/
    59705 +    112,
    59706 +/**/
    59707 +    111,
    59708 +/**/
    59709 +    110,
    59710 +/**/
    59711 +    109,
    59712 +/**/
    59713 +    108,
    59714 +/**/
    59715 +    107,
    59716 +/**/
    59717 +    106,
    59718 +/**/
    59719 +    105,
    59720 +/**/
    59721 +    104,
    59722 +/**/
    59723 +    103,
    59724 +/**/
    59725 +    102,
    59726 +/**/
    59727 +    101,
    59728 +/**/
    59729 +    100,
    59730 +/**/
    59731 +    99,
    59732 +/**/
    59733 +    98,
    59734 +/**/
    59735 +    97,
    59736 +/**/
    59737 +    96,
    59738 +/**/
    59739 +    95,
    59740 +/**/
    59741 +    94,
    59742 +/**/
    59743 +    93,
    59744 +/**/
    59745 +    92,
    59746 +/**/
    59747 +    91,
    59748 +/**/
    59749 +    90,
    59750 +/**/
    59751 +    89,
    59752 +/**/
    59753 +    88,
    59754 +/**/
    59755 +    87,
    59756 +/**/
    59757 +    86,
    59758 +/**/
    59759 +    85,
    59760 +/**/
    59761 +    84,
    59762 +/**/
    59763 +    83,
    59764 +/**/
    59765 +    82,
    59766 +/**/
    59767 +    81,
    59768 +/**/
    59769 +    80,
    59770 +/**/
    59771 +    79,
    59772 +/**/
    59773 +    78,
    59774 +/**/
    59775 +    77,
    59776 +/**/
    59777 +    76,
    59778 +/**/
    59779 +    75,
    59780 +/**/
    59781 +    74,
    59782 +/**/
    59783 +    73,
    59784 +/**/
    59785 +    72,
    59786 +/**/
    59787 +    71,
    59788 +/**/
    59789 +    70,
    59790 +/**/
    59791 +    69,
    59792 +/**/
    59793 +    68,
    59794 +/**/
    59795 +    67,
    59796 +/**/
    59797 +    66,
    59798 +/**/
    59799 +    65,
    59800 +/**/
    59801 +    64,
    59802 +/**/
    59803 +    63,
    59804 +/**/
    59805 +    62,
    59806 +/**/
    59807 +    61,
    59808 +/**/
    59809 +    60,
    59810 +/**/
    59811 +    59,
    59812 +/**/
    59813 +    58,
    59814 +/**/
    59815 +    57,
    59816 +/**/
    59817 +    56,
    59818 +/**/
    59819 +    55,
    59820 +/**/
    59821 +    54,
    59822 +/**/
    59823 +    53,
    59824 +/**/
    59825 +    52,
    59826 +/**/
    59827 +    51,
    59828 +/**/
    59829 +    50,
    59830 +/**/
    59831 +    49,
    59832 +/**/
    59833 +    48,
    59834 +/**/
    59835 +    47,
    59836 +/**/
    59837 +    46,
    59838 +/**/
    59839 +    45,
    59840 +/**/
    59841 +    44,
    59842 +/**/
    59843 +    43,
    59844 +/**/
    59845 +    42,
    59846 +/**/
    59847 +    41,
    59848 +/**/
    59849 +    40,
    59850 +/**/
    59851 +    39,
    59852 +/**/
    59853 +    38,
    59854 +/**/
    59855 +    37,
    59856 +/**/
    59857 +    36,
    59858 +/**/
    59859 +    35,
    59860 +/**/
    59861 +    34,
    59862 +/**/
    59863 +    33,
    59864 +/**/
    59865 +    32,
    59866 +/**/
    59867 +    31,
    59868 +/**/
    59869 +    30,
    59870 +/**/
    59871 +    29,
    59872 +/**/
    59873 +    28,
    59874 +/**/
    59875 +    27,
    59876 +/**/
    59877 +    26,
    59878 +/**/
    59879 +    25,
    59880 +/**/
    59881 +    24,
    59882 +/**/
    59883 +    23,
    59884 +/**/
    59885 +    22,
    59886 +/**/
    59887 +    21,
    59888 +/**/
    59889 +    20,
    59890 +/**/
    59891 +    19,
    59892 +/**/
    59893 +    18,
    59894 +/**/
    59895 +    17,
    59896 +/**/
    59897 +    16,
    59898 +/**/
    59899 +    15,
    59900 +/**/
    59901 +    14,
    59902 +/**/
    59903 +    13,
    59904 +/**/
    59905 +    12,
    59906 +/**/
    59907 +    11,
    59908 +/**/
    59909 +    10,
    59910 +/**/
    59911 +    9,
    59912 +/**/
    59913 +    8,
    59914 +/**/
    59915 +    7,
    59916 +/**/
    59917 +    6,
    59918 +/**/
    59919 +    5,
    59920 +/**/
    59921 +    4,
    59922 +/**/
    59923 +    3,
    59924 +/**/
    59925 +    2,
    59926 +/**/
    59927 +    1,
    59928 +/**/
    59929      0
    59930  };
    59931  
    59932 @@ -833,9 +1721,6 @@
    59933  # endif
    59934  #endif
    59935  
     65196-    0
     65197-};
     65198-
     65199-/*
     65200- * Place to put a short description when adding a feature with a patch.
     65201- * Keep it short, e.g.,: "relative numbers", "persistent undo".
     65202- * Also add a comment marker to separate the lines.
     65203- * See the official Vim patches for the diff format: It must use a context of
     65204- * one line only.  Create it by hand or use "diff -C2" and edit the patch.
     65205- */
     65206-static char *(extra_patches[]) =
     65207-{   /* Add your patch description below this line */
     65208+    538,
     65209 /**/
     65210-    NULL
     65211-};
     65212-
     65213-    int
     65214-highest_patch()
     65215-{
     65216-    int                i;
     65217-    int                h = 0;
     65218-
     65219-    for (i = 0; included_patches[i] != 0; ++i)
     65220-       if (included_patches[i] > h)
     65221-           h = included_patches[i];
     65222-    return h;
     65223-}
     65224-
     65225-#if defined(FEAT_EVAL) || defined(PROTO)
     65226-/*
     65227- * Return TRUE if patch "n" has been included.
     65228- */
     65229-    int
     65230-has_patch(n)
     65231-    int                n;
     65232-{
     65233-    int                i;
     65234-
     65235-    for (i = 0; included_patches[i] != 0; ++i)
     65236-       if (included_patches[i] == n)
     65237-           return TRUE;
     65238-    return FALSE;
     65239-}
     65240-#endif
     65241-
     65242-    void
     65243-ex_version(eap)
     65244-    exarg_T    *eap;
     65245-{
     65246-    /*
     65247-     * Ignore a ":version 9.99" command.
     65248-     */
     65249-    if (*eap->arg == NUL)
     65250-    {
     65251-       msg_putchar('\n');
     65252-       list_version();
     65253-    }
     65254-}
     65255-
     65256-    void
     65257-list_version()
     65258-{
     65259-    int                i;
     65260-    int                first;
     65261-    char       *s = "";
     65262-
     65263-    /*
     65264-     * When adding features here, don't forget to update the list of
     65265-     * internal variables in eval.c!
     65266-     */
     65267-    MSG(longVersion);
     65268-#ifdef WIN3264
     65269-# ifdef FEAT_GUI_W32
     65270-#  if defined(_MSC_VER) && (_MSC_VER <= 1010)
     65271-    /* Only MS VC 4.1 and earlier can do Win32s */
     65272-    MSG_PUTS(_("\nMS-Windows 16/32-bit GUI version"));
     65273-#  else
     65274-#   ifdef _WIN64
     65275-    MSG_PUTS(_("\nMS-Windows 64-bit GUI version"));
     65276-#   else
     65277-    MSG_PUTS(_("\nMS-Windows 32-bit GUI version"));
     65278-#   endif
     65279-#  endif
     65280-    if (gui_is_win32s())
     65281-       MSG_PUTS(_(" in Win32s mode"));
     65282-# ifdef FEAT_OLE
     65283-    MSG_PUTS(_(" with OLE support"));
     65284-# endif
     65285-# else
     65286-#  ifdef _WIN64
     65287-    MSG_PUTS(_("\nMS-Windows 64-bit console version"));
     65288-#  else
     65289-    MSG_PUTS(_("\nMS-Windows 32-bit console version"));
     65290-#  endif
     65291-# endif
     65292-#endif
     65293-#ifdef WIN16
     65294-    MSG_PUTS(_("\nMS-Windows 16-bit version"));
     65295-#endif
     65296-#ifdef MSDOS
     65297-# ifdef DJGPP
     65298-    MSG_PUTS(_("\n32-bit MS-DOS version"));
     65299-# else
     65300-    MSG_PUTS(_("\n16-bit MS-DOS version"));
     65301-# endif
     65302-#endif
     65303-#ifdef MACOS
     65304-# ifdef MACOS_X
     65305-#  ifdef MACOS_X_UNIX
     65306-    MSG_PUTS(_("\nMacOS X (unix) version"));
     65307-#  else
     65308-    MSG_PUTS(_("\nMacOS X version"));
     65309-#  endif
     65310-#else
     65311-    MSG_PUTS(_("\nMacOS version"));
     65312-# endif
     65313-#endif
     65314-
    5993665315-#ifdef RISCOS
    5993765316-    MSG_PUTS(_("\nRISC OS version"));
    5993865317-#endif
     65318+    537,
     65319+/**/
     65320+    536,
     65321+/**/
     65322+    535,
     65323+/**/
     65324+    534,
     65325+/**/
     65326+    533,
     65327+/**/
     65328+    532,
     65329+/**/
     65330+    531,
     65331+/**/
     65332+    530,
     65333+/**/
     65334+    529,
     65335+/**/
     65336+    528,
     65337+/**/
     65338+    527,
     65339+/**/
     65340+    526,
     65341+/**/
     65342+    525,
     65343+/**/
     65344+    524,
     65345+/**/
     65346+    523,
     65347+/**/
     65348+    522,
     65349+/**/
     65350+    521,
     65351+/**/
     65352+    520,
     65353+/**/
     65354+    519,
     65355+/**/
     65356+    518,
     65357+/**/
     65358+    517,
     65359+/**/
     65360+    516,
     65361+/**/
     65362+    515,
     65363+/**/
     65364+    514,
     65365+/**/
     65366+    513,
     65367+/**/
     65368+    512,
     65369+/**/
     65370+    511,
     65371+/**/
     65372+    510,
     65373+/**/
     65374+    509,
     65375+/**/
     65376+    508,
     65377+/**/
     65378+    507,
     65379+/**/
     65380+    506,
     65381+/**/
     65382+    505,
     65383+/**/
     65384+    504,
     65385+/**/
     65386+    503,
     65387+/**/
     65388+    502,
     65389+/**/
     65390+    501,
     65391+/**/
     65392+    500,
     65393+/**/
     65394+    499,
     65395+/**/
     65396+    498,
     65397+/**/
     65398+    497,
     65399+/**/
     65400+    496,
     65401+/**/
     65402+    495,
     65403+/**/
     65404+    494,
     65405+/**/
     65406+    493,
     65407+/**/
     65408+    492,
     65409+/**/
     65410+    491,
     65411+/**/
     65412+    490,
     65413+/**/
     65414+    489,
     65415+/**/
     65416+    488,
     65417+/**/
     65418+    487,
     65419+/**/
     65420+    486,
     65421+/**/
     65422+    485,
     65423+/**/
     65424+    484,
     65425+/**/
     65426+    483,
     65427+/**/
     65428+    482,
     65429+/**/
     65430+    481,
     65431+/**/
     65432+    480,
     65433+/**/
     65434+    479,
     65435+/**/
     65436+    478,
     65437+/**/
     65438+    477,
     65439+/**/
     65440+    476,
     65441+/**/
     65442+    475,
     65443+/**/
     65444+    474,
     65445+/**/
     65446+    473,
     65447+/**/
     65448+    472,
     65449+/**/
     65450+    471,
     65451+/**/
     65452+    470,
     65453+/**/
     65454+    469,
     65455+/**/
     65456+    468,
     65457+/**/
     65458+    467,
     65459+/**/
     65460+    466,
     65461+/**/
     65462+    465,
     65463+/**/
     65464+    464,
     65465+/**/
     65466+    463,
     65467+/**/
     65468+    462,
     65469+/**/
     65470+    461,
     65471+/**/
     65472+    460,
     65473+/**/
     65474+    459,
     65475+/**/
     65476+    458,
     65477+/**/
     65478+    457,
     65479+/**/
     65480+    456,
     65481+/**/
     65482+    455,
     65483+/**/
     65484+    454,
     65485+/**/
     65486+    453,
     65487+/**/
     65488+    452,
     65489+/**/
     65490+    451,
     65491+/**/
     65492+    450,
     65493+/**/
     65494+    449,
     65495+/**/
     65496+    448,
     65497+/**/
     65498+    447,
     65499+/**/
     65500+    446,
     65501+/**/
     65502+    445,
     65503+/**/
     65504+    444,
     65505+/**/
     65506+    443,
     65507+/**/
     65508+    442,
     65509+/**/
     65510+    441,
     65511+/**/
     65512+    440,
     65513+/**/
     65514+    439,
     65515+/**/
     65516+    438,
     65517+/**/
     65518+    437,
     65519+/**/
     65520+    436,
     65521+/**/
     65522+    435,
     65523+/**/
     65524+    434,
     65525+/**/
     65526+    433,
     65527+/**/
     65528+    432,
     65529+/**/
     65530+    431,
     65531+/**/
     65532+    430,
     65533+/**/
     65534+    429,
     65535+/**/
     65536+    428,
     65537+/**/
     65538+    427,
     65539+/**/
     65540+    426,
     65541+/**/
     65542+    425,
     65543+/**/
     65544+    424,
     65545+/**/
     65546+    423,
     65547+/**/
     65548+    422,
     65549+/**/
     65550+    421,
     65551+/**/
     65552+    420,
     65553+/**/
     65554+    419,
     65555+/**/
     65556+    418,
     65557+/**/
     65558+    417,
     65559+/**/
     65560+    416,
     65561+/**/
     65562+    415,
     65563+/**/
     65564+    414,
     65565+/**/
     65566+    413,
     65567+/**/
     65568+    412,
     65569+/**/
     65570+    411,
     65571+/**/
     65572+    410,
     65573+/**/
     65574+    409,
     65575+/**/
     65576+    408,
     65577+/**/
     65578+    407,
     65579+/**/
     65580+    406,
     65581+/**/
     65582+    405,
     65583+/**/
     65584+    404,
     65585+/**/
     65586+    403,
     65587+/**/
     65588+    402,
     65589+/**/
     65590+    401,
     65591+/**/
     65592+    400,
     65593+/**/
     65594+    399,
     65595+/**/
     65596+    398,
     65597+/**/
     65598+    397,
     65599+/**/
     65600+    396,
     65601+/**/
     65602+    395,
     65603+/**/
     65604+    394,
     65605+/**/
     65606+    393,
     65607+/**/
     65608+    392,
     65609+/**/
     65610+    391,
     65611+/**/
     65612+    390,
     65613+/**/
     65614+    389,
     65615+/**/
     65616+    388,
     65617+/**/
     65618+    387,
     65619+/**/
     65620+    386,
     65621+/**/
     65622+    385,
     65623+/**/
     65624+    384,
     65625+/**/
     65626+    383,
     65627+/**/
     65628+    382,
     65629+/**/
     65630+    381,
     65631+/**/
     65632+    380,
     65633+/**/
     65634+    379,
     65635+/**/
     65636+    378,
     65637+/**/
     65638+    377,
     65639+/**/
     65640+    376,
     65641+/**/
     65642+    375,
     65643+/**/
     65644+    374,
     65645+/**/
     65646+    373,
     65647+/**/
     65648+    372,
     65649+/**/
     65650+    371,
     65651+/**/
     65652+    370,
     65653+/**/
     65654+    369,
     65655+/**/
     65656+    368,
     65657+/**/
     65658+    367,
     65659+/**/
     65660+    366,
     65661+/**/
     65662+    365,
     65663+/**/
     65664+    364,
     65665+/**/
     65666+    363,
     65667+/**/
     65668+    362,
     65669+/**/
     65670+    361,
     65671+/**/
     65672+    360,
     65673+/**/
     65674+    359,
     65675+/**/
     65676+    358,
     65677+/**/
     65678+    357,
     65679+/**/
     65680+    356,
     65681+/**/
     65682+    355,
     65683+/**/
     65684+    354,
     65685+/**/
     65686+    353,
     65687+/**/
     65688+    352,
     65689+/**/
     65690+    351,
     65691+/**/
     65692+    350,
     65693+/**/
     65694+    349,
     65695+/**/
     65696+    348,
     65697+/**/
     65698+    347,
     65699+/**/
     65700+    346,
     65701+/**/
     65702+    345,
     65703+/**/
     65704+    344,
     65705+/**/
     65706+    343,
     65707+/**/
     65708+    342,
     65709+/**/
     65710+    341,
     65711+/**/
     65712+    340,
     65713+/**/
     65714+    339,
     65715+/**/
     65716+    338,
     65717+/**/
     65718+    337,
     65719+/**/
     65720+    336,
     65721+/**/
     65722+    335,
     65723+/**/
     65724+    334,
     65725+/**/
     65726+    333,
     65727+/**/
     65728+    332,
     65729+/**/
     65730+    331,
     65731+/**/
     65732+    330,
     65733+/**/
     65734+    329,
     65735+/**/
     65736+    328,
     65737+/**/
     65738+    327,
     65739+/**/
     65740+    326,
     65741+/**/
     65742+    325,
     65743+/**/
     65744+    324,
     65745+/**/
     65746+    323,
     65747+/**/
     65748+    322,
     65749+/**/
     65750+    321,
     65751+/**/
     65752+    320,
     65753+/**/
     65754+    319,
     65755+/**/
     65756+    318,
     65757+/**/
     65758+    317,
     65759+/**/
     65760+    316,
     65761+/**/
     65762+    315,
     65763+/**/
     65764+    314,
     65765+/**/
     65766+    313,
     65767+/**/
     65768+    312,
     65769+/**/
     65770+    311,
     65771+/**/
     65772+    310,
     65773+/**/
     65774+    309,
     65775+/**/
     65776+    308,
     65777+/**/
     65778+    307,
     65779+/**/
     65780+    306,
     65781+/**/
     65782+    305,
     65783+/**/
     65784+    304,
     65785+/**/
     65786+    303,
     65787+/**/
     65788+    302,
     65789+/**/
     65790+    301,
     65791+/**/
     65792+    300,
     65793+/**/
     65794+    299,
     65795+/**/
     65796+    298,
     65797+/**/
     65798+    297,
     65799+/**/
     65800+    296,
     65801+/**/
     65802+    295,
     65803+/**/
     65804+    294,
     65805+/**/
     65806+    293,
     65807+/**/
     65808+    292,
     65809+/**/
     65810+    291,
     65811+/**/
     65812+    290,
     65813+/**/
     65814+    289,
     65815+/**/
     65816+    288,
     65817+/**/
     65818+    287,
     65819+/**/
     65820+    286,
     65821+/**/
     65822+    285,
     65823+/**/
     65824+    284,
     65825+/**/
     65826+    283,
     65827+/**/
     65828+    282,
     65829+/**/
     65830+    281,
     65831+/**/
     65832+    280,
     65833+/**/
     65834+    279,
     65835+/**/
     65836+    278,
     65837+/**/
     65838+    277,
     65839+/**/
     65840+    276,
     65841+/**/
     65842+    275,
     65843+/**/
     65844+    274,
     65845+/**/
     65846+    273,
     65847+/**/
     65848+    272,
     65849+/**/
     65850+    271,
     65851+/**/
     65852+    270,
     65853+/**/
     65854+    269,
     65855+/**/
     65856+    268,
     65857+/**/
     65858+    267,
     65859+/**/
     65860+    266,
     65861+/**/
     65862+    265,
     65863+/**/
     65864+    264,
     65865+/**/
     65866+    263,
     65867+/**/
     65868+    262,
     65869+/**/
     65870+    261,
     65871+/**/
     65872+    260,
     65873+/**/
     65874+    259,
     65875+/**/
     65876+    258,
     65877+/**/
     65878+    257,
     65879+/**/
     65880+    256,
     65881+/**/
     65882+    255,
     65883+/**/
     65884+    254,
     65885+/**/
     65886+    253,
     65887+/**/
     65888+    252,
     65889+/**/
     65890+    251,
     65891+/**/
     65892+    250,
     65893+/**/
     65894+    249,
     65895+/**/
     65896+    248,
     65897+/**/
     65898+    247,
     65899+/**/
     65900+    246,
     65901+/**/
     65902+    245,
     65903+/**/
     65904+    244,
     65905+/**/
     65906+    243,
     65907+/**/
     65908+    242,
     65909+/**/
     65910+    241,
     65911+/**/
     65912+    240,
     65913+/**/
     65914+    239,
     65915+/**/
     65916+    238,
     65917+/**/
     65918+    237,
     65919+/**/
     65920+    236,
     65921+/**/
     65922+    235,
     65923+/**/
     65924+    234,
     65925+/**/
     65926+    233,
     65927+/**/
     65928+    232,
     65929+/**/
     65930+    231,
     65931+/**/
     65932+    230,
     65933+/**/
     65934+    229,
     65935+/**/
     65936+    228,
     65937+/**/
     65938+    227,
     65939+/**/
     65940+    226,
     65941+/**/
     65942+    225,
     65943+/**/
     65944+    224,
     65945+/**/
     65946+    223,
     65947+/**/
     65948+    222,
     65949+/**/
     65950+    221,
     65951+/**/
     65952+    220,
     65953+/**/
     65954+    219,
     65955+/**/
     65956+    218,
     65957+/**/
     65958+    217,
     65959+/**/
     65960+    216,
     65961+/**/
     65962+    215,
     65963+/**/
     65964+    214,
     65965+/**/
     65966+    213,
     65967+/**/
     65968+    212,
     65969+/**/
     65970+    211,
     65971+/**/
     65972+    210,
     65973+/**/
     65974+    209,
     65975+/**/
     65976+    208,
     65977+/**/
     65978+    207,
     65979+/**/
     65980+    206,
     65981+/**/
     65982+    205,
     65983+/**/
     65984+    204,
     65985+/**/
     65986+    203,
     65987+/**/
     65988+    202,
     65989+/**/
     65990+    201,
     65991+/**/
     65992+    200,
     65993+/**/
     65994+    199,
     65995+/**/
     65996+    198,
     65997+/**/
     65998+    197,
     65999+/**/
     66000+    196,
     66001+/**/
     66002+    195,
     66003+/**/
     66004+    194,
     66005+/**/
     66006+    193,
     66007+/**/
     66008+    192,
     66009+/**/
     66010+    191,
     66011+/**/
     66012+    190,
     66013+/**/
     66014+    189,
     66015+/**/
     66016+    188,
     66017+/**/
     66018+    187,
     66019+/**/
     66020+    186,
     66021+/**/
     66022+    185,
     66023+/**/
     66024+    184,
     66025+/**/
     66026+    183,
     66027+/**/
     66028+    182,
     66029+/**/
     66030+    181,
     66031+/**/
     66032+    180,
     66033+/**/
     66034+    179,
     66035+/**/
     66036+    178,
     66037+/**/
     66038+    177,
     66039+/**/
     66040+    176,
     66041+/**/
     66042+    175,
     66043+/**/
     66044+    174,
     66045+/**/
     66046+    173,
     66047+/**/
     66048+    172,
     66049+/**/
     66050+    171,
     66051+/**/
     66052+    170,
     66053+/**/
     66054+    169,
     66055+/**/
     66056+    168,
     66057+/**/
     66058+    167,
     66059+/**/
     66060+    166,
     66061+/**/
     66062+    165,
     66063+/**/
     66064+    164,
     66065+/**/
     66066+    163,
     66067+/**/
     66068+    162,
     66069+/**/
     66070+    161,
     66071+/**/
     66072+    160,
     66073+/**/
     66074+    159,
     66075+/**/
     66076+    158,
     66077+/**/
     66078+    157,
     66079+/**/
     66080+    156,
     66081+/**/
     66082+    155,
     66083+/**/
     66084+    154,
     66085+/**/
     66086+    153,
     66087+/**/
     66088+    152,
     66089+/**/
     66090+    151,
     66091+/**/
     66092+    150,
     66093+/**/
     66094+    149,
     66095+/**/
     66096+    148,
     66097+/**/
     66098+    147,
     66099+/**/
     66100+    146,
     66101+/**/
     66102+    145,
     66103+/**/
     66104+    144,
     66105+/**/
     66106+    143,
     66107+/**/
     66108+    142,
     66109+/**/
     66110+    141,
     66111+/**/
     66112+    140,
     66113+/**/
     66114+    139,
     66115+/**/
     66116+    138,
     66117+/**/
     66118+    137,
     66119+/**/
     66120+    136,
     66121+/**/
     66122+    135,
     66123+/**/
     66124+    134,
     66125+/**/
     66126+    133,
     66127+/**/
     66128+    132,
     66129+/**/
     66130+    131,
     66131+/**/
     66132+    130,
     66133+/**/
     66134+    129,
     66135+/**/
     66136+    128,
     66137+/**/
     66138+    127,
     66139+/**/
     66140+    126,
     66141+/**/
     66142+    125,
     66143+/**/
     66144+    124,
     66145+/**/
     66146+    123,
     66147+/**/
     66148+    122,
     66149+/**/
     66150+    121,
     66151+/**/
     66152+    120,
     66153+/**/
     66154+    119,
     66155+/**/
     66156+    118,
     66157+/**/
     66158+    117,
     66159+/**/
     66160+    116,
     66161+/**/
     66162+    115,
     66163+/**/
     66164+    114,
     66165+/**/
     66166+    113,
     66167+/**/
     66168+    112,
     66169+/**/
     66170+    111,
     66171+/**/
     66172+    110,
     66173+/**/
     66174+    109,
     66175+/**/
     66176+    108,
     66177+/**/
     66178+    107,
     66179+/**/
     66180+    106,
     66181+/**/
     66182+    105,
     66183+/**/
     66184+    104,
     66185+/**/
     66186+    103,
     66187+/**/
     66188+    102,
     66189+/**/
     66190+    101,
     66191+/**/
     66192+    100,
     66193+/**/
     66194+    99,
     66195+/**/
     66196+    98,
     66197+/**/
     66198+    97,
     66199+/**/
     66200+    96,
     66201+/**/
     66202+    95,
     66203+/**/
     66204+    94,
     66205+/**/
     66206+    93,
     66207+/**/
     66208+    92,
     66209+/**/
     66210+    91,
     66211+/**/
     66212+    90,
     66213+/**/
     66214+    89,
     66215+/**/
     66216+    88,
     66217+/**/
     66218+    87,
     66219+/**/
     66220+    86,
     66221+/**/
     66222+    85,
     66223+/**/
     66224+    84,
     66225+/**/
     66226+    83,
     66227+/**/
     66228+    82,
     66229+/**/
     66230+    81,
     66231+/**/
     66232+    80,
     66233+/**/
     66234+    79,
     66235+/**/
     66236+    78,
     66237+/**/
     66238+    77,
     66239+/**/
     66240+    76,
     66241+/**/
     66242+    75,
     66243+/**/
     66244+    74,
     66245+/**/
     66246+    73,
     66247+/**/
     66248+    72,
     66249+/**/
     66250+    71,
     66251+/**/
     66252+    70,
     66253+/**/
     66254+    69,
     66255+/**/
     66256+    68,
     66257+/**/
     66258+    67,
     66259+/**/
     66260+    66,
     66261+/**/
     66262+    65,
     66263+/**/
     66264+    64,
     66265+/**/
     66266+    63,
     66267+/**/
     66268+    62,
     66269+/**/
     66270+    61,
     66271+/**/
     66272+    60,
     66273+/**/
     66274+    59,
     66275+/**/
     66276+    58,
     66277+/**/
     66278+    57,
     66279+/**/
     66280+    56,
     66281+/**/
     66282+    55,
     66283+/**/
     66284+    54,
     66285+/**/
     66286+    53,
     66287+/**/
     66288+    52,
     66289+/**/
     66290+    51,
     66291+/**/
     66292+    50,
     66293+/**/
     66294+    49,
     66295+/**/
     66296+    48,
     66297+/**/
     66298+    47,
     66299+/**/
     66300+    46,
     66301+/**/
     66302+    45,
     66303+/**/
     66304+    44,
     66305+/**/
     66306+    43,
     66307+/**/
     66308+    42,
     66309+/**/
     66310+    41,
     66311+/**/
     66312+    40,
     66313+/**/
     66314+    39,
     66315+/**/
     66316+    38,
     66317+/**/
     66318+    37,
     66319+/**/
     66320+    36,
     66321+/**/
     66322+    35,
     66323+/**/
     66324+    34,
     66325+/**/
     66326+    33,
     66327+/**/
     66328+    32,
     66329+/**/
     66330+    31,
     66331+/**/
     66332+    30,
     66333+/**/
     66334+    29,
     66335+/**/
     66336+    28,
     66337+/**/
     66338+    27,
     66339+/**/
     66340+    26,
     66341+/**/
     66342+    25,
     66343+/**/
     66344+    24,
     66345+/**/
     66346+    23,
     66347+/**/
     66348+    22,
     66349+/**/
     66350+    21,
     66351+/**/
     66352+    20,
     66353+/**/
     66354+    19,
     66355+/**/
     66356+    18,
     66357+/**/
     66358+    17,
     66359+/**/
     66360+    16,
     66361+/**/
     66362+    15,
     66363+/**/
     66364+    14,
     66365+/**/
     66366+    13,
     66367+/**/
     66368+    12,
     66369+/**/
     66370+    11,
     66371+/**/
     66372+    10,
     66373+/**/
     66374+    9,
     66375+/**/
     66376+    8,
     66377+/**/
     66378+    7,
     66379+/**/
     66380+    6,
     66381+/**/
     66382+    5,
     66383+/**/
     66384+    4,
     66385+/**/
     66386+    3,
     66387+/**/
     66388+    2,
     66389+/**/
     66390+    1,
     66391+/**/
     66392+    0
     66393+};
     66394+
     66395+/*
     66396+ * Place to put a short description when adding a feature with a patch.
     66397+ * Keep it short, e.g.,: "relative numbers", "persistent undo".
     66398+ * Also add a comment marker to separate the lines.
     66399+ * See the official Vim patches for the diff format: It must use a context of
     66400+ * one line only.  Create it by hand or use "diff -C2" and edit the patch.
     66401+ */
     66402+static char *(extra_patches[]) =
     66403+{   /* Add your patch description below this line */
     66404+/**/
     66405+    NULL
     66406+};
     66407+
     66408+    int
     66409+highest_patch()
     66410+{
     66411+    int                i;
     66412+    int                h = 0;
     66413+
     66414+    for (i = 0; included_patches[i] != 0; ++i)
     66415+       if (included_patches[i] > h)
     66416+           h = included_patches[i];
     66417+    return h;
     66418+}
     66419+
     66420+#if defined(FEAT_EVAL) || defined(PROTO)
     66421+/*
     66422+ * Return TRUE if patch "n" has been included.
     66423+ */
     66424+    int
     66425+has_patch(n)
     66426+    int                n;
     66427+{
     66428+    int                i;
     66429+
     66430+    for (i = 0; included_patches[i] != 0; ++i)
     66431+       if (included_patches[i] == n)
     66432+           return TRUE;
     66433+    return FALSE;
     66434+}
     66435+#endif
     66436+
     66437+    void
     66438+ex_version(eap)
     66439+    exarg_T    *eap;
     66440+{
     66441+    /*
     66442+     * Ignore a ":version 9.99" command.
     66443+     */
     66444+    if (*eap->arg == NUL)
     66445+    {
     66446+       msg_putchar('\n');
     66447+       list_version();
     66448+    }
     66449+}
     66450+
     66451+    void
     66452+list_version()
     66453+{
     66454+    int                i;
     66455+    int                first;
     66456+    char       *s = "";
     66457+
     66458+    /*
     66459+     * When adding features here, don't forget to update the list of
     66460+     * internal variables in eval.c!
     66461+     */
     66462+    MSG(longVersion);
     66463+#ifdef WIN3264
     66464+# ifdef FEAT_GUI_W32
     66465+#  if defined(_MSC_VER) && (_MSC_VER <= 1010)
     66466+    /* Only MS VC 4.1 and earlier can do Win32s */
     66467+    MSG_PUTS(_("\nMS-Windows 16/32-bit GUI version"));
     66468+#  else
     66469+#   ifdef _WIN64
     66470+    MSG_PUTS(_("\nMS-Windows 64-bit GUI version"));
     66471+#   else
     66472+    MSG_PUTS(_("\nMS-Windows 32-bit GUI version"));
     66473+#   endif
     66474+#  endif
     66475+    if (gui_is_win32s())
     66476+       MSG_PUTS(_(" in Win32s mode"));
     66477+# ifdef FEAT_OLE
     66478+    MSG_PUTS(_(" with OLE support"));
     66479+# endif
     66480+# else
     66481+#  ifdef _WIN64
     66482+    MSG_PUTS(_("\nMS-Windows 64-bit console version"));
     66483+#  else
     66484+    MSG_PUTS(_("\nMS-Windows 32-bit console version"));
     66485+#  endif
     66486+# endif
     66487+#endif
     66488+#ifdef WIN16
     66489+    MSG_PUTS(_("\nMS-Windows 16-bit version"));
     66490+#endif
     66491+#ifdef MSDOS
     66492+# ifdef DJGPP
     66493+    MSG_PUTS(_("\n32-bit MS-DOS version"));
     66494+# else
     66495+    MSG_PUTS(_("\n16-bit MS-DOS version"));
     66496+# endif
     66497+#endif
     66498+#ifdef MACOS
     66499+# ifdef MACOS_X
     66500+#  ifdef MACOS_X_UNIX
     66501+    MSG_PUTS(_("\nMacOS X (unix) version"));
     66502+#  else
     66503+    MSG_PUTS(_("\nMacOS X version"));
     66504+#  endif
     66505+#else
     66506+    MSG_PUTS(_("\nMacOS version"));
     66507+# endif
     66508+#endif
     66509+
    5993966510 #ifdef VMS
    5994066511     MSG_PUTS(_("\nOpenVMS version"));
    5994166512 # ifdef HAVE_PATHDEF
    59942 @@ -1262,9 +2147,9 @@
     66513@@ -1262,14 +2335,11 @@
    5994366514        if (highest_patch())
    5994466515        {
     
    5994866519            {
    5994966520-               if (isalpha((int)mediumVersion[4]))
    59950 +               if (isalpha((int)vers[4]))
    59951                     sprintf((char *)vers + 5, ".%d%s", highest_patch(),
    59952                                                            mediumVersion + 5);
    59953                 else
     66521-                   sprintf((char *)vers + 5, ".%d%s", highest_patch(),
     66522-                                                          mediumVersion + 5);
     66523-               else
     66524-                   sprintf((char *)vers + 4, ".%d%s", highest_patch(),
     66525-                                                          mediumVersion + 4);
     66526+               int len = (isalpha((int)vers[4])) ? 5 : 4;
     66527+               sprintf((char *)vers + len, ".%d%s", highest_patch(),
     66528+                                                        mediumVersion + len);
     66529            }
     66530            else
     66531                sprintf((char *)vers + 3, ".%d", highest_patch());
    5995466532diff -Naur vim73.orig/src/version.c.orig vim73/src/version.c.orig
    5995566533--- vim73.orig/src/version.c.orig       1970-01-01 00:00:00.000000000 +0000
    59956 +++ vim73/src/version.c.orig    2012-02-15 21:57:45.989460632 +0000
     66534+++ vim73/src/version.c.orig    2012-06-03 23:09:54.144039098 +0000
    5995766535@@ -0,0 +1,1691 @@
    5995866536+/* vi:set ts=8 sts=4 sw=4:
     
    6164868226+}
    6164968227diff -Naur vim73.orig/src/vim.h vim73/src/vim.h
    61650 --- vim73.orig/src/vim.h        2012-02-15 21:57:45.053435946 +0000
    61651 +++ vim73/src/vim.h     2012-02-15 21:57:46.293468653 +0000
     68228--- vim73.orig/src/vim.h        2012-06-03 23:09:52.940007057 +0000
     68229+++ vim73/src/vim.h     2012-06-03 23:09:55.952087212 +0000
    6165268230@@ -27,6 +27,11 @@
    6165368231 # endif
     
    6171468292  * Allow other (non-unix) systems to configure themselves now
    6171568293  * These are also in os_unix.h, because osdef.sh needs them there.
    61716 @@ -776,6 +780,7 @@
     68294@@ -776,6 +780,8 @@
    6171768295 #define EXPAND_FILETYPE                37
    6171868296 #define EXPAND_FILES_IN_PATH   38
    6171968297 #define EXPAND_OWNSYNTAX       39
    6172068298+#define EXPAND_LOCALES         40
     68299+#define EXPAND_HISTORY         41
    6172168300 
    6172268301 /* Values for exmode_active (0 is no exmode) */
    6172368302 #define EXMODE_NORMAL          1
    61724 @@ -798,6 +803,7 @@
     68303@@ -789,6 +795,7 @@
     68304 #define WILD_PREV              5
     68305 #define WILD_ALL               6
     68306 #define WILD_LONGEST           7
     68307+#define WILD_ALL_KEEP          8
     68308 
     68309 #define WILD_LIST_NOTFOUND     1
     68310 #define WILD_HOME_REPLACE      2
     68311@@ -798,6 +805,7 @@
    6172568312 #define WILD_KEEP_ALL          32
    6172668313 #define WILD_SILENT            64
     
    6173068317 /* Flags for expand_wildcards() */
    6173168318 #define EW_DIR         0x01    /* include directory names */
    61732 @@ -808,6 +814,9 @@
     68319@@ -808,6 +816,9 @@
    6173368320 #define EW_SILENT      0x20    /* don't print "1 returned" from shell */
    6173468321 #define EW_EXEC                0x40    /* executable files */
     
    6174068327  * is used when executing commands and EW_SILENT for interactive expanding. */
    6174168328 
    61742 @@ -1269,6 +1278,7 @@
     68329@@ -1269,6 +1280,7 @@
    6174368330     EVENT_WINENTER,            /* after entering a window */
    6174468331     EVENT_WINLEAVE,            /* before leaving a window */
     
    6174868335     EVENT_CURSORHOLDI,         /* idem, in Insert mode */
    6174968336     EVENT_FUNCUNDEFINED,       /* if calling a function which doesn't exist */
    61750 @@ -1423,6 +1433,8 @@
     68337@@ -1307,6 +1319,7 @@
     68338     , HLF_M        /* "--More--" message */
     68339     , HLF_CM       /* Mode (e.g., "-- INSERT --") */
     68340     , HLF_N        /* line number for ":number" and ":#" commands */
     68341+    , HLF_CLN      /* current line number */
     68342     , HLF_R        /* return to continue message and yes/no questions */
     68343     , HLF_S        /* status lines */
     68344     , HLF_SNC      /* status lines of not-current windows */
     68345@@ -1344,7 +1357,7 @@
     68346 /* The HL_FLAGS must be in the same order as the HLF_ enums!
     68347  * When changing this also adjust the default for 'highlight'. */
     68348 #define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \
     68349-                 'n', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
     68350+                 'n', 'N', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
     68351                  'f', 'F', 'A', 'C', 'D', 'T', '-', '>', \
     68352                  'B', 'P', 'R', 'L', \
     68353                  '+', '=', 'x', 'X', '*', '#', '_', '!', '.', 'o'}
     68354@@ -1423,6 +1436,8 @@
    6175168355 
    6175268356 #define IOSIZE    (1024+1)     /* file i/o and sprintf buffer size */
     
    6175768361 # define MSG_BUF_LEN 480       /* length of buffer for small messages */
    6175868362 # define MSG_BUF_CLEN  (MSG_BUF_LEN / 6)    /* cell length (worst case: utf-8
    61759 @@ -1640,6 +1652,11 @@
     68363@@ -1640,6 +1655,11 @@
    6176068364 # define USE_INPUT_BUF
    6176168365 #endif
     
    6176968373 /* On MS-Windows the third argument isn't size_t.  This matters for Win64,
    6177068374  * where sizeof(size_t)==8, not 4 */
    61771 @@ -1842,7 +1859,8 @@
     68375@@ -1683,6 +1703,8 @@
     68376  * character of up to 6 bytes, or one 16-bit character of up to three bytes
     68377  * plus six following composing characters of three bytes each. */
     68378 # define MB_MAXBYTES   21
     68379+#else
     68380+# define MB_MAXBYTES   1
     68381 #endif
     68382 
     68383 #if (defined(FEAT_PROFILE) || defined(FEAT_RELTIME)) && !defined(PROTO)
     68384@@ -1842,7 +1864,8 @@
    6177268385 #define VV_OP          52
    6177368386 #define VV_SEARCHFORWARD 53
     
    6177968392 #ifdef FEAT_CLIPBOARD
    6178068393 
    61781 @@ -2193,4 +2211,14 @@
     68394@@ -1996,6 +2019,7 @@
     68395  #pragma warning(disable : 4312)
     68396 #endif
     68397 
     68398+/* Note: a NULL argument for vim_realloc() is not portable, don't use it. */
     68399 #if defined(MEM_PROFILE)
     68400 # define vim_realloc(ptr, size)  mem_realloc((ptr), (size))
     68401 #else
     68402@@ -2193,4 +2217,14 @@
    6178268403 #define MSCR_LEFT      -1
    6178368404 #define MSCR_RIGHT     -2
     
    6179568416 #endif /* VIM__H */
    6179668417diff -Naur vim73.orig/src/window.c vim73/src/window.c
    61797 --- vim73.orig/src/window.c     2012-02-15 21:57:45.053435946 +0000
    61798 +++ vim73/src/window.c  2012-02-15 21:57:46.789481734 +0000
     68418--- vim73.orig/src/window.c     2012-06-03 23:09:52.940007057 +0000
     68419+++ vim73/src/window.c  2012-06-03 23:09:55.896085721 +0000
     68420@@ -23,7 +23,7 @@
     68421 static void win_totop __ARGS((int size, int flags));
     68422 static void win_equal_rec __ARGS((win_T *next_curwin, int current, frame_T *topfr, int dir, int col, int row, int width, int height));
     68423 static int last_window __ARGS((void));
     68424-static int one_window __ARGS((void));
     68425+static int close_last_window_tabpage __ARGS((win_T *win, int free_buf, tabpage_T *prev_curtab));
     68426 static win_T *win_free_mem __ARGS((win_T *win, int *dirp, tabpage_T *tp));
     68427 static frame_T *win_altframe __ARGS((win_T *win, tabpage_T *tp));
     68428 static tabpage_T *alt_tabpage __ARGS((void));
    6179968429@@ -70,7 +70,8 @@
    6180068430 #endif /* FEAT_WINDOWS */
     
    6194568575 
    6194668576 /*
    61947 @@ -2164,7 +2170,7 @@
     68577@@ -2077,7 +2083,7 @@
     68578  * Return TRUE if there is only one window other than "aucmd_win" in the
     68579  * current tab page.
     68580  */
     68581-    static int
     68582+    int
     68583 one_window()
     68584 {
     68585 #ifdef FEAT_AUTOCMD
     68586@@ -2100,10 +2106,46 @@
     68587 }
     68588 
     68589 /*
     68590+ * Close the possibly last window in a tab page.
     68591+ * Returns TRUE when the window was closed already.
     68592+ */
     68593+    static int
     68594+close_last_window_tabpage(win, free_buf, prev_curtab)
     68595+    win_T      *win;
     68596+    int                free_buf;
     68597+    tabpage_T   *prev_curtab;
     68598+{
     68599+    if (firstwin == lastwin)
     68600+    {
     68601+       /*
     68602+        * Closing the last window in a tab page.  First go to another tab
     68603+        * page and then close the window and the tab page.  This avoids that
     68604+        * curwin and curtab are invalid while we are freeing memory, they may
     68605+        * be used in GUI events.
     68606+        */
     68607+       goto_tabpage_tp(alt_tabpage());
     68608+       redraw_tabline = TRUE;
     68609+
     68610+       /* Safety check: Autocommands may have closed the window when jumping
     68611+        * to the other tab page. */
     68612+       if (valid_tabpage(prev_curtab) && prev_curtab->tp_firstwin == win)
     68613+       {
     68614+           int     h = tabline_height();
     68615+
     68616+           win_close_othertab(win, free_buf, prev_curtab);
     68617+           if (h != tabline_height())
     68618+               shell_new_rows();
     68619+       }
     68620+       return TRUE;
     68621+    }
     68622+    return FALSE;
     68623+}
     68624+
     68625+/*
     68626  * Close window "win".  Only works for the current tab page.
     68627  * If "free_buf" is TRUE related buffer may be unloaded.
     68628  *
     68629- * called by :quit, :close, :xit, :wq and findtag()
     68630+ * Called by :quit, :close, :xit, :wq and findtag().
     68631  */
     68632     void
     68633 win_close(win, free_buf)
     68634@@ -2138,33 +2180,15 @@
     68635     }
     68636 #endif
     68637 
     68638-    /*
     68639-     * When closing the last window in a tab page first go to another tab
     68640-     * page and then close the window and the tab page.  This avoids that
     68641-     * curwin and curtab are not invalid while we are freeing memory, they may
     68642-     * be used in GUI events.
     68643-     */
     68644-    if (firstwin == lastwin)
     68645-    {
     68646-       goto_tabpage_tp(alt_tabpage());
     68647-       redraw_tabline = TRUE;
     68648-
     68649-       /* Safety check: Autocommands may have closed the window when jumping
     68650-        * to the other tab page. */
     68651-       if (valid_tabpage(prev_curtab) && prev_curtab->tp_firstwin == win)
     68652-       {
     68653-           int     h = tabline_height();
     68654-
     68655-           win_close_othertab(win, free_buf, prev_curtab);
     68656-           if (h != tabline_height())
     68657-               shell_new_rows();
     68658-       }
     68659-       return;
     68660-    }
     68661+    /* When closing the last window in a tab page first go to another tab page
     68662+     * and then close the window and the tab page to avoid that curwin and
     68663+     * curtab are invalid while we are freeing memory. */
     68664+    if (close_last_window_tabpage(win, free_buf, prev_curtab))
     68665+      return;
    6194868666 
    6194968667     /* When closing the help window, try restoring a snapshot after closing
     
    6195468672     else
    6195568673        clear_snapshot(curtab, SNAP_HELP_IDX);
    61956 @@ -2206,17 +2212,25 @@
     68674@@ -2206,17 +2230,26 @@
    6195768675        out_flush();
    6195868676 #endif
     
    6196968687-    close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0);
    6197068688+    if (win->w_buffer != NULL)
    61971 +       close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0);
     68689+       close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, TRUE);
    6197268690 
    6197368691     /* Autocommands may have closed the window already, or closed the only
    6197468692      * other window or moved to another tab page. */
    61975      if (!win_valid(win) || last_window() || curtab != prev_curtab)
     68693-    if (!win_valid(win) || last_window() || curtab != prev_curtab)
     68694+    if (!win_valid(win) || last_window() || curtab != prev_curtab
     68695+           || close_last_window_tabpage(win, free_buf, prev_curtab))
    6197668696        return;
    6197768697 
     
    6198268702 
    6198368703     /* Make sure curwin isn't invalid.  It can cause severe trouble when
    61984 @@ -3241,6 +3255,9 @@
     68704@@ -2297,7 +2330,7 @@
     68705 
     68706 /*
     68707  * Close window "win" in tab page "tp", which is not the current tab page.
     68708- * This may be the last window ih that tab page and result in closing the tab,
     68709+ * This may be the last window in that tab page and result in closing the tab,
     68710  * thus "tp" may become invalid!
     68711  * Caller must check if buffer is hidden and whether the tabline needs to be
     68712  * updated.
     68713@@ -2314,7 +2347,7 @@
     68714     int                free_tp = FALSE;
     68715 
     68716     /* Close the link to the buffer. */
     68717-    close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0);
     68718+    close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, FALSE);
     68719 
     68720     /* Careful: Autocommands may have closed the tab page or made it the
     68721      * current tab page.  */
     68722@@ -3241,6 +3274,9 @@
    6198568723     else
    6198668724        wp->w_farsi = W_CONV;
     
    6199268730 
    6199368731 /*
    61994 @@ -3277,9 +3294,7 @@
     68732@@ -3277,9 +3313,7 @@
    6199568733     if (aucmd_win != NULL)
    6199668734     {
     
    6200368741     }
    6200468742 }
    62005 @@ -3320,10 +3335,8 @@
     68743@@ -3320,10 +3354,8 @@
    6200668744        /* First window in new tab page, initialize it from "oldwin". */
    6200768745        win_init(curwin, oldwin, 0);
     
    6201668754 #endif
    6201768755 
    62018 @@ -4271,19 +4284,19 @@
     68756@@ -3664,13 +3696,6 @@
     68757     win_enter_ext(tp->tp_curwin, FALSE, TRUE);
     68758     prevwin = next_prevwin;
     68759 
     68760-#ifdef FEAT_AUTOCMD
     68761-    apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf);
     68762-
     68763-    if (old_curbuf != curbuf)
     68764-       apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf);
     68765-#endif
     68766-
     68767     last_status(FALSE);                /* status line may appear or disappear */
     68768     (void)win_comp_pos();      /* recompute w_winrow for all windows */
     68769     must_redraw = CLEAR;       /* need to redraw everything */
     68770@@ -3700,6 +3725,14 @@
     68771     gui_may_update_scrollbars();
     68772 #endif
     68773 
     68774+#ifdef FEAT_AUTOCMD
     68775+    /* Apply autocommands after updating the display, when 'rows' and
     68776+     * 'columns' have been set correctly. */
     68777+    apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf);
     68778+    if (old_curbuf != curbuf)
     68779+       apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf);
     68780+#endif
     68781+
     68782     redraw_all_later(CLEAR);
     68783 }
     68784 
     68785@@ -4271,19 +4304,19 @@
    6201968786     win_T      *after UNUSED;
    6202068787     int                hidden UNUSED;
     
    6204268809 #ifdef FEAT_AUTOCMD
    6204368810        /* Don't execute autocommands while the window is not properly
    62044 @@ -4296,53 +4309,53 @@
     68811@@ -4296,53 +4329,53 @@
    6204568812         */
    6204668813 #ifdef FEAT_WINDOWS
     
    6211568882 
    6211668883 #if defined(FEAT_WINDOWS) || defined(PROTO)
    62117 @@ -4435,7 +4448,6 @@
     68884@@ -4435,7 +4468,6 @@
    6211868885 #endif /* FEAT_GUI */
    6211968886 
     
    6212368890 #endif
    6212468891 
    62125 @@ -5459,6 +5471,19 @@
     68892@@ -5459,6 +5491,19 @@
    6212668893 
    6212768894 #endif /* FEAT_WINDOWS */
     
    6214368910  * Set the height of a window.
    6214468911  * This takes care of the things inside the window, not what happens to the
    62145 @@ -5471,7 +5496,6 @@
     68912@@ -5471,7 +5516,6 @@
    6214668913 {
    6214768914     linenr_T   lnum;
     
    6215168918     /* Don't want a negative height.  Happens when splitting a tiny window.
    6215268919      * Will equalize heights soon to fix it. */
    62153 @@ -5481,8 +5505,7 @@
     68920@@ -5481,8 +5525,7 @@
    6215468921        return;     /* nothing to do */
    6215568922 
     
    6216268929     wp->w_skipcol = 0;
    6216368930diff -Naur vim73.orig/src/workshop.c vim73/src/workshop.c
    62164 --- vim73.orig/src/workshop.c   2012-02-15 21:57:45.041435628 +0000
    62165 +++ vim73/src/workshop.c        2012-02-15 21:57:45.493447550 +0000
     68931--- vim73.orig/src/workshop.c   2012-06-03 23:09:52.924006631 +0000
     68932+++ vim73/src/workshop.c        2012-06-03 23:09:53.540023023 +0000
    6216668933@@ -16,7 +16,6 @@
    6216768934 #include <sys/types.h>
     
    6217368940 # include <libgen.h>
    6217468941diff -Naur vim73.orig/src/xpm_w32.c vim73/src/xpm_w32.c
    62175 --- vim73.orig/src/xpm_w32.c    2012-02-15 21:57:45.053435946 +0000
    62176 +++ vim73/src/xpm_w32.c 2012-02-15 21:57:46.897484584 +0000
     68942--- vim73.orig/src/xpm_w32.c    2012-06-03 23:09:52.940007057 +0000
     68943+++ vim73/src/xpm_w32.c 2012-06-03 23:09:55.348071138 +0000
    6217768944@@ -1,4 +1,5 @@
    6217868945-/*
     
    6222568992diff -Naur vim73.orig/src/xxd/Make_ming.mak vim73/src/xxd/Make_ming.mak
    6222668993--- vim73.orig/src/xxd/Make_ming.mak    1970-01-01 00:00:00.000000000 +0000
    62227 +++ vim73/src/xxd/Make_ming.mak 2012-02-15 21:57:46.501474139 +0000
     68994+++ vim73/src/xxd/Make_ming.mak 2012-06-03 23:09:54.804056662 +0000
    6222868995@@ -0,0 +1,28 @@
    6222968996+# The most simplistic Makefile, for MinGW gcc on MS-DOS
     
    6225669023+       -$(DEL) xxd.exe
    6225769024diff -Naur vim73.orig/src/xxd/xxd.c vim73/src/xxd/xxd.c
    62258 --- vim73.orig/src/xxd/xxd.c    2012-02-15 21:57:45.057436051 +0000
    62259 +++ vim73/src/xxd/xxd.c 2012-02-15 21:57:45.841456730 +0000
     69025--- vim73.orig/src/xxd/xxd.c    2012-06-03 23:09:52.944007163 +0000
     69026+++ vim73/src/xxd/xxd.c 2012-06-03 23:09:53.932033457 +0000
    6226069027@@ -49,6 +49,8 @@
    6226169028  *         option -b added: 01000101 binary output in normal format.
Note: See TracChangeset for help on using the changeset viewer.