Changeset eb3c388
- Timestamp:
- Jun 4, 2012, 11:07:54 AM (12 years ago)
- Branches:
- clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
- Children:
- 3e3e226
- Parents:
- c7fdbf48
- Files:
-
- 1 added
- 1 deleted
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
BOOK/general.ent
rc7fdbf48 reb3c388 1 1 <?xml version="1.0" encoding="ISO-8859-1"?> 2 2 3 <!ENTITY month "0 3"> <!-- Use two digits -->4 <!ENTITY month_name " March">5 <!ENTITY day " 14"> <!-- Use two digits -->3 <!ENTITY month "06"> <!-- Use two digits --> 4 <!ENTITY month_name "June"> 5 <!ENTITY day "04"> <!-- Use two digits --> 6 6 <!ENTITY year "2012"> <!-- Use four digits --> 7 7 -
BOOK/introduction/common/changelog.xml
rc7fdbf48 reb3c388 38 38 39 39 <listitem> 40 <para>4 June 2012</para> 41 <itemizedlist> 42 <listitem> 43 <para>[Jonathan] - Updated Bash Branch Update patch to -4.</para> 44 </listitem> 45 <listitem> 46 <para>[Jonathan] - Updated Vim Branch Update patch to -4.</para> 47 </listitem> 48 </itemizedlist> 49 </listitem> 50 51 <listitem> 40 52 <para>15 April 2012</para> 41 53 <itemizedlist> -
BOOK/patches.ent
rc7fdbf48 reb3c388 5 5 <!-- Start of Common Patches --> 6 6 7 <!ENTITY bash-branch_update-patch "bash-&bash-version;-branch_update- 3.patch">8 <!ENTITY bash-branch_update-patch-md5 " 65f1ae14e3f5f8cbcdcba6defc3b1c9e">9 <!ENTITY bash-branch_update-patch-size " 24 KB">7 <!ENTITY bash-branch_update-patch "bash-&bash-version;-branch_update-4.patch"> 8 <!ENTITY bash-branch_update-patch-md5 "3143b23ee24c2dd630ad8db4c95948d9"> 9 <!ENTITY bash-branch_update-patch-size "44 KB"> 10 10 11 11 <!ENTITY coreutils-uname-patch "coreutils-&coreutils-version;-uname-1.patch"> … … 89 89 <!ENTITY texinfo-new_compressors-patch-size "2 KB"> 90 90 91 <!ENTITY vim-branch_update-patch "vim-&vim-version;-branch_update- 3.patch">92 <!ENTITY vim-branch_update-patch-md5 " f0f1be4f8f5c0bb4f128bebe77bc8ef9">93 <!ENTITY vim-branch_update-patch-size " 1.9MB">91 <!ENTITY vim-branch_update-patch "vim-&vim-version;-branch_update-4.patch"> 92 <!ENTITY vim-branch_update-patch-md5 "edde25ac785167dd31ee17e5560f2788"> 93 <!ENTITY vim-branch_update-patch-size "2.1 MB"> 94 94 95 95 <!-- Start of multilib patches --> -
patches/vim-7.3-branch_update-4.patch
rc7fdbf48 reb3c388 1 1 Submitted By: Jonathan Norman (jonathan at bluesquarelinux dot co dot uk) 2 Date: 2012-0 2-152 Date: 2012-06-03 3 3 Initial Package Version: 7.3 4 4 Origin: Upstream 5 5 Upstream Status: Applied 6 Description: Contains all upstream patches up to 7.3. 4446 Description: Contains all upstream patches up to 7.3.538 7 7 8 8 diff -Naur vim73.orig/Filelist vim73/Filelist 9 --- vim73.orig/Filelist 2012-0 2-15 21:57:45.065436261+000010 +++ vim73/Filelist 2012-0 2-15 21:57:46.545475298+00009 --- vim73.orig/Filelist 2012-06-03 23:09:52.956007482 +0000 10 +++ vim73/Filelist 2012-06-03 23:09:54.868058365 +0000 11 11 @@ -39,6 +39,7 @@ 12 12 src/mark.c \ … … 72 72 runtime/spell/??/main.aap \ 73 73 diff -Naur vim73.orig/Makefile vim73/Makefile 74 --- vim73.orig/Makefile 2012-0 2-15 21:57:45.117437632+000075 +++ vim73/Makefile 2012-0 2-15 21:57:45.645451559+000074 --- vim73.orig/Makefile 2012-06-03 23:09:53.028009398 +0000 75 +++ vim73/Makefile 2012-06-03 23:09:53.712027602 +0000 76 76 @@ -23,6 +23,9 @@ 77 77 # has run can result in compiling with $(CC) empty. … … 95 95 cd src && $(MAKE) $@ 96 96 diff -Naur vim73.orig/README_extra.txt vim73/README_extra.txt 97 --- vim73.orig/README_extra.txt 2012-0 2-15 21:57:45.041435628+000098 +++ vim73/README_extra.txt 2012-0 2-15 21:57:45.977460316+000097 --- 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 99 99 @@ -13,9 +13,6 @@ 100 100 … … 108 108 109 109 diff -Naur vim73.orig/runtime/doc/autocmd.txt vim73/runtime/doc/autocmd.txt 110 --- vim73.orig/runtime/doc/autocmd.txt 2012-0 2-15 21:57:45.113437526+0000111 +++ vim73/runtime/doc/autocmd.txt 2012-0 2-15 21:57:46.965486377+0000110 --- 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 112 112 @@ -299,6 +299,8 @@ 113 113 |InsertEnter| starting Insert mode … … 137 137 InsertEnter Just before starting Insert mode. Also for 138 138 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 @@ 140 164 argument is included, Vim executes only the matching 141 165 autocommands for that group. Note: if you use an … … 159 183 the autocommands, not the buffers to which they are 160 184 diff -Naur vim73.orig/runtime/doc/change.txt vim73/runtime/doc/change.txt 161 --- vim73.orig/runtime/doc/change.txt 2012-0 2-15 21:57:45.109437420 +0000162 +++ vim73/runtime/doc/change.txt 2012-0 2-15 21:57:45.869457468+0000185 --- 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 163 187 @@ -916,8 +916,10 @@ 164 188 {Visual}["x]Y Yank the highlighted lines [into register x] (for … … 174 198 :[range]y[ank] [x] {count} 175 199 Yank {count} lines, starting with last line number 200 diff -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 222 diff -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 176 244 diff -Naur vim73.orig/runtime/doc/eval.txt vim73/runtime/doc/eval.txt 177 --- vim73.orig/runtime/doc/eval.txt 2012-0 2-15 21:57:45.105437315+0000178 +++ vim73/runtime/doc/eval.txt 2012-0 2-15 21:57:46.673478676+0000245 --- 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 179 247 @@ -798,11 +798,12 @@ 180 248 For |Lists| only "+" is possible and then both expr6 must be a list. The … … 225 293 append( {lnum}, {list}) Number append lines {list} below line {lnum} 226 294 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 @@ 228 316 inputsave() Number save and clear typeahead 229 317 inputsecret( {prompt} [, {text}]) String like input() but hiding the text … … 233 321 islocked( {expr}) Number TRUE if {expr} is locked 234 322 items( {dict}) List key-value pairs in {dict} 235 @@ -1822,7 +183 5,7 @@323 @@ -1822,7 +1837,7 @@ 236 324 log( {expr}) Float natural logarithm (base e) of {expr} 237 325 log10( {expr}) Float logarithm of Float {expr} to base 10 … … 242 330 mapcheck( {name}[, {mode} [, {abbr}]]) 243 331 String check for mappings matching {name} 244 @@ -1846,6 +18 59,7 @@332 @@ -1846,6 +1861,7 @@ 245 333 mzeval( {expr}) any evaluate |MzScheme| expression 246 334 nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum} … … 250 338 pow( {x}, {y}) Float {x} to the power of {y} 251 339 prevnonblank( {lnum}) Number line nr of non-blank line <= {lnum} 252 @@ -1904,7 +19 18,8 @@340 @@ -1904,7 +1920,8 @@ 253 341 simplify( {filename}) String simplify filename as much as possible 254 342 sin( {expr}) Float sine of {expr} … … 260 348 spellbadword() String badly spelled word at cursor 261 349 spellsuggest( {word} [, {max} [, {capital}]]) 262 @@ -1967,6 +198 2,7 @@350 @@ -1967,6 +1984,7 @@ 263 351 winwidth( {nr}) Number width of window {nr} 264 352 writefile( {list}, {fname} [, {binary}]) … … 268 356 abs({expr}) *abs()* 269 357 Return the absolute value of {expr}. When {expr} evaluates to 270 @@ -2006,6 +202 2,13 @@358 @@ -2006,6 +2024,13 @@ 271 359 Use |insert()| to add an item at another position. 272 360 … … 282 370 When {expr} is a |List|: Append each item of the |List| as a 283 371 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 @@ 285 447 Note that when {item} is a |List| it is inserted as a single 286 448 item. Use |extend()| to concatenate |Lists|. … … 294 456 The result is a Number, which is non-zero when a directory 295 457 with the name {directory} exists. If {directory} doesn't 296 @@ -3966,23 + 3994,51 @@458 @@ -3966,23 +4005,51 @@ 297 459 further items in {expr} are processed. 298 460 … … 353 515 then the global mappings. 354 516 This function can be used to map a key even when it's already 355 @@ -4295,6 +43 51,13 @@517 @@ -4295,6 +4362,13 @@ 356 518 call setpos('.', save_cursor) 357 519 < Also see |setpos()|. … … 367 529 Shorten directory names in the path {expr} and return the 368 530 result. The tail, the file name, is kept as-is. The other 369 @@ -5228,7 +5 291,7 @@531 @@ -5228,7 +5302,7 @@ 370 532 {only available when compiled with the |+float| feature} 371 533 … … 376 538 want a list to remain unmodified make a copy first: > 377 539 :let sortedlist = sort(copy(mylist)) 378 @@ -5236,6 +5 299,8 @@540 @@ -5236,6 +5310,8 @@ 379 541 Numbers sort after Strings, |Lists| after Numbers. 380 542 For sorting text in the current buffer use |:sort|. … … 385 547 is called to compare items. The function is invoked with two 386 548 items as argument and must return zero if they are equal, 1 or 387 @@ -6056,7 +61 21,15 @@549 @@ -6056,7 +6132,15 @@ 388 550 To copy a file byte for byte: > 389 551 :let fl = readfile("foo", "b") … … 404 566 diff -Naur vim73.orig/runtime/doc/eval.txt.orig vim73/runtime/doc/eval.txt.orig 405 567 --- vim73.orig/runtime/doc/eval.txt.orig 1970-01-01 00:00:00.000000000 +0000 406 +++ vim73/runtime/doc/eval.txt.orig 2012-0 2-15 21:57:46.013461267+0000568 +++ vim73/runtime/doc/eval.txt.orig 2012-06-03 23:09:54.176039949 +0000 407 569 @@ -0,0 +1,8362 @@ 408 570 +*eval.txt* For Vim version 7.3. Last change: 2010 Aug 15 … … 8769 8931 + vim:tw=78:ts=8:ft=help:norl: 8770 8932 diff -Naur vim73.orig/runtime/doc/if_cscop.txt vim73/runtime/doc/if_cscop.txt 8771 --- vim73.orig/runtime/doc/if_cscop.txt 2012-0 2-15 21:57:45.109437420+00008772 +++ vim73/runtime/doc/if_cscop.txt 2012-0 2-15 21:57:46.089463271+00008933 --- 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 8773 8935 @@ -272,6 +272,15 @@ 8774 8936 :set cst … … 9281 9443 + 9282 9444 + vim:tw=78:ts=8:ft=help:norl: 9445 diff -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: 9283 9645 diff -Naur vim73.orig/runtime/doc/indent.txt vim73/runtime/doc/indent.txt 9284 --- vim73.orig/runtime/doc/indent.txt 2012-0 2-15 21:57:45.113437526+00009285 +++ vim73/runtime/doc/indent.txt 2012-0 2-15 21:57:46.169465381+00009646 --- 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 9286 9648 @@ -128,13 +128,20 @@ 9287 9649 used CTRL-T or CTRL-D. … … 9527 9889 using "(0" or "u0", respectively and the unclosed parentheses is 9528 9890 the last non-white character in its line and it is not the 9529 @@ -410,6 +459, 7@@9891 @@ -410,6 +459,23 @@ 9530 9892 a_short_line(argument, a_short_line(argument, 9531 9893 argument); argument); 9532 9894 < 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 +< 9533 9911 + *cino-m* 9534 9912 mN When N is non-zero, line up a line starting with a closing 9535 9913 parentheses with the first character of the line with the 9536 9914 matching opening parentheses. (default 0). 9537 @@ -424,6 +4 74,7 @@9915 @@ -424,6 +490,7 @@ 9538 9916 ) ) 9539 9917 foo; foo; … … 9543 9921 parentheses with the first character of the previous line. 9544 9922 (default 0). 9545 @@ -433,7 + 484,7 @@9923 @@ -433,7 +500,7 @@ 9546 9924 cond2 cond2 9547 9925 ) ) … … 9552 9930 currently unused but must be non-zero (e.g. 'j1'). 'j1' will 9553 9931 indent for example the following code snippet correctly: > 9554 @@ -444,7 + 495,7 @@9932 @@ -444,7 +511,7 @@ 9555 9933 } 9556 9934 }); … … 9561 9939 them with labels. The value 'N' is currently unused but must be 9562 9940 non-zero (e.g. 'J1'). > 9563 @@ -462, 14 +513,19@@9941 @@ -462,23 +529,28 @@ 9564 9942 } 9565 9943 } … … 9579 9957 + *cino-#* 9580 9958 #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 9582 9961 that lines starting with # will still be seen as preprocessor 9583 @@ -477,7 +533,7 @@ 9962 lines. 9584 9963 9585 9964 9586 9965 The defaults, spelled out in full, are: 9587 9966 - 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 9588 9968 + 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,#09969 + c3,C0,/0,(2s,us,U0,w0,W0,k0,m0,j0,J0,)20,*70,#0 9590 9970 9591 9971 Vim puts a line in column 1 if: 9972 - It starts with '#' (preprocessor directives), if 'cinkeys' contains '#'. 9592 9973 diff -Naur vim73.orig/runtime/doc/indent.txt.orig vim73/runtime/doc/indent.txt.orig 9593 9974 --- vim73.orig/runtime/doc/indent.txt.orig 1970-01-01 00:00:00.000000000 +0000 … … 10406 10787 + vim:tw=78:ts=8:ft=help:norl: 10407 10788 diff -Naur vim73.orig/runtime/doc/map.txt vim73/runtime/doc/map.txt 10408 --- vim73.orig/runtime/doc/map.txt 2012-0 2-15 21:57:45.109437420+000010409 +++ vim73/runtime/doc/map.txt 2012-0 2-15 21:57:46.273468124+000010789 --- 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 10410 10791 @@ -226,7 +226,7 @@ 10411 10792 … … 10417 10798 Be very careful about side effects! The expression is evaluated while 10418 10799 obtaining characters, you may very well make the command dysfunctional. 10419 @@ -1202,20 +1202,2 6@@10800 @@ -1202,20 +1202,28 @@ 10420 10801 10421 10802 -complete=augroup autocmd groups 10422 10803 -complete=buffer buffer names 10804 + -complete=behave :behave suboptions 10423 10805 + -complete=color color schemes 10424 10806 -complete=command Ex command (and arguments) … … 10435 10817 -complete=help help subjects 10436 10818 -complete=highlight highlight groups 10819 + -complete=history :history suboptions 10437 10820 + -complete=locale locale names (as output of locale -a) 10438 10821 -complete=mapping mapping name … … 10445 10828 -complete=tag_listfiles tags, file names are shown when CTRL-D is hit 10446 10829 diff -Naur vim73.orig/runtime/doc/motion.txt vim73/runtime/doc/motion.txt 10447 --- vim73.orig/runtime/doc/motion.txt 2012-0 2-15 21:57:45.109437420+000010448 +++ vim73/runtime/doc/motion.txt 2012-0 2-15 21:57:46.181465699 +000010830 --- 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 10449 10832 @@ -269,11 +269,11 @@ 10450 10833 {char} can be entered like with the |f| command. … … 10462 10845 3. Up-down motions *up-down-motions* 10463 10846 diff -Naur vim73.orig/runtime/doc/netbeans.txt vim73/runtime/doc/netbeans.txt 10464 --- vim73.orig/runtime/doc/netbeans.txt 2012-0 2-15 21:57:45.109437420 +000010465 +++ vim73/runtime/doc/netbeans.txt 2012-0 2-15 21:57:46.565475827+000010847 --- 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 10466 10849 @@ -1,4 +1,4 @@ 10467 10850 -*netbeans.txt* For Vim version 7.3. Last change: 2010 Jul 20 … … 10525 10908 ============================================================================== 10526 10909 diff -Naur vim73.orig/runtime/doc/options.txt vim73/runtime/doc/options.txt 10527 --- vim73.orig/runtime/doc/options.txt 2012-0 2-15 21:57:45.109437420+000010528 +++ vim73/runtime/doc/options.txt 2012-0 2-15 21:57:46.969486483+000010910 --- 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 10529 10912 @@ -150,6 +150,18 @@ 10530 10913 (the ^[ is a real <Esc> here, use CTRL-V <Esc> to enter it) … … 10632 11015 and the other initializations, so that when the 'shell' option is set 10633 11016 there, the 'shellpipe' option changes automatically, unless it was 10634 @@ -5980, 8 +6023,8@@11017 @@ -5980,6 +6023,7 @@ 10635 11018 10636 11019 *'shellxquote'* *'sxq'* 10637 11020 '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: "\"" 10642 11024 for Unix, when using system(): "\"") 10643 global 10644 {not in Vi} 10645 @@ -5989,11 +6032,12 @@ 11025 @@ -5989,14 +6033,28 @@ 10646 11026 the "!" and ":!" commands. Includes the redirection. See 10647 11027 'shellquote' to exclude the redirection. It's probably not useful … … 10652 11032 - according the value of 'shell', to reduce the need to set this option 10653 11033 - 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'. 10654 11037 + This is an empty string by default on most systems, but is known to be 10655 11038 + useful for on Win32 version, either for cmd.exe which automatically … … 10661 11044 security reasons. 10662 11045 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 @@ 10664 11060 ! When included, save and restore global variables that start 10665 11061 with an uppercase letter, and don't contain a lowercase … … 10673 11069 the '<' item, with the disadvantage that you need to put a 10674 11070 backslash before the ", otherwise it will be recognized as the 10675 @@ -7747,6 +7 792,17 @@11071 @@ -7747,6 +7806,17 @@ 10676 11072 a pattern from the list. This avoids problems when a future version 10677 11073 uses another default. … … 10693 11089 diff -Naur vim73.orig/runtime/doc/options.txt.orig vim73/runtime/doc/options.txt.orig 10694 11090 --- vim73.orig/runtime/doc/options.txt.orig 1970-01-01 00:00:00.000000000 +0000 10695 +++ vim73/runtime/doc/options.txt.orig 2012-0 2-15 21:57:45.713453353+000011091 +++ vim73/runtime/doc/options.txt.orig 2012-06-03 23:09:53.792029731 +0000 10696 11092 @@ -0,0 +1,8079 @@ 10697 11093 +*options.txt* For Vim version 7.3. Last change: 2010 Aug 15 … … 18776 19172 + vim:tw=78:ts=8:ft=help:norl: 18777 19173 diff -Naur vim73.orig/runtime/doc/os_risc.txt vim73/runtime/doc/os_risc.txt 18778 --- vim73.orig/runtime/doc/os_risc.txt 2012-0 2-15 21:57:45.113437526+000018779 +++ vim73/runtime/doc/os_risc.txt 2012-0 2-15 21:57:45.965460001+000019174 --- 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 18780 19176 @@ -1,322 +1,12 @@ 18781 19177 -*os_risc.txt* For Vim version 7.3. Last change: 2010 Aug 07 … … 19105 19501 vim:tw=78:ts=8:ft=help:norl: 19106 19502 diff -Naur vim73.orig/runtime/doc/os_win32.txt vim73/runtime/doc/os_win32.txt 19107 --- vim73.orig/runtime/doc/os_win32.txt 2012-0 2-15 21:57:45.109437420 +000019108 +++ vim73/runtime/doc/os_win32.txt 2012-0 2-15 21:57:46.169465381+000019503 --- 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 19109 19505 @@ -313,6 +313,37 @@ 19110 19506 with :!start do not get passed Vim's open file handles, which means they do … … 19146 19542 Vim doesn't wait for it to finish! Help! 19147 19543 diff -Naur vim73.orig/runtime/doc/pattern.txt vim73/runtime/doc/pattern.txt 19148 --- vim73.orig/runtime/doc/pattern.txt 2012-0 2-15 21:57:45.109437420+000019149 +++ vim73/runtime/doc/pattern.txt 2012-0 2-15 21:57:46.277468229+000019544 --- 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 19150 19546 @@ -1027,11 +1027,9 @@ 19151 19547 These items only work for 8-bit characters. … … 19163 19559 character in the form: 19164 19560 diff -Naur vim73.orig/runtime/filetype.vim vim73/runtime/filetype.vim 19165 --- vim73.orig/runtime/filetype.vim 2012-0 2-15 21:57:45.077436578+000019166 +++ vim73/runtime/filetype.vim 2012-0 2-15 21:57:46.905484794+000019561 --- 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 19167 19563 @@ -2475,17 +2475,19 @@ 19168 19564 " detected filetypes. … … 21707 22103 +unlet s:cpo_save 21708 22104 diff -Naur vim73.orig/runtime/ftplugof.vim vim73/runtime/ftplugof.vim 21709 --- vim73.orig/runtime/ftplugof.vim 2012-0 2-15 21:57:45.117437632+000021710 +++ vim73/runtime/ftplugof.vim 2012-0 2-15 21:57:46.549475403+000022105 --- 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 21711 22107 @@ -1,11 +1,13 @@ 21712 22108 " Vim support file to switch off loading plugins for file types … … 21728 22124 diff -Naur vim73.orig/src/GvimExt/Make_cyg.mak vim73/src/GvimExt/Make_cyg.mak 21729 22125 --- vim73.orig/src/GvimExt/Make_cyg.mak 1970-01-01 00:00:00.000000000 +0000 21730 +++ vim73/src/GvimExt/Make_cyg.mak 2012-0 2-15 21:57:46.501474139+000022126 +++ vim73/src/GvimExt/Make_cyg.mak 2012-06-03 23:09:54.804056662 +0000 21731 22127 @@ -0,0 +1,77 @@ 21732 22128 +# Project: gvimext … … 21808 22204 + -$(DEL) $(OBJ) $(RES) $(DLL) 21809 22205 diff -Naur vim73.orig/src/GvimExt/Make_ming.mak vim73/src/GvimExt/Make_ming.mak 21810 --- vim73.orig/src/GvimExt/Make_ming.mak 2012-0 2-15 21:57:45.057436051+000021811 +++ vim73/src/GvimExt/Make_ming.mak 2012-0 2-15 21:57:46.501474139+000022206 --- 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 21812 22208 @@ -1,6 +1,6 @@ 21813 22209 # Project: gvimext … … 21877 22273 - 21878 22274 diff -Naur vim73.orig/src/GvimExt/gvimext.cpp vim73/src/GvimExt/gvimext.cpp 21879 --- vim73.orig/src/GvimExt/gvimext.cpp 2012-0 2-15 21:57:45.057436051+000021880 +++ vim73/src/GvimExt/gvimext.cpp 2012-0 2-15 21:57:46.337469812+000022275 --- 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 21881 22277 @@ -142,6 +142,7 @@ 21882 22278 static int dyn_libintl_init(char *dir); … … 21963 22359 &pi) // Pointer to PROCESS_INFORMATION structure. 21964 22360 diff -Naur vim73.orig/src/GvimExt/gvimext.def vim73/src/GvimExt/gvimext.def 21965 --- vim73.orig/src/GvimExt/gvimext.def 2012-0 2-15 21:57:45.057436051+000021966 +++ vim73/src/GvimExt/gvimext.def 2012-0 2-15 21:57:46.141464642+000022361 --- 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 21967 22363 @@ -1,7 +1,7 @@ 21968 22364 ;gvimdef.def : Declares the module parameters for the DLL. … … 21975 22371 DllCanUnloadNow private 21976 22372 diff -Naur vim73.orig/src/GvimExt/gvimext_ming.def vim73/src/GvimExt/gvimext_ming.def 21977 --- vim73.orig/src/GvimExt/gvimext_ming.def 2012-0 2-15 21:57:45.057436051+000021978 +++ vim73/src/GvimExt/gvimext_ming.def 2012-0 2-15 21:57:46.141464642+000022373 --- 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 21979 22375 @@ -3,7 +3,7 @@ 21980 22376 ;Hence this is the same file as gvimext.def with private removed … … 21987 22383 DllCanUnloadNow = DllCanUnloadNow@0 21988 22384 diff -Naur vim73.orig/src/INSTALL vim73/src/INSTALL 21989 --- vim73.orig/src/INSTALL 2012-0 2-15 21:57:45.053435946+000021990 +++ vim73/src/INSTALL 2012-0 2-15 21:57:45.977460316+000022385 --- vim73.orig/src/INSTALL 2012-06-03 23:09:52.940007057 +0000 22386 +++ vim73/src/INSTALL 2012-06-03 23:09:54.124038565 +0000 21991 22387 @@ -6,9 +6,8 @@ 21992 22388 Contents: … … 22038 22434 [NOTE: this is quite old, it might not work anymore] 22039 22435 diff -Naur vim73.orig/src/INSTALLpc.txt vim73/src/INSTALLpc.txt 22040 --- vim73.orig/src/INSTALLpc.txt 2012-0 2-15 21:57:45.057436051+000022041 +++ vim73/src/INSTALLpc.txt 2012-0 2-15 21:57:46.237467173+000022436 --- 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 22042 22438 @@ -11,9 +11,9 @@ 22043 22439 this, then you will get the default behavior as is documented, which should … … 22078 22474 22079 22475 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 @@ 22081 22490 22082 22491 If you get all kinds of strange error messages when compiling, try adding … … 22139 22548 +Happy Vimming! 22140 22549 diff -Naur vim73.orig/src/Make_cyg.mak vim73/src/Make_cyg.mak 22141 --- vim73.orig/src/Make_cyg.mak 2012-0 2-15 21:57:45.041435628+000022142 +++ vim73/src/Make_cyg.mak 2012-0 2-15 21:57:46.501474139+000022550 --- 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 22143 22552 @@ -1,6 +1,6 @@ 22144 22553 # … … 22202 22611 -$(DEL) obj$(DIRSLASH)*.o 22203 22612 diff -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 22207 22639 NETBEANS=$(GUI) 22208 22640 … … 22217 22649 ifeq (no, $(GETTEXT)) 22218 22650 GETTEXT= 22219 @@ -81,7 + 87,7 @@22651 @@ -81,7 +91,7 @@ 22220 22652 22221 22653 # If you are using gettext-0.10.35 from http://sourceforge.net/projects/gettext … … 22226 22658 #STATIC_GETTEXT=USE_STATIC_GETTEXT 22227 22659 #DYNAMIC_GETTEXT=DYNAMIC_GETTEXT 22228 @@ -102,6 +1 08,13 @@22660 @@ -102,6 +112,13 @@ 22229 22661 # on NT, it's here: 22230 22662 PERLLIB=$(PERL)/lib … … 22240 22672 22241 22673 # uncomment 'LUA' if you want a Lua-enabled version 22242 @@ -141,11 +15 4,17 @@22674 @@ -141,11 +158,17 @@ 22243 22675 MZSCHEME_GENERATE_BASE=no 22244 22676 endif … … 22260 22692 # the modern MinGW can dynamically link to dlls directly. 22261 22693 # point MZSCHEME_DLLS to where you put libmzschXXXXXXX.dll and libgcXXXXXXX.dll 22262 @@ -304,11 +32 3,13 @@22694 @@ -304,11 +327,13 @@ 22263 22695 endif 22264 22696 CC := $(CROSS_COMPILE)gcc … … 22274 22706 ifdef GETTEXT 22275 22707 DEFINES += -DHAVE_GETTEXT -DHAVE_LOCALE_H 22276 @@ -343,7 +36 4,7 @@22708 @@ -343,7 +368,7 @@ 22277 22709 ifdef MZSCHEME 22278 22710 CFLAGS += -I$(MZSCHEME)/include -DFEAT_MZSCHEME -DMZSCHEME_COLLECTS=\"$(MZSCHEME)/collects\" … … 22283 22715 endif 22284 22716 22285 @@ -571,8 +59 2,13 @@22717 @@ -571,8 +596,13 @@ 22286 22718 endif 22287 22719 … … 22298 22730 22299 22731 ifeq (yes, $(MBYTE)) 22300 @@ -615,7 +641,7 @@ 22732 @@ -614,8 +644,12 @@ 22733 upx gvim.exe 22301 22734 upx vim.exe 22302 22735 22736 +mpress: exes 22737 + mpress gvim.exe 22738 + mpress vim.exe 22739 + 22303 22740 xxd/xxd.exe: xxd/xxd.c 22304 22741 - $(MAKE) -C xxd -f Make_cyg.mak CC=$(CC) … … 22307 22744 GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h 22308 22745 $(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE) 22309 @@ -633,7 +6 59,7 @@22746 @@ -633,7 +667,7 @@ 22310 22747 -$(DEL) mzscheme_base.c 22311 22748 endif … … 22316 22753 ########################################################################### 22317 22754 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) 22319 22757 $(CC) -c $(CFLAGS) $< -o $@ 22320 22758 22321 22759 -$(OUTDIR)/vimres.res: vim.rc version.h gui_w32_rc.h 22322 22760 - $(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 22326 22763 - $(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 $@ 22328 22767 22329 22768 $(OUTDIR): 22330 22769 $(MKDIR) $(OUTDIR) 22331 @@ -677,7 +70 3,7 @@22770 @@ -677,7 +709,7 @@ 22332 22771 endif 22333 22772 … … 22339 22778 $(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC) 22340 22779 diff -Naur vim73.orig/src/Make_mvc.mak vim73/src/Make_mvc.mak 22341 --- vim73.orig/src/Make_mvc.mak 2012-0 2-15 21:57:45.041435628+000022342 +++ vim73/src/Make_mvc.mak 2012-0 2-15 21:57:46.953486059+000022780 --- 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 22343 22782 @@ -380,9 +380,6 @@ 22344 22783 !if "$(_NMAKE_VER)" == "10.00.30319.01" … … 22362 22801 !endif 22363 22802 !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 22364 22812 @@ -705,12 +702,18 @@ 22365 22813 MZSCHEME_VER = 205_000 … … 22453 22901 22454 22902 diff -Naur vim73.orig/src/Make_ro.mak vim73/src/Make_ro.mak 22455 --- vim73.orig/src/Make_ro.mak 2012-0 2-15 21:57:45.053435946+000022903 --- vim73.orig/src/Make_ro.mak 2012-06-03 23:09:52.940007057 +0000 22456 22904 +++ vim73/src/Make_ro.mak 1970-01-01 00:00:00.000000000 +0000 22457 22905 @@ -1,135 +0,0 @@ … … 22592 23040 -o.window: c.window 22593 23041 diff -Naur vim73.orig/src/Makefile vim73/src/Makefile 22594 --- vim73.orig/src/Makefile 2012-0 2-15 21:57:45.065436261+000022595 +++ vim73/src/Makefile 2012-0 2-15 21:57:46.689479097+000023042 --- vim73.orig/src/Makefile 2012-06-03 23:09:52.956007482 +0000 23043 +++ vim73/src/Makefile 2012-06-03 23:09:55.668079655 +0000 22596 23044 @@ -29,7 +29,7 @@ 22597 23045 # - Uncomment the line "CONF_OPT_X = --without-x" if you have X11 but … … 22818 23266 $(CONF_OPT_CSCOPE) $(CONF_OPT_MULTIBYTE) $(CONF_OPT_INPUT) \ 22819 23267 $(CONF_OPT_OUTPUT) $(CONF_OPT_GPM) $(CONF_OPT_WORKSHOP) \ 22820 @@ -1694, 8 +1715,9@@23268 @@ -1694,11 +1715,12 @@ 22821 23269 $(VIMTARGET): auto/config.mk objects $(OBJ) version.c version.h 22822 23270 $(CCC) version.c -o objects/version.o … … 22829 23277 22830 23278 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. 22832 23284 @@ -1818,6 +1840,15 @@ 22833 23285 ln -s $(VIMTARGET) vim; \ … … 22938 23390 arabic.h version.h 22939 23391 diff -Naur vim73.orig/src/VisVim/Commands.cpp vim73/src/VisVim/Commands.cpp 22940 --- vim73.orig/src/VisVim/Commands.cpp 2012-0 2-15 21:57:45.045435734+000022941 +++ vim73/src/VisVim/Commands.cpp 2012-0 2-15 21:57:46.345470023+000023392 --- 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 22942 23394 @@ -549,7 +549,7 @@ 22943 23395 if (g_bNewTabs) … … 22959 23411 *s++ = '/'; 22960 23412 else 23413 diff -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); 22961 23425 diff -Naur vim73.orig/src/ascii.h vim73/src/ascii.h 22962 --- vim73.orig/src/ascii.h 2012-0 2-15 21:57:45.061436156+000022963 +++ vim73/src/ascii.h 2012-0 2-15 21:57:46.701479413+000023426 --- 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 22964 23428 @@ -123,7 +123,7 @@ 22965 23429 #define DCS 0x90 /* Device Control String */ … … 22986 23450 #endif 22987 23451 diff -Naur vim73.orig/src/auto/config.mk vim73/src/auto/config.mk 22988 --- vim73.orig/src/auto/config.mk 2012-0 2-15 21:57:45.061436156+000023452 --- vim73.orig/src/auto/config.mk 2012-06-03 23:09:52.948007269 +0000 22989 23453 +++ vim73/src/auto/config.mk 1970-01-01 00:00:00.000000000 +0000 22990 23454 @@ -1,5 +0,0 @@ … … 22995 23459 -VIEWNAME = view 22996 23460 diff -Naur vim73.orig/src/auto/configure vim73/src/auto/configure 22997 --- vim73.orig/src/auto/configure 2012-0 2-15 21:57:45.061436156+000022998 +++ vim73/src/auto/configure 2012-0 2-15 21:57:46.917485111+000023461 --- 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 22999 23463 @@ -593,6 +593,7 @@ 23000 23464 … … 23597 24061 cat >confcache <<\_ACEOF 23598 24062 diff -Naur vim73.orig/src/blowfish.c vim73/src/blowfish.c 23599 --- vim73.orig/src/blowfish.c 2012-0 2-15 21:57:45.049435840+000023600 +++ vim73/src/blowfish.c 2012-0 2-15 21:57:45.661451983 +000024063 --- 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 23601 24065 @@ -413,6 +413,7 @@ 23602 24066 int salt_len; … … 23619 24083 mch_memmove(sbx, sbi, 4 * 4 * 256); 23620 24084 diff -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 @@ 23624 24155 #endif 23625 24156 … … 23636 24167 #ifdef FEAT_AUTOCMD 23637 24168 /* Autocommands may have deleted the buffer. */ 23638 @@ -560,6 +5 68,11 @@24169 @@ -560,6 +585,11 @@ 23639 24170 #ifdef FEAT_DIFF 23640 24171 diff_buf_delete(buf); /* Can't use 'diff' for unloaded buffer. */ … … 23648 24179 #ifdef FEAT_FOLDING 23649 24180 /* No folds in an empty buffer. */ 23650 @@ -639,6 +6 52,9 @@24181 @@ -639,6 +669,9 @@ 23651 24182 { 23652 24183 clear_wininfo(buf); /* including window-local options */ … … 23658 24189 #ifdef FEAT_EVAL 23659 24190 vars_clear(&buf->b_vars.dv_hashtab); /* free all internal variables */ 23660 @@ -661,9 +6 77,6 @@24191 @@ -661,9 +694,6 @@ 23661 24192 vim_free(buf->b_start_fenc); 23662 24193 buf->b_start_fenc = NULL; … … 23668 24199 23669 24200 /* 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 @@ 23671 24229 /* Go to the other buffer. */ 23672 24230 set_curbuf(buf, action); … … 23683 24241 23684 24242 #if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) 23685 @@ -1343,6 +13 59,10 @@24243 @@ -1343,6 +1376,10 @@ 23686 24244 # endif 23687 24245 #endif … … 23694 24252 if (unload) 23695 24253 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 @@ 23697 24264 foldUpdateAll(curwin); /* update folds (later). */ 23698 24265 #endif … … 23705 24272 curwin->w_buffer = buf; 23706 24273 curbuf = buf; 23707 @@ -1406,6 +14 22,10 @@24274 @@ -1406,6 +1439,10 @@ 23708 24275 diff_buf_add(curbuf); 23709 24276 #endif … … 23716 24283 curwin->w_cursor.lnum = 1; 23717 24284 curwin->w_cursor.col = 0; 23718 @@ -1805,9 +18 25,6 @@24285 @@ -1805,9 +1842,6 @@ 23719 24286 #ifdef FEAT_AUTOCMD 23720 24287 clear_string_option(&buf->b_p_ft); … … 23726 24293 clear_string_option(&buf->b_p_cink); 23727 24294 clear_string_option(&buf->b_p_cino); 23728 @@ -1917,9 +19 34,7 @@24295 @@ -1917,9 +1951,7 @@ 23729 24296 tabpage_new(); 23730 24297 else if (win_split(0, 0) == FAIL) /* Open in a new window */ … … 23737 24304 } 23738 24305 #endif 23739 @@ -2526,6 +25 41,9 @@24306 @@ -2526,6 +2558,9 @@ 23740 24307 if (p_fdls >= 0) 23741 24308 curwin->w_p_fdl = p_fdls; … … 23747 24314 23748 24315 /* 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 @@ 23750 24327 /* format: "fname + (path) (1 of 2) - VIM" */ 23751 24328 … … 23756 24333 { 23757 24334 p = transstr(gettail(curbuf->b_fname)); 23758 @@ -3231,7 +32 49,7 @@24335 @@ -3231,7 +3267,7 @@ 23759 24336 if (serverName != NULL) 23760 24337 { … … 23765 24342 else 23766 24343 #endif 23767 @@ -3240,9 +32 58,8 @@24344 @@ -3240,9 +3276,8 @@ 23768 24345 if (maxlen > 0) 23769 24346 { … … 23777 24354 } 23778 24355 } 23779 @@ -3363,7 +33 80,8 @@24356 @@ -3363,7 +3398,8 @@ 23780 24357 * or truncated if too long, fillchar is used for all whitespace. 23781 24358 */ … … 23787 24364 char_u *out; /* buffer to write into != NameBuff */ 23788 24365 size_t outlen; /* length of out[] */ 23789 @@ -3458,6 +34 76,18 @@24366 @@ -3458,6 +3494,18 @@ 23790 24367 prevchar_isitem = FALSE; 23791 24368 for (s = usefmt; *s; ) … … 23806 24383 prevchar_isflag = prevchar_isitem = FALSE; 23807 24384 23808 @@ -3473,6 +35 03,8 @@24385 @@ -3473,6 +3521,8 @@ 23809 24386 * Handle one '%' item. 23810 24387 */ … … 23815 24392 { 23816 24393 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(); 23817 24610 diff -Naur vim73.orig/src/charset.c vim73/src/charset.c 23818 --- vim73.orig/src/charset.c 2012-0 2-15 21:57:45.057436051+000023819 +++ vim73/src/charset.c 2012-0 2-15 21:57:46.841483105 +000024611 --- 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 23820 24613 @@ -463,41 +463,42 @@ 23821 24614 if (enc_utf8) … … 23894 24687 int 23895 24688 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 @@ 23897 24705 hex = 0; /* can't be octal */ 23898 24706 break; … … 23904 24712 } 23905 24713 diff -Naur vim73.orig/src/config.h.in vim73/src/config.h.in 23906 --- vim73.orig/src/config.h.in 2012-0 2-15 21:57:45.065436261+000023907 +++ vim73/src/config.h.in 2012-0 2-15 21:57:46.921485217 +000024714 --- 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 23908 24716 @@ -346,9 +346,15 @@ 23909 24717 /* Define if dynamic python does not require RTLD_GLOBAL */ … … 23931 24739 23932 24740 diff -Naur vim73.orig/src/config.mk.in vim73/src/config.mk.in 23933 --- vim73.orig/src/config.mk.in 2012-0 2-15 21:57:45.061436156+000023934 +++ vim73/src/config.mk.in 2012-0 2-15 21:57:45.325443119+000024741 --- 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 23935 24743 @@ -30,6 +30,7 @@ 23936 24744 CPP = @CPP@ … … 23942 24750 X_PRE_LIBS = @X_PRE_LIBS@ 23943 24751 diff -Naur vim73.orig/src/configure.in vim73/src/configure.in 23944 --- vim73.orig/src/configure.in 2012-0 2-15 21:57:45.061436156+000023945 +++ vim73/src/configure.in 2012-0 2-15 21:57:46.917485111 +000024752 --- 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 23946 24754 @@ -28,6 +28,16 @@ 23947 24755 AC_HEADER_STDC … … 24444 25252 24445 25253 diff -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 @@ 24449 25273 # endif 24450 25274 … … 24462 25286 # ifdef FEAT_FOLDING 24463 25287 curwin = wp; 24464 @@ -1177,10 +11 79,7 @@25288 @@ -1177,10 +1188,7 @@ 24465 25289 { 24466 25290 /* Set 'diff', 'scrollbind' off and 'wrap' on. */ … … 24475 25299 curwin = wp; 24476 25300 diff -Naur vim73.orig/src/digraph.c vim73/src/digraph.c 24477 --- vim73.orig/src/digraph.c 2012-0 2-15 21:57:45.061436156+000024478 +++ vim73/src/digraph.c 2012-0 2-15 21:57:46.757480890 +000025301 --- 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 24479 25303 @@ -2080,13 +2080,13 @@ 24480 25304 /* … … 24525 25349 } 24526 25350 diff -Naur vim73.orig/src/edit.c vim73/src/edit.c 24527 --- vim73.orig/src/edit.c 2012-0 2-15 21:57:45.061436156+000024528 +++ vim73/src/edit.c 2012-0 2-15 21:57:46.885484267+000025351 --- 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 24529 25353 @@ -58,6 +58,10 @@ 24530 25354 }; … … 24568 25392 static int ins_compl_get_exp __ARGS((pos_T *ini)); 24569 25393 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 @@ 24571 25433 goto do_intr; 24572 25434 #endif … … 24580 25442 + if (!p_paste) 24581 25443 + { 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) 24588 25449 + { 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) 24593 25451 + { 24594 + if (stop_arrow() != FAIL) 25452 + /* Insert the new value of v:char literally. */ 25453 + for (p = str; *p != NUL; mb_ptr_adv(p)) 24595 25454 + { 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); 24598 25460 + } 24599 + c = NUL;25461 + AppendToRedobuffLit(str, -1); 24600 25462 + } 24601 + else24602 + c = PTR2CHAR(s);25463 + vim_free(str); 25464 + c = NUL; 24603 25465 + } 24604 25466 + 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. */ 24610 25469 + if (c == NUL) 24611 25470 + break; … … 24615 25474 /* Try to perform smart-indenting. */ 24616 25475 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 @@ 24618 25496 ins_ctrl_v() 24619 25497 { … … 24632 25510 24633 25511 #ifdef FEAT_CMDL_INFO 24634 @@ -1562,8 +16 10,10 @@25512 @@ -1562,8 +1625,10 @@ 24635 25513 #endif 24636 25514 … … 24645 25523 clear_showcmd(); 24646 25524 #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 @@ 24648 25538 static void 24649 25539 undisplay_dollar() … … 24657 25547 } 24658 25548 } 24659 @@ -2133,7 +21 83,7 @@25549 @@ -2133,7 +2194,7 @@ 24660 25550 || c == Ctrl_I || c == Ctrl_D || c == Ctrl_P 24661 25551 || c == Ctrl_N || c == Ctrl_T || c == Ctrl_V … … 24666 25556 return (c == Ctrl_Y || c == Ctrl_E); 24667 25557 case CTRL_X_WHOLE_LINE: 24668 @@ -2658,6 +27 08,7 @@25558 @@ -2658,6 +2719,7 @@ 24669 25559 if (stop_arrow() == FAIL) 24670 25560 return; … … 24674 25564 startcol = curwin->w_cursor.col; 24675 25565 compl_col = startcol; 24676 @@ -3295,7 +33 46,7 @@25566 @@ -3295,7 +3357,7 @@ 24677 25567 /* Deleted more than what was used to find matches or didn't finish 24678 25568 * finding all matches: need to look for matches all over again. */ … … 24683 25573 24684 25574 vim_free(compl_leader); 24685 @@ -3309,6 +33 60,20 @@25575 @@ -3309,6 +3371,20 @@ 24686 25576 } 24687 25577 … … 24704 25594 * Show the popup menu with a different set of matches. 24705 25595 * May also search for matches again if the previous search was interrupted. 24706 @@ -3397,14 +34 62,20 @@25596 @@ -3397,14 +3473,20 @@ 24707 25597 ins_char(c); 24708 25598 … … 24730 25620 24731 25621 /* 24732 @@ -3480,11 +35 51,7 @@25622 @@ -3480,11 +3562,7 @@ 24733 25623 return; 24734 25624 } … … 24743 25633 } 24744 25634 24745 @@ -3653,9 +37 20,6 @@25635 @@ -3653,9 +3731,6 @@ 24746 25636 * memory that was used, and make sure we can redo the insert. */ 24747 25637 if (compl_curr_match != NULL || compl_leader != NULL || c == Ctrl_E) … … 24753 25643 * If any of the original typed text has been changed, eg when 24754 25644 * ignorecase is set, we must add back-spaces to the redo 24755 @@ -3666,25 +37 30,9 @@25645 @@ -3666,25 +3741,9 @@ 24756 25646 */ 24757 25647 if (compl_curr_match != NULL && compl_used_match && c != Ctrl_E) … … 24781 25671 24782 25672 #ifdef FEAT_CINDENT 24783 @@ -3774,6 +38 22,44 @@25673 @@ -3774,6 +3833,44 @@ 24784 25674 } 24785 25675 … … 24826 25716 * (depending on flag) starting from buf and looking for a non-scanned 24827 25717 * buffer (other than curbuf). curbuf is special, if it is called with 24828 @@ -3829,10 +39 15,14 @@25718 @@ -3829,10 +3926,14 @@ 24829 25719 int type; /* CTRL_X_OMNI or CTRL_X_FUNCTION */ 24830 25720 char_u *base; … … 24842 25732 funcname = (type == CTRL_X_FUNCTION) ? curbuf->b_p_cfu : curbuf->b_p_ofu; 24843 25733 if (*funcname == NUL) 24844 @@ -3843,13 +39 33,50 @@25734 @@ -3843,13 +3944,50 @@ 24845 25735 args[1] = base; 24846 25736 … … 24898 25788 #endif /* FEAT_COMPL_FUNC */ 24899 25789 24900 @@ -3876,6 +40 03,33 @@25790 @@ -3876,6 +4014,33 @@ 24901 25791 } 24902 25792 … … 24932 25822 * If the given string is already in the list of completions, then return 24933 25823 * NOTDONE, otherwise add it to the list and return OK. If there is an error, 24934 @@ -3889,6 +40 43,7 @@25824 @@ -3889,6 +4054,7 @@ 24935 25825 char_u *word; 24936 25826 int icase = FALSE; … … 24940 25830 24941 25831 if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL) 24942 @@ -3906,13 +40 61,15 @@25832 @@ -3906,13 +4072,15 @@ 24943 25833 icase = get_dict_number(tv->vval.v_dict, (char_u *)"icase"); 24944 25834 if (get_dict_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL) … … 24957 25847 return ins_compl_add(word, -1, icase, NULL, cptext, dir, 0, adup); 24958 25848 } 24959 @@ -4403,6 +45 60,11 @@25849 @@ -4403,6 +4571,11 @@ 24960 25850 int found_end = FALSE; 24961 25851 int advance; … … 24969 25859 && (compl_shown_match->cp_flags & ORIGINAL_TEXT) == 0) 24970 25860 { 24971 @@ -4994,6 +51 56,8 @@25861 @@ -4994,6 +5167,8 @@ 24972 25862 int col; 24973 25863 char_u *funcname; … … 24978 25868 /* Call 'completefunc' or 'omnifunc' and get pattern length as a 24979 25869 * string */ 24980 @@ -5009,8 +51 73,32@@25870 @@ -5009,8 +5184,40 @@ 24981 25871 args[0] = (char_u *)"1"; 24982 25872 args[1] = NULL; … … 24999 25889 + 25000 25890 + /* 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.*/ 25002 25893 + if (col == -2) 25003 25894 + return FAIL; 25895 + if (col == -3) 25896 + { 25897 + ctrl_x_mode = 0; 25898 + edit_submode = NULL; 25899 + msg_clr_cmdline(); 25900 + return FAIL; 25901 + } 25004 25902 + 25005 25903 + /* … … 25011 25909 if (col < 0) 25012 25910 col = curs_col; 25013 @@ -5089,6 +52 77,10 @@25911 @@ -5089,6 +5296,10 @@ 25014 25912 else 25015 25913 edit_submode = (char_u *)_(CTRL_X_MSG(ctrl_x_mode)); … … 25022 25920 vim_free(compl_orig_text); 25023 25921 compl_orig_text = vim_strnsave(line + compl_col, compl_length); 25024 @@ -5249,7 +54 41,7 @@25922 @@ -5249,7 +5460,7 @@ 25025 25923 compl_curr_match->cp_number); 25026 25924 edit_submode_extra = match_ref; … … 25031 25929 } 25032 25930 } 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 @@ 25034 25951 * Stop at first entered white when 'formatoptions' has 'v' 25035 25952 */ … … 25039 25956 || curwin->w_cursor.col >= Insstart.col) 25040 25957 { 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 @@ 25042 25989 * We can emulate the vi behaviour by pretending there is a dollar 25043 25990 * displayed even when there isn't. … … 25048 25995 25049 25996 #ifdef FEAT_FOLDING 25050 @@ -9598,6 +9 791,7 @@25997 @@ -9598,6 +9811,7 @@ 25051 25998 { 25052 25999 int c; … … 25056 26003 pc_status = PC_STATUS_UNSET; 25057 26004 if (redrawing() && !char_avail()) 25058 @@ -9606,6 +98 00,7 @@26005 @@ -9606,6 +9820,7 @@ 25059 26006 ins_redraw(FALSE); 25060 26007 … … 25064 26011 add_to_showcmd_c(Ctrl_K); 25065 26012 #endif 25066 @@ -9622,8 +98 17,10 @@26013 @@ -9622,8 +9837,10 @@ 25067 26014 c = plain_vgetc(); 25068 26015 --no_mapping; … … 25077 26024 if (IS_SPECIAL(c) || mod_mask) /* special key */ 25078 26025 { 25079 @@ -9635,6 +98 32,7 @@26026 @@ -9635,6 +9852,7 @@ 25080 26027 } 25081 26028 if (c != ESC) … … 25085 26032 { 25086 26033 /* may need to redraw when no more chars available now */ 25087 @@ -9642,11 +98 40,9 @@26034 @@ -9642,11 +9860,9 @@ 25088 26035 25089 26036 if (char2cells(c) == 1) … … 25098 26045 #ifdef FEAT_CMDL_INFO 25099 26046 add_to_showcmd_c(c); 25100 @@ -9657,8 +98 53,10 @@26047 @@ -9657,8 +9873,10 @@ 25101 26048 cc = plain_vgetc(); 25102 26049 --no_mapping; … … 25111 26058 { 25112 26059 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 25113 26122 diff -Naur vim73.orig/src/eval.c vim73/src/eval.c 25114 --- vim73.orig/src/eval.c 2012-0 2-15 21:57:45.065436261+000025115 +++ vim73/src/eval.c 2012-0 2-15 21:57:46.941485744+000026123 --- 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 25116 26125 @@ -10,9 +10,6 @@ 25117 26126 /* … … 25194 26203 static void f_islocked __ARGS((typval_T *argvars, typval_T *rettv)); 25195 26204 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 @@ 25197 26216 #endif 25198 26217 static void f_nextnonblank __ARGS((typval_T *argvars, typval_T *rettv)); … … 25202 26221 #ifdef FEAT_FLOAT 25203 26222 static void f_pow __ARGS((typval_T *argvars, typval_T *rettv)); 25204 @@ -757,6 +75 5,7 @@26223 @@ -757,6 +758,7 @@ 25205 26224 static void f_winsaveview __ARGS((typval_T *argvars, typval_T *rettv)); 25206 26225 static void f_winwidth __ARGS((typval_T *argvars, typval_T *rettv)); … … 25210 26229 static int list2fpos __ARGS((typval_T *arg, pos_T *posp, int *fnump)); 25211 26230 static pos_T *var2fpos __ARGS((typval_T *varp, int dollar_lnum, int *fnum)); 25212 @@ -791,6 +79 0,8 @@26231 @@ -791,6 +793,8 @@ 25213 26232 static void set_var __ARGS((char_u *name, typval_T *varp, int copy)); 25214 26233 static int var_check_ro __ARGS((int flags, char_u *name)); … … 25219 26238 static int item_copy __ARGS((typval_T *from, typval_T *to, int deep, int copyID)); 25220 26239 static char_u *find_option_end __ARGS((char_u **arg, int *opt_flags)); 25221 @@ -853,6 +85 4,7 @@26240 @@ -853,6 +857,7 @@ 25222 26241 25223 26242 init_var_dict(&globvardict, &globvars_var); … … 25227 26246 hash_init(&func_hashtab); 25228 26247 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 '"' */ 25230 26253 25231 26254 #ifdef EBCDIC … … 25236 26259 sortFunctions(); 25237 26260 #endif 25238 @@ -910,6 +91 2,7 @@26261 @@ -910,6 +916,7 @@ 25239 26262 hash_clear(&compat_hashtab); 25240 26263 … … 25244 26267 /* global variables */ 25245 26268 vars_clear(&globvarht); 25246 @@ -1355,7 +13 58,11 @@26269 @@ -1355,7 +1362,11 @@ 25247 26270 { 25248 26271 ga_init2(&ga, (int)sizeof(char), 80); … … 25256 26279 retval = (char_u *)ga.ga_data; 25257 26280 } 25258 @@ -1557,7 +156 4,7 @@26281 @@ -1557,7 +1568,7 @@ 25259 26282 * arguments are currently supported. 25260 26283 * Returns OK or FAIL. … … 25265 26288 char_u *func; 25266 26289 int argc; 25267 @@ -2325,7 +233 2,7 @@26290 @@ -2325,7 +2336,7 @@ 25268 26291 else if (endchars != NULL 25269 26292 && vim_strchr(endchars, *skipwhite(arg)) == NULL) … … 25274 26297 c1 = name[len]; 25275 26298 name[len] = NUL; 25276 @@ -2718,8 +272 5,27 @@26299 @@ -2718,8 +2729,27 @@ 25277 26300 lp->ll_list = NULL; 25278 26301 lp->ll_dict = lp->ll_tv->vval.v_dict; … … 25302 26325 if (*p == '[' || *p == '.' || unlet) 25303 26326 { 25304 @@ -2739,6 +276 5,10 @@26327 @@ -2739,6 +2769,10 @@ 25305 26328 p = NULL; 25306 26329 break; … … 25313 26336 clear_tv(&var1); 25314 26337 lp->ll_tv = &lp->ll_di->di_tv; 25315 @@ -2770,6 +280 0,8 @@26338 @@ -2770,6 +2804,8 @@ 25316 26339 { 25317 26340 if (lp->ll_range && !lp->ll_empty2) … … 25322 26345 } 25323 26346 25324 @@ -2787,7 +28 19,11 @@26347 @@ -2787,7 +2823,11 @@ 25325 26348 { 25326 26349 ni = list_find(lp->ll_list, lp->ll_n2); … … 25334 26357 } 25335 26358 25336 @@ -2795,7 +283 1,11 @@26359 @@ -2795,7 +2835,11 @@ 25337 26360 if (lp->ll_n1 < 0) 25338 26361 lp->ll_n1 = list_idx_of_item(lp->ll_list, lp->ll_li); … … 25346 26369 25347 26370 lp->ll_tv = &lp->ll_li->li_tv; 25348 @@ -3337,6 +33 77,18 @@26371 @@ -3337,6 +3381,18 @@ 25349 26372 int failed = FALSE; 25350 26373 funcdict_T fudi; … … 25365 26388 if (fudi.fd_newkey != NULL) 25366 26389 { 25367 @@ -3386,6 +34 38,9 @@26390 @@ -3386,6 +3442,9 @@ 25368 26391 { 25369 26392 curwin->w_cursor.lnum = lnum; … … 25375 26398 arg = startarg; 25376 26399 if (get_func_tv(name, (int)STRLEN(name), &rettv, &arg, 25377 @@ -4349,7 +440 4,8 @@26400 @@ -4349,7 +4408,8 @@ 25378 26401 else 25379 26402 { … … 25385 26408 n1 = !n1; 25386 26409 } 25387 @@ -4378,7 +443 4,8 @@26410 @@ -4378,7 +4438,8 @@ 25388 26411 else 25389 26412 { … … 25395 26418 n1 = !n1; 25396 26419 } 25397 @@ -5097,9 +515 4,7 @@26420 @@ -5097,9 +5158,7 @@ 25398 26421 else 25399 26422 ret = OK; … … 25406 26429 25407 26430 *arg = skipwhite(*arg); 25408 @@ -5913,10 +59 68,11 @@26431 @@ -5913,10 +5972,11 @@ 25409 26432 * Return TRUE when two lists have exactly the same values. 25410 26433 */ … … 25419 26442 listitem_T *item1, *item2; 25420 26443 25421 @@ -5930,7 +59 86,7 @@26444 @@ -5930,7 +5990,7 @@ 25422 26445 for (item1 = l1->lv_first, item2 = l2->lv_first; 25423 26446 item1 != NULL && item2 != NULL; … … 25428 26451 return item1 == NULL && item2 == NULL; 25429 26452 } 25430 @@ -5952,10 +60 08,11 @@26453 @@ -5952,10 +6012,11 @@ 25431 26454 * Return TRUE when two dictionaries have exactly the same key/values. 25432 26455 */ … … 25441 26464 hashitem_T *hi; 25442 26465 dictitem_T *item2; 25443 @@ -5976,7 +603 3,7 @@26466 @@ -5976,7 +6037,7 @@ 25444 26467 item2 = dict_find(d2, hi->hi_key, -1); 25445 26468 if (item2 == NULL) … … 25450 26473 --todo; 25451 26474 } 25452 @@ -5984,41 +604 1,54 @@26475 @@ -5984,41 +6045,54 @@ 25453 26476 return TRUE; 25454 26477 } … … 25516 26539 25517 26540 case VAR_FUNC: 25518 @@ -6502,47 +657 2,119 @@26541 @@ -6502,47 +6576,119 @@ 25519 26542 return (char_u *)ga.ga_data; 25520 26543 } … … 25653 26676 * 25654 26677 * 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 @@ 25656 26690 * Unreference a Dictionary: decrement the reference count and free it when it 25657 26691 * becomes zero. … … 25662 26696 dict_T *d; 25663 26697 { 25664 @@ -7075,7 +72 17,7 @@26698 @@ -7075,7 +7225,7 @@ 25665 26699 } 25666 26700 … … 25671 26705 */ 25672 26706 int 25673 @@ -7097,6 +72 39,7 @@26707 @@ -7097,6 +7247,7 @@ 25674 26708 dictitem_free(item); 25675 26709 return FAIL; … … 25679 26713 } 25680 26714 25681 @@ -7649,6 +7 792,7 @@26715 @@ -7649,6 +7800,7 @@ 25682 26716 {"acos", 1, 1, f_acos}, /* WJMc */ 25683 26717 #endif … … 25687 26721 {"argc", 0, 0, f_argc}, 25688 26722 {"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 @@ 25690 26742 {"inputsave", 0, 0, f_inputsave}, 25691 26743 {"inputsecret", 1, 2, f_inputsecret}, … … 25695 26747 {"islocked", 1, 1, f_islocked}, 25696 26748 {"items", 1, 1, f_items}, 25697 @@ -7802,7 +7947,7 @@ 26749 @@ -7801,8 +7954,11 @@ 26750 {"log", 1, 1, f_log}, 25698 26751 {"log10", 1, 1, f_log10}, 25699 26752 #endif 26753 +#ifdef FEAT_LUA 26754 + {"luaeval", 1, 2, f_luaeval}, 26755 +#endif 25700 26756 {"map", 2, 2, f_map}, 25701 26757 - {"maparg", 1, 3, f_maparg}, … … 25704 26760 {"match", 2, 4, f_match}, 25705 26761 {"matchadd", 2, 4, f_matchadd}, 25706 @@ -7822,6 +79 67,7 @@26762 @@ -7822,6 +7978,7 @@ 25707 26763 #endif 25708 26764 {"nextnonblank", 1, 1, f_nextnonblank}, … … 25712 26768 #ifdef FEAT_FLOAT 25713 26769 {"pow", 2, 2, f_pow}, 25714 @@ -7870,7 +80 16,7 @@26770 @@ -7870,7 +8027,7 @@ 25715 26771 {"sin", 1, 1, f_sin}, 25716 26772 {"sinh", 1, 1, f_sinh}, … … 25721 26777 {"spellbadword", 0, 1, f_spellbadword}, 25722 26778 {"spellsuggest", 1, 3, f_spellsuggest}, 25723 @@ -7933,6 +80 79,7 @@26779 @@ -7933,6 +8090,7 @@ 25724 26780 {"winsaveview", 0, 0, f_winsaveview}, 25725 26781 {"winwidth", 1, 1, f_winwidth}, … … 25729 26785 25730 26786 #if defined(FEAT_CMDL_COMPL) || defined(PROTO) 25731 @@ -8497,7 +86 44,7 @@26787 @@ -8497,7 +8655,7 @@ 25732 26788 if (argvars[0].v_type == VAR_LIST) 25733 26789 { … … 25738 26794 copy_tv(&argvars[0], rettv); 25739 26795 } 25740 @@ -8506,6 +86 53,18 @@26796 @@ -8506,6 +8664,18 @@ 25741 26797 } 25742 26798 … … 25757 26813 */ 25758 26814 static void 25759 @@ -9298,7 +94 57,7 @@26815 @@ -9298,7 +9468,7 @@ 25760 26816 25761 26817 if (!error) … … 25766 26822 } 25767 26823 25768 @@ -9389,7 +95 48,7 @@26824 @@ -9389,7 +9559,7 @@ 25769 26825 } 25770 26826 … … 25775 26831 } 25776 26832 } 25777 @@ -9416,7 +95 75,7 @@26833 @@ -9416,7 +9586,7 @@ 25778 26834 if (!HASHITEM_EMPTY(hi)) 25779 26835 { … … 25784 26840 } 25785 26841 } 25786 @@ -9857, 7 +10016,7@@26842 @@ -9857,17 +10027,36 @@ 25787 26843 char_u *s; 25788 26844 int len; … … 25792 26848 expand_T xpc; 25793 26849 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 @@ 25796 26882 * for 'wildignore' and don't put matches for 'suffixes' at the end. */ 25797 26883 if (argvars[1].v_type != VAR_UNKNOWN … … 25806 26892 + if (p_wic) 25807 26893 + 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 + } 25809 26906 } 25810 26907 else 25811 26908 rettv->vval.v_string = NULL; 25812 @@ -9896,6 +100 57,8 @@26909 @@ -9896,6 +10098,8 @@ 25813 26910 typval_T *argvars; 25814 26911 typval_T *rettv; … … 25819 26916 { 25820 26917 list_T *l1, *l2; 25821 @@ -9905,7 +10 068,7 @@26918 @@ -9905,7 +10109,7 @@ 25822 26919 25823 26920 l1 = argvars[0].vval.v_list; … … 25828 26925 { 25829 26926 if (argvars[2].v_type != VAR_UNKNOWN) 25830 @@ -9944,7 +101 07,7 @@26927 @@ -9944,7 +10148,7 @@ 25831 26928 25832 26929 d1 = argvars[0].vval.v_dict; … … 25837 26934 { 25838 26935 /* 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 @@ 25840 26946 typval_T save_key; 25841 26947 int rem; … … 25863 26969 } 25864 26970 else 25865 @@ -10236,7 +104 01,8 @@26971 @@ -10236,7 +10442,8 @@ 25866 26972 { 25867 26973 --todo; … … 25873 26979 vimvars[VV_KEY].vv_str = vim_strsave(di->di_key); 25874 26980 if (filter_map_one(&di->di_tv, expr, map, &rem) == FAIL 25875 @@ -10255,7 +104 21,7 @@26981 @@ -10255,7 +10462,7 @@ 25876 26982 25877 26983 for (li = l->lv_first; li != NULL; li = nli) … … 25882 26988 nli = li->li_next; 25883 26989 vimvars[VV_KEY].vv_nr = idx; 25884 @@ -10839,6 +110 05,11 @@26990 @@ -10839,6 +11046,11 @@ 25885 26991 25886 26992 if (*varname == '&') /* buffer-local-option */ … … 25894 27000 { 25895 27001 if (*varname == NUL) 25896 @@ -11039,18 +112 10,22 @@27002 @@ -11039,18 +11251,22 @@ 25897 27003 typval_T *argvars UNUSED; 25898 27004 typval_T *rettv; … … 25924 27030 } 25925 27031 25926 @@ -11653, 7 +11828,7@@27032 @@ -11653,22 +11869,44 @@ 25927 27033 typval_T *argvars; 25928 27034 typval_T *rettv; … … 25933 27039 int error = FALSE; 25934 27040 25935 @@ -11661,14 +11836,16 @@ 25936 25937 25938 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)) 25939 27045 - flags |= WILD_KEEP_ALL; 25940 + options |= WILD_KEEP_ALL;27046 + * for 'wildignore' and don't put matches for 'suffixes' at the end. */ 25941 27047 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 + } 25942 27059 if (!error) 25943 27060 { 25944 27061 ExpandInit(&xpc); 25945 27062 xpc.xp_context = EXPAND_FILES; 27063 - rettv->vval.v_string = ExpandOne(&xpc, get_tv_string(&argvars[0]), 27064 - NULL, flags, WILD_ALL); 25946 27065 + if (p_wic) 25947 27066 + 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]), 25950 27069 + 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 + } 25951 27081 } 25952 27082 else 25953 27083 rettv->vval.v_string = NULL; 25954 @@ -11741,9 +119 18,6 @@27084 @@ -11741,9 +11979,6 @@ 25955 27085 #ifdef __QNX__ 25956 27086 "qnx", … … 25962 27092 "unix", 25963 27093 #endif 25964 @@ -11856,7 +120 30,7 @@27094 @@ -11856,7 +12091,7 @@ 25965 27095 #ifdef FEAT_SEARCHPATH 25966 27096 "file_in_path", 25967 27097 #endif 25968 27098 -#if defined(UNIX) && !defined(USE_SYSTEM) 25969 +#if (defined(UNIX) && !defined(USE_SYSTEM)) || defined(WIN3264)27099 +#ifdef FEAT_FILTERPIPE 25970 27100 "filterpipe", 25971 27101 #endif 25972 27102 #ifdef FEAT_FIND_ID 25973 @@ -12002,9 +12 176,6 @@27103 @@ -12002,9 +12237,6 @@ 25974 27104 #ifdef FEAT_OLE 25975 27105 "ole", … … 25981 27111 "path_extra", 25982 27112 #endif 25983 @@ -12116,6 +12 287,9 @@27113 @@ -12116,6 +12348,9 @@ 25984 27114 #ifdef FEAT_TOOLBAR 25985 27115 "toolbar", … … 25991 27121 "user-commands", /* was accidentally included in 5.4 */ 25992 27122 "user_commands", 25993 @@ -12159,6 +123 33,9 @@27123 @@ -12159,6 +12394,9 @@ 25994 27124 #ifdef FEAT_XFONTSET 25995 27125 "xfontset", … … 26001 27131 "xsmp", 26002 27132 #endif 26003 @@ -12572,7 +12 749,7 @@27133 @@ -12572,7 +12810,7 @@ 26004 27134 } 26005 27135 … … 26010 27140 rettv->vval.v_number = idx; 26011 27141 break; 26012 @@ -12712,7 +12 889,7 @@27142 @@ -12712,7 +12950,7 @@ 26013 27143 IObuff[0] = NUL; 26014 27144 if (message != NULL && defstr != NULL … … 26019 27149 else 26020 27150 { 26021 @@ -12850,7 +130 27,7 @@27151 @@ -12850,7 +13088,7 @@ 26022 27152 if (argvars[0].v_type != VAR_LIST) 26023 27153 EMSG2(_(e_listarg), "insert()"); … … 26028 27158 if (argvars[2].v_type != VAR_UNKNOWN) 26029 27159 before = get_tv_number_chk(&argvars[2], &error); 26030 @@ -12877,6 +13 054,17 @@27160 @@ -12877,6 +13115,17 @@ 26031 27161 } 26032 27162 … … 26046 27176 */ 26047 27177 static void 26048 @@ -13290,8 +13 478,10 @@27178 @@ -13290,8 +13539,10 @@ 26049 27179 char_u *keys_buf = NULL; 26050 27180 char_u *rhs; … … 26058 27188 /* return empty string for failure */ 26059 27189 rettv->v_type = VAR_STRING; 26060 @@ -13305,7 +13 495,11 @@27190 @@ -13305,7 +13556,11 @@ 26061 27191 { 26062 27192 which = get_tv_string_buf_chk(&argvars[1], buf); … … 26070 27200 else 26071 27201 which = (char_u *)""; 26072 @@ -13315,19 +135 09,34 @@27202 @@ -13315,19 +13570,34 @@ 26073 27203 mode = get_map_mode(&which, 0); 26074 27204 … … 26115 27245 } 26116 27246 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 @@ 26118 27272 } 26119 27273 … … 26134 27288 */ 26135 27289 static void 26136 @@ -14177,22 +14 398,19 @@27290 @@ -14177,22 +14476,19 @@ 26137 27291 typval_T *rettv; 26138 27292 { … … 26168 27322 if (argvars[1].v_type != VAR_UNKNOWN) 26169 27323 { 26170 @@ -14214,49 +14 432,61 @@27324 @@ -14214,49 +14510,61 @@ 26171 27325 return; 26172 27326 } … … 26261 27415 } 26262 27416 li->li_tv.v_type = VAR_STRING; 26263 @@ -14264,71 +14 494,109@@27417 @@ -14264,71 +14572,111 @@ 26264 27418 li->li_tv.vval.v_string = s; 26265 27419 list_append(rettv->vval.v_list, li); … … 26360 27514 + prevsize = (long)(p - start); 26361 27515 + 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) 26362 27524 { 26363 27525 - mch_memmove(s, prev, prevlen); … … 26366 27528 - prev = s; 26367 27529 - 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 + {26374 27530 + do_outofmem_msg((long_u)prevsize); 26375 27531 + failed = TRUE; 26376 27532 + break; 26377 +}27533 } 26378 27534 + prev = newprev; 26379 27535 } 26380 27536 - filtd = 0; 27537 - } 27538 - else 27539 - { 27540 - mch_memmove(buf, buf + tolist, buflen - tolist); 27541 - filtd -= tolist; 26381 27542 + /* Add the line part to end of "prev". */ 26382 27543 + mch_memmove(prev + prevlen, start, p - start); 26383 27544 + prevlen += (long)(p - start); 26384 27545 } 26385 - else26386 - {26387 - mch_memmove(buf, buf + tolist, buflen - tolist);26388 - filtd -= tolist;26389 - }26390 27546 - } 26391 27547 + } /* while */ … … 26413 27569 fclose(fd); 26414 27570 } 26415 @@ -14691,13 +1 4959,14 @@27571 @@ -14691,13 +15039,14 @@ 26416 27572 char_u *key; 26417 27573 dict_T *d; … … 26429 27585 key = get_tv_string_chk(&argvars[1]); 26430 27586 if (key != NULL) 26431 @@ -14717,7 +1 4986,7 @@27587 @@ -14717,7 +15066,7 @@ 26432 27588 else if (argvars[0].v_type != VAR_LIST) 26433 27589 EMSG2(_(e_listdictarg), "remove()"); … … 26438 27594 int error = FALSE; 26439 27595 26440 @@ -14847,6 +151 16,9 @@27596 @@ -14847,6 +15196,9 @@ 26441 27597 typval_T *rettv; 26442 27598 { … … 26448 27604 p = get_tv_string(&argvars[0]); 26449 27605 #ifdef FEAT_SHORTCUT 26450 @@ -14862,7 +15 134,6 @@27606 @@ -14862,7 +15214,6 @@ 26451 27607 #else 26452 27608 # ifdef HAVE_READLINK … … 26456 27612 int len; 26457 27613 char_u *remain = NULL; 26458 @@ -14879,7 +15 150,10 @@27614 @@ -14879,7 +15230,10 @@ 26459 27615 26460 27616 len = STRLEN(p); … … 26467 27623 q = getnextcomp(p); 26468 27624 if (*q != NUL) 26469 @@ -14890,6 +15 164,10 @@27625 @@ -14890,6 +15244,10 @@ 26470 27626 q[-1] = NUL; 26471 27627 } … … 26478 27634 { 26479 27635 for (;;) 26480 @@ -15033,6 +153 11,7 @@27636 @@ -15033,6 +15391,7 @@ 26481 27637 26482 27638 #ifdef HAVE_READLINK … … 26486 27642 rettv->v_type = VAR_STRING; 26487 27643 } 26488 @@ -15051,7 +15 330,7 @@27644 @@ -15051,7 +15410,7 @@ 26489 27645 if (argvars[0].v_type != VAR_LIST) 26490 27646 EMSG2(_(e_listarg), "reverse()"); … … 26495 27651 li = l->lv_last; 26496 27652 l->lv_first = l->lv_last = NULL; 26497 @@ -16256,6 +16 535,7 @@27653 @@ -16256,6 +16615,7 @@ 26498 27654 26499 27655 static int item_compare_ic; … … 26503 27659 #define ITEM_COMPARE_FAIL 999 26504 27660 26505 @@ -16315,7 +16 595,8 @@27661 @@ -16315,7 +16675,8 @@ 26506 27662 26507 27663 rettv.v_type = VAR_UNKNOWN; /* clear_tv() uses this */ … … 26513 27669 clear_tv(&argv[1]); 26514 27670 26515 @@ -16348,7 +16 629,8 @@27671 @@ -16348,7 +16709,8 @@ 26516 27672 else 26517 27673 { … … 26523 27679 rettv->vval.v_list = l; 26524 27680 rettv->v_type = VAR_LIST; 26525 @@ -16360,8 +16 642,10 @@27681 @@ -16360,8 +16722,10 @@ 26526 27682 26527 27683 item_compare_ic = FALSE; … … 26534 27690 item_compare_func = argvars[1].vval.v_string; 26535 27691 else 26536 @@ -16376,6 +16 660,17 @@27692 @@ -16376,6 +16740,17 @@ 26537 27693 else 26538 27694 item_compare_func = get_tv_string(&argvars[1]); … … 26552 27708 26553 27709 /* Make an array with each entry pointing to an item in the List. */ 26554 @@ -17512,18 +178 07,22 @@27710 @@ -17512,18 +17887,22 @@ 26555 27711 typval_T *argvars UNUSED; 26556 27712 typval_T *rettv; … … 26576 27732 26577 27733 /* 26578 @@ -17711,7 +180 10,7 @@27734 @@ -17711,7 +18090,7 @@ 26579 27735 typval_T *argvars; 26580 27736 typval_T *rettv; … … 26585 27741 char_u *tostr; 26586 27742 char_u *p; 26587 @@ -17728,7 +18 027,7 @@27743 @@ -17728,7 +18107,7 @@ 26588 27744 char_u buf2[NUMBUFLEN]; 26589 27745 garray_T ga; … … 26594 27750 tostr = get_tv_string_buf_chk(&argvars[2], buf2); 26595 27751 26596 @@ -17754,19 +18 053,19 @@27752 @@ -17754,19 +18133,19 @@ 26597 27753 } 26598 27754 … … 26618 27774 for (p = tostr; *p != NUL; p += tolen) 26619 27775 { 26620 @@ -17785,11 +18 084,11 @@27776 @@ -17785,11 +18164,11 @@ 26621 27777 ++idx; 26622 27778 } … … 26632 27788 for (p = tostr; *p != NUL; p += tolen) 26633 27789 { 26634 @@ -17804,18 +181 03,18 @@27790 @@ -17804,18 +18183,18 @@ 26635 27791 mch_memmove((char *)ga.ga_data + ga.ga_len, cpstr, (size_t)cplen); 26636 27792 ga.ga_len += cplen; … … 26655 27811 } 26656 27812 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 @@ 26658 27840 } 26659 27841 … … 26675 27857 * Returns NULL when there is an error. 26676 27858 */ 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 @@ 26678 27873 * worked find the variable again. Don't auto-load a script if it was 26679 27874 * loaded already, otherwise it would be loaded every time when … … 26692 27887 return NULL; 26693 27888 } 26694 @@ -19730,7 +20 047,6 @@27889 @@ -19730,7 +20133,6 @@ 26695 27890 dictitem_T *v; 26696 27891 char_u *varname; … … 26700 27895 ht = find_var_ht(name, &varname); 26701 27896 if (ht == NULL || *varname == NUL) 26702 @@ -19740,25 +20 056,8 @@27897 @@ -19740,25 +20142,8 @@ 26703 27898 } 26704 27899 v = find_var_in_ht(ht, varname, TRUE); … … 26728 27923 if (v != NULL) 26729 27924 { 26730 @@ -19824,13 +20 123,8 @@27925 @@ -19824,13 +20209,8 @@ 26731 27926 } 26732 27927 … … 26744 27939 v = (dictitem_T *)alloc((unsigned)(sizeof(dictitem_T) 26745 27940 + STRLEN(varname))); 26746 @@ -19895,6 +20 189,55 @@27941 @@ -19895,6 +20275,55 @@ 26747 27942 } 26748 27943 … … 26800 27995 * Also give an error message, using "name". 26801 27996 */ 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 @@ 26803 28012 exarg_T *eap; 26804 28013 { … … 26808 28017 int c; 26809 28018 int saved_did_emsg; 26810 @@ -20548,6 +20 892,15 @@28019 @@ -20548,6 +20984,15 @@ 26811 28020 arg = vim_strsave(arg); 26812 28021 if (arg == NULL) … … 26824 28033 *p = c; 26825 28034 newargs.ga_len++; 26826 @@ -20623,7 +2 0976,8 @@28035 @@ -20623,7 +21068,8 @@ 26827 28036 nesting = 0; 26828 28037 for (;;) … … 26834 28043 sourcing_lnum_off = sourcing_lnum; 26835 28044 26836 @@ -20726,6 +21 080,8 @@28045 @@ -20726,6 +21172,8 @@ 26837 28046 && (!ASCII_ISALPHA(p[2]) || p[2] == 'r')) 26838 28047 || (p[0] == 't' && p[1] == 'c' … … 26843 28052 && (!ASCII_ISALPHA(p[3]) || p[3] == 'y')) 26844 28053 || (p[0] == 'm' && p[1] == 'z' 26845 @@ -21562,6 +2 1918,9 @@28054 @@ -21562,6 +22010,9 @@ 26846 28055 ++hi; 26847 28056 fp = HI2UF(hi); … … 26853 28062 return fp->uf_name; /* prevents overflow */ 26854 28063 26855 @@ -21921,8 +22 280,12 @@28064 @@ -21921,8 +22372,12 @@ 26856 28065 s = tv2string(&argvars[i], &tofree, numbuf2, 0); 26857 28066 if (s != NULL) … … 26868 28077 } 26869 28078 } 26870 @@ -22010,8 +22 373,12 @@28079 @@ -22010,8 +22465,12 @@ 26871 28080 s = tv2string(fc->rettv, &tofree, numbuf2, 0); 26872 28081 if (s != NULL) … … 26883 28092 } 26884 28093 } 26885 @@ -22519,18 +22 886,21 @@28094 @@ -22519,18 +22978,21 @@ 26886 28095 if (tab != NULL) 26887 28096 { … … 26910 28119 (int)(tab - virp->vir_line + 1), TRUE); 26911 28120 #ifdef FEAT_FLOAT 26912 @@ -22539,9 +2 2909,27@@28121 @@ -22539,9 +23001,28 @@ 26913 28122 #endif 26914 28123 else … … 26926 28135 + vim_free(tv.vval.v_string); 26927 28136 + tv = *etv; 28137 + vim_free(etv); 26928 28138 + } 26929 28139 + } … … 26939 28149 } 26940 28150 } 26941 @@ -22583,8 +2 2971,10 @@28151 @@ -22583,8 +23064,10 @@ 26942 28152 case VAR_STRING: s = "STR"; break; 26943 28153 case VAR_NUMBER: s = "NUM"; break; … … 26951 28161 } 26952 28162 fprintf(fp, "!%s\t%s\t", this_var->di_key, s); 26953 @@ -22656,7 +23 046,7 @@28163 @@ -22656,7 +23139,7 @@ 26954 28164 f = -f; 26955 28165 sign = '-'; … … 26960 28170 || put_eol(fd) == FAIL) 26961 28171 return FAIL; 26962 @@ -23019,6 +23 409,7 @@28172 @@ -23019,6 +23502,7 @@ 26963 28173 int c; 26964 28174 int has_fullname = 0; … … 26968 28178 #endif 26969 28179 26970 @@ -23193,24 +23 584,25 @@28180 @@ -23193,24 +23677,25 @@ 26971 28181 } 26972 28182 … … 27001 28211 { 27002 28212 if (shortpath_for_partial(fnamep, bufp, fnamelen) == FAIL) 27003 @@ -23218,18 +23 610,16 @@28213 @@ -23218,18 +23703,16 @@ 27004 28214 } 27005 28215 else … … 27024 28234 return -1; 27025 28235 diff -Naur vim73.orig/src/ex_cmds.c vim73/src/ex_cmds.c 27026 --- vim73.orig/src/ex_cmds.c 2012-0 2-15 21:57:45.057436051+000027027 +++ vim73/src/ex_cmds.c 2012-0 2-15 21:57:46.717479836+000028236 --- 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 27028 28238 @@ -11,10 +11,6 @@ 27029 28239 * ex_cmds.c: some functions for command line commands … … 27037 28247 #include "version.h" 27038 28248 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 @@ 27040 28258 /* When sorting numbers "start_col_nr" is the number, not the column 27041 28259 * number. */ … … 27047 28265 { 27048 28266 /* We need to copy one line into "sortbuf1", because there is no 27049 @@ -482,7 +47 9,7 @@28267 @@ -482,7 +478,7 @@ 27050 28268 * of the match, by temporarily terminating the string there */ 27051 28269 s2 = s + end_col; … … 27056 28274 p = s + start_col; 27057 28275 if (sort_hex) 27058 @@ -491,9 +48 8,13 @@28276 @@ -491,9 +487,13 @@ 27059 28277 s = skiptodigit(p); 27060 28278 if (s > p && s[-1] == '-') … … 27073 28291 else 27074 28292 { 27075 @@ -819,7 +8 20,13 @@28293 @@ -819,7 +819,13 @@ 27076 28294 curwin->w_cursor.lnum = dest + (line2 - line1) + 1; 27077 28295 … … 27088 28306 changed_lines(dest + 1, 0, line1 + num_lines, 0L); 27089 28307 27090 @@ -898,9 +90 5,6 @@28308 @@ -898,9 +904,6 @@ 27091 28309 * Handle the ":!cmd" command. Also for ":r !cmd" and ":w !cmd" 27092 28310 * Bangs in the argument are replaced with the previously entered command. … … 27098 28316 void 27099 28317 do_bang(addr_count, eap, forceit, do_in, do_out) 27100 @@ -979,11 +98 3,7 @@28318 @@ -979,11 +982,7 @@ 27101 28319 trailarg = NULL; 27102 28320 while (*p) … … 27111 28329 if (p > newcmd && p[-1] == '\\') 27112 28330 STRMOVE(p - 1, p); 27113 @@ -1113,7 +111 3,7 @@28331 @@ -1113,7 +1112,7 @@ 27114 28332 if (do_out) 27115 28333 shell_flags |= SHELL_DOOUT; 27116 28334 27117 28335 -#if !defined(USE_SYSTEM) && defined(UNIX) 27118 +#if (!defined(USE_SYSTEM) && defined(UNIX)) || defined(WIN3264)28336 +#ifdef FEAT_FILTERPIPE 27119 28337 if (!do_in && do_out && !p_stmp) 27120 28338 { 27121 28339 /* Use a pipe to fetch stdout of the command, do not use a temp file. */ 27122 @@ -1577,14 +157 7,8 @@28340 @@ -1577,14 +1576,8 @@ 27123 28341 if (p != NULL) 27124 28342 *p = NUL; … … 27135 28353 { 27136 28354 p = vim_strchr(cmd, '|'); 27137 @@ -1633,16 +162 7,9 @@28355 @@ -1633,16 +1626,9 @@ 27138 28356 else 27139 28357 vim_snprintf((char *)end, (size_t)(buflen - (end - buf)), … … 27152 28370 (char *)opt, (char *)fname); 27153 28371 } 27154 @@ -1843,11 +18 30,7 @@28372 @@ -1843,11 +1829,7 @@ 27155 28373 #ifdef VMS 27156 28374 (char_u *)"-tmp", … … 27164 28382 FALSE); 27165 28383 if (tempname == NULL) /* out of memory */ 27166 @@ -2700,6 +268 3,10 @@28384 @@ -2700,6 +2682,10 @@ 27167 28385 TRUE); 27168 28386 do_modelines(0); … … 27175 28393 } 27176 28394 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 @@ 27178 28405 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) 27179 28406 if (p_confirm || cmdmod.confirm) … … 27184 28411 dialog_msg(buff, _("Overwrite existing file \"%s\"?"), fname); 27185 28412 if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 2) != VIM_YES) 27186 @@ -2790,7 +277 7,7 @@28413 @@ -2790,7 +2776,7 @@ 27187 28414 /* For ":w! filename" check that no swap file exists for "filename". */ 27188 28415 if (other && !emsg_silent) … … 27193 28420 int r; 27194 28421 char_u *swapname; 27195 @@ -2801,20 +278 8,29 @@28422 @@ -2801,20 +2787,29 @@ 27196 28423 * Use 'shortname' of the current buffer, since there is no buffer 27197 28424 * for the written file. */ … … 27224 28451 dialog_msg(buff, 27225 28452 _("Swap file \"%s\" exists, overwrite anyway?"), 27226 @@ -2964,7 +29 60,7 @@28453 @@ -2964,7 +2959,7 @@ 27227 28454 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) 27228 28455 if ((p_confirm || cmdmod.confirm) && buf->b_fname != NULL) … … 27233 28460 if (buf->b_p_ro) 27234 28461 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); 27237 28468 27238 28469 #ifdef FEAT_AUTOCMD … … 27247 28478 if (aborting()) /* autocmds may abort script processing */ 27248 28479 { 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 @@ 27250 28490 curbuf->b_p_bin = FALSE; /* reset 'bin' before reading file */ 27251 28491 curwin->w_p_nu = 0; /* no line numbers */ … … 27258 28498 curwin->w_p_arab = FALSE; /* no arabic mode */ 27259 28499 #endif 27260 @@ -3631,10 +363 2,6 @@28500 @@ -3631,10 +3631,6 @@ 27261 28501 */ 27262 28502 check_arg_idx(curwin); … … 27269 28509 if (!auto_buf) 27270 28510 #endif 27271 @@ -4109,8 +410 6,8 @@28511 @@ -4109,8 +4105,8 @@ 27272 28512 switch (*kind) 27273 28513 { … … 27280 28520 break; 27281 28521 27282 @@ -4637,7 +463 4,15 @@28522 @@ -4637,7 +4633,15 @@ 27283 28523 * for a match in this line again. */ 27284 28524 skip_match = TRUE; … … 27297 28537 } 27298 28538 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 @@ 27300 28558 global_exe(cmd) 27301 28559 char_u *cmd; … … 27309 28567 /* 27310 28568 * Set current position only once for a global command. 27311 @@ -5398,8 +540 4,10 @@28569 @@ -5398,8 +5406,10 @@ 27312 28570 msg_didout = FALSE; 27313 28571 … … 27322 28580 } 27323 28581 27324 @@ -5409,7 +541 7,7 @@28582 @@ -5409,7 +5419,7 @@ 27325 28583 vir_T *virp; 27326 28584 int force; … … 27331 28589 if (force || old_sub == NULL) 27332 28590 old_sub = viminfo_readstring(virp, 1, TRUE); 27333 @@ -5471,9 +54 79,8 @@28591 @@ -5471,9 +5481,8 @@ 27334 28592 return FALSE; 27335 28593 curwin->w_p_pvw = TRUE; … … 27343 28601 curwin->w_p_diff = FALSE; /* no 'diff' */ 27344 28602 # endif 27345 @@ -5514,6 +552 1,9 @@28603 @@ -5514,6 +5523,9 @@ 27346 28604 int len; 27347 28605 char_u *lang; … … 27353 28611 if (eap != NULL) 27354 28612 { 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 @@ 27356 28623 if (!p_im) 27357 28624 restart_edit = 0; /* don't want insert mode in help file */ … … 27366 28633 do_tag(tag, DT_HELP, 1, FALSE, TRUE); 27367 28634 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 @@ 27369 28666 char_u *line; 27370 28667 int in_example = FALSE; … … 27374 28671 char_u *rt; 27375 28672 int mustfree; 27376 @@ -6025,124 +60 42,187 @@28673 @@ -6025,124 +6067,187 @@ 27377 28674 } 27378 28675 … … 27653 28950 } 27654 28951 } 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 @@ 27656 28965 struct sign 27657 28966 { … … 27663 28972 char_u *sn_icon; /* name of pixmap */ 27664 28973 #ifdef FEAT_SIGN_ICONS 27665 @@ -6572,7 +66 51,7 @@28974 @@ -6572,7 +6679,7 @@ 27666 28975 }; 27667 28976 … … 27672 28981 static int sign_cmd_idx __ARGS((char_u *begin_cmd, char_u *end_cmd)); 27673 28982 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) 27675 28992 EMSG(_("E156: Missing sign name")); 27676 28993 else … … 27687 29004 for (sp = first_sign; sp != NULL; sp = sp->sn_next) 27688 29005 { 27689 @@ -6669,46 +67 53,52 @@29006 @@ -6669,46 +6781,52 @@ 27690 29007 /* ":sign define {name} ...": define a sign */ 27691 29008 if (sp == NULL) … … 27768 29085 27769 29086 /* set values for a defined sign. */ 27770 @@ -6886,6 + 6976,8 @@29087 @@ -6886,6 +7004,8 @@ 27771 29088 arg = skiptowhite(arg); 27772 29089 if (*arg != NUL) … … 27778 29095 { 27779 29096 diff -Naur vim73.orig/src/ex_cmds.h vim73/src/ex_cmds.h 27780 --- vim73.orig/src/ex_cmds.h 2012-0 2-15 21:57:45.057436051+000027781 +++ vim73/src/ex_cmds.h 2012-0 2-15 21:57:46.973486588+000029097 --- 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 27782 29099 @@ -102,7 +102,7 @@ 27783 29100 EX(CMD_aboveleft, "aboveleft", ex_wrongmodifier, … … 27789 29106 RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN), 27790 29107 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, 27791 29117 @@ -788,7 +788,7 @@ 27792 29118 EX(CMD_rubyfile, "rubyfile", ex_rubyfile, … … 27817 29143 EX(CMD_xit, "xit", ex_exit, 27818 29144 diff -Naur vim73.orig/src/ex_cmds2.c vim73/src/ex_cmds2.c 27819 --- vim73.orig/src/ex_cmds2.c 2012-0 2-15 21:57:45.061436156+000027820 +++ vim73/src/ex_cmds2.c 2012-0 2-15 21:57:46.933485534+000029145 --- 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 27821 29147 @@ -11,10 +11,6 @@ 27822 29148 * ex_cmds2.c: some more functions for command line commands … … 27881 29207 */ 27882 29208 void 27883 @@ -1496, 7 +1486,7@@29209 @@ -1496,9 +1486,10 @@ 27884 29210 buf_T *buf; 27885 29211 int checkall; /* may abandon all changed buffers */ … … 27889 29215 int ret; 27890 29216 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 @@ 27893 29396 } 27894 29397 … … 27899 29402 */ 27900 29403 static int 27901 @@ -2165,9 +2 155,7 @@29404 @@ -2165,9 +2221,7 @@ 27902 29405 { 27903 29406 if (win_split(0, 0) == FAIL) … … 27910 29413 else 27911 29414 #endif 27912 @@ -2946,11 + 2934,7 @@29415 @@ -2946,11 +3000,7 @@ 27913 29416 proftime_T wait_start; 27914 29417 #endif … … 27922 29425 return retval; 27923 29426 fname_exp = fix_fname(p); 27924 @@ -3286,7 +3 270,11 @@29427 @@ -3286,7 +3336,11 @@ 27925 29428 27926 29429 for (i = 1; i <= script_items.ga_len && !got_int; ++i) … … 27931 29434 + NameBuff, MAXPATHL, TRUE); 27932 29435 + smsg((char_u *)"%3d: %s", i, NameBuff); 27933 + 29436 + } 27934 29437 } 27935 29438 27936 29439 # if defined(BACKSLASH_IN_FILENAME) || defined(PROTO) 27937 @@ -3412,7 +34 00,7 @@29440 @@ -3412,7 +3466,7 @@ 27938 29441 { 27939 29442 struct source_cookie *sp = (struct source_cookie *)cookie; … … 27944 29447 #ifdef FEAT_EVAL 27945 29448 /* If breakpoints have been added/deleted need to check for it. */ 27946 @@ -3451,28 +3 439,40@@29449 @@ -3451,28 +3505,49 @@ 27947 29450 { 27948 29451 /* compensate for the one line read-ahead */ … … 27970 29473 + garray_T ga; 27971 29474 + 27972 + ga_init2(&ga, (int)sizeof(char_u), 200);29475 + ga_init2(&ga, (int)sizeof(char_u), 400); 27973 29476 + ga_concat(&ga, line); 27974 29477 + ga_concat(&ga, p + 1); … … 27982 29485 + if (*p != '\\') 27983 29486 + 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 + } 27984 29496 + ga_concat(&ga, p + 1); 27985 29497 + } … … 28000 29512 s = string_convert(&sp->conv, line, NULL); 28001 29513 if (s != NULL) 28002 @@ -4166,11 +4 166,90 @@29514 @@ -4166,11 +4241,90 @@ 28003 29515 /* Set v:lang, v:lc_time and v:ctype to the final result. */ 28004 29516 set_lang_var(); … … 28091 29603 * Function given to ExpandGeneric() to obtain the possible arguments of the 28092 29604 * ":language" command. 28093 @@ -4186,7 +4 265,25 @@29605 @@ -4186,7 +4340,25 @@ 28094 29606 return (char_u *)"ctype"; 28095 29607 if (idx == 2) … … 28119 29631 28120 29632 diff -Naur vim73.orig/src/ex_docmd.c vim73/src/ex_docmd.c 28121 --- vim73.orig/src/ex_docmd.c 2012-0 2-15 21:57:45.041435628+000028122 +++ vim73/src/ex_docmd.c 2012-0 2-15 21:57:46.965486377+000029633 --- 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 28123 29635 @@ -61,6 +61,7 @@ 28124 29636 static char_u *do_one_cmd __ARGS((char_u **, int, char_u *(*fgetline)(int, void *, int), void *cookie)); … … 28597 30109 #endif 28598 30110 #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 @@ 28600 30129 else /* n == 2 */ 28601 30130 { … … 28614 30143 return FAIL; 28615 30144 } 28616 @@ -4777,12 +484 0,10 @@30145 @@ -4777,12 +4848,10 @@ 28617 30146 #ifdef FEAT_MBYTE 28618 30147 else if (STRNCMP(arg, "enc", 3) == 0) … … 28631 30160 } 28632 30161 else if (STRNCMP(arg, "bad", 3) == 0) 28633 @@ -4894,7 +49 55,7 @@30162 @@ -4894,7 +4963,7 @@ 28634 30163 map_clear(eap->cmd, eap->arg, TRUE, TRUE); 28635 30164 } … … 28640 30169 ex_autocmd(eap) 28641 30170 exarg_T *eap; 28642 @@ -4921,8 +49 82,12 @@30171 @@ -4921,8 +4990,12 @@ 28643 30172 ex_doautocmd(eap) 28644 30173 exarg_T *eap; … … 28655 30184 #endif 28656 30185 28657 @@ -5087,12 +51 52,14 @@30186 @@ -5087,12 +5160,14 @@ 28658 30187 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) 28659 30188 if ((p_confirm || cmdmod.confirm) && curbuf->b_fname != NULL) … … 28673 30202 if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 1) == VIM_YES) 28674 30203 return OK; 28675 @@ -5263,7 +5330,9 @@ 30204 @@ -5262,8 +5337,11 @@ 30205 } command_complete[] = 28676 30206 { 28677 30207 {EXPAND_AUGROUP, "augroup"}, 30208 + {EXPAND_BEHAVE, "behave"}, 28678 30209 {EXPAND_BUFFERS, "buffer"}, 28679 30210 + {EXPAND_COLORS, "color"}, … … 28683 30214 {EXPAND_CSCOPE, "cscope"}, 28684 30215 #endif 28685 @@ -5276,10 +53 45,15@@30216 @@ -5276,10 +5354,18 @@ 28686 30217 {EXPAND_EVENTS, "event"}, 28687 30218 {EXPAND_EXPRESSION, "expression"}, … … 28692 30223 {EXPAND_HELP, "help"}, 28693 30224 {EXPAND_HIGHLIGHT, "highlight"}, 30225 +#if defined(FEAT_CMDHIST) 30226 + {EXPAND_HISTORY, "history"}, 30227 +#endif 28694 30228 +#if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \ 28695 + 30229 + && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE)) 28696 30230 + {EXPAND_LOCALES, "locale"}, 28697 30231 +#endif … … 28699 30233 {EXPAND_MENUS, "menu"}, 28700 30234 {EXPAND_OWNSYNTAX, "syntax"}, 28701 @@ -5587,6 +56 61,7 @@30235 @@ -5587,6 +5673,7 @@ 28702 30236 int compl = EXPAND_NOTHING; 28703 30237 char_u *compl_arg = NULL; … … 28707 30241 p = eap->arg; 28708 30242 28709 @@ -5612,6 +56 87,7 @@30243 @@ -5612,6 +5699,7 @@ 28710 30244 return; 28711 30245 } … … 28715 30249 /* If there is nothing after the name, and no attributes were specified, 28716 30250 * we are listing commands 28717 @@ -5626,6 +57 02,13 @@30251 @@ -5626,6 +5714,13 @@ 28718 30252 EMSG(_("E183: User defined commands must start with an uppercase letter")); 28719 30253 return; … … 28729 30263 uc_add_command(name, end - name, p, argt, def, flags, compl, compl_arg, 28730 30264 eap->forceit); 28731 @@ -5888,7 +59 71,14 @@30265 @@ -5888,7 +5983,14 @@ 28732 30266 result = STRLEN(eap->arg) + 2; 28733 30267 for (p = eap->arg; *p; ++p) … … 28745 30279 } 28746 30280 28747 @@ -5897,7 +59 87,14 @@30281 @@ -5897,7 +5999,14 @@ 28748 30282 *buf++ = '"'; 28749 30283 for (p = eap->arg; *p; ++p) … … 28761 30295 *buf++ = *p; 28762 30296 } 28763 @@ -6039,15 +61 36,17 @@30297 @@ -6039,15 +6148,17 @@ 28764 30298 end = vim_strchr(start + 1, '>'); 28765 30299 if (buf != NULL) … … 28782 30316 * do_cmdline() doesn't handle that, so convert it back. 28783 30317 * Also change K_SPECIAL KS_EXTRA KE_CSI into CSI. */ 28784 @@ -6439,7 +65 38,7 @@30318 @@ -6439,7 +6550,7 @@ 28785 30319 { 28786 30320 # ifdef FEAT_CMDWIN … … 28791 30325 # endif 28792 30326 if (!text_locked() 28793 @@ -6897,9 + 6996,7 @@30327 @@ -6897,9 +7008,7 @@ 28794 30328 # ifdef FEAT_WINDOWS 28795 30329 if (win_split(0, 0) == FAIL) … … 28802 30336 /* When splitting the window, create a new alist. Otherwise the 28803 30337 * existing one is overwritten. */ 28804 @@ -7026,7 +71 23,7 @@30338 @@ -7026,7 +7135,7 @@ 28805 30339 old_arg_count = GARGCOUNT; 28806 30340 if (expand_wildcards(old_arg_count, old_arg_files, … … 28811 30345 { 28812 30346 alist_set(&global_alist, new_arg_file_count, new_arg_files, 28813 @@ -7299,7 +7 396,9 @@30347 @@ -7299,7 +7408,9 @@ 28814 30348 || cmdmod.browse 28815 30349 # endif … … 28822 30356 do_check_scrollbind(FALSE); 28823 30357 # endif 28824 @@ -8122,6 +82 21,12 @@30358 @@ -8122,6 +8233,12 @@ 28825 30359 { 28826 30360 ui_delay(msec - done > 1000L ? 1000L : msec - done, TRUE); … … 28835 30369 } 28836 30370 28837 @@ -8193,7 +8 298,7 @@30371 @@ -8193,7 +8310,7 @@ 28838 30372 p = skipwhite(p); 28839 30373 if (*p != NUL && *p != '"' && eap->nextcmd == NULL) … … 28844 30378 /* Pass flags on for ":vertical wincmd ]". */ 28845 30379 postponed_split_flags = cmdmod.split; 28846 @@ -8907,35 +90 12,42 @@30380 @@ -8907,35 +9024,42 @@ 28847 30381 failed = TRUE; 28848 30382 if (eap->cmdidx == CMD_mksession) … … 28911 30445 } 28912 30446 else 28913 @@ -8966,10 +90 78,15 @@30447 @@ -8966,10 +9090,15 @@ 28914 30448 else if (eap->cmdidx == CMD_mksession) 28915 30449 { … … 28930 30464 #endif 28931 30465 #ifdef MKSESSION_NL 28932 @@ -9295,7 +94 12,7 @@30466 @@ -9295,7 +9424,7 @@ 28933 30467 && !got_int) 28934 30468 { … … 28939 30473 } 28940 30474 #endif 28941 @@ -9393,7 +95 10,7 @@30475 @@ -9393,7 +9522,7 @@ 28942 30476 ex_ptag(eap) 28943 30477 exarg_T *eap; … … 28948 30482 } 28949 30483 28950 @@ -9525,17 +96 42,23 @@30484 @@ -9525,17 +9654,23 @@ 28951 30485 #define SPEC_CFILE 4 28952 30486 "<sfile>", /* ":so" file name */ … … 28976 30510 }; 28977 30511 28978 @@ -9560,6 +96 83,7 @@30512 @@ -9560,6 +9695,7 @@ 28979 30513 * '<cWORD>' to WORD under the cursor 28980 30514 * '<cfile>' to path name under the cursor … … 28984 30518 * '<abuf>' to buffer number for autocommand 28985 30519 * '<amatch>' to matching name for autocommand 28986 @@ -9591,10 +97 15,7 @@30520 @@ -9591,10 +9727,7 @@ 28987 30521 #ifdef FEAT_MODIFY_FNAME 28988 30522 int skip_mod = FALSE; … … 28995 30529 *errormsg = NULL; 28996 30530 if (escaped != NULL) 28997 @@ -9653,14 +97 74,7 @@30531 @@ -9653,14 +9786,7 @@ 28998 30532 valid = 0; /* Must have ":p:h" to be valid */ 28999 30533 } … … 29010 30544 29011 30545 case SPEC_HASH: /* '#' or "#99": alternate file */ 29012 @@ -9783,6 +9 897,15 @@30546 @@ -9783,6 +9909,15 @@ 29013 30547 return NULL; 29014 30548 } … … 29026 30560 case SPEC_CLIENT: /* Source of last submitted input */ 29027 30561 sprintf((char *)strbuf, PRINTF_HEX_LONG_U, 29028 @@ -9796,11 +99 19,7 @@30562 @@ -9796,11 +9931,7 @@ 29029 30563 if (src[*usedlen] == '<') /* remove the file name extension */ 29030 30564 { … … 29038 30572 } 29039 30573 #ifdef FEAT_MODIFY_FNAME 29040 @@ -10645,7 +107 64,7 @@30574 @@ -10645,7 +10776,7 @@ 29041 30575 unsigned *flagp; 29042 30576 { … … 29047 30581 29048 30582 if (gap->ga_len == 0) 29049 @@ -10660,11 +107 79,19 @@30583 @@ -10660,11 +10791,19 @@ 29050 30584 { 29051 30585 if (fullname) … … 29069 30603 } 29070 30604 return put_eol(fd); 29071 @@ -10707,7 +108 34,7 @@30605 @@ -10707,7 +10846,7 @@ 29072 30606 * Write a file name to the session file. 29073 30607 * Takes care of the "slash" option in 'sessionoptions' and escapes special … … 29078 30612 static int 29079 30613 ses_put_fname(fd, name, flagp) 29080 @@ -10716,49 +108 43,32 @@30614 @@ -10716,49 +10855,32 @@ 29081 30615 unsigned *flagp; 29082 30616 { … … 29148 30682 } 29149 30683 29150 @@ -10826,8 +109 36,7 @@30684 @@ -10826,8 +10948,7 @@ 29151 30685 else if (vim_ispathsep(*p)) 29152 30686 { … … 29158 30692 *s++ = '-'; 29159 30693 else 29160 @@ -10910,7 +110 19,7 @@30694 @@ -10910,7 +11031,7 @@ 29161 30695 29162 30696 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) || defined(PROTO) … … 29167 30701 */ 29168 30702 void 29169 @@ -10921,7 +110 30,7 @@30703 @@ -10921,7 +11042,7 @@ 29170 30704 { 29171 30705 if (fname == NULL) … … 29177 30711 29178 30712 diff -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 */ 29181 30724 @@ -67,7 +67,7 @@ 29182 30725 … … 29188 30731 static int calc_hist_idx __ARGS((int histype, int num)); 29189 30732 # endif 29190 @@ -110,7 +110, 7@@30733 @@ -110,7 +110,10 @@ 29191 30734 static int expand_showtail __ARGS((expand_T *xp)); 29192 30735 #ifdef FEAT_CMDL_COMPL … … 29194 30737 -static int ExpandRTDir __ARGS((char_u *pat, int *num_file, char_u ***file, char *dirname)); 29195 30738 +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 29196 30742 # if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) 29197 30743 static int ExpandUserDefined __ARGS((expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file)); 29198 30744 static int ExpandUserList __ARGS((expand_T *xp, int *num_file, char_u ***file)); 29199 @@ -121,6 +12 1,14 @@30745 @@ -121,6 +124,14 @@ 29200 30746 static int ex_window __ARGS((void)); 29201 30747 #endif … … 29212 30758 * getcmdline() - accept a command line starting with firstc. 29213 30759 * 29214 @@ -637,7 +64 5,11 @@30760 @@ -637,7 +648,11 @@ 29215 30761 } 29216 30762 else if (ccline.cmdpos > i) … … 29224 30770 } 29225 30771 29226 @@ -688,28 +70 0,35 @@30772 @@ -688,28 +703,35 @@ 29227 30773 p = get_expr_line(); 29228 30774 --textlock; … … 29277 30823 #endif 29278 30824 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 @@ 29280 30840 # endif 29281 30841 s = getcmdline(firstc, 1L, 0); … … 29292 30852 return s; 29293 30853 } 29294 @@ -2342,15 +23 65,31 @@30854 @@ -2342,15 +2371,31 @@ 29295 30855 windgoto(msg_row, msg_col); 29296 30856 pend = (char_u *)(line_ga.ga_data) + line_ga.ga_len; … … 29333 30893 } 29334 30894 29335 @@ -2843,6 +288 2,7 @@30895 @@ -2843,6 +2888,7 @@ 29336 30896 { 29337 30897 msg_no_more = TRUE; … … 29341 30901 /* Avoid clearing the rest of the line too often. */ 29342 30902 if (cmdline_row != i || ccline.overstrike) 29343 @@ -3023,7 +306 3,7 @@30903 @@ -3023,7 +3069,7 @@ 29344 30904 int len; 29345 30905 … … 29350 30910 #ifdef FEAT_MBYTE 29351 30911 if (has_mbyte) 29352 @@ -3041,7 +308 1,7 @@30912 @@ -3041,7 +3087,7 @@ 29353 30913 --w; 29354 30914 } … … 29359 30919 p += len; 29360 30920 } 29361 @@ -3258,6 +3 298,24 @@30921 @@ -3258,6 +3304,24 @@ 29362 30922 return check_abbr(c, ccline.cmdbuff, ccline.cmdpos, 0); 29363 30923 } … … 29384 30944 * Return FAIL if this is not an appropriate context in which to do 29385 30945 * completion of anything, return OK if it is (even if there are no matches). 29386 @@ -3316,10 +33 74,14 @@30946 @@ -3316,10 +3380,14 @@ 29387 30947 p2 = NULL; 29388 30948 else … … 29401 30961 /* longest match: make sure it is not shorter, happens with :help */ 29402 30962 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 @@ 29404 30972 * options = WILD_KEEP_ALL: don't remove 'wildignore' entries 29405 30973 * options = WILD_SILENT: don't print warning messages … … 29409 30977 * The variables xp->xp_context and xp->xp_backslash must have been set! 29410 30978 */ 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 @@ 29412 30990 if (options & WILD_ESCAPE) 29413 30991 { … … 29417 30995 || xp->xp_context == EXPAND_BUFFERS 29418 30996 || xp->xp_context == EXPAND_DIRECTORIES) 29419 @@ -4338,6 +44 02,7 @@30997 @@ -4338,6 +4410,7 @@ 29420 30998 char_u ***matches; /* return: array of pointers to matches */ 29421 30999 { … … 29425 31003 if (xp->xp_context == EXPAND_UNSUCCESSFUL) 29426 31004 { 29427 @@ -4356,9 +442 1,11 @@31005 @@ -4356,9 +4429,11 @@ 29428 31006 if (file_str == NULL) 29429 31007 return EXPAND_UNSUCCESSFUL; … … 29439 31017 *matchcount = 0; 29440 31018 *matches = NULL; 29441 @@ -4410,7 +44 77,7 @@31019 @@ -4410,7 +4485,7 @@ 29442 31020 char_u *pat; 29443 31021 int *num_file; … … 29448 31026 #ifdef FEAT_CMDL_COMPL 29449 31027 regmatch_T regmatch; 29450 @@ -4464,6 +453 1,9 @@31028 @@ -4464,6 +4539,9 @@ 29451 31029 flags |= (EW_FILE | EW_PATH); 29452 31030 else … … 29458 31036 ret = expand_wildcards_eval(&pat, num_file, file, flags); 29459 31037 if (free_pat) 29460 @@ -4501,13 +457 1,25 @@31038 @@ -4501,13 +4579,25 @@ 29461 31039 || xp->xp_context == EXPAND_TAGS_LISTFILES) 29462 31040 return expand_tags(xp->xp_context == EXPAND_TAGS, pat, num_file, file); … … 29488 31066 if (xp->xp_context == EXPAND_USER_LIST) 29489 31067 return ExpandUserList(xp, num_file, file); 29490 @@ -4536,48 +46 18,50@@31068 @@ -4536,48 +4626,53 @@ 29491 31069 int context; 29492 31070 char_u *((*func)__ARGS((expand_T *, int))); … … 29499 31077 + {EXPAND_COMMANDS, get_command_name, FALSE, TRUE}, 29500 31078 + {EXPAND_BEHAVE, get_behave_arg, TRUE, TRUE}, 31079 +#ifdef FEAT_CMDHIST 31080 + {EXPAND_HISTORY, get_history_arg, TRUE, TRUE}, 31081 +#endif 29501 31082 #ifdef FEAT_USR_CMDS 29502 31083 - {EXPAND_USER_COMMANDS, get_user_commands, FALSE}, … … 29560 31141 int i; 29561 31142 29562 @@ -4591,7 +46 75,8 @@31143 @@ -4591,7 +4686,8 @@ 29563 31144 { 29564 31145 if (tab[i].ic) … … 29570 31151 } 29571 31152 } 29572 @@ -4613,13 +4 698,14 @@31153 @@ -4613,13 +4709,14 @@ 29573 31154 * Returns OK when no problems encountered, FAIL for error (out of memory). 29574 31155 */ … … 29586 31167 int i; 29587 31168 int count = 0; 29588 @@ -4644,7 +47 30,10 @@31169 @@ -4644,7 +4741,10 @@ 29589 31170 { 29590 31171 if (round) … … 29598 31179 #ifdef FEAT_MENU 29599 31180 if (func == get_menu_names && str != NULL) 29600 @@ -4676,7 +47 65,16 @@31181 @@ -4676,7 +4776,16 @@ 29601 31182 29602 31183 /* Sort the results. Keep menu's in the specified order. */ … … 29616 31197 #ifdef FEAT_CMDL_COMPL 29617 31198 /* Reset the variables used for special highlight names expansion, so that 29618 @@ -4728,7 +48 26,11 @@31199 @@ -4728,7 +4837,11 @@ 29619 31200 || (pat[1] == '.' && vim_ispathsep(pat[2]))))) 29620 31201 path = (char_u *)"."; … … 29628 31209 /* 29629 31210 * Go over all directories in $PATH. Expand matches in that directory and 29630 @@ -4949,57 +50 51,68 @@31211 @@ -4949,57 +5062,68 @@ 29631 31212 /* 29632 31213 * Expand color scheme, compiler or filetype names: … … 29727 31308 29728 31309 *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 @@ 29730 31346 * If 'move_to_front' is TRUE, matching entry is moved to end of history. 29731 31347 */ … … 29744 31360 if (hisidx[type] < 0) 29745 31361 return FALSE; 29746 @@ -5235,7 +53 50,12 @@31362 @@ -5235,7 +5389,12 @@ 29747 31363 { 29748 31364 if (history[type][i].hisstr == NULL) … … 29758 31374 if (!move_to_front) 29759 31375 return TRUE; 29760 @@ -5329,7 +54 49,7 @@31376 @@ -5329,7 +5488,7 @@ 29761 31377 } 29762 31378 last_maptick = -1; … … 29767 31383 if (++hisidx[histype] == hislen) 29768 31384 hisidx[histype] = 0; 29769 @@ -5803,7 +59 23,7 @@31385 @@ -5803,7 +5962,7 @@ 29770 31386 hist[i].hisnum); 29771 31387 if (vim_strsize(hist[i].hisstr) > (int)Columns - 10) … … 29776 31392 STRCAT(IObuff, hist[i].hisstr); 29777 31393 msg_outtrans(IObuff); 29778 @@ -5907,8 +60 27,10 @@31394 @@ -5907,8 +6066,10 @@ 29779 31395 val = viminfo_readstring(virp, 1, TRUE); 29780 31396 if (val != NULL && *val != NUL) … … 29788 31404 /* Need to re-allocate to append the separator byte. */ 29789 31405 len = STRLEN(val); 29790 @@ -5920,7 +60 42,7 @@31406 @@ -5920,7 +6081,7 @@ 29791 31407 /* Search entry: Move the separator from the first 29792 31408 * column to after the NUL. */ … … 29797 31413 else 29798 31414 { 29799 @@ -6147,9 +6 269,7 @@31415 @@ -6147,9 +6308,7 @@ 29800 31416 curwin->w_p_rl = cmdmsg_rl; 29801 31417 cmdmsg_rl = FALSE; … … 29808 31424 # ifdef FEAT_AUTOCMD 29809 31425 /* Do execute autocommands for setting the filetype (load syntax). */ 29810 @@ -6287,6 +64 07,12 @@31426 @@ -6287,6 +6446,12 @@ 29811 31427 ccline.cmdbuff = vim_strsave((char_u *)"qa"); 29812 31428 cmdwin_result = CAR; … … 29821 31437 ccline.cmdbuff = vim_strsave(ml_get_curline()); 29822 31438 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); 29823 31448 diff -Naur vim73.orig/src/feature.h vim73/src/feature.h 29824 --- vim73.orig/src/feature.h 2012-0 2-15 21:57:45.061436156+000029825 +++ vim73/src/feature.h 2012-0 2-15 21:57:46.553475509+000031449 --- 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 29826 31451 @@ -506,15 +506,6 @@ 29827 31452 #endif … … 29878 31503 #endif 29879 31504 #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 29880 31517 diff -Naur vim73.orig/src/fileio.c vim73/src/fileio.c 29881 --- vim73.orig/src/fileio.c 2012-0 2-15 21:57:45.041435628+000029882 +++ vim73/src/fileio.c 2012-0 2-15 21:57:46.961486271+000031518 --- 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 29883 31520 @@ -11,14 +11,6 @@ 29884 31521 * fileio.c: read from and write to a file … … 29993 31630 /* When reloading a buffer put the cursor at the first line that is 29994 31631 * different. */ 29995 @@ -2658,1 3 +2648,17@@31632 @@ -2658,10 +2648,10 @@ 29996 31633 FALSE, NULL, eap); 29997 31634 if (msg_scrolled == n) … … 30006 31643 #endif 30007 31644 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 @@ 30016 31646 int write_undo_file = FALSE; 30017 31647 context_sha256_T sha_ctx; … … 30023 31653 if (fname == NULL || *fname == NUL) /* safety check */ 30024 31654 return FAIL; 30025 @@ -3345,8 +33 42,22 @@31655 @@ -3345,8 +3338,22 @@ 30026 31656 } 30027 31657 else if (reset_changed && whole) … … 30048 31678 #ifdef FEAT_QUICKFIX 30049 31679 if (overwriting && bt_nofile(curbuf)) 30050 @@ -3799,13 +38 10,7 @@31680 @@ -3799,13 +3806,7 @@ 30051 31681 30052 31682 /* make sure we have a valid backup extension to use */ … … 30062 31692 backup_ext = p_bex; 30063 31693 30064 @@ -4000,7 +400 5,7 @@31694 @@ -4000,7 +4001,7 @@ 30065 31695 #ifdef HAS_BW_FLAGS 30066 31696 write_info.bw_flags = FIO_NOCONVERT; … … 30071 31701 { 30072 31702 if (buf_write_bytes(&write_info) == FAIL) 30073 @@ -4568,7 +45 73,7 @@31703 @@ -4568,7 +4569,7 @@ 30074 31704 if (end == 0 30075 31705 || (lnum == end … … 30080 31710 { 30081 31711 ++lnum; /* written the line, count it */ 30082 @@ -4719,11 +472 4,6 @@31712 @@ -4719,11 +4720,6 @@ 30083 31713 #endif 30084 31714 if (perm >= 0) /* set perm. of new file same as old file */ … … 30092 31722 /* Probably need to set the ACL before changing the user (can't set the 30093 31723 * ACL on a file the user doesn't own). */ 30094 @@ -4731,6 +47 31,7 @@31724 @@ -4731,6 +4727,7 @@ 30095 31725 mch_set_acl(wfname, acl); 30096 31726 #endif … … 30100 31730 crypt_pop_state(); 30101 31731 #endif 30102 @@ -4813,7 +481 4,7 @@31732 @@ -4813,7 +4810,7 @@ 30103 31733 #ifdef HAS_BW_FLAGS 30104 31734 write_info.bw_flags = FIO_NOCONVERT; … … 30109 31739 if (buf_write_bytes(&write_info) == FAIL) 30110 31740 break; 30111 @@ -4885,7 +488 6,10 @@31741 @@ -4885,7 +4882,10 @@ 30112 31742 #ifdef FEAT_CRYPT 30113 31743 if (wb_flags & FIO_ENCRYPTED) … … 30121 31751 } 30122 31752 #endif 30123 @@ -5094, 8 +5098,6@@31753 @@ -5094,7 +5094,7 @@ 30124 31754 { 30125 31755 aco_save_T aco; 30126 31756 30127 31757 - 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 30129 31760 /* 30130 31761 * Apply POST autocommands. 30131 * Careful: The autocommands may call buf_write() recursively! 30132 @@ -5330,7 +5332,7 @@ 31762 @@ -5330,7 +5330,7 @@ 30133 31763 30134 31764 /* … … 30139 31769 * Return FAIL for failure, OK otherwise. 30140 31770 */ 30141 @@ -5702,16 +570 4,8 @@31771 @@ -5702,16 +5702,8 @@ 30142 31772 crypt_encode(buf, len, buf); 30143 31773 #endif … … 30158 31788 30159 31789 #ifdef FEAT_MBYTE 30160 @@ -6024,15 +601 8,19 @@31790 @@ -6024,15 +6016,19 @@ 30161 31791 shorten_fname1(full_path) 30162 31792 char_u *full_path; … … 30179 31809 } 30180 31810 #endif 30181 @@ -6259,19 +625 7,17 @@31811 @@ -6259,19 +6255,17 @@ 30182 31812 */ 30183 31813 for (ptr = retval + fnamelen; ptr > retval; mb_ptr_back(retval, ptr)) … … 30203 31833 { 30204 31834 ++ptr; 30205 @@ -6306,23 +630 2,14 @@31835 @@ -6306,23 +6300,14 @@ 30206 31836 if (fname == NULL || *fname == NUL 30207 31837 || vim_ispathsep(fname[STRLEN(fname) - 1])) … … 30227 31857 if ((size_t)(s - ptr) > (size_t)8) 30228 31858 { 30229 @@ -6334,13 +63 21,8 @@31859 @@ -6334,13 +6319,8 @@ 30230 31860 * If the extension doesn't start with '.', and the file name 30231 31861 * doesn't have an extension yet, append a '.' … … 30241 31871 * If the extension doesn't start with '.', and there already is an 30242 31872 * extension, it may need to be truncated 30243 @@ -6368,23 +63 50,14 @@31873 @@ -6368,23 +6348,14 @@ 30244 31874 /* 30245 31875 * Prepend the dot. … … 30266 31896 #endif 30267 31897 30268 @@ -6552,6 +652 5,21 @@31898 @@ -6552,6 +6523,21 @@ 30269 31899 use_tmp_file = TRUE; 30270 31900 } … … 30288 31918 #if defined(UNIX) || defined(CASE_INSENSITIVE_FILENAME) 30289 31919 if (use_tmp_file) 30290 @@ -6662,8 +66 50,8 @@31920 @@ -6662,8 +6648,8 @@ 30291 31921 return -1; 30292 31922 } … … 30299 31929 errmsg = _("E208: Error writing to \"%s\""); 30300 31930 break; 30301 @@ -7024,7 +701 2,7 @@31931 @@ -7024,7 +7010,7 @@ 30302 31932 STRCAT(tbuf, mesg2); 30303 31933 } … … 30308 31938 } 30309 31939 else 30310 @@ -7272,8 +72 60,8 @@31940 @@ -7272,8 +7258,8 @@ 30311 31941 write_lnum_adjust(offset) 30312 31942 linenr_T offset; … … 30319 31949 30320 31950 #if defined(TEMPDIRNAMES) || defined(PROTO) 30321 @@ -7475,7 +746 3,10 @@31951 @@ -7475,7 +7461,10 @@ 30322 31952 30323 31953 STRCPY(itmp, ""); … … 30331 31961 buf4[2] = extra_char; /* make it "VIa", "VIb", etc. */ 30332 31962 if (GetTempFileName(szTempFile, buf4, 0, itmp) == 0) 30333 @@ -7496,8 +748 7,11 @@31963 @@ -7496,8 +7485,11 @@ 30334 31964 # else /* WIN3264 */ 30335 31965 … … 30344 31974 # else 30345 31975 char_u *p; 30346 @@ -7682,6 +767 6,7 @@31976 @@ -7682,6 +7674,7 @@ 30347 31977 {"InsertChange", EVENT_INSERTCHANGE}, 30348 31978 {"InsertEnter", EVENT_INSERTENTER}, … … 30352 31982 {"QuickFixCmdPost", EVENT_QUICKFIXCMDPOST}, 30353 31983 {"QuickFixCmdPre", EVENT_QUICKFIXCMDPRE}, 30354 @@ -8744,6 +873 9,8 @@31984 @@ -8744,6 +8737,8 @@ 30355 31985 int retval; 30356 31986 aco_save_T aco; … … 30361 31991 /* 30362 31992 * This is a bit tricky: For some commands curwin->w_buffer needs to be 30363 @@ -8760,11 +875 7,15 @@31993 @@ -8760,11 +8755,15 @@ 30364 31994 aucmd_prepbuf(&aco, buf); 30365 31995 … … 30381 32011 /* restore the current window */ 30382 32012 aucmd_restbuf(&aco); 30383 @@ -8779,6 +87 80,23 @@32013 @@ -8779,6 +8778,23 @@ 30384 32014 } 30385 32015 … … 30405 32035 * Search for a visible window containing the current buffer. If there isn't 30406 32036 * one then use "aucmd_win". 30407 @@ -8903,10 +89 21,11 @@32037 @@ -8903,10 +8919,11 @@ 30408 32038 if (tp != curtab) 30409 32039 goto_tabpage_tp(tp); … … 30418 32048 /* Remove the window and frame from the tree of frames. */ 30419 32049 (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 @@ 30421 32062 { 30422 32063 int state; … … 30430 32071 && !ins_compl_active() 30431 32072 #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 @@ 30433 32090 if ((c == ';' || c == '>') && match == FALSE) 30434 32091 { … … 30439 32096 *pattern = c; /* Restore the terminator */ 30440 32097 type_start = pattern + 1; 30441 @@ -10181,19 +102 05,11 @@32098 @@ -10181,19 +10216,11 @@ 30442 32099 ++p; 30443 32100 break; … … 30459 32116 break; 30460 32117 case '\\': 30461 @@ -10304,3 +103 20,55 @@32118 @@ -10304,3 +10331,55 @@ 30462 32119 } 30463 32120 return reg_pat; … … 30516 32173 +#endif 30517 32174 diff -Naur vim73.orig/src/fold.c vim73/src/fold.c 30518 --- vim73.orig/src/fold.c 2012-0 2-15 21:57:45.057436051+000030519 +++ vim73/src/fold.c 2012-0 2-15 21:57:46.765481102+000032175 --- 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 30520 32177 @@ -1033,10 +1033,10 @@ 30521 32178 * Init the fold info in a new window. … … 30560 32217 mch_memmove(fp, nfp, (size_t)(sizeof(fold_T) * moved)); 30561 32218 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 */ 30562 32323 diff -Naur vim73.orig/src/getchar.c vim73/src/getchar.c 30563 --- vim73.orig/src/getchar.c 2012-0 2-15 21:57:45.061436156+000030564 +++ vim73/src/getchar.c 2012-0 2-15 21:57:46.909484899+000032324 --- 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 30565 32326 @@ -418,12 +418,12 @@ 30566 32327 … … 30660 32421 static int 30661 32422 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 30662 32441 @@ -1506,9 +1532,6 @@ 30663 32442 } … … 30670 32449 * Get the next input character. 30671 32450 * 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 30672 32460 @@ -2171,7 +2194,7 @@ 30673 32461 if (!timedout) … … 31039 32827 if (p_verbose > 0) 31040 32828 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 @@ 31042 32854 { 31043 32855 char_u *res; … … 31065 32877 /* Forbid changing text or using ":normal" to avoid most of the bad side 31066 32878 * effects. Also restore the cursor position. */ 31067 @@ -4493,16 +455 4,23 @@32879 @@ -4493,16 +4551,23 @@ 31068 32880 #endif 31069 32881 set_vim_var_char(c); /* set v:char to the typed character */ … … 31090 32902 vim_free(p); 31091 32903 31092 @@ -4995,19 +506 3,21 @@32904 @@ -4995,19 +5060,21 @@ 31093 32905 sourcing_name = save_name; 31094 32906 } … … 31117 32929 int hash; 31118 32930 int len, minlen; 31119 @@ -5062,7 +51 32,17 @@32931 @@ -5062,7 +5129,17 @@ 31120 32932 minlen = mp->m_keylen - 3; 31121 32933 } … … 31136 32948 } 31137 32949 diff -Naur vim73.orig/src/globals.h vim73/src/globals.h 31138 --- vim73.orig/src/globals.h 2012-0 2-15 21:57:45.061436156+000031139 +++ vim73/src/globals.h 2012-0 2-15 21:57:46.945485849 +000032950 --- 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 31140 32952 @@ -113,9 +113,9 @@ 31141 32953 * When '$' is included in 'cpoptions' option set: … … 31207 33019 EXTERN short disallow_gui INIT(= FALSE); 31208 33020 diff -Naur vim73.orig/src/gui.c vim73/src/gui.c 31209 --- vim73.orig/src/gui.c 2012-0 2-15 21:57:45.041435628+000031210 +++ vim73/src/gui.c 2012-0 2-15 21:57:46.561475721+000033021 --- 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 31211 33023 @@ -37,6 +37,24 @@ 31212 33024 static void gui_set_bg_color __ARGS((char_u *name)); … … 31234 33046 31235 33047 /* 31236 @@ -59,42 +77, 47@@33048 @@ -59,42 +77,53 @@ 31237 33049 gui_start() 31238 33050 { … … 31284 33096 +#endif 31285 33097 + { 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 31286 33104 + gui_attempt_start(); 31287 33105 + } … … 31304 33122 #ifdef FEAT_TITLE 31305 33123 set_title_defaults(); /* set 'title' and 'icon' again */ 31306 @@ -103,101 +1 26,217@@33124 @@ -103,101 +132,223 @@ 31307 33125 31308 33126 vim_free(old_term); … … 31443 33261 + status = gui_read_child_pipe(pipefd[0]); 31444 33262 + 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 + { 31451 33264 + /* The child failed to start the GUI, so the caller must 31452 33265 + * continue. There may be more error information written … … 31459 33272 + EMSG(_("E852: The child process failed to start the GUI")); 31460 33273 + 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; 31461 33283 } 31462 + else if (status == GUI_CHILD_IO_ERROR)31463 + {31464 + pipe_error = TRUE;31465 + }31466 33284 + /* else GUI_CHILD_OK: parent exit */ 31467 33285 + } … … 31496 33314 + } 31497 33315 + /* 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 31498 33322 + 31499 33323 +# if defined(HAVE_SETSID) || defined(HAVE_SETPGID) … … 31590 33414 * Call this when vim starts up, whether or not the GUI is started 31591 33415 */ 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 @@ 31593 33435 if (!gui.shell_created) 31594 33436 return; … … 31599 33441 * number of characters that fit in the maximized window. */ 31600 33442 if (!mustset && gui_mch_maximized()) 31601 @@ -2146,7 +2 285,7 @@33443 @@ -2146,7 +2307,7 @@ 31602 33444 31603 33445 if (highlight_mask & (HL_INVERSE | HL_STANDOUT)) … … 31608 33450 #else 31609 33451 gui_mch_set_fg_color(bg_color); 31610 @@ -2155,7 +2 294,7 @@33452 @@ -2155,7 +2316,7 @@ 31611 33453 } 31612 33454 else … … 31617 33459 #else 31618 33460 gui_mch_set_fg_color(fg_color); 31619 @@ -2183,7 +23 22,7 @@33461 @@ -2183,7 +2344,7 @@ 31620 33462 if (back != 0 && ((draw_flags & DRAW_BOLD) || (highlight_mask & HL_ITALIC))) 31621 33463 return FAIL; … … 31626 33468 * For GTK2, we don't need a different font for italic style. */ 31627 33469 if (hl_mask_todo & HL_ITALIC) 31628 @@ -2352,7 +2 491,7 @@33470 @@ -2352,7 +2513,7 @@ 31629 33471 if (draw_sign) 31630 33472 /* Draw the sign on top of the spaces. */ … … 31635 33477 if (multi_sign) 31636 33478 netbeans_draw_multisign_indicator(gui.row); 31637 @@ -2975,26 +31 14,11 @@33479 @@ -2975,26 +3136,11 @@ 31638 33480 did_clip = TRUE; 31639 33481 } … … 31663 33505 /* Always allow pasting */ 31664 33506 if (button != MOUSE_MIDDLE) 31665 @@ -4893,7 +50 17,7 @@33507 @@ -4893,7 +5039,7 @@ 31666 33508 if (STRLEN(p) > 2000) 31667 33509 STRCPY(p + 2000 - 14, "...(truncated)"); … … 31673 33515 ga_clear(&error_ga); 31674 33516 diff -Naur vim73.orig/src/gui.h vim73/src/gui.h 31675 --- vim73.orig/src/gui.h 2012-0 2-15 21:57:45.041435628+000031676 +++ vim73/src/gui.h 2012-0 2-15 21:57:46.177465593+000033517 --- 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 31677 33519 @@ -52,10 +52,6 @@ 31678 33520 # include <SegLoad.h>*/ … … 31730 33572 PtWidget_t *vimTextArea; /* PtRaw */ 31731 33573 diff -Naur vim73.orig/src/gui_athena.c vim73/src/gui_athena.c 31732 --- vim73.orig/src/gui_athena.c 2012-0 2-15 21:57:45.057436051+000031733 +++ vim73/src/gui_athena.c 2012-0 2-15 21:57:45.553449133+000033574 --- 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 31734 33576 @@ -2117,13 +2117,14 @@ 31735 33577 } … … 31749 33591 char_u *p, *next; 31750 33592 diff -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 @@ 31754 33637 char_u *message, /* message text */ 31755 33638 char_u *buttons, /* names of buttons */ … … 31761 33644 GtkWidget *dialog; 31762 33645 GtkWidget *entry = NULL; 31763 @@ -1287,6 +1 288,9 @@33646 @@ -1287,6 +1301,9 @@ 31764 33647 entry = gtk_entry_new(); 31765 33648 gtk_widget_show(entry); … … 31771 33654 gtk_entry_set_text(GTK_ENTRY(entry), (const char *)text); 31772 33655 CONVERT_TO_UTF8_FREE(text); 31773 @@ -1387,7 +1 391,7 @@33656 @@ -1387,7 +1404,7 @@ 31774 33657 gtk_menu_popup(GTK_MENU(menu->submenu_id), 31775 33658 NULL, NULL, … … 31780 33663 31781 33664 /* Ugly global variable to pass "mouse_pos" flag from gui_make_popup() to 31782 @@ -1795,7 +1 799,6 @@33665 @@ -1795,7 +1812,6 @@ 31783 33666 char_u *repl_text; 31784 33667 gboolean direction_down; … … 31788 33671 flags = (int)(long)data; /* avoid a lint warning here */ 31789 33672 31790 @@ -1821,7 +18 24,7 @@33673 @@ -1821,7 +1837,7 @@ 31791 33674 31792 33675 repl_text = CONVERT_FROM_UTF8(repl_text); … … 31797 33680 CONVERT_FROM_UTF8_FREE(find_text); 31798 33681 } 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 + 31799 33697 diff -Naur vim73.orig/src/gui_gtk_x11.c vim73/src/gui_gtk_x11.c 31800 --- vim73.orig/src/gui_gtk_x11.c 2012-0 2-15 21:57:45.057436051+000031801 +++ vim73/src/gui_gtk_x11.c 2012-0 2-15 21:57:46.569475932+000033698 --- 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 31802 33700 @@ -86,7 +86,6 @@ 31803 33701 … … 31843 33741 if (text == NULL || len <= 0) 31844 33742 { 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 @@ 31846 33775 int x, y; 31847 33776 int_u vim_modifiers; … … 31852 33781 /* Make sure we have focus now we've been selected */ 31853 33782 if (gtk_socket_id != 0 && !GTK_WIDGET_HAS_FOCUS(widget)) 31854 @@ -1733,7 +17 31,7 @@33783 @@ -1733,7 +1753,7 @@ 31855 33784 int x, y; 31856 33785 int_u vim_modifiers; … … 31861 33790 /* Remove any motion "machine gun" timers used for automatic further 31862 33791 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 @@ 31864 33802 31865 33803 for (i = 0; i < (int)N_DND_TARGETS; ++i) … … 31870 33808 else 31871 33809 targets[j++] = dnd_targets[i]; 31872 @@ -3093,7 +3 091,7 @@33810 @@ -3093,7 +3113,7 @@ 31873 33811 gtk_drag_dest_set(gui.drawarea, 31874 33812 GTK_DEST_DEFAULT_ALL, … … 31879 33817 31880 33818 /* 31881 @@ -3902,6 +39 00,21 @@33819 @@ -3902,6 +3922,21 @@ 31882 33820 } 31883 33821 … … 31901 33839 */ 31902 33840 void 31903 @@ -4411,14 +44 24,9 @@33841 @@ -4411,14 +4446,9 @@ 31904 33842 31905 33843 if (gui_mch_maximized()) … … 31917 33855 else 31918 33856 { 31919 @@ -5419,7 +54 27,7 @@33857 @@ -5419,7 +5449,7 @@ 31920 33858 } 31921 33859 … … 31926 33864 #endif 31927 33865 31928 @@ -5654,7 +56 62,7 @@33866 @@ -5654,7 +5684,7 @@ 31929 33867 int success; 31930 33868 … … 31936 33874 } 31937 33875 diff -Naur vim73.orig/src/gui_mac.c vim73/src/gui_mac.c 31938 --- vim73.orig/src/gui_mac.c 2012-0 2-15 21:57:45.041435628+000031939 +++ vim73/src/gui_mac.c 2012-0 2-15 21:57:46.661478358+000033876 --- 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 31940 33878 @@ -1480,7 +1480,7 @@ 31941 33879 * … … 32059 33997 // of the tabs, not pointers to the tabs (which are invalid for a short time). 32060 33998 diff -Naur vim73.orig/src/gui_motif.c vim73/src/gui_motif.c 32061 --- vim73.orig/src/gui_motif.c 2012-0 2-15 21:57:45.057436051+000032062 +++ vim73/src/gui_motif.c 2012-0 2-15 21:57:45.557449238+000033999 --- 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 32063 34001 @@ -2549,13 +2549,14 @@ 32064 34002 #endif … … 32078 34016 char_u *p, *next; 32079 34017 diff -Naur vim73.orig/src/gui_photon.c vim73/src/gui_photon.c 32080 --- vim73.orig/src/gui_photon.c 2012-0 2-15 21:57:45.061436156+000032081 +++ vim73/src/gui_photon.c 2012-0 2-15 21:57:46.453472871+000034018 --- 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 32082 34020 @@ -32,9 +32,9 @@ 32083 34021 #endif … … 35246 37184 35247 37185 diff -Naur vim73.orig/src/gui_riscos.c vim73/src/gui_riscos.c 35248 --- vim73.orig/src/gui_riscos.c 2012-0 2-15 21:57:45.057436051+000037186 --- vim73.orig/src/gui_riscos.c 2012-06-03 23:09:52.944007163 +0000 35249 37187 +++ vim73/src/gui_riscos.c 1970-01-01 00:00:00.000000000 +0000 35250 37188 @@ -1,3558 +0,0 @@ … … 38808 40746 -} 38809 40747 diff -Naur vim73.orig/src/gui_riscos.h vim73/src/gui_riscos.h 38810 --- vim73.orig/src/gui_riscos.h 2012-0 2-15 21:57:45.061436156+000040748 --- vim73.orig/src/gui_riscos.h 2012-06-03 23:09:52.948007269 +0000 38811 40749 +++ vim73/src/gui_riscos.h 1970-01-01 00:00:00.000000000 +0000 38812 40750 @@ -1,32 +0,0 @@ … … 38844 40782 -void ro_open_main(int *block); 38845 40783 diff -Naur vim73.orig/src/gui_w16.c vim73/src/gui_w16.c 38846 --- vim73.orig/src/gui_w16.c 2012-0 2-15 21:57:45.057436051+000038847 +++ vim73/src/gui_w16.c 2012-0 2-15 21:57:46.877484055+000040784 --- 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 38848 40786 @@ -21,6 +21,12 @@ 38849 40787 * … … 38870 40808 LPWORD p, pnumitems; 38871 40809 diff -Naur vim73.orig/src/gui_w32.c vim73/src/gui_w32.c 38872 --- vim73.orig/src/gui_w32.c 2012-0 2-15 21:57:45.061436156+000038873 +++ vim73/src/gui_w32.c 2012-0 2-15 21:57:46.733480258+000040810 --- 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 38874 40812 @@ -289,13 +289,13 @@ 38875 40813 … … 39154 41092 39155 41093 diff -Naur vim73.orig/src/gui_w48.c vim73/src/gui_w48.c 39156 --- vim73.orig/src/gui_w48.c 2012-0 2-15 21:57:45.053435946+000039157 +++ vim73/src/gui_w48.c 2012-0 2-15 21:57:46.821482580+000041094 --- 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 39158 41096 @@ -328,6 +328,10 @@ 39159 41097 static LRESULT _OnImeNotify(HWND hWnd, DWORD dwCommand, DWORD dwData); … … 39351 41289 39352 41290 diff -Naur vim73.orig/src/gui_x11.c vim73/src/gui_x11.c 39353 --- vim73.orig/src/gui_x11.c 2012-0 2-15 21:57:45.041435628+000039354 +++ vim73/src/gui_x11.c 2012-0 2-15 21:57:45.353443858+000041291 --- 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 39355 41293 @@ -2895,6 +2895,11 @@ 39356 41294 focus = gui.in_focus; … … 39366 41304 * char arrives, instead we use XtAppProcessEvent() to hang until an 39367 41305 diff -Naur vim73.orig/src/gui_xmdlg.c vim73/src/gui_xmdlg.c 39368 --- vim73.orig/src/gui_xmdlg.c 2012-0 2-15 21:57:45.057436051+000039369 +++ vim73/src/gui_xmdlg.c 2012-0 2-15 21:57:45.549449028+000041306 --- 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 39370 41308 @@ -688,7 +688,7 @@ 39371 41309 do_dialog(VIM_ERROR, … … 39387 41325 else 39388 41326 diff -Naur vim73.orig/src/hardcopy.c vim73/src/hardcopy.c 39389 --- vim73.orig/src/hardcopy.c 2012-0 2-15 21:57:45.057436051+000039390 +++ vim73/src/hardcopy.c 2012-0 2-15 21:57:45.829456412+000041327 --- 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 39391 41329 @@ -1759,18 +1759,25 @@ 39392 41330 char *name; … … 39645 41583 void 39646 41584 diff -Naur vim73.orig/src/if_cscope.c vim73/src/if_cscope.c 39647 --- vim73.orig/src/if_cscope.c 2012-0 2-15 21:57:45.053435946+000039648 +++ vim73/src/if_cscope.c 2012-0 2-15 21:57:46.093463376+000041585 --- 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 39649 41587 @@ -13,16 +13,10 @@ 39650 41588 … … 39811 41749 /* 39812 41750 diff -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 * 39815 41759 @@ -9,12 +9,11 @@ 39816 41760 * See README.txt for an overview of the Vim source code. … … 39828 41772 /* Only do the following when the feature is enabled. Needed for "make 39829 41773 * 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 @@ 39831 41825 # define symbol_from_dll dlsym 39832 41826 # define close_dll dlclose … … 39837 41831 # define close_dll FreeLibrary 39838 41832 #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 @@ 39841 41901 #define lua_rawset dll_lua_rawset 39842 41902 #define lua_rawseti dll_lua_rawseti 39843 +#define lua_remove dll_lua_remove39844 41903 #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 @@ 39849 41982 void (*dll_lua_rawset) (lua_State *L, int idx); 39850 41983 void (*dll_lua_rawseti) (lua_State *L, int idx, int n); 39851 +void (*dll_lua_remove) (lua_State *L, int idx);39852 41984 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 @@ 39857 42061 {"lua_rawset", (luaV_function) &dll_lua_rawset}, 39858 42062 {"lua_rawseti", (luaV_function) &dll_lua_rawseti}, 39859 + {"lua_remove", (luaV_function) &dll_lua_remove},39860 42063 {"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 @@ 39864 43066 } 39865 43067 … … 39893 43095 { 39894 43096 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 39896 43162 static int 39897 43163 luaV_open(lua_State *L) … … 39908 43174 } 39909 43175 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 */ 39911 43332 /* print */ 39912 43333 lua_pushcfunction(L, luaV_print); … … 39919 43340 /* free */ 39920 43341 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 39922 43473 diff -Naur vim73.orig/src/if_mzsch.c vim73/src/if_mzsch.c 39923 --- vim73.orig/src/if_mzsch.c 2012-0 2-15 21:57:45.061436156+000039924 +++ vim73/src/if_mzsch.c 2012-0 2-15 21:57:46.957486165+000043474 --- 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 39925 43476 @@ -31,8 +31,6 @@ 39926 43477 * depend". */ … … 40081 43632 40082 43633 diff -Naur vim73.orig/src/if_ole.h vim73/src/if_ole.h 40083 --- vim73.orig/src/if_ole.h 2012-0 2-15 21:57:45.041435628+000040084 +++ vim73/src/if_ole.h 2012-0 2-15 21:57:46.053462322+000043634 --- 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 40085 43636 @@ -46,8 +46,11 @@ 40086 43637 /* header files for imported files */ … … 40098 43649 #define __IVim_INTERFACE_DEFINED__ 40099 43650 diff -Naur vim73.orig/src/if_perl.xs vim73/src/if_perl.xs 40100 --- vim73.orig/src/if_perl.xs 2012-0 2-15 21:57:45.053435946+000040101 +++ vim73/src/if_perl.xs 2012-0 2-15 21:57:46.949485954+000043651 --- 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 40102 43653 @@ -106,7 +106,7 @@ 40103 43654 #define close_dll dlclose … … 40206 43757 if (safe == NULL || !SvTRUE(safe)) 40207 43758 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 @@ 40209 43785 VIWIN win 40210 43786 … … 40215 43791 EXTEND(sp, 2); 40216 43792 if (!win_valid(win)) 40217 @@ -1116,7 +11 37,7 @@43793 @@ -1116,7 +1119,7 @@ 40218 43794 PUSHs(sv_2mortal(newSViv(win->w_cursor.lnum))); 40219 43795 PUSHs(sv_2mortal(newSViv(win->w_cursor.col))); … … 40224 43800 int lnum, col; 40225 43801 40226 @@ -1249,9 +12 70,9 @@43802 @@ -1249,9 +1252,9 @@ 40227 43803 { 40228 43804 lnum = SvIV(ST(1)); … … 40237 43813 count = -count; 40238 43814 diff -Naur vim73.orig/src/if_py_both.h vim73/src/if_py_both.h 40239 --- vim73.orig/src/if_py_both.h 2012-0 2-15 21:57:45.061436156+000040240 +++ vim73/src/if_py_both.h 2012-0 2-15 21:57:46.869483845+000043815 --- 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 40241 43817 @@ -12,6 +12,12 @@ 40242 43818 * Common code for if_python.c and if_python3.c. … … 40276 43852 40277 43853 #define PyErr_SetVim(str) PyErr_SetString(VimError, str) 40278 @@ -62,10 +71,1 0@@43854 @@ -62,10 +71,15 @@ 40279 43855 OutputWrite(PyObject *self, PyObject *args) 40280 43856 { … … 40286 43862 - if (!PyArg_ParseTuple(args, "s#", &str, &len)) 40287 43863 + 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) 40288 43869 return NULL; 40289 43870 40290 43871 Py_BEGIN_ALLOW_THREADS 40291 @@ -73,6 +8 2,7 @@43872 @@ -73,6 +87,7 @@ 40292 43873 writer((writefn)(error ? emsg : msg), (char_u *)str, len); 40293 43874 Python_Release_Vim(); … … 40297 43878 Py_INCREF(Py_None); 40298 43879 return Py_None; 40299 @@ -101,10 +11 1,10 @@43880 @@ -101,10 +116,10 @@ 40300 43881 for (i = 0; i < n; ++i) 40301 43882 { … … 40310 43891 Py_DECREF(list); 40311 43892 return NULL; 40312 @@ -115,6 +1 25,7 @@43893 @@ -115,6 +130,7 @@ 40313 43894 writer((writefn)(error ? emsg : msg), (char_u *)str, len); 40314 43895 Python_Release_Vim(); … … 40318 43899 40319 43900 Py_DECREF(list); 40320 @@ -122,52 +13 3,28 @@43901 @@ -122,52 +138,28 @@ 40321 43902 return Py_None; 40322 43903 } … … 40342 43923 - while (new_size < n) 40343 43924 - new_size += 80; 40344 - 43925 + /* do nothing */ 43926 + Py_INCREF(Py_None); 43927 + return Py_None; 43928 +} 43929 40345 43930 - if (new_size != buffer_size) 40346 43931 - { … … 40348 43933 - if (new_buffer == NULL) 40349 43934 - return; 40350 + /* do nothing */40351 + Py_INCREF(Py_None);40352 + return Py_None;40353 +}40354 43935 40355 43936 - if (buffer) … … 40358 43939 - vim_free(buffer); 40359 43940 - } 40360 43941 - 40361 43942 - buffer = new_buffer; 40362 43943 - buffer_size = new_size; … … 40384 43965 40385 43966 static void 40386 @@ -175,30 +16 2,34 @@43967 @@ -175,30 +167,34 @@ 40387 43968 { 40388 43969 char_u *ptr; … … 40431 44012 40432 44013 /***************/ 40433 @@ -543,7 +53 4,6 @@44014 @@ -543,7 +539,6 @@ 40434 44015 { 40435 44016 long lnum; … … 40439 44020 if (!PyArg_Parse(val, "(ll)", &lnum, &col)) 40440 44021 return -1; 40441 @@ -558,18 +5 48,15 @@44022 @@ -558,18 +553,15 @@ 40442 44023 if (VimErrorCheck()) 40443 44024 return -1; … … 40461 44042 } 40462 44043 else if (strcmp(name, "height") == 0) 40463 @@ -698,6 +6 85,7 @@44044 @@ -698,6 +690,7 @@ 40464 44045 { 40465 44046 const char *str; … … 40469 44050 PyInt i; 40470 44051 char *p; 40471 @@ -708,8 + 696,9 @@44052 @@ -708,8 +701,9 @@ 40472 44053 return NULL; 40473 44054 } … … 40481 44062 /* 40482 44063 * Error checking: String must not contain newlines, as we 40483 @@ -748,6 +7 37,7 @@44064 @@ -748,6 +742,7 @@ 40484 44065 } 40485 44066 … … 40489 44070 return save; 40490 44071 } 40491 @@ -834,7 +82 4,8 @@44072 @@ -834,7 +829,8 @@ 40492 44073 invalidate_botline(); 40493 44074 } … … 40499 44080 * a Python string object. The object is checked for validity 40500 44081 * and correct format. Errors are returned as a value of FAIL. 40501 @@ -925,6 +9 16,193 @@44082 @@ -925,6 +921,193 @@ 40502 44083 } 40503 44084 } … … 40693 44274 /* Insert a number of lines into the specified buffer after the specifed line. 40694 44275 * The line number is in Vim format (1-based). The lines to be inserted are 40695 @@ -1130,6 +13 08,40 @@44276 @@ -1130,6 +1313,40 @@ 40696 44277 return 0; 40697 44278 } … … 40734 44315 static PyObject * 40735 44316 RBAppend(BufferObject *self, PyObject *args, PyInt start, PyInt end, PyInt *new_end) 40736 @@ -1267,6 +14 79,9 @@44317 @@ -1267,6 +1484,9 @@ 40737 44318 {"append", BufferAppend, 1, "Append data to Vim buffer" }, 40738 44319 {"mark", BufferMark, 1, "Return (row,col) representing position of named mark" }, … … 40745 44326 40746 44327 diff -Naur vim73.orig/src/if_python.c vim73/src/if_python.c 40747 --- vim73.orig/src/if_python.c 2012-0 2-15 21:57:45.041435628+000040748 +++ vim73/src/if_python.c 2012-0 2-15 21:57:46.377470867+000044328 --- 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 40749 44330 @@ -56,6 +56,10 @@ 40750 44331 … … 41155 44736 * 41156 44737 diff -Naur vim73.orig/src/if_python3.c vim73/src/if_python3.c 41157 --- vim73.orig/src/if_python3.c 2012-0 2-15 21:57:45.053435946+000041158 +++ vim73/src/if_python3.c 2012-0 2-15 21:57:46.873483950 +000044738 --- 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 41159 44740 @@ -22,8 +22,8 @@ 41160 44741 * Adaptations to support both python3.x and python2.x … … 41721 45302 return result; 41722 45303 diff -Naur vim73.orig/src/if_ruby.c vim73/src/if_ruby.c 41723 --- vim73.orig/src/if_ruby.c 2012-0 2-15 21:57:45.057436051+000041724 +++ vim73/src/if_ruby.c 2012-0 2-15 21:57:46.305468968+000045304 --- 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 41725 45306 @@ -4,12 +4,17 @@ 41726 45307 * … … 42094 45675 } 42095 45676 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 42096 45697 diff -Naur vim73.orig/src/if_sniff.c vim73/src/if_sniff.c 42097 --- vim73.orig/src/if_sniff.c 2012-0 2-15 21:57:45.041435628+000042098 +++ vim73/src/if_sniff.c 2012-0 2-15 21:57:45.469446917+000045698 --- 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 42099 45700 @@ -9,7 +9,6 @@ 42100 45701 … … 42106 45707 # include <assert.h> 42107 45708 diff -Naur vim73.orig/src/if_tcl.c vim73/src/if_tcl.c 42108 --- vim73.orig/src/if_tcl.c 2012-0 2-15 21:57:45.041435628+000042109 +++ vim73/src/if_tcl.c 2012-0 2-15 21:57:46.289468547+000042110 @@ -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 @@ 42111 45712 #endif 42112 45713 … … 42116 45717 42117 45718 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 @@ 42119 45882 { 42120 45883 int newerr = OK; 42121 45884 42122 45885 - 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 + ) 42124 45891 { 42125 45892 - int retval; 42126 45893 char buf[50]; 42127 42128 42129 45894 - Tcl_Obj *robj; 45895 45896 - robj = Tcl_GetObjResult(tclinfo.interp); 42130 45897 - 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) 42132 45901 { 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); 42139 45911 - 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) 42144 45937 diff -Naur vim73.orig/src/integration.c vim73/src/integration.c 42145 --- vim73.orig/src/integration.c 2012-0 2-15 21:57:45.061436156+000042146 +++ vim73/src/integration.c 2012-0 2-15 21:57:45.489447445+000045938 --- 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 42147 45940 @@ -33,7 +33,6 @@ 42148 45941 #include <sys/un.h> … … 42154 45947 #include <sys/param.h> 42155 45948 diff -Naur vim73.orig/src/keymap.h vim73/src/keymap.h 42156 --- vim73.orig/src/keymap.h 2012-0 2-15 21:57:45.061436156+000042157 +++ vim73/src/keymap.h 2012-0 2-15 21:57:46.801482050+000045949 --- 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 42158 45951 @@ -92,13 +92,13 @@ 42159 45952 */ … … 42192 45985 #define K_TEAROFF TERMCAP2KEY(KS_TEAROFF, KE_FILLER) 42193 45986 diff -Naur vim73.orig/src/link.sh vim73/src/link.sh 42194 --- vim73.orig/src/link.sh 2012-0 2-15 21:57:45.041435628+000042195 +++ vim73/src/link.sh 2012-0 2-15 21:57:45.325443119+000045987 --- 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 42196 45989 @@ -5,7 +5,7 @@ 42197 45990 # libraries when they exist, but this doesn't mean they are needed for Vim. … … 42238 46031 # 42239 46032 diff -Naur vim73.orig/src/macros.h vim73/src/macros.h 42240 --- vim73.orig/src/macros.h 2012-0 2-15 21:57:45.061436156+000042241 +++ vim73/src/macros.h 2012-0 2-15 21:57:45.153438583+000046033 --- 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 42242 46035 @@ -285,3 +285,17 @@ 42243 46036 #else … … 42259 46052 +#endif 42260 46053 diff -Naur vim73.orig/src/main.c vim73/src/main.c 42261 --- vim73.orig/src/main.c 2012-0 2-15 21:57:45.041435628+000042262 +++ vim73/src/main.c 2012-0 2-15 21:57:46.957486165+000046054 --- 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 42263 46056 @@ -7,10 +7,6 @@ 42264 46057 * See README.txt for an overview of the Vim source code. … … 42362 46155 exe_pre_commands(¶ms); 42363 46156 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 @@ 42365 46177 if (netbeansArg != NULL && strncmp("-nb", netbeansArg, 3) == 0) 42366 46178 { … … 42371 46183 if (gui.in_use) 42372 46184 { 42373 @@ -958,18 +9 82,13 @@46185 @@ -958,18 +994,13 @@ 42374 46186 42375 46187 /* … … 42392 46204 /* 42393 46205 * Main loop: Execute Normal mode commands until exiting Vim. 42394 @@ -1009,6 +10 28,7 @@46206 @@ -1009,6 +1040,7 @@ 42395 46207 skip_redraw = FALSE; 42396 46208 RedrawingDisabled = 0; … … 42400 46212 emsg_skip = 0; 42401 46213 # endif 42402 @@ -1202,7 +12 22,9 @@46214 @@ -1202,7 +1234,9 @@ 42403 46215 || conceal_cursor_line(curwin) 42404 46216 || need_cursor_line_redraw)) … … 42411 46223 update_single_line(curwin, conceal_new_cursor_line); 42412 46224 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 @@ 42414 46235 mch_exit(exitval); 42415 46236 } … … 42419 46240 * Get a (optional) count for a Vim argument. 42420 46241 */ 42421 @@ -2996,6 +30 19,8 @@46242 @@ -2996,6 +3031,8 @@ 42422 46243 #endif 42423 46244 } … … 42428 46249 * Get an environment variable, and execute it as Ex commands. 42429 46250 * Returns FAIL if the environment variable was not executed, OK otherwise. 42430 @@ -3035,7 +30 60,7 @@46251 @@ -3035,7 +3072,7 @@ 42431 46252 return FAIL; 42432 46253 } … … 42437 46258 * Return TRUE if we are certain the user owns the file "fname". 42438 46259 * Used for ".vimrc" and ".exrc". 42439 @@ -3093,6 +31 18,7 @@46260 @@ -3093,6 +3130,7 @@ 42440 46261 mainerr(ME_ARG_MISSING, str); 42441 46262 } … … 42445 46266 * print a message with three spaces prepended and '\n' appended. 42446 46267 */ 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 @@ 42448 46277 main_msg(_("+reverse\t\tDon't use reverse video (also: +rv)")); 42449 46278 main_msg(_("-xrm <resource>\tSet the specified resource")); … … 42457 46286 mch_msg(_("\nArguments recognised by gvim (GTK+ version):\n")); 42458 46287 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 @@ 42460 46297 #ifdef FEAT_GUI_GNOME 42461 46298 /* Gnome gives extra messages for --help if we continue, but not for -h. */ … … 42468 46305 #endif 42469 46306 mch_exit(0); 42470 @@ -3313,6 +33 37,8 @@46307 @@ -3313,6 +3351,8 @@ 42471 46308 } 42472 46309 #endif … … 42477 46314 static void time_diff __ARGS((struct timeval *then, struct timeval *now)); 42478 46315 42479 @@ -3422,7 +34 48,7 @@46316 @@ -3422,7 +3462,7 @@ 42480 46317 42481 46318 #endif … … 42486 46323 /* 42487 46324 * Common code for the X command server and the Win32 command server. 42488 @@ -3806,7 +38 32,7 @@46325 @@ -3806,7 +3846,7 @@ 42489 46326 int i; 42490 46327 char_u *inicmd = NULL; … … 42495 46332 if (filec > 0 && filev[0][0] == '+') 42496 46333 { 42497 @@ -3817,15 +38 43,25 @@46334 @@ -3817,15 +3857,25 @@ 42498 46335 /* Check if we have at least one argument. */ 42499 46336 if (filec <= 0) … … 42523 46360 ga_init2(&ga, 1, 100); 42524 46361 ga_concat(&ga, (char_u *)"<C-\\><C-N>:cd "); 42525 @@ -3858,13 +3 894,20 @@46362 @@ -3858,13 +3908,20 @@ 42526 46363 ga_concat(&ga, p); 42527 46364 vim_free(p); … … 42548 46385 { 42549 46386 /* Can't use <CR> after "inicmd", because an "startinsert" would cause 42550 @@ -3881,6 +39 24,32 @@46387 @@ -3881,6 +3938,32 @@ 42551 46388 } 42552 46389 … … 42581 46418 */ 42582 46419 void 42583 @@ -3991,32 +40 60,7 @@46420 @@ -3991,32 +4074,7 @@ 42584 46421 # endif 42585 46422 return res; … … 42616 46453 * When FEAT_FKMAP is defined, also compile the Farsi source code. 42617 46454 diff -Naur vim73.orig/src/mark.c vim73/src/mark.c 42618 --- vim73.orig/src/mark.c 2012-0 2-15 21:57:45.049435840+000042619 +++ vim73/src/mark.c 2012-0 2-15 21:57:45.665452088+000046455 --- 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 42620 46457 @@ -1750,7 +1750,10 @@ 42621 46458 { … … 42631 46468 case '"': curbuf->b_last_cursor = pos; break; 42632 46469 diff -Naur vim73.orig/src/mbyte.c vim73/src/mbyte.c 42633 --- vim73.orig/src/mbyte.c 2012-0 2-15 21:57:45.053435946+000042634 +++ vim73/src/mbyte.c 2012-0 2-15 21:57:46.633477621+000046470 --- 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 42635 46472 @@ -132,6 +132,7 @@ 42636 46473 static int dbcs_char2cells __ARGS((int c)); … … 42641 46478 /* 42642 46479 * 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 42643 46489 @@ -837,6 +838,27 @@ 42644 46490 } … … 42735 46581 * Get character at **pp and advance *pp to the next character. 42736 46582 * 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. 42737 46592 */ 42738 46593 @@ -2667,7 +2749,8 @@ … … 42781 46636 42782 46637 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 @@ 42784 46648 return TOUPPER_LOC(a); 42785 46649 … … 42790 46654 42791 46655 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 @@ 42793 46666 return TOLOWER_LOC(a); 42794 46667 … … 42799 46672 42800 46673 int 42801 @@ -3079,6 +316 5,80 @@46674 @@ -3079,6 +3166,80 @@ 42802 46675 return (utf_tolower(a) != a); 42803 46676 } … … 42880 46753 * Version of strnicmp() that handles multi-byte characters. 42881 46754 * Needed for Big5, Sjift-JIS and UTF-8 encoding. Other DBCS encodings can 42882 @@ -3092,46 +325 2,21 @@46755 @@ -3092,46 +3253,21 @@ 42883 46756 char_u *s1, *s2; 42884 46757 size_t nn; … … 42937 46810 if (l <= 1) 42938 46811 { 42939 @@ -3560,7 +369 5,7 @@46812 @@ -3560,7 +3696,7 @@ 42940 46813 void 42941 46814 mb_adjust_cursor() … … 42946 46819 42947 46820 /* 42948 @@ -3568,7 +370 3,8 @@46821 @@ -3568,7 +3704,8 @@ 42949 46822 * If it points to a tail byte it's moved backwards to the head byte. 42950 46823 */ … … 42956 46829 { 42957 46830 char_u *p; 42958 @@ -3579,7 +371 5,7 @@46831 @@ -3579,7 +3716,7 @@ 42959 46832 #endif 42960 46833 ) … … 42965 46838 #ifdef FEAT_VIRTUALEDIT 42966 46839 /* Reset "coladd" when the cursor would be on the right half of a 42967 @@ -4126,7 +426 2,7 @@46840 @@ -4126,7 +4263,7 @@ 42968 46841 done = to - (char *)result; 42969 46842 } … … 42974 46847 return result; 42975 46848 } 42976 @@ -4159,11 +429 5,11 @@46849 @@ -4159,11 +4296,11 @@ 42977 46850 { 42978 46851 if (hIconvDLL != 0 && hMsvcrtDLL != 0) … … 42989 46862 { 42990 46863 /* 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 @@ 42992 46875 /* We had a keypad key, and XIM tried to thieve it */ 42993 46876 return FALSE; … … 43000 46883 return imresult; 43001 46884 } 43002 @@ -5167,16 +530 7,16 @@46885 @@ -5167,16 +5309,16 @@ 43003 46886 void 43004 46887 xim_set_preedit() … … 43022 46905 { 43023 46906 /* hide XIM cursor */ 43024 @@ -5554,12 +569 4,12 @@46907 @@ -5554,12 +5696,12 @@ 43025 46908 void 43026 46909 xim_set_status_area() … … 43039 46922 if (input_style & XIMPreeditArea) 43040 46923 diff -Naur vim73.orig/src/memfile.c vim73/src/memfile.c 43041 --- vim73.orig/src/memfile.c 2012-0 2-15 21:57:45.053435946+000043042 +++ vim73/src/memfile.c 2012-0 2-15 21:57:45.949459578 +000046924 --- 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 43043 46926 @@ -32,10 +32,6 @@ 43044 46927 * file is opened. … … 43451 47334 diff -Naur vim73.orig/src/memfile_test.c vim73/src/memfile_test.c 43452 47335 --- vim73.orig/src/memfile_test.c 1970-01-01 00:00:00.000000000 +0000 43453 +++ vim73/src/memfile_test.c 2012-0 2-15 21:57:45.721453564+000047336 +++ vim73/src/memfile_test.c 2012-06-03 23:09:53.800029943 +0000 43454 47337 @@ -0,0 +1,145 @@ 43455 47338 +/* vi:set ts=8 sts=4 sw=4: … … 43599 47482 +} 43600 47483 diff -Naur vim73.orig/src/memline.c vim73/src/memline.c 43601 --- vim73.orig/src/memline.c 2012-0 2-15 21:57:45.053435946+000043602 +++ vim73/src/memline.c 2012-0 2-15 21:57:46.577476142+000047484 --- 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 43603 47486 @@ -42,10 +42,6 @@ 43604 47487 * mf_get(). … … 43886 47769 if (process_still_running && choice >= 4) 43887 47770 diff -Naur vim73.orig/src/menu.c vim73/src/menu.c 43888 --- vim73.orig/src/menu.c 2012-0 2-15 21:57:45.053435946+000043889 +++ vim73/src/menu.c 2012-0 2-15 21:57:45.789455357+000047771 --- 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 43890 47773 @@ -1394,7 +1394,8 @@ 43891 47774 int idx; … … 43933 47816 { 43934 47817 diff -Naur vim73.orig/src/message.c vim73/src/message.c 43935 --- vim73.orig/src/message.c 2012-0 2-15 21:57:45.065436261+000043936 +++ vim73/src/message.c 2012-0 2-15 21:57:46.837483000+000047818 --- 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 43937 47820 @@ -39,7 +39,6 @@ 43938 47821 static void msg_screen_putchar __ARGS((int c, int attr)); … … 44183 48066 { 44184 48067 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 @@ 44186 48086 #ifdef FEAT_CON_DIALOG 44187 48087 int retval = FALSE; … … 44192 48092 msgchunk_T *mp; 44193 48093 int i; 44194 @@ -2489,49 +25 52,49 @@48094 @@ -2489,49 +2562,49 @@ 44195 48095 } 44196 48096 #endif … … 44251 48151 break; 44252 48152 44253 @@ -2584,9 +26 47,9 @@48153 @@ -2584,9 +2657,9 @@ 44254 48154 continue; 44255 48155 } … … 44263 48163 /* go to start of last line */ 44264 48164 if (mp_last == NULL) 44265 @@ -2604,7 +26 67,7 @@48165 @@ -2604,7 +2677,7 @@ 44266 48166 if (mp != NULL && mp->sb_prev != NULL) 44267 48167 { … … 44272 48172 if (mp == NULL || mp->sb_prev == NULL) 44273 48173 break; 44274 @@ -2615,7 +26 78,7 @@48174 @@ -2615,7 +2688,7 @@ 44275 48175 mp_last = msg_sb_start(mp_last->sb_prev); 44276 48176 } … … 44281 48181 { 44282 48182 /* display line at top */ 44283 @@ -2631,13 +2 694,13 @@48183 @@ -2631,13 +2704,13 @@ 44284 48184 ++msg_scrolled; 44285 48185 } … … 44297 48197 /* scroll up, display line at bottom */ 44298 48198 msg_scroll_up(); 44299 @@ -2645,11 +27 08,11 @@48199 @@ -2645,11 +2718,11 @@ 44300 48200 screen_fill((int)Rows - 2, (int)Rows - 1, 0, 44301 48201 (int)Columns, ' ', ' ', 0); … … 44311 48211 /* displayed the requested text, more prompt again */ 44312 48212 screen_fill((int)Rows - 1, (int)Rows, 0, 44313 @@ -2659,7 +27 22,7 @@48213 @@ -2659,7 +2732,7 @@ 44314 48214 } 44315 48215 … … 44320 48220 44321 48221 break; 44322 @@ -3019,12 +30 82,9 @@48222 @@ -3019,12 +3092,9 @@ 44323 48223 if (redir_off) 44324 48224 return; … … 44336 48236 if (redirecting()) 44337 48237 { 44338 @@ -3038,9 +3 098,12 @@48238 @@ -3038,9 +3108,12 @@ 44339 48239 write_reg_contents(redir_reg, (char_u *)" ", -1, TRUE); 44340 48240 else if (redir_vname) … … 44350 48250 } 44351 48251 } 44352 @@ -3052,13 +31 15,16 @@48252 @@ -3052,13 +3125,16 @@ 44353 48253 var_redir_str(s, maxlen); 44354 48254 #endif … … 44370 48270 cur_col = 0; 44371 48271 else if (*s == '\t') 44372 @@ -3076,7 +31 42,7 @@48272 @@ -3076,7 +3152,7 @@ 44373 48273 int 44374 48274 redirecting() … … 44379 48279 || redir_reg || redir_vname 44380 48280 #endif 44381 @@ -3134,9 +32 00,6 @@48281 @@ -3134,9 +3210,6 @@ 44382 48282 cmdline_row = msg_row; 44383 48283 } … … 44389 48289 * Called when 'verbosefile' is set: stop writing to the file. 44390 48290 */ 44391 @@ -3174,49 +32 37,6 @@48291 @@ -3174,49 +3247,6 @@ 44392 48292 } 44393 48293 … … 44439 48339 * Use 'w' highlighting and may repeat the message after redrawing 44440 48340 */ 44441 @@ -3294,7 +33 14,7 @@48341 @@ -3294,7 +3324,7 @@ 44442 48342 * different letter. 44443 48343 */ … … 44448 48348 char_u *title UNUSED; 44449 48349 char_u *message; 44450 @@ -3302,6 +33 22,8 @@48350 @@ -3302,6 +3332,8 @@ 44451 48351 int dfltbutton; 44452 48352 char_u *textfield UNUSED; /* IObuff for inputdialog(), NULL … … 44457 48357 int oldState; 44458 48358 int retval = 0; 44459 @@ -3320,7 +33 42,7 @@48359 @@ -3320,7 +3352,7 @@ 44460 48360 if (gui.in_use && vim_strchr(p_go, GO_CONDIALOG) == NULL) 44461 48361 { … … 44466 48366 need_wait_return = FALSE; 44467 48367 emsg_on_display = FALSE; 44468 @@ -3367,6 +33 89,13 @@48368 @@ -3367,6 +3399,13 @@ 44469 48369 default: /* Could be a hotkey? */ 44470 48370 if (c < 0) /* special keys are ignored here */ … … 44480 48380 c = MB_TOLOWER(c); 44481 48381 retval = 1; 44482 @@ -3640,7 +36 69,7 @@48382 @@ -3640,7 +3679,7 @@ 44483 48383 if (do_dialog(type, 44484 48384 title == NULL ? (char_u *)_("Question") : title, … … 44489 48389 return VIM_NO; 44490 48390 } 44491 @@ -3655,7 +36 84,7 @@48391 @@ -3655,7 +3694,7 @@ 44492 48392 switch (do_dialog(type, 44493 48393 title == NULL ? (char_u *)_("Question") : title, … … 44498 48398 case 1: return VIM_YES; 44499 48399 case 2: return VIM_NO; 44500 @@ -3674,7 +37 03,7 @@48400 @@ -3674,7 +3713,7 @@ 44501 48401 title == NULL ? (char_u *)"Question" : title, 44502 48402 message, … … 44508 48408 case 2: return VIM_NO; 44509 48409 diff -Naur vim73.orig/src/misc1.c vim73/src/misc1.c 44510 --- vim73.orig/src/misc1.c 2012-0 2-15 21:57:45.057436051+000044511 +++ vim73/src/misc1.c 2012-0 2-15 21:57:46.909484899+000048410 --- 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 44512 48412 @@ -363,7 +363,7 @@ 44513 48413 … … 44687 48587 } 44688 48588 #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); 44689 48598 @@ -2919,7 +2944,7 @@ 44690 48599 buf_T *buf; … … 44868 48777 p = pp; 44869 48778 *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 @@ 44871 48821 vim_ispathsep(c) 44872 48822 int c; … … 44902 48852 44903 48853 #if defined(FEAT_SEARCHPATH) || defined(PROTO) 44904 @@ -4907, 7 +4962,7@@48854 @@ -4907,11 +4967,12 @@ 44905 48855 static int cin_islinecomment __ARGS((char_u *)); 44906 48856 static int cin_isterminated __ARGS((char_u *, int, int)); … … 44911 48861 static int cin_iselse __ARGS((char_u *)); 44912 48862 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 @@ 44914 48869 static int corr_ind_maxparen __ARGS((int ind_maxparen, pos_T *startpos)); 44915 48870 static int find_last_paren __ARGS((char_u *l, int start, int end)); … … 44919 48874 static int ind_hash_comment = 0; /* # starts a comment */ 44920 48875 44921 @@ -4968,7 +50 24,7 @@48876 @@ -4968,7 +5030,7 @@ 44922 48877 } 44923 48878 … … 44928 48883 */ 44929 48884 static int 44930 @@ -5101,6 +51 57,9 @@48885 @@ -5101,6 +5163,9 @@ 44931 48886 if (STRNCMP(s, "typedef", 7) == 0 && !vim_isIDc(s[7])) 44932 48887 s = cin_skipcomment(s + 7); … … 44938 48893 return TRUE; 44939 48894 44940 @@ -5185,6 +52 44,50 @@48895 @@ -5185,6 +5250,50 @@ 44941 48896 return (*(s = cin_skipcomment(s + i)) == ':' && s[1] != ':'); 44942 48897 } … … 44989 48944 * Return a pointer to the first non-empty non-comment character after a ':'. 44990 48945 * Return NULL if not found. 44991 @@ -5383,8 +54 86,7 @@48946 @@ -5383,8 +5492,7 @@ 44992 48947 cin_ispreproc(s) 44993 48948 char_u *s; … … 44999 48954 return FALSE; 45000 48955 } 45001 @@ -5444,8 +55 46,11 @@48956 @@ -5444,8 +5552,11 @@ 45002 48957 } 45003 48958 … … 45012 48967 * both apply in order to determine initializations). 45013 48968 */ 45014 @@ -5455,21 +556 0,35 @@48969 @@ -5455,21 +5566,35 @@ 45015 48970 int incl_open; /* include '{' at the end as terminator */ 45016 48971 int incl_comma; /* recognize a trailing comma */ … … 45051 49006 if (*s) 45052 49007 s++; 45053 @@ -5485,21 +56 04,41 @@49008 @@ -5485,21 +5610,41 @@ 45054 49009 * "sp" points to a string with the line. When looking at other lines it must 45055 49010 * be restored to the line. When it's NULL fetch lines here. … … 45094 49049 { 45095 49050 if (cin_iscomment(s)) /* ignore comments */ 45096 @@ -5525,18 +56 64,38 @@49051 @@ -5525,18 +5670,38 @@ 45097 49052 retval = TRUE; 45098 49053 goto done; … … 45137 49092 45138 49093 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 @@ 45140 49148 continue; 45141 49149 } … … 45148 49156 if (s[1] == ':') 45149 49157 { 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 @@ 45151 49168 45152 49169 /* … … 45157 49174 static int 45158 49175 find_last_paren(l, start, end) 45159 @@ -6021,7 +6 182,7 @@49176 @@ -6021,7 +6234,7 @@ 45160 49177 45161 49178 curwin->w_cursor.col = 0; /* default is start of line */ … … 45166 49183 i = (int)(cin_skipcomment(l + i) - l); /* ignore parens in comments */ 45167 49184 i = (int)(skip_string(l + i) - l); /* ignore parens in quotes */ 45168 @@ -6222,6 +6 383,11@@49185 @@ -6222,6 +6435,17 @@ 45169 49186 */ 45170 49187 int ind_keep_case_label = 0; … … 45175 49192 + int ind_cpp_namespace = 0; 45176 49193 + 49194 + /* 49195 + * handle continuation lines containing conditions of if(), for() and 49196 + * while() 49197 + */ 49198 + int ind_if_for_while = 0; 49199 + 45177 49200 pos_T cur_curpos; 45178 49201 int amount; 45179 49202 int scope_amount; 45180 @@ -6262,8 +64 28,10 @@49203 @@ -6262,8 +6486,10 @@ 45181 49204 int n; 45182 49205 int iscase; … … 45189 49212 for (options = curbuf->b_p_cino; *options; ) 45190 49213 { 45191 @@ -6335,6 +65 03,7@@49214 @@ -6335,6 +6561,8 @@ 45192 49215 case 'J': ind_js = n; break; 45193 49216 case 'l': ind_keep_case_label = n; break; 45194 49217 case '#': ind_hash_comment = n; break; 45195 49218 + case 'N': ind_cpp_namespace = n; break; 49219 + case 'k': ind_if_for_while = n; break; 45196 49220 } 45197 49221 if (*options == ',') 45198 49222 ++options; 45199 @@ -6424,6 +6 593,8 @@49223 @@ -6424,6 +6652,8 @@ 45200 49224 /* find how indented the line beginning the comment is */ 45201 49225 getvcol(curwin, trypos, &col, NULL, NULL); … … 45206 49230 p = curbuf->b_p_com; 45207 49231 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 @@ 45209 49286 { 45210 49287 curwin->w_cursor.lnum = our_paren_pos.lnum; … … 45215 49292 amount += ind_unclosed2; 45216 49293 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 @@ 45219 49305 * ldfd) { 45220 49306 * } … … 45225 49311 amount = get_indent(); 45226 49312 else 45227 @@ -6901,11 +7 071,24 @@49313 @@ -6901,11 +7163,24 @@ 45228 49314 if (start_brace == BRACE_IN_COL0) /* '{' is in column 0 */ 45229 49315 { … … 45250 49336 { 45251 49337 /* Compensate for adding ind_open_extra later. */ 45252 @@ -7014,7 +7 197,8 @@49338 @@ -7014,7 +7289,8 @@ 45253 49339 * (it's a variable declaration). 45254 49340 */ … … 45260 49346 /* if the line is terminated with another ',' 45261 49347 * it is a continued variable initialization. 45262 @@ -7076,12 +7 260,59 @@49348 @@ -7076,12 +7352,59 @@ 45263 49349 else 45264 49350 amount += ind_continuation; … … 45325 49411 break; 45326 49412 } 45327 @@ -7466,17 +7 697,25 @@49413 @@ -7466,17 +7789,25 @@ 45328 49414 45329 49415 /* … … 45358 49444 45359 49445 /* 45360 @@ -7757,8 + 7996,8 @@49446 @@ -7757,8 +8088,8 @@ 45361 49447 * If we're at the end of a block, skip to the start of 45362 49448 * that block. … … 45369 49455 != NULL) /* XXX */ 45370 49456 { 45371 @@ -7820,7 +8 059,9 @@49457 @@ -7820,7 +8151,9 @@ 45372 49458 && vim_strchr(theline, '}') == NULL 45373 49459 && !cin_ends_in(theline, (char_u *)":", NULL) … … 45380 49466 { 45381 49467 amount = ind_func_type; 45382 @@ -7926,7 +8 167,8 @@49468 @@ -7926,7 +8259,8 @@ 45383 49469 * If the line looks like a function declaration, and we're 45384 49470 * not in a comment, put it the left margin. … … 45390 49476 l = ml_get_curline(); 45391 49477 45392 @@ -7947,11 +8 189,35 @@49478 @@ -7947,11 +8281,35 @@ 45393 49479 break; 45394 49480 … … 45427 49513 amount = ind_param; 45428 49514 break; 45429 @@ -8856,11 +9 122,15 @@49515 @@ -8856,11 +9214,15 @@ 45430 49516 } 45431 49517 … … 45444 49530 vim_free(buf); 45445 49531 return 0; 45446 @@ -8928,7 +9 198,10 @@49532 @@ -8928,7 +9290,10 @@ 45447 49533 * all entries found with "matchname". */ 45448 49534 if ((p[0] != '.' || starts_with_dot) … … 45456 49542 #ifdef WIN3264 45457 49543 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 @@ 45459 49567 e = p; 45460 49568 *e = NUL; … … 45465 49573 * component. */ 45466 49574 for (p = buf + wildoff; p < s; ++p) 45467 @@ -9161,12 +9 434,19 @@49575 @@ -9161,12 +9532,19 @@ 45468 49576 #ifdef CASE_INSENSITIVE_FILENAME 45469 49577 regmatch.rm_ic = TRUE; /* Behave like Terminal.app */ … … 45487 49595 vim_free(buf); 45488 49596 return 0; 45489 @@ -9196,7 +9 476,10 @@49597 @@ -9196,7 +9574,10 @@ 45490 49598 if (dp == NULL) 45491 49599 break; … … 45499 49607 STRCPY(s, dp->d_name); 45500 49608 len = STRLEN(buf); 45501 @@ -9317,7 +96 00,8 @@49609 @@ -9317,7 +9698,8 @@ 45502 49610 continue; /* it's different when it's shorter */ 45503 49611 … … 45509 49617 } 45510 49618 45511 @@ -9642,7 + 9926,7 @@49619 @@ -9642,7 +10024,7 @@ 45512 49620 if (paths == NULL) 45513 49621 return 0; … … 45519 49627 return 0; 45520 49628 diff -Naur vim73.orig/src/misc2.c vim73/src/misc2.c 45521 --- vim73.orig/src/misc2.c 2012-0 2-15 21:57:45.061436156+000045522 +++ vim73/src/misc2.c 2012-0 2-15 21:57:46.805482156+000049629 --- 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 45523 49631 @@ -200,7 +200,6 @@ 45524 49632 } … … 45628 49736 } 45629 49737 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 45630 49747 @@ -1223,7 +1236,7 @@ 45631 49748 #endif … … 45715 49832 * "sep_chars". 45716 49833 * 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 @@ 45718 49867 } 45719 49868 } … … 45741 49890 * functions that use lookup tables for various things, generally to do with 45742 49891 * special key codes. 45743 @@ -2356,10 +241 6,21 @@49892 @@ -2356,10 +2414,21 @@ 45744 49893 {'<', (char_u *)"lt"}, 45745 49894 … … 45763 49912 {K_LEFTMOUSE_NM, (char_u *)"LeftMouseNM"}, 45764 49913 {K_LEFTDRAG, (char_u *)"LeftDrag"}, 45765 @@ -2698,6 +276 9,7 @@49914 @@ -2698,6 +2767,7 @@ 45766 49915 int bit; 45767 49916 int key; … … 45771 49920 src = *srcp; 45772 49921 if (src[0] != '<') 45773 @@ -2710,26 +278 2,32 @@49922 @@ -2710,26 +2780,32 @@ 45774 49923 if (*bp == '-') 45775 49924 { … … 45815 49964 modifiers = 0x0; 45816 49965 for (bp = src + 1; bp < last_dash; bp++) 45817 @@ -2748,16 +282 6,32 @@49966 @@ -2748,16 +2824,32 @@ 45818 49967 */ 45819 49968 if (bp >= last_dash) … … 45856 50005 45857 50006 /* 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 @@ 45859 50043 #if defined(FEAT_MBYTE) || defined(PROTO) 45860 50044 /* … … 45865 50049 */ 45866 50050 int 45867 @@ -3199,7 +3 293,7 @@50051 @@ -3199,7 +3305,7 @@ 45868 50052 char_u *b; 45869 50053 char_u *p; … … 45874 50058 } 45875 50059 #endif 45876 @@ -4210,6 +43 04,8 @@50060 @@ -4210,6 +4316,8 @@ 45877 50061 static int ff_path_in_stoplist __ARGS((char_u *, int, char_u **)); 45878 50062 #endif … … 45883 50067 /* 45884 50068 * if someone likes findfirst/findnext, here are the functions 45885 @@ -4506,6 +46 02,11 @@50069 @@ -4506,6 +4614,11 @@ 45886 50070 len = 0; 45887 50071 while (*wc_part != NUL) … … 45895 50079 { 45896 50080 ff_expand_buffer[len++] = *wc_part++; 45897 @@ -4551,6 +46 52,12 @@50081 @@ -4551,6 +4664,12 @@ 45898 50082 } 45899 50083 … … 45908 50092 add_pathsep(ff_expand_buffer); 45909 50093 STRCAT(ff_expand_buffer, search_ctx->ffsc_fix_path); 45910 @@ -4597,9 +47 04,8 @@50094 @@ -4597,9 +4716,8 @@ 45911 50095 { 45912 50096 if (r_ptr[0] == '\\' && r_ptr[1] == ';') … … 45920 50104 r_ptr++; 45921 50105 } 45922 @@ -4858,10 +49 64,13 @@50106 @@ -4858,10 +4976,13 @@ 45923 50107 stackp->ffs_filearray_size = 0; 45924 50108 } … … 45935 50119 stackp->ffs_filearray_cur = 0; 45936 50120 stackp->ffs_stage = 0; 45937 @@ -6443,3 +65 52,23 @@50121 @@ -6443,3 +6564,23 @@ 45938 50122 #endif 45939 50123 … … 45960 50144 +#endif 45961 50145 diff -Naur vim73.orig/src/move.c vim73/src/move.c 45962 --- vim73.orig/src/move.c 2012-0 2-15 21:57:45.041435628+000045963 +++ vim73/src/move.c 2012-0 2-15 21:57:46.885484267+000050146 --- 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 45964 50148 @@ -362,7 +362,7 @@ 45965 50149 #endif … … 46000 50184 && !curwin->w_cline_folded 46001 50185 #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; 46004 50197 win_T *old_curwin = curwin; 46005 50198 buf_T *old_curbuf = curbuf; … … 46008 50201 int old_VIsual_select = VIsual_select; 46009 50202 int old_VIsual_active = VIsual_active; 46010 @@ -2875,16 +2876,22 @@ 50203 @@ -2874,17 +2880,28 @@ 50204 # endif 46011 50205 curwin->w_cursor.lnum = line; 46012 50206 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; 46013 50212 46014 50213 - /* Make sure the cursor is in a valid position. */ … … 46036 50235 diff -Naur vim73.orig/src/msvc2010.bat vim73/src/msvc2010.bat 46037 50236 --- vim73.orig/src/msvc2010.bat 1970-01-01 00:00:00.000000000 +0000 46038 +++ vim73/src/msvc2010.bat 2012-0 2-15 21:57:46.085463166+000050237 +++ vim73/src/msvc2010.bat 2012-06-03 23:09:54.252041972 +0000 46039 50238 @@ -0,0 +1,7 @@ 46040 50239 +@echo off … … 46046 50245 +call "%VS100COMNTOOLS%%vsvars32.bat" 46047 50246 diff -Naur vim73.orig/src/netbeans.c vim73/src/netbeans.c 46048 --- vim73.orig/src/netbeans.c 2012-0 2-15 21:57:45.061436156+000046049 +++ vim73/src/netbeans.c 2012-0 2-15 21:57:46.793481839+000050247 --- 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 46050 50249 @@ -14,12 +14,15 @@ 46051 50250 * which are *between* characters, whereas vim uses line number … … 46437 50636 ff_detected = EOL_DOS; 46438 50637 --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. */ 46443 50644 - newline = alloc_check((unsigned)(STRLEN(oldline) + len + 1)); 50645 + /* Insert halfway a line. */ 46444 50646 + newline = alloc_check( 46445 50647 + (unsigned)(STRLEN(oldline) + len + 1)); 46446 50648 if (newline != NULL) 46447 50649 { 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 @@ 46450 50659 { 46451 50660 /* Append a new line. Not that we always do this, … … 46466 50675 46467 50676 /* Adjust the marks below the inserted lines. */ 46468 @@ -1986,7 +199 4,7 @@50677 @@ -1986,7 +1995,7 @@ 46469 50678 EMSG("E640: invalid buffer identifier in initDone"); 46470 50679 return FAIL; … … 46475 50684 nb_set_curbuf(buf->bufp); 46476 50685 #if defined(FEAT_AUTOCMD) 46477 @@ -2075,7 +208 3,7 @@50686 @@ -2075,7 +2084,7 @@ 46478 50687 ECMD_HIDE + ECMD_OLDBUF, curwin); 46479 50688 buf->bufp = curbuf; … … 46484 50693 maketitle(); 46485 50694 #endif 46486 @@ -2103,7 +211 1,7 @@50695 @@ -2103,7 +2112,7 @@ 46487 50696 exarg.forceit = FALSE; 46488 50697 dosetvisible = TRUE; … … 46493 50702 46494 50703 #ifdef FEAT_GUI 46495 @@ -2250,6 +225 8,7 @@50704 @@ -2250,6 +2259,7 @@ 46496 50705 update_topline(); /* scroll to show the line */ 46497 50706 update_screen(VALID); … … 46501 50710 #ifdef FEAT_GUI 46502 50711 if (gui.in_use) 46503 @@ -2302,7 +231 1,7 @@50712 @@ -2302,7 +2312,7 @@ 46504 50713 buf->bufp->b_fnum, TRUE); 46505 50714 buf->bufp = NULL; … … 46510 50719 } 46511 50720 else if (streq((char *)cmd, "setStyle")) /* obsolete... */ 46512 @@ -2393,7 +240 2,7 @@50721 @@ -2393,7 +2403,7 @@ 46513 50722 return FAIL; 46514 50723 } … … 46519 50728 cp = (char *)args; 46520 50729 serNum = strtol(cp, &cp, 10); 46521 @@ -2441,7 +245 0,7 @@50730 @@ -2441,7 +2451,7 @@ 46522 50731 nbdebug((" invalid buffer identifier in removeAnno\n")); 46523 50732 return FAIL; … … 46528 50737 serNum = strtol(cp, &cp, 10); 46529 50738 args = (char_u *)cp; 46530 @@ -2486,7 +249 5,7 @@50739 @@ -2486,7 +2496,7 @@ 46531 50740 len = strtol(cp, NULL, 10); 46532 50741 args = (char_u *)cp; … … 46537 50746 nbdebug((" no such start pos in %s, %ld\n", cmd, off)); 46538 50747 else 46539 @@ -2548,7 +255 7,7 @@50748 @@ -2548,7 +2558,7 @@ 46540 50749 inAtomic = 0; 46541 50750 if (needupdate) … … 46546 50755 } 46547 50756 /* =====================================================================*/ 46548 @@ -2629,21 +263 8,22 @@50757 @@ -2629,21 +2639,22 @@ 46549 50758 * Unrecognized command is ignored. 46550 50759 */ … … 46573 50782 #ifdef FEAT_GUI 46574 50783 if (gui.in_use) 46575 @@ -2773,6 +278 3,16 @@50784 @@ -2773,6 +2784,16 @@ 46576 50785 ex_nbstart(eap) 46577 50786 exarg_T *eap; … … 46590 50799 } 46591 50800 46592 @@ -2880,7 +290 0,7 @@50801 @@ -2880,7 +2901,7 @@ 46593 50802 char_u *text; 46594 50803 linenr_T lnum; … … 46599 50808 46600 50809 /* Don't do anything when 'ballooneval' is off, messages scrolled the 46601 @@ -2894,15 +291 4,20 @@50810 @@ -2894,15 +2915,20 @@ 46602 50811 * length. */ 46603 50812 if (text != NULL && text[0] != NUL && STRLEN(text) < MAXPATHL) … … 46627 50836 vim_free(text); 46628 50837 } 46629 @@ -2937,7 +296 2,7 @@50838 @@ -2937,7 +2963,7 @@ 46630 50839 if (!NB_HAS_GUI || !NETBEANS_OPEN) 46631 50840 return; … … 46636 50845 * when there is input on the editor connection socket 46637 50846 */ 46638 @@ -3000,6 +302 5,7 @@50847 @@ -3000,6 +3026,7 @@ 46639 50848 changed_window_setting(); 46640 50849 update_screen(CLEAR); … … 46644 50853 #ifdef FEAT_GUI 46645 50854 if (gui.in_use) 46646 @@ -3027,7 +305 3,7 @@50855 @@ -3027,7 +3054,7 @@ 46647 50856 } 46648 50857 } … … 46653 50862 * Tell netbeans that the window was moved or resized. 46654 50863 */ 46655 @@ -3458,7 +348 4,7 @@50864 @@ -3458,7 +3485,7 @@ 46656 50865 return FALSE; 46657 50866 } … … 46662 50871 * We have multiple signs to draw at the same location. Draw the 46663 50872 * multi-sign indicator instead. This is the Motif version. 46664 @@ -3487,7 +351 3,7 @@50873 @@ -3487,7 +3514,7 @@ 46665 50874 XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+3, y++); 46666 50875 XDrawPoint(gui.dpy, gui.wid, gui.text_gc, x+2, y); … … 46671 50880 #if defined(FEAT_GUI_GTK) && !defined(PROTO) 46672 50881 /* 46673 @@ -3902,14 +392 8,12 @@50882 @@ -3902,14 +3929,12 @@ 46674 50883 } 46675 50884 else … … 46692 50901 46693 50902 diff -Naur vim73.orig/src/normal.c vim73/src/normal.c 46694 --- vim73.orig/src/normal.c 2012-0 2-15 21:57:45.061436156+000046695 +++ vim73/src/normal.c 2012-0 2-15 21:57:46.901484689+000046696 @@ -20,1 1 +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 @@ 46697 50906 */ 46698 50907 static int resel_VIsual_mode = NUL; /* 'v', 'V', or Ctrl-V */ … … 46708 50917 +#endif 46709 50918 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)); 46712 50928 @@ -648,6 +651,14 @@ 46713 50929 dont_scroll = FALSE; /* allow scrolling here */ … … 46984 51200 else 46985 51201 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 @@ 46987 51226 } 46988 51227 curwin->w_cursor.lnum++; … … 46992 51231 } 46993 51232 } 46994 @@ -5666,8 +57 43,13 @@51233 @@ -5666,8 +5751,13 @@ 46995 51234 else if (cmdchar == '#') 46996 51235 aux_ptr = (char_u *)(p_magic ? "/?.*~[^$\\" : "/?^$\\"); … … 47008 51247 aux_ptr = (char_u *)"\\|\"\n*?["; 47009 51248 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 @@ 47011 51303 if (VIsual_mode == 'v') 47012 51304 { … … 47029 51321 curwin->w_curswant = MAXCOL; 47030 51322 coladvance((colnr_T)MAXCOL); 47031 @@ -7599,7 +7 685,7 @@51323 @@ -7599,7 +7708,7 @@ 47032 51324 { 47033 51325 validate_virtcol(); … … 47038 51330 } 47039 51331 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 @@ 47041 51350 else 47042 51351 curwin->w_curswant = 0; … … 47047 51356 } 47048 51357 47049 @@ -8736,7 +88 22,7 @@51358 @@ -8736,7 +8855,7 @@ 47050 51359 { 47051 51360 --pp->col; … … 47056 51365 } 47057 51366 else if (pp->lnum > 1) 47058 @@ -9261,7 +93 47,7 @@51367 @@ -9261,7 +9380,7 @@ 47059 51368 # ifdef FEAT_CLIPBOARD 47060 51369 adjust_clip_reg(®name); … … 47066 51375 # endif 47067 51376 diff -Naur vim73.orig/src/ops.c vim73/src/ops.c 47068 --- vim73.orig/src/ops.c 2012-0 2-15 21:57:45.053435946+000047069 +++ vim73/src/ops.c 2012-0 2-15 21:57:46.741480469 +000051377 --- 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 47070 51379 @@ -1584,9 +1584,11 @@ 47071 51380 adjust_clip_reg(rp) … … 47097 51406 if (*ptr == NUL && inindent(0)) 47098 51407 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 @@ 47100 51427 curwin->w_cursor.coladd = 0; 47101 51428 } … … 47121 51448 else /* delete characters between lines */ 47122 51449 { 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 */ 47124 51462 ++curwin->w_cursor.lnum; 47125 51463 del_lines((long)(oap->line_count - 2), FALSE); … … 47129 51467 - (void)del_bytes((long)(oap->end.col + 1 - !oap->inclusive), 47130 51468 - !virtual_op, oap->op_type == OP_DELETE 51469 + if (delete_last_line) 51470 + oap->end.lnum = curbuf->b_ml.ml_line_count; 51471 + 47131 51472 + n = (oap->end.col + 1 - !oap->inclusive); 47132 + if (oap->inclusive && oap->end.lnum == curbuf->b_ml.ml_line_count51473 + if (oap->inclusive && delete_last_line 47133 51474 + && n > (int)STRLEN(ml_get(oap->end.lnum))) 47134 51475 + { … … 47158 51499 } 47159 51500 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 @@ 47161 51512 char_u *p; 47162 51513 char_u *pnew; … … 47168 51519 /* check for read-only register */ 47169 51520 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 @@ 47171 51540 */ 47172 51541 if (clip_star.available … … 47178 51547 if (curr != &(y_regs[STAR_REGISTER])) 47179 51548 /* Copy the text from register 0 to the clipboard register. */ 47180 @@ -3123,6 +31 55,9 @@51549 @@ -3123,6 +3166,9 @@ 47181 51550 47182 51551 clip_own_selection(&clip_star); … … 47188 51557 47189 51558 # ifdef FEAT_X11 47190 @@ -3130,12 +31 65,18 @@51559 @@ -3130,12 +3176,18 @@ 47191 51560 * If we were yanking to the '+' register, send result to selection. 47192 51561 * Also copy to the '*' register, in case auto-select is off. … … 47210 51579 copy_yank_reg(&(y_regs[STAR_REGISTER])); 47211 51580 clip_own_selection(&clip_star); 47212 @@ -3293,8 +33 34,8 @@51581 @@ -3293,8 +3345,8 @@ 47213 51582 if (regname == '=') 47214 51583 { … … 47221 51590 { 47222 51591 y_size = 0; 47223 @@ -3310,7 +33 51,7 @@51592 @@ -3310,7 +3362,7 @@ 47224 51593 if (y_array != NULL) 47225 51594 *ptr = NUL; … … 47230 51599 { 47231 51600 y_type = MLINE; 47232 @@ -3979,7 +40 20,12 @@51601 @@ -3979,7 +4031,12 @@ 47233 51602 for (i = -1; i < NUM_REGISTERS && !got_int; ++i) 47234 51603 { … … 47244 51613 47245 51614 #ifdef FEAT_CLIPBOARD 47246 @@ -4153,9 +4 199,10 @@51615 @@ -4153,9 +4210,10 @@ 47247 51616 int save_undo; 47248 51617 { … … 47256 51625 int endcurr2 = NUL; 47257 51626 int currsize = 0; /* size of the current line */ 47258 @@ -4181,7 +42 28,7 @@51627 @@ -4181,7 +4239,7 @@ 47259 51628 */ 47260 51629 for (t = 0; t < count; ++t) … … 47265 51634 { 47266 51635 curr = skipwhite(curr); 47267 @@ -4265,10 +43 12,10 @@51636 @@ -4265,10 +4323,10 @@ 47268 51637 copy_spaces(cend, (size_t)(spaces[t])); 47269 51638 } … … 47278 51647 curr = skipwhite(curr); 47279 51648 currsize = (int)STRLEN(curr); 47280 @@ -4388,7 +44 35,7 @@51649 @@ -4388,7 +4446,7 @@ 47281 51650 #endif 47282 51651 … … 47287 51656 void 47288 51657 op_format(oap, keep_cursor) 47289 @@ -5712,7 +57 59,9 @@51658 @@ -5712,7 +5770,9 @@ 47290 51659 } 47291 51660 } … … 47298 51667 clip_yank_selection(type, str, len, cbd) 47299 51668 int type; 47300 @@ -6069,9 +61 18,6 @@51669 @@ -6069,9 +6129,6 @@ 47301 51670 if (yank_type == MBLOCK) 47302 51671 yank_type = MAUTO; … … 47308 51677 47309 51678 # ifdef FEAT_CLIPBOARD 47310 @@ -6092,13 +61 38,14 @@51679 @@ -6092,13 +6149,14 @@ 47311 51680 * is appended. 47312 51681 */ … … 47325 51694 long start; 47326 51695 long i; 47327 @@ -6115,6 +61 62,12 @@51696 @@ -6115,6 +6173,12 @@ 47328 51697 if (y_ptr->y_array == NULL) /* NULL means empty register */ 47329 51698 y_ptr->y_size = 0; … … 47338 51707 * Count the number of lines within the string 47339 51708 */ 47340 @@ -6261,7 +63 14,7 @@51709 @@ -6261,7 +6325,7 @@ 47341 51710 *wc += words; 47342 51711 … … 47348 51717 chars += eol_size; 47349 51718 diff -Naur vim73.orig/src/option.c vim73/src/option.c 47350 --- vim73.orig/src/option.c 2012-0 2-15 21:57:45.061436156+000047351 +++ vim73/src/option.c 2012-0 2-15 21:57:46.969486483+000051719 --- 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 47352 51721 @@ -140,9 +140,6 @@ 47353 51722 #define PV_MOD OPT_BUF(BV_MOD) … … 47370 51739 #ifdef FEAT_TEXTOBJ 47371 51740 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 @@ 47373 51819 {(char_u *)0L, (char_u *)0L} 47374 51820 #endif … … 47384 51830 #ifdef FEAT_CSCOPE 47385 51831 (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 @@ 47387 51887 (char_u *)NULL, PV_NONE, 47388 51888 {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, … … 47400 51900 (char_u *)&p_para, PV_NONE, 47401 51901 {(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 @@ 47403 51928 (char_u *)&p_wc, PV_NONE, 47404 51929 {(char_u *)(long)Ctrl_E, (char_u *)(long)TAB} … … 47409 51934 {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, 47410 51935 {"wildignore", "wig", P_STRING|P_VI_DEF|P_COMMA|P_NODUP, 47411 @@ -2750,6 +27 45,9 @@51936 @@ -2750,6 +2756,9 @@ 47412 51937 (char_u *)NULL, PV_NONE, 47413 51938 #endif … … 47419 51944 #ifdef FEAT_WILDMENU 47420 51945 (char_u *)&p_wmnu, PV_NONE, 47421 @@ -3843,6 +38 41,8 @@51946 @@ -3843,6 +3852,8 @@ 47422 51947 # ifndef OS2 /* Always use bourne shell style redirection if we reach this */ 47423 51948 if ( fnamecmp(p, "sh") == 0 … … 47428 51953 || fnamecmp(p, "zsh-beta") == 0 47429 51954 || fnamecmp(p, "bash") == 0 47430 @@ -3850,6 +38 50,8 @@51955 @@ -3850,6 +3861,8 @@ 47431 51956 || fnamecmp(p, "cmd") == 0 47432 51957 || fnamecmp(p, "sh.exe") == 0 … … 47437 51962 || fnamecmp(p, "zsh-beta.exe") == 0 47438 51963 || fnamecmp(p, "bash.exe") == 0 47439 @@ -3881,7 +38 83,8 @@51964 @@ -3881,7 +3894,8 @@ 47440 51965 47441 51966 #if defined(MSDOS) || defined(WIN3264) || defined(OS2) … … 47447 51972 * set, but only if they have not been set before. Default for p_shcf is 47448 51973 * "/c", for p_shq is "". For "sh" like shells it is changed here to 47449 @@ -3918,6 +39 21,42@@51974 @@ -3918,6 +3932,37 @@ 47450 51975 # endif 47451 51976 # endif … … 47463 51988 + * when executed. 47464 51989 + * 47465 + * To avoid this, use the /s argument in addition to /c to force the47466 + * stripping behavior, and also set shellxquote to automatically47467 + * surround the entire command in quotes (which get strippedas47468 + * 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"'. 47469 51994 + */ 47470 +47471 + /* Set shellxquote default to add the quotes to be stripped. */47472 51995 + idx3 = findoption((char_u *)"sxq"); 47473 51996 + if (idx3 >= 0 && !(options[idx3].flags & P_WAS_SET)) 47474 51997 + { 47475 + p_sxq = (char_u *)" \"";51998 + p_sxq = (char_u *)"("; 47476 51999 + options[idx3].def_val[VI_DEFAULT] = p_sxq; 47477 52000 + } 47478 52001 + 47479 + /* Set shellcmdflag default to always strip the quotes, note the order47480 + * between /s and /c is important or cmd.exe will treat the /s as part47481 + * of the command to be executed. */47482 52002 + idx3 = findoption((char_u *)"shcf"); 47483 52003 + if (idx3 >= 0 && !(options[idx3].flags & P_WAS_SET)) 47484 52004 + { 47485 + p_shcf = (char_u *)"/ s /c";52005 + p_shcf = (char_u *)"/c"; 47486 52006 + options[idx3].def_val[VI_DEFAULT] = p_shcf; 47487 52007 + } … … 47490 52010 47491 52011 #ifdef FEAT_TITLE 47492 @@ -4349,7 +43 88,7 @@52012 @@ -4349,7 +4394,7 @@ 47493 52013 p = find_termcode(key_name); 47494 52014 if (p == NULL) … … 47499 52019 } 47500 52020 else 47501 @@ -4565,6 +46 04,31 @@52021 @@ -4565,6 +4610,31 @@ 47502 52022 arg = errbuf; 47503 52023 } … … 47531 52051 * backwards compatibility with Vim 3.0. 47532 52052 * Misuse errbuf[] for the resulting string. 47533 @@ -4697,8 +476 1,8 @@52053 @@ -4697,8 +4767,8 @@ 47534 52054 || s[i] == ',' 47535 52055 || s[i] == NUL)) … … 47542 52062 if (s > origval && s[-1] == '\\') 47543 52063 ++bs; 47544 @@ -5275,9 +53 39,6 @@52064 @@ -5275,9 +5345,6 @@ 47545 52065 #ifdef FEAT_AUTOCMD 47546 52066 check_string_option(&buf->b_p_ft); … … 47552 52072 check_string_option(&buf->b_p_cinw); 47553 52073 #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 @@ 47555 52088 int i; 47556 52089 int j = 0; … … 47562 52095 { 47563 52096 if (*s == '-' || *s == '+') 47564 @@ -7304,7 +73 68,7 @@52097 @@ -7304,7 +7376,7 @@ 47565 52098 static char_u * 47566 52099 check_clipboard_option() … … 47571 52104 int new_autoselectml = FALSE; 47572 52105 int new_html = FALSE; 47573 @@ -7316,9 +738 0,15 @@52106 @@ -7316,9 +7388,15 @@ 47574 52107 { 47575 52108 if (STRNCMP(p, "unnamed", 7) == 0 && (p[7] == ',' || p[7] == NUL)) … … 47588 52121 && (p[10] == ',' || p[10] == NUL)) 47589 52122 { 47590 @@ -7483, 6 +7553,31@@52123 @@ -7483,14 +7561,36 @@ 47591 52124 compatible_set(); 47592 52125 } … … 47620 52153 else if ((int *)varp == &curwin->w_p_list 47621 52154 || (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 @@ 47623 52173 #ifdef FEAT_BEVAL 47624 52174 else if ((int *)varp == &p_beval) … … 47632 52182 } 47633 52183 #endif 47634 @@ -7798,6 +789 3,10 @@52184 @@ -7798,6 +7896,10 @@ 47635 52185 /* Only de-activate it here, it will be enabled when changing mode. */ 47636 52186 if (p_imdisable) … … 47643 52193 #endif 47644 52194 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 @@ 47646 52251 long_u flags; 47647 52252 { … … 47654 52259 #ifdef FEAT_WINDOWS 47655 52260 if ((flags & P_RSTAT) || all) /* mark all status lines dirty */ 47656 @@ -8535,7 +86 34,7 @@52261 @@ -8535,7 +8617,7 @@ 47657 52262 changed_window_setting(); 47658 52263 if (flags & P_RBUF) … … 47663 52268 else if (all) 47664 52269 redraw_all_later(NOT_VALID); 47665 @@ -9172,7 +92 71,7 @@52270 @@ -9172,7 +9254,7 @@ 47666 52271 int expand; 47667 52272 { … … 47672 52277 if (fprintf(fd, "%s %s=", cmd, name) < 0) 47673 52278 return FAIL; 47674 @@ -9190,9 +92 89,16 @@52279 @@ -9190,9 +9272,16 @@ 47675 52280 } 47676 52281 else if (expand) … … 47689 52294 else if (put_escstr(fd, *valuep, 2) == FAIL) 47690 52295 return FAIL; 47691 @@ -9645,9 +97 51,6 @@52296 @@ -9645,9 +9734,6 @@ 47692 52297 case PV_MA: return (char_u *)&(curbuf->b_p_ma); 47693 52298 case PV_MOD: return (char_u *)&(curbuf->b_changed); … … 47699 52304 #ifdef FEAT_TEXTOBJ 47700 52305 case PV_QE: return (char_u *)&(curbuf->b_p_qe); 47701 @@ -9756,6 +98 59,9 @@52306 @@ -9756,6 +9842,9 @@ 47702 52307 #ifdef FEAT_SCROLLBIND 47703 52308 to->wo_scb = from->wo_scb; … … 47709 52314 to->wo_spell = from->wo_spell; 47710 52315 #endif 47711 @@ -9995,9 +10 101,6 @@52316 @@ -9995,9 +10084,6 @@ 47712 52317 /* Don't copy 'filetype', it must be detected */ 47713 52318 buf->b_p_ft = empty_option; … … 47719 52324 #if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT) 47720 52325 buf->b_p_cinw = vim_strsave(p_cinw); 47721 @@ -10011,7 +10 114,7 @@52326 @@ -10011,7 +10097,7 @@ 47722 52327 buf->b_p_smc = p_smc; 47723 52328 #endif … … 47728 52333 buf->b_s.b_p_spf = vim_strsave(p_spf); 47729 52334 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 @@ 47731 52346 * from when editing started (save_file_ff() called). 47732 52347 * Also when 'endofline' was changed and 'binary' is set, or when 'bomb' was … … 47752 52367 return FALSE; 47753 52368 diff -Naur vim73.orig/src/option.h vim73/src/option.h 47754 --- vim73.orig/src/option.h 2012-0 2-15 21:57:45.041435628+000047755 +++ vim73/src/option.h 2012-0 2-15 21:57:46.557475615+000052369 --- 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 47756 52371 @@ -33,7 +33,7 @@ 47757 52372 # ifdef EBCDIC … … 47786 52401 EXTERN char_u *p_csqf; /* 'cscopequickfix' */ 47787 52402 # 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 @@ 47789 52412 EXTERN char_u *p_ttym; /* 'ttymouse' */ 47790 52413 EXTERN unsigned ttym_flags; … … 47795 52418 # define TTYM_XTERM 0x01 47796 52419 # define TTYM_XTERM2 0x02 47797 @@ -824,6 +82 7,7 @@52420 @@ -824,6 +828,7 @@ 47798 52421 # define TTYM_NETTERM 0x08 47799 52422 # define TTYM_JSBTERM 0x10 … … 47803 52426 EXTERN char_u *p_udir; /* 'undodir' */ 47804 52427 EXTERN long p_ul; /* 'undolevels' */ 47805 @@ -854,7 +85 8,11 @@52428 @@ -854,7 +859,11 @@ 47806 52429 # define VE_ONEMORE 8 47807 52430 #endif … … 47816 52439 #ifdef FEAT_CMDL_COMPL 47817 52440 EXTERN char_u *p_wop; /* 'wildoptions' */ 47818 @@ -872,6 +88 0,7 @@52441 @@ -872,6 +881,7 @@ 47819 52442 EXTERN char_u *p_ww; /* 'whichwrap' */ 47820 52443 EXTERN long p_wc; /* 'wildchar' */ … … 47824 52447 #ifdef FEAT_WILDMENU 47825 52448 EXTERN int p_wmnu; /* 'wildmenu' */ 47826 @@ -979,9 +98 8,6 @@52449 @@ -979,9 +989,6 @@ 47827 52450 , BV_MOD 47828 52451 , BV_MPS … … 47835 52458 #endif 47836 52459 diff -Naur vim73.orig/src/os_amiga.c vim73/src/os_amiga.c 47837 --- vim73.orig/src/os_amiga.c 2012-0 2-15 21:57:45.041435628+000047838 +++ vim73/src/os_amiga.c 2012-0 2-15 21:57:46.553475509+000052460 --- 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 47839 52462 @@ -1022,7 +1022,7 @@ 47840 52463 … … 47847 52470 id = (struct InfoData *)(((long)id_a + 3L) & ~3L); 47848 52471 diff -Naur vim73.orig/src/os_mac_conv.c vim73/src/os_mac_conv.c 47849 --- vim73.orig/src/os_mac_conv.c 2012-0 2-15 21:57:45.049435840+000047850 +++ vim73/src/os_mac_conv.c 2012-0 2-15 21:57:46.553475509+000052472 --- 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 47851 52474 @@ -14,6 +14,8 @@ 47852 52475 */ … … 47868 52491 * there is an incomplete byte sequence. Only do up to 6 bytes to avoid 47869 52492 diff -Naur vim73.orig/src/os_macosx.m vim73/src/os_macosx.m 47870 --- vim73.orig/src/os_macosx.m 2012-0 2-15 21:57:45.057436051+000047871 +++ vim73/src/os_macosx.m 2012-0 2-15 21:57:46.161465170 +000052493 --- 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 47872 52495 @@ -15,6 +15,11 @@ 47873 52496 Error: MACOS 9 is no longer supported in Vim 7 … … 47937 52560 int len = [string lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; 47938 52561 diff -Naur vim73.orig/src/os_msdos.c vim73/src/os_msdos.c 47939 --- vim73.orig/src/os_msdos.c 2012-0 2-15 21:57:45.061436156+000047940 +++ vim73/src/os_msdos.c 2012-0 2-15 21:57:46.137464536+000052562 --- 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 47941 52564 @@ -21,7 +21,6 @@ 47942 52565 * Some functions are also used for Win16 (MS-Windows 3.1). … … 47972 52595 /* Did we get anything? */ 47973 52596 diff -Naur vim73.orig/src/os_mswin.c vim73/src/os_mswin.c 47974 --- vim73.orig/src/os_mswin.c 2012-0 2-15 21:57:45.061436156+000047975 +++ vim73/src/os_mswin.c 2012-0 2-15 21:57:46.605476881+000052597 --- 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 47976 52599 @@ -22,7 +22,6 @@ 47977 52600 # endif … … 48396 53019 48397 53020 diff -Naur vim73.orig/src/os_qnx.c vim73/src/os_qnx.c 48398 --- vim73.orig/src/os_qnx.c 2012-0 2-15 21:57:45.061436156+000048399 +++ vim73/src/os_qnx.c 2012-0 2-15 21:57:46.485473716+000053021 --- 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 48400 53023 @@ -24,10 +24,10 @@ 48401 53024 #if defined(FEAT_GUI_PHOTON) … … 48562 53185 #endif 48563 53186 diff -Naur vim73.orig/src/os_riscos.c vim73/src/os_riscos.c 48564 --- vim73.orig/src/os_riscos.c 2012-0 2-15 21:57:45.053435946+000053187 --- vim73.orig/src/os_riscos.c 2012-06-03 23:09:52.940007057 +0000 48565 53188 +++ vim73/src/os_riscos.c 1970-01-01 00:00:00.000000000 +0000 48566 53189 @@ -1,1292 +0,0 @@ … … 49858 54481 -} 49859 54482 diff -Naur vim73.orig/src/os_riscos.h vim73/src/os_riscos.h 49860 --- vim73.orig/src/os_riscos.h 2012-0 2-15 21:57:45.053435946+000054483 --- vim73.orig/src/os_riscos.h 2012-06-03 23:09:52.940007057 +0000 49861 54484 +++ vim73/src/os_riscos.h 1970-01-01 00:00:00.000000000 +0000 49862 54485 @@ -1,166 +0,0 @@ … … 50028 54651 -#define mch_setenv(name, val, x) setenv(name, val, x) 50029 54652 diff -Naur vim73.orig/src/os_unix.c vim73/src/os_unix.c 50030 --- vim73.orig/src/os_unix.c 2012-0 2-15 21:57:45.053435946+000050031 +++ vim73/src/os_unix.c 2012-0 2-15 21:57:46.921485217+000054653 --- 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 50032 54655 @@ -154,6 +154,13 @@ 50033 54656 … … 50254 54877 #endif 50255 54878 50256 @@ -3643,26 +3721,4 6@@54879 @@ -3643,26 +3721,43 @@ 50257 54880 /* Nothing to do. */ 50258 54881 } … … 50269 54892 -append_ga_line(gap) 50270 54893 - garray_T *gap; 50271 + static pid_t 50272 +wait4pid(child, status) 50273 + pid_t child; 50274 + waitstatus *status; 50275 { 54894 -{ 50276 54895 - /* Remove trailing CR. */ 50277 54896 - if (gap->ga_len > 0 … … 50282 54901 - ml_append(curwin->w_cursor.lnum++, gap->ga_data, 0, FALSE); 50283 54902 - gap->ga_len = 0; 54903 + static pid_t 54904 +wait4pid(child, status) 54905 + pid_t child; 54906 + waitstatus *status; 54907 +{ 50284 54908 + pid_t wait_pid = 0; 50285 54909 + 50286 54910 + while (wait_pid != child) 50287 54911 + { 50288 + # ifdef _THREAD_SAFE50289 + /* Ugly hack: when compiled with Python threads are probably50290 + * used, in which case wait() sometimes hangs for no obvious50291 + * reason. Use waitpid() instead and loop (like the GUI). */50292 +# 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__ 50293 54917 + wait_pid = wait4(child, status, WNOHANG, (struct rusage *)0); 50294 +# 54918 +# else 50295 54919 + wait_pid = waitpid(child, status, WNOHANG); 50296 +# 54920 +# endif 50297 54921 + if (wait_pid == 0) 50298 54922 + { … … 50301 54925 + continue; 50302 54926 + } 50303 +# else50304 + wait_pid = wait(status);50305 +# endif50306 54927 + if (wait_pid <= 0 50307 54928 +# ifdef ECHILD … … 50317 54938 int 50318 54939 mch_call_shell(cmd, options) 50319 @@ -3706,6 +380 4,10 @@54940 @@ -3706,6 +3801,10 @@ 50320 54941 if (options & SHELL_COOKED) 50321 54942 settmode(TMODE_COOK); /* set to normal mode */ … … 50328 54949 if (cmd == NULL) 50329 54950 x = system(""); /* this starts an interactive shell in emx */ 50330 @@ -3795,6 +389 7,7 @@54951 @@ -3795,6 +3894,7 @@ 50331 54952 int retval = -1; 50332 54953 char **argv = NULL; … … 50336 54957 char_u *p; 50337 54958 int inquote; 50338 @@ -3814,13 +391 7,17 @@54959 @@ -3814,13 +3914,17 @@ 50339 54960 # endif 50340 54961 int did_settmode = FALSE; /* settmode(TMODE_RAW) called */ … … 50357 54978 /* 50358 54979 * Do this loop twice: 50359 @@ -3851,6 +395 8,19 @@54980 @@ -3851,6 +3955,19 @@ 50360 54981 } 50361 54982 if (argv == NULL) … … 50377 54998 if (argv == NULL) /* out of memory */ 50378 54999 goto error; 50379 @@ -3858,9 +397 8,27 @@55000 @@ -3858,9 +3975,27 @@ 50380 55001 } 50381 55002 if (cmd != NULL) … … 50406 55027 } 50407 55028 argv[argc] = NULL; 50408 @@ -3885,11 +402 3,21 @@55029 @@ -3885,11 +4020,21 @@ 50409 55030 if (p_guipty && !(options & (SHELL_READ|SHELL_WRITE))) 50410 55031 { … … 50432 55053 } 50433 55054 /* 50434 @@ -4148,7 +429 6,6 @@55055 @@ -4148,7 +4293,6 @@ 50435 55056 # ifdef FEAT_GUI 50436 55057 if (pty_master_fd >= 0) … … 50440 55061 toshell_fd = dup(pty_master_fd); 50441 55062 } 50442 @@ -4190,15 +433 7,13 @@55063 @@ -4190,15 +4334,13 @@ 50443 55064 { 50444 55065 MSG_PUTS(_("\nCannot fork\n")); … … 50457 55078 for (;;) 50458 55079 { 50459 @@ -4210,7 +435 5,8 @@55080 @@ -4210,7 +4352,8 @@ 50460 55081 len = write(toshell_fd, "", (size_t)1); 50461 55082 else … … 50467 55088 s == NULL ? l 50468 55089 : (size_t)(s - (lp + written))); 50469 @@ -4221,7 +436 7,7 @@55090 @@ -4221,7 +4364,7 @@ 50470 55091 * should not have one. */ 50471 55092 if (lnum != curbuf->b_op_end.lnum … … 50476 55097 curbuf->b_ml.ml_line_count 50477 55098 || curbuf->b_p_eol))) 50478 @@ -4243,7 +438 9,7 @@55099 @@ -4243,7 +4386,7 @@ 50479 55100 } 50480 55101 _exit(0); … … 50485 55106 close(toshell_fd); 50486 55107 toshell_fd = -1; 50487 @@ -4430,7 +457 6,7 @@55108 @@ -4430,7 +4573,7 @@ 50488 55109 ++noread_cnt; 50489 55110 while (RealWaitForChar(fromshell_fd, 10L, NULL)) … … 50494 55115 + buffer_off, (size_t)(BUFLEN - buffer_off) 50495 55116 # else 50496 @@ -4540,7 +468 6,7 @@55117 @@ -4540,7 +4683,7 @@ 50497 55118 * typed characters (otherwise we would lose typeahead). 50498 55119 */ … … 50503 55124 wait_pid = waitpid(pid, &status, WNOHANG); 50504 55125 # endif 50505 @@ -4564,10 +47 10,10 @@55126 @@ -4564,10 +4707,10 @@ 50506 55127 { 50507 55128 append_ga_line(&ga); … … 50516 55137 } 50517 55138 50518 @@ -4589,38 +473 5,24 @@55139 @@ -4589,38 +4732,24 @@ 50519 55140 * Don't wait if wait_pid was already set above, indicating the 50520 55141 * child already exited. … … 50567 55188 /* 50568 55189 * Set to raw mode right now, otherwise a CTRL-C after 50569 @@ -4656,6 +478 8,7 @@55190 @@ -4656,6 +4785,7 @@ 50570 55191 } 50571 55192 } … … 50575 55196 error: 50576 55197 if (!did_settmode) 50577 @@ -4766,7 +489 9,8 @@55198 @@ -4766,7 +4896,8 @@ 50578 55199 50579 55200 /* … … 50585 55206 * Returns also, when a request from Sniff is waiting -- toni. 50586 55207 * Or when a Linux GPM mouse event is waiting. 50587 @@ -5004,7 +513 8,8 @@55208 @@ -5004,7 +5135,8 @@ 50588 55209 /* 50589 55210 * Select on ready for reading and exceptional condition (end of file). … … 50595 55216 FD_SET(fd, &rfds); 50596 55217 # if !defined(__QNX__) && !defined(__CYGWIN32__) 50597 @@ -5064,6 +519 9,21 @@55218 @@ -5064,6 +5196,21 @@ 50598 55219 # else 50599 55220 ret = select(maxfd + 1, &rfds, NULL, &efds, tvp); … … 50617 55238 if (ret == -1 && errno == ENOTSUP) 50618 55239 { 50619 @@ -5071,7 +52 21,7 @@55240 @@ -5071,7 +5218,7 @@ 50620 55241 FD_ZERO(&efds); 50621 55242 ret = 0; … … 50626 55247 if (ret == 0 && mzquantum_used) 50627 55248 /* loop if MzThreads must be scheduled and timeout occurred */ 50628 @@ -5693,6 +584 3,7 @@55249 @@ -5693,6 +5840,7 @@ 50629 55250 if (shell_style == STYLE_PRINT && !did_find_nul) 50630 55251 { … … 50634 55255 did_find_nul = TRUE; 50635 55256 else 50636 @@ -6562,7 +671 3,7 @@55257 @@ -6562,7 +6710,7 @@ 50637 55258 xterm_hints.x = 2; 50638 55259 return TRUE; … … 50644 55265 return FALSE; 50645 55266 diff -Naur vim73.orig/src/os_unix.h vim73/src/os_unix.h 50646 --- vim73.orig/src/os_unix.h 2012-0 2-15 21:57:45.041435628+000050647 +++ vim73/src/os_unix.h 2012-0 2-15 21:57:45.669452193 +000055267 --- 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 50648 55269 @@ -184,10 +184,6 @@ 50649 55270 … … 50658 55279 #endif 50659 55280 diff -Naur vim73.orig/src/os_win16.c vim73/src/os_win16.c 50660 --- vim73.orig/src/os_win16.c 2012-0 2-15 21:57:45.041435628+000050661 +++ vim73/src/os_win16.c 2012-0 2-15 21:57:46.553475509+000055281 --- 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 50662 55283 @@ -20,13 +20,11 @@ 50663 55284 # pragma warn -obs … … 50687 55308 PostQuitMessage(msg.wParam); 50688 55309 diff -Naur vim73.orig/src/os_win32.c vim73/src/os_win32.c 50689 --- vim73.orig/src/os_win32.c 2012-0 2-15 21:57:45.065436261+000050690 +++ vim73/src/os_win32.c 2012-0 2-15 21:57:46.377470867+000055310 --- 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 50691 55312 @@ -20,7 +20,6 @@ 50692 55313 * Roger Knobbe <rogerk@wonderware.com> did the initial port of Vim 3.0. … … 50720 55341 /* Win32 Console handles for input and output */ 50721 55342 static HANDLE g_hConIn = INVALID_HANDLE_VALUE; 50722 @@ -206,42 +212, 73@@55343 @@ -206,42 +212,96 @@ 50723 55344 static int suppress_winsize = 1; /* don't fiddle with console */ 50724 55345 #endif … … 50791 55412 + 50792 55413 +/* 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 +/* 50793 55437 + * Load library "name". 50794 55438 + */ … … 50815 55459 50816 55460 #if defined(DYNAMIC_GETTEXT) || defined(PROTO) 50817 @@ -254,7 + 291,7 @@55461 @@ -254,7 +314,7 @@ 50818 55462 static char *null_libintl_bindtextdomain(const char *, const char *); 50819 55463 static char *null_libintl_bind_textdomain_codeset(const char *, const char *); … … 50824 55468 char *(*dyn_libintl_textdomain)(const char *) = null_libintl_textdomain; 50825 55469 char *(*dyn_libintl_bindtextdomain)(const char *, const char *) 50826 @@ -282,26 +3 19,16 @@55470 @@ -282,26 +342,16 @@ 50827 55471 if (hLibintlDLL) 50828 55472 return 1; … … 50857 55501 for (i = 0; libintl_entry[i].name != NULL 50858 55502 && libintl_entry[i].ptr != NULL; ++i) 50859 @@ -398,6 +4 25,11 @@55503 @@ -398,6 +448,11 @@ 50860 55504 static PGNSECINFO pGetNamedSecurityInfo; 50861 55505 #endif … … 50869 55513 * Set g_PlatformId to VER_PLATFORM_WIN32_NT (NT) or 50870 55514 * VER_PLATFORM_WIN32_WINDOWS (Win95). 50871 @@ -430,7 +4 62,7 @@55515 @@ -430,7 +485,7 @@ 50872 55516 * Seems like a lot of overhead to load/unload ADVAPI32.DLL each 50873 55517 * time we verify security... … … 50878 55522 { 50879 55523 pSetNamedSecurityInfo = (PSNSECINFO)GetProcAddress(advapi_lib, 50880 @@ -448,6 + 480,18 @@55524 @@ -448,6 +503,18 @@ 50881 55525 } 50882 55526 } … … 50897 55541 } 50898 55542 } 50899 @@ -1615,6 +16 59,35 @@55543 @@ -1615,6 +1682,35 @@ 50900 55544 return TRUE; 50901 55545 } … … 50933 55577 50934 55578 /* 50935 @@ -1627,6 +17 00,9 @@55579 @@ -1627,6 +1723,9 @@ 50936 55580 extern int _fmode; 50937 55581 #endif … … 50943 55587 * for the timestamp test to work on removed floppies. */ 50944 55588 SetErrorMode(SEM_FAILCRITICALERRORS); 50945 @@ -1835,8 +19 11,7 @@55589 @@ -1835,8 +1934,7 @@ 50946 55590 cb->BufferSize.X = cb->Info.dwSize.X; 50947 55591 cb->BufferSize.Y = cb->Info.dwSize.Y; … … 50953 55597 if (cb->Buffer == NULL) 50954 55598 return FALSE; 50955 @@ -2103,6 +2 178,9 @@55599 @@ -2103,6 +2201,9 @@ 50956 55600 extern int _fmode; 50957 55601 #endif … … 50963 55607 * for the timestamp test to work on removed floppies. */ 50964 55608 SetErrorMode(SEM_FAILCRITICALERRORS); 50965 @@ -2273,12 +23 51,14 @@55609 @@ -2273,12 +2374,14 @@ 50966 55610 int len) 50967 55611 { … … 50978 55622 flen = (int)STRLEN(name); 50979 55623 if (flen == 0 || flen > _MAX_PATH) 50980 @@ -2323,12 +24 03,19 @@55624 @@ -2323,12 +2426,19 @@ 50981 55625 } 50982 55626 *ptrue = NUL; … … 50999 55643 { 51000 55644 c = *porig; 51001 @@ -2578,30 +26 65,73 @@55645 @@ -2578,30 +2688,73 @@ 51002 55646 } 51003 55647 … … 51078 55722 /* Retry with non-wide function (for Windows 98). */ 51079 55723 vim_free(wn); 51080 @@ -2612,17 +27 42,18 @@55724 @@ -2612,17 +2765,18 @@ 51081 55725 #endif 51082 55726 hFile = CreateFile(fname, /* file name */ … … 51102 55746 } 51103 55747 51104 @@ -3104,7 +32 35,7 @@55748 @@ -3104,7 +3258,7 @@ 51105 55749 * 4. Prompt the user to press a key to close the console window 51106 55750 */ … … 51111 55755 STARTUPINFO si; 51112 55756 PROCESS_INFORMATION pi; 51113 @@ -3120,9 +32 51,10 @@55757 @@ -3120,9 +3274,10 @@ 51114 55758 * It's nicer to run a filter command in a minimized window, but in 51115 55759 * Windows 95 this makes the command MUCH slower. We can't do it under … … 51123 55767 si.wShowWindow = SW_SHOWNORMAL; 51124 55768 si.cbReserved2 = 0; 51125 @@ -3160,10 +3 292,10 @@55769 @@ -3160,10 +3315,10 @@ 51126 55770 { 51127 55771 MSG msg; … … 51136 55780 if (WaitForSingleObject(pi.hProcess, delay) != WAIT_TIMEOUT) 51137 55781 break; 51138 @@ -3208,6 +33 40,494@@55782 @@ -3208,6 +3363,506 @@ 51139 55783 51140 55784 return ret; … … 51359 56003 + int delay = 1; 51360 56004 + DWORD buffer_off = 0; /* valid bytes in buffer[] */ 56005 + char *p = NULL; 51361 56006 + 51362 56007 + SECURITY_ATTRIBUTES saAttr; … … 51399 56044 + ga_init2(&ga, 1, BUFLEN); 51400 56045 + 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 + 51401 56055 + /* Now, run the command */ 51402 56056 + CreateProcess(NULL, /* Executable name */ 51403 + cmd, /* Command to execute */56057 + p, /* Command to execute */ 51404 56058 + NULL, /* Process security attributes */ 51405 56059 + NULL, /* Thread security attributes */ … … 51416 56070 + &pi); /* Process information */ 51417 56071 + 56072 + if (p != cmd) 56073 + vim_free(p); 51418 56074 + 51419 56075 + /* Close our unused side of the pipes */ … … 51631 56287 51632 56288 # 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; 51636 56469 #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 51638 56496 + (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) 51643 56502 { 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 @@ 51695 56506 MB_ICONWARNING); 51696 56507 need_vimrun_warning = FALSE; … … 51701 56512 * window, which can be closed without killing Vim. */ 51702 56513 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 @@ 51704 56525 /* Print the return value, unless "vimrun" was used. */ 51705 56526 if (x != 0 && !(options & SHELL_SILENT) && !emsg_silent … … 51712 56533 { 51713 56534 diff -Naur vim73.orig/src/os_win32.h vim73/src/os_win32.h 51714 --- vim73.orig/src/os_win32.h 2012-0 2-15 21:57:45.053435946+000051715 +++ vim73/src/os_win32.h 2012-0 2-15 21:57:46.345470023 +000056535 --- 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 51716 56537 @@ -191,5 +191,19 @@ 51717 56538 #ifdef __BORLANDC__ … … 51736 56557 #endif 51737 56558 diff -Naur vim73.orig/src/popupmnu.c vim73/src/popupmnu.c 51738 --- vim73.orig/src/popupmnu.c 2012-0 2-15 21:57:45.057436051+000051739 +++ vim73/src/popupmnu.c 2012-0 2-15 21:57:45.305442592 +000056559 --- 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 51740 56561 @@ -558,8 +558,11 @@ 51741 56562 win_T *curwin_save = curwin; … … 51751 56572 g_do_tagpreview = 0; 51752 56573 56574 diff -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)); 56586 diff -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 : */ 51753 56595 diff -Naur vim73.orig/src/proto/eval.pro vim73/src/proto/eval.pro 51754 --- vim73.orig/src/proto/eval.pro 2012-0 2-15 21:57:45.057436051+000051755 +++ vim73/src/proto/eval.pro 2012-0 2-15 21:57:46.461473083+000056596 --- 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 51756 56598 @@ -23,6 +23,7 @@ 51757 56599 list_T *eval_spell_expr __ARGS((char_u *badword, char_u *expr)); … … 51770 56612 void dictitem_free __ARGS((dictitem_T *item)); 51771 56613 int dict_add __ARGS((dict_T *d, dictitem_T *item)); 56614 diff -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)); 51772 56625 diff -Naur vim73.orig/src/proto/ex_cmds2.pro vim73/src/proto/ex_cmds2.pro 51773 --- vim73.orig/src/proto/ex_cmds2.pro 2012-0 2-15 21:57:45.057436051+000051774 +++ vim73/src/proto/ex_cmds2.pro 2012-0 2-15 21:57:46.049462216+000056626 --- 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 51775 56628 @@ -83,5 +83,7 @@ 51776 56629 char_u *get_mess_lang __ARGS((void)); … … 51782 56635 /* vim: set ft=c : */ 51783 56636 diff -Naur vim73.orig/src/proto/ex_docmd.pro vim73/src/proto/ex_docmd.pro 51784 --- vim73.orig/src/proto/ex_docmd.pro 2012-0 2-15 21:57:45.057436051+000051785 +++ vim73/src/proto/ex_docmd.pro 2012-0 2-15 21:57:46.877484055+000056637 --- 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 51786 56639 @@ -1,7 +1,7 @@ 51787 56640 /* ex_docmd.c */ … … 51794 56647 int checkforcmd __ARGS((char_u **pp, char *cmd, int len)); 51795 56648 diff -Naur vim73.orig/src/proto/ex_getln.pro vim73/src/proto/ex_getln.pro 51796 --- vim73.orig/src/proto/ex_getln.pro 2012-0 2-15 21:57:45.057436051+000051797 +++ vim73/src/proto/ex_getln.pro 2012-0 2-15 21:57:46.049462216+000056649 --- 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 51798 56651 @@ -31,7 +31,7 @@ 51799 56652 char_u *addstar __ARGS((char_u *fname, int len, int context)); … … 51806 56659 int get_histtype __ARGS((char_u *name)); 51807 56660 diff -Naur vim73.orig/src/proto/fileio.pro vim73/src/proto/fileio.pro 51808 --- vim73.orig/src/proto/fileio.pro 2012-0 2-15 21:57:45.057436051+000051809 +++ vim73/src/proto/fileio.pro 2012-0 2-15 21:57:46.965486377+000056661 --- 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 51810 56663 @@ -35,6 +35,7 @@ 51811 56664 void do_autocmd __ARGS((char_u *arg, int forceit)); … … 51816 56669 void aucmd_restbuf __ARGS((aco_save_T *aco)); 51817 56670 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 @@ 51819 56680 int match_file_pat __ARGS((char_u *pattern, regprog_T *prog, char_u *fname, char_u *sfname, char_u *tail, int allow_dirs)); 51820 56681 int match_file_list __ARGS((char_u *list, char_u *sfname, char_u *ffname)); … … 51824 56685 /* vim: set ft=c : */ 51825 56686 diff -Naur vim73.orig/src/proto/getchar.pro vim73/src/proto/getchar.pro 51826 --- vim73.orig/src/proto/getchar.pro 2012-0 2-15 21:57:45.057436051+000051827 +++ vim73/src/proto/getchar.pro 2012-0 2-15 21:57:46.905484794+000056687 --- 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 51828 56689 @@ -4,8 +4,9 @@ 51829 56690 char_u *get_inserted __ARGS((void)); … … 51855 56716 /* vim: set ft=c : */ 51856 56717 diff -Naur vim73.orig/src/proto/gui_athena.pro vim73/src/proto/gui_athena.pro 51857 --- vim73.orig/src/proto/gui_athena.pro 2012-0 2-15 21:57:45.057436051+000051858 +++ vim73/src/proto/gui_athena.pro 2012-0 2-15 21:57:45.565449449+000056718 --- 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 51859 56720 @@ -27,5 +27,5 @@ 51860 56721 void gui_mch_set_scrollbar_colors __ARGS((scrollbar_T *sb)); … … 51865 56726 /* vim: set ft=c : */ 51866 56727 diff -Naur vim73.orig/src/proto/gui_gtk.pro vim73/src/proto/gui_gtk.pro 51867 --- vim73.orig/src/proto/gui_gtk.pro 2012-0 2-15 21:57:45.057436051+000051868 +++ vim73/src/proto/gui_gtk.pro 2012-0 2-15 21:57:45.565449449+000056728 --- 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 51869 56730 @@ -13,7 +13,7 @@ 51870 56731 void gui_mch_destroy_scrollbar __ARGS((scrollbar_T *sb)); … … 51877 56738 void gui_mch_find_dialog __ARGS((exarg_T *eap)); 51878 56739 diff -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 @@ 51882 56751 void gui_mch_set_winpos __ARGS((int x, int y)); 51883 56752 int gui_mch_maximized __ARGS((void)); … … 51888 56757 void gui_mch_settitle __ARGS((char_u *title, char_u *icon)); 51889 56758 diff -Naur vim73.orig/src/proto/gui_mac.pro vim73/src/proto/gui_mac.pro 51890 --- vim73.orig/src/proto/gui_mac.pro 2012-0 2-15 21:57:45.057436051+000051891 +++ vim73/src/proto/gui_mac.pro 2012-0 2-15 21:57:45.565449449+000056759 --- 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 51892 56761 @@ -81,7 +81,7 @@ 51893 56762 int gui_mch_get_mouse_y __ARGS((void)); … … 51900 56769 void gui_mch_show_tabline __ARGS((int showit)); 51901 56770 diff -Naur vim73.orig/src/proto/gui_motif.pro vim73/src/proto/gui_motif.pro 51902 --- vim73.orig/src/proto/gui_motif.pro 2012-0 2-15 21:57:45.057436051+000051903 +++ vim73/src/proto/gui_motif.pro 2012-0 2-15 21:57:45.565449449+000056771 --- 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 51904 56773 @@ -29,7 +29,7 @@ 51905 56774 void gui_mch_set_scrollbar_colors __ARGS((scrollbar_T *sb)); … … 51912 56781 void gui_mch_show_toolbar __ARGS((int showit)); 51913 56782 diff -Naur vim73.orig/src/proto/gui_photon.pro vim73/src/proto/gui_photon.pro 51914 --- vim73.orig/src/proto/gui_photon.pro 2012-0 2-15 21:57:45.057436051+000051915 +++ vim73/src/proto/gui_photon.pro 2012-0 2-15 21:57:45.565449449+000056783 --- 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 51916 56785 @@ -8,7 +8,7 @@ 51917 56786 void gui_mch_update __ARGS((void)); … … 51924 56793 void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height, int direction)); 51925 56794 diff -Naur vim73.orig/src/proto/gui_riscos.pro vim73/src/proto/gui_riscos.pro 51926 --- vim73.orig/src/proto/gui_riscos.pro 2012-0 2-15 21:57:45.057436051+000056795 --- vim73.orig/src/proto/gui_riscos.pro 2012-06-03 23:09:52.944007163 +0000 51927 56796 +++ vim73/src/proto/gui_riscos.pro 1970-01-01 00:00:00.000000000 +0000 51928 56797 @@ -1,66 +0,0 @@ … … 51994 56863 -/* vim: set ft=c : */ 51995 56864 diff -Naur vim73.orig/src/proto/gui_w16.pro vim73/src/proto/gui_w16.pro 51996 --- vim73.orig/src/proto/gui_w16.pro 2012-0 2-15 21:57:45.057436051+000051997 +++ vim73/src/proto/gui_w16.pro 2012-0 2-15 21:57:45.565449449+000056865 --- 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 51998 56867 @@ -74,6 +74,6 @@ 51999 56868 void gui_mch_add_menu_item __ARGS((vimmenu_T *menu, int idx)); … … 52005 56874 /* vim: set ft=c : */ 52006 56875 diff -Naur vim73.orig/src/proto/gui_w32.pro vim73/src/proto/gui_w32.pro 52007 --- vim73.orig/src/proto/gui_w32.pro 2012-0 2-15 21:57:45.057436051+000052008 +++ vim73/src/proto/gui_w32.pro 2012-0 2-15 21:57:45.565449449+000056876 --- 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 52009 56878 @@ -81,7 +81,7 @@ 52010 56879 void gui_mch_add_menu_item __ARGS((vimmenu_T *menu, int idx)); … … 52016 56885 void gui_mch_drawsign __ARGS((int row, int col, int typenr)); 52017 56886 void *gui_mch_register_sign __ARGS((char_u *signfile)); 56887 diff -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 : */ 52018 56897 diff -Naur vim73.orig/src/proto/if_mzsch.pro vim73/src/proto/if_mzsch.pro 52019 --- vim73.orig/src/proto/if_mzsch.pro 2012-0 2-15 21:57:45.057436051+000052020 +++ vim73/src/proto/if_mzsch.pro 2012-0 2-15 21:57:46.957486165+000056898 --- 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 52021 56900 @@ -14,6 +14,7 @@ 52022 56901 void mzvim_reset_timer __ARGS((void)); … … 52029 56908 /* vim: set ft=c : */ 52030 56909 diff -Naur vim73.orig/src/proto/mbyte.pro vim73/src/proto/mbyte.pro 52031 --- vim73.orig/src/proto/mbyte.pro 2012-0 2-15 21:57:45.057436051+000052032 +++ vim73/src/proto/mbyte.pro 2012-0 2-15 21:57:46.329469602+000056910 --- 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 52033 56912 @@ -2,6 +2,7 @@ 52034 56913 int enc_canon_props __ARGS((char_u *name)); … … 52049 56928 int mb_charlen_len __ARGS((char_u *str, int len)); 52050 56929 diff -Naur vim73.orig/src/proto/message.pro vim73/src/proto/message.pro 52051 --- vim73.orig/src/proto/message.pro 2012-0 2-15 21:57:45.057436051+000052052 +++ vim73/src/proto/message.pro 2012-0 2-15 21:57:46.821482580+000056930 --- 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 52053 56932 @@ -4,7 +4,7 @@ 52054 56933 int msg_attr __ARGS((char_u *s, int attr)); … … 52068 56947 void str2specialbuf __ARGS((char_u *sp, char_u *buf, int len)); 52069 56948 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 @@ 52071 56958 int verbose_open __ARGS((void)); 52072 56959 void give_warning __ARGS((char_u *message, int hl)); … … 52078 56965 int vim_dialog_yesnocancel __ARGS((int type, char_u *title, char_u *message, int dflt)); 52079 56966 diff -Naur vim73.orig/src/proto/misc2.pro vim73/src/proto/misc2.pro 52080 --- vim73.orig/src/proto/misc2.pro 2012-0 2-15 21:57:45.057436051+000052081 +++ vim73/src/proto/misc2.pro 2012-0 2-15 21:57:46.749480679+000056967 --- 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 52082 56969 @@ -14,6 +14,7 @@ 52083 56970 linenr_T get_cursor_rel_lnum __ARGS((win_T *wp, linenr_T lnum)); … … 52111 56998 /* vim: set ft=c : */ 52112 56999 diff -Naur vim73.orig/src/proto/option.pro vim73/src/proto/option.pro 52113 --- vim73.orig/src/proto/option.pro 2012-0 2-15 21:57:45.057436051+000052114 +++ vim73/src/proto/option.pro 2012-0 2-15 21:57:45.573449661+000057000 --- 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 52115 57002 @@ -54,6 +54,6 @@ 52116 57003 int option_was_set __ARGS((char_u *name)); … … 52122 57009 /* vim: set ft=c : */ 52123 57010 diff -Naur vim73.orig/src/proto/os_riscos.pro vim73/src/proto/os_riscos.pro 52124 --- vim73.orig/src/proto/os_riscos.pro 2012-0 2-15 21:57:45.057436051+000057011 --- vim73.orig/src/proto/os_riscos.pro 2012-06-03 23:09:52.944007163 +0000 52125 57012 +++ vim73/src/proto/os_riscos.pro 1970-01-01 00:00:00.000000000 +0000 52126 57013 @@ -1,49 +0,0 @@ … … 52175 57062 -/* vim: set ft=c : */ 52176 57063 diff -Naur vim73.orig/src/proto/os_win32.pro vim73/src/proto/os_win32.pro 52177 --- vim73.orig/src/proto/os_win32.pro 2012-0 2-15 21:57:45.057436051+000052178 +++ vim73/src/proto/os_win32.pro 2012-0 2-15 21:57:45.897458206+000057064 --- 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 52179 57066 @@ -1,4 +1,5 @@ 52180 57067 /* os_win32.c */ … … 52194 57081 int mch_nodetype __ARGS((char_u *name)); 52195 57082 diff -Naur vim73.orig/src/proto/term.pro vim73/src/proto/term.pro 52196 --- vim73.orig/src/proto/term.pro 2012-0 2-15 21:57:45.057436051+000052197 +++ vim73/src/proto/term.pro 2012-0 2-15 21:57:46.913485005 +000057083 --- 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 52198 57085 @@ -50,7 +50,7 @@ 52199 57086 char_u *get_termcode __ARGS((int i)); … … 52205 57092 int find_term_bykeys __ARGS((char_u *src)); 52206 57093 void show_termcodes __ARGS((void)); 57094 diff -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)); 52207 57113 diff -Naur vim73.orig/src/proto.h vim73/src/proto.h 52208 --- vim73.orig/src/proto.h 2012-0 2-15 21:57:45.053435946+000052209 +++ vim73/src/proto.h 2012-0 2-15 21:57:45.953459684+000057114 --- 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 52210 57116 @@ -62,9 +62,6 @@ 52211 57117 # ifdef __BEOS__ … … 52229 57135 # endif 52230 57136 diff -Naur vim73.orig/src/pty.c vim73/src/pty.c 52231 --- vim73.orig/src/pty.c 2012-0 2-15 21:57:45.065436261+000052232 +++ vim73/src/pty.c 2012-0 2-15 21:57:46.821482580+000057137 --- 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 52233 57139 @@ -14,6 +14,10 @@ 52234 57140 * It has been modified to work better with Vim. … … 52282 57188 close(f); 52283 57189 diff -Naur vim73.orig/src/quickfix.c vim73/src/quickfix.c 52284 --- vim73.orig/src/quickfix.c 2012-0 2-15 21:57:45.053435946+000052285 +++ vim73/src/quickfix.c 2012-0 2-15 21:57:46.797481944+000052286 @@ -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 @@ 52287 57193 static win_T *qf_find_win __ARGS((qf_info_T *qi)); 52288 57194 static buf_T *qf_find_buf __ARGS((qf_info_T *qi)); … … 52292 57198 #endif 52293 57199 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 @@ 52295 57220 break; 52296 57221 … … 52303 57228 *efmp = NUL; 52304 57229 #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 @@ 52306 57258 } 52307 57259 else … … 52313 57265 { 52314 57266 char_u *p = alloc((int)STRLEN(qf_title) + 2); 52315 @@ -904,8 +9 08,6 @@57267 @@ -904,8 +921,6 @@ 52316 57268 if (p != NULL) 52317 57269 sprintf((char *)p, ":%s", (char *)qf_title); … … 52322 57274 52323 57275 /* 52324 @@ -1164,7 +11 66,7 @@57276 @@ -1164,7 +1179,7 @@ 52325 57277 52326 57278 /* When no valid entries are present in the list, qf_ptr points to … … 52331 57283 } 52332 57284 52333 @@ -1182,21 +11 84,17 @@57285 @@ -1182,21 +1197,17 @@ 52334 57286 if (fname == NULL || *fname == NUL) /* no file name */ 52335 57287 return 0; … … 52357 57309 && (ptr = concat_fnames(directory, fname, TRUE)) != NULL) 52358 57310 { 52359 @@ -1221,7 +12 19,6 @@57311 @@ -1221,7 +1232,6 @@ 52360 57312 return fnum; 52361 57313 } … … 52365 57317 } 52366 57318 52367 @@ -1656,9 +16 53,7 @@57319 @@ -1656,9 +1666,7 @@ 52368 57320 opened_window = TRUE; /* close it when fail */ 52369 57321 p_swb = empty_option; /* don't split again */ … … 52376 57328 { 52377 57329 /* The new window should use the location list from the 52378 @@ -1847,8 +18 42,10 @@57330 @@ -1847,8 +1855,10 @@ 52379 57331 #endif 52380 57332 if (print_message) … … 52389 57341 qi->qf_lists[qi->qf_curlist].qf_count, 52390 57342 qf_ptr->qf_cleared ? _(" (line deleted)") : "", 52391 @@ -2125,6 +21 22,7 @@57343 @@ -2125,6 +2135,7 @@ 52392 57344 --qi->qf_lists[idx].qf_count; 52393 57345 } … … 52397 57349 52398 57350 /* 52399 @@ -2244,6 +22 42,7 @@57351 @@ -2244,6 +2255,7 @@ 52400 57352 * it if we have errors; otherwise, leave it closed. 52401 57353 */ … … 52405 57357 { 52406 57358 if (win != NULL) 52407 @@ -2333,9 +23 32,7 @@57359 @@ -2333,9 +2345,7 @@ 52408 57360 win_goto(lastwin); 52409 57361 if (win_split(height, WSP_BELOW | WSP_NEWLOC) == FAIL) … … 52416 57368 if (eap->cmdidx == CMD_lopen || eap->cmdidx == CMD_lwindow) 52417 57369 { 52418 @@ -2362,6 +23 59,7 @@57370 @@ -2362,6 +2372,7 @@ 52419 57371 set_option_value((char_u *)"bt", 0L, (char_u *)"quickfix", 52420 57372 OPT_LOCAL); … … 52424 57376 curwin->w_p_diff = FALSE; 52425 57377 #endif 52426 @@ -2390,8 +2 388,7 @@57378 @@ -2390,8 +2401,7 @@ 52427 57379 qf_fill_buffer(qi); 52428 57380 … … 52434 57386 curwin->w_cursor.lnum = qi->qf_lists[qi->qf_curlist].qf_index; 52435 57387 curwin->w_cursor.col = 0; 52436 @@ -2528,6 +25 25,8 @@57388 @@ -2528,6 +2538,8 @@ 52437 57389 qf_info_T *qi; 52438 57390 { … … 52443 57395 52444 57396 /* Check if a buffer for the quickfix list exists. Update it. */ 52445 @@ -2539,6 +25 38,16 @@57397 @@ -2539,6 +2551,16 @@ 52446 57398 52447 57399 qf_fill_buffer(qi); … … 52460 57412 aucmd_restbuf(&aco); 52461 57413 52462 @@ -2546,6 +25 55,14 @@57414 @@ -2546,6 +2568,14 @@ 52463 57415 } 52464 57416 } … … 52475 57427 * Fill current buffer with quickfix errors, replacing any previous contents. 52476 57428 * curbuf must be the quickfix buffer! 52477 @@ -2657,7 +26 74,7 @@57429 @@ -2657,7 +2687,7 @@ 52478 57430 bt_quickfix(buf) 52479 57431 buf_T *buf; … … 52484 57436 52485 57437 /* 52486 @@ -2668,8 +26 85,8 @@57438 @@ -2668,8 +2698,8 @@ 52487 57439 bt_nofile(buf) 52488 57440 buf_T *buf; … … 52495 57447 52496 57448 /* 52497 @@ -2679,7 +2 696,7 @@57449 @@ -2679,7 +2709,7 @@ 52498 57450 bt_dontwrite(buf) 52499 57451 buf_T *buf; … … 52504 57456 52505 57457 int 52506 @@ -2744,6 +27 61,13 @@57458 @@ -2744,6 +2774,13 @@ 52507 57459 #ifdef FEAT_AUTOCMD 52508 57460 char_u *au_name = NULL; … … 52518 57470 { 52519 57471 case CMD_make: au_name = (char_u *)"make"; break; 52520 @@ -2765,13 +2 789,6 @@57472 @@ -2765,13 +2802,6 @@ 52521 57473 } 52522 57474 #endif … … 52532 57484 || eap->cmdidx == CMD_lgrepadd) 52533 57485 wp = curwin; 52534 @@ -2819,17 +28 36,21 @@57486 @@ -2819,17 +2849,21 @@ 52535 57487 (eap->cmdidx != CMD_grepadd 52536 57488 && eap->cmdidx != CMD_lgrepadd), … … 52558 57510 mch_remove(fname); 52559 57511 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 @@ 52561 57566 int flags = 0; 52562 57567 colnr_T col; … … 52586 57591 } 52587 57592 if (au_name != NULL) 52588 @@ -3130,6 +31 55,11 @@57593 @@ -3130,6 +3197,11 @@ 52589 57594 goto theend; 52590 57595 } … … 52598 57603 * ":lcd %:p:h" changes the meaning of short path names. */ 52599 57604 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 @@ 52601 57651 } 52602 57652 … … 52607 57657 vim_free(regmatch.regprog); 52608 57658 } 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) 52610 57705 char_u *fname; 57706 + char_u *dirname_start; /* in: old directory */ 57707 + char_u *resulting_dir; /* out: new directory */ 52611 57708 { 52612 57709 buf_T *newbuf; … … 52615 57712 aco_save_T aco; 52616 57713 52617 @@ -3471, 15 +3504,19@@57714 @@ -3471,33 +3569,48 @@ 52618 57715 failed = FALSE; 52619 57716 if (curbuf != newbuf) … … 52637 57734 } 52638 57735 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 + 52639 57744 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 @@ 52641 57802 } 52642 57803 … … 52647 57808 else 52648 57809 qi->qf_lists[qi->qf_curlist].qf_nonevalid = FALSE; 52649 @@ -3841,16 +3 878,35 @@57810 @@ -3841,16 +3964,35 @@ 52650 57811 qf_info_T *qi = &ql_info; 52651 57812 int new_qi = FALSE; … … 52687 57848 { 52688 57849 /* Find an existing help window */ 52689 @@ -3876,6 + 3932,16 @@57850 @@ -3876,6 +4018,16 @@ 52690 57851 regmatch.rm_ic = FALSE; 52691 57852 if (regmatch.regprog != NULL) … … 52704 57865 qf_new_list(qi, *eap->cmdlinep); 52705 57866 52706 @@ -3910,21 + 3976,33 @@57867 @@ -3910,21 +4062,33 @@ 52707 57868 lnum = 1; 52708 57869 while (!vim_fgets(IObuff, IOSIZE, fd) && !got_int) … … 52744 57905 FALSE, /* vis_col */ 52745 57906 NULL, /* search pattern */ 52746 @@ -3934,9 +40 12,17 @@57907 @@ -3934,9 +4098,17 @@ 52747 57908 ) == FAIL) 52748 57909 { … … 52762 57923 line_breakcheck(); 52763 57924 } 52764 @@ -3946,7 +4 032,12 @@57925 @@ -3946,7 +4118,12 @@ 52765 57926 FreeWild(fcount, fnames); 52766 57927 } … … 52775 57936 qi->qf_lists[qi->qf_curlist].qf_nonevalid = FALSE; 52776 57937 qi->qf_lists[qi->qf_curlist].qf_ptr = 52777 @@ -3964,6 +4 055,17 @@57938 @@ -3964,6 +4141,17 @@ 52778 57939 qf_update_buffer(qi); 52779 57940 #endif … … 52794 57955 qf_jump(qi, 0, 0, FALSE); 52795 57956 diff -Naur vim73.orig/src/regexp.c vim73/src/regexp.c 52796 --- vim73.orig/src/regexp.c 2012-0 2-15 21:57:45.065436261+000052797 +++ vim73/src/regexp.c 2012-0 2-15 21:57:46.277468229+000057957 --- 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 52798 57959 @@ -666,8 +666,12 @@ 52799 57960 static void regc __ARGS((int b)); … … 53182 58343 can_f_submatch = FALSE; 53183 58344 diff -Naur vim73.orig/src/screen.c vim73/src/screen.c 53184 --- vim73.orig/src/screen.c 2012-0 2-15 21:57:45.061436156+000053185 +++ vim73/src/screen.c 2012-0 2-15 21:57:46.889484373+000058345 --- 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 53186 58347 @@ -764,9 +764,13 @@ 53187 58348 doit = TRUE; … … 53290 58451 sprintf((char *)extra, "%*ld ", 53291 58452 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 @@ 53293 58468 } 53294 58469 … … 53299 58474 #ifdef FEAT_DIFF 53300 58475 && filler_todo <= 0 53301 @@ -4253,7 +42 58,7 @@58476 @@ -4253,7 +4260,7 @@ 53302 58477 { 53303 58478 /* tab amount depends on current column */ … … 53308 58483 mb_utf8 = FALSE; /* don't draw as UTF-8 */ 53309 58484 #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 @@ 53311 58499 struct stl_hlrec hltab[STL_MAX_ITEM]; 53312 58500 struct stl_hlrec tabtab[STL_MAX_ITEM]; … … 53317 58505 /* setup environment for the task at hand */ 53318 58506 if (wp == NULL) 53319 @@ -6514,16 +652 1,31 @@58507 @@ -6514,16 +6529,31 @@ 53320 58508 if (maxwidth <= 0) 53321 58509 return; … … 53352 58540 { 53353 58541 #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 @@ 53355 58568 53356 58569 /* … … 53372 58585 } 53373 58586 53374 @@ -7850,8 +78 72,8 @@58587 @@ -7850,8 +7881,8 @@ 53375 58588 * final size of the shell is needed. 53376 58589 */ … … 53383 58596 int new_row, old_row; 53384 58597 #ifdef FEAT_GUI 53385 @@ -8047,7 +80 69,7 @@58598 @@ -8047,7 +8078,7 @@ 53386 58599 * (used when resizing the window at the "--more--" prompt or when 53387 58600 * executing an external command, for the GUI). … … 53392 58605 (void)vim_memset(new_ScreenLines + new_row * Columns, 53393 58606 ' ', (size_t)Columns * sizeof(schar_T)); 53394 @@ -8137,7 +81 59,7 @@58607 @@ -8137,7 +8168,7 @@ 53395 58608 screen_Columns = Columns; 53396 58609 … … 53402 58615 #ifdef FEAT_GUI 53403 58616 diff -Naur vim73.orig/src/search.c vim73/src/search.c 53404 --- vim73.orig/src/search.c 2012-0 2-15 21:57:45.065436261+000053405 +++ vim73/src/search.c 2012-0 2-15 21:57:46.889484373+000058617 --- 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 53406 58619 @@ -1161,12 +1161,20 @@ 53407 58620 { … … 53594 58807 static void 53595 58808 diff -Naur vim73.orig/src/spell.c vim73/src/spell.c 53596 --- vim73.orig/src/spell.c 2012-0 2-15 21:57:45.041435628+000053597 +++ vim73/src/spell.c 2012-0 2-15 21:57:46.785481629+000058809 --- 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 53598 58811 @@ -303,10 +303,6 @@ 53599 58812 * few bytes as possible, see offset2bytes()) … … 53723 58936 ga_clear(&buf->b_s.b_langp); 53724 58937 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 @@ 53726 58948 53727 58949 sblock_T *si_blocks; /* memory blocks used */ … … 53732 58954 compression limit */ 53733 58955 wordnode_T *si_first_free; /* List of nodes that have been freed during 53734 @@ -4951,7 +497 4,7 @@58956 @@ -4951,7 +4972,7 @@ 53735 58957 char_u *si_info; /* info text chars or NULL */ 53736 58958 int si_region_count; /* number of regions supported (1 when there … … 53741 58963 53742 58964 garray_T si_rep; /* list of fromto_T entries from REP lines */ 53743 @@ -4997,7 +50 20,6 @@58965 @@ -4997,7 +5018,6 @@ 53744 58966 static int str_equal __ARGS((char_u *s1, char_u *s2)); 53745 58967 static void add_fromto __ARGS((spellinfo_T *spin, garray_T *gap, char_u *from, char_u *to)); … … 53749 58971 static int spell_read_dic __ARGS((spellinfo_T *spin, char_u *fname, afffile_T *affile)); 53750 58972 static int get_affix_flags __ARGS((afffile_T *affile, char_u *afflist)); 53751 @@ -5027,7 +504 9,7 @@58973 @@ -5027,7 +5047,7 @@ 53752 58974 static int offset2bytes __ARGS((int nr, char_u *buf)); 53753 58975 static int bytes2offset __ARGS((char_u **pp)); … … 53758 58980 static void init_spellfile __ARGS((void)); 53759 58981 53760 @@ -5456,21 +547 8,25 @@58982 @@ -5456,21 +5476,25 @@ 53761 58983 } 53762 58984 else if (is_aff_rule(items, itemcnt, "COMPOUNDRULE", 2)) … … 53795 59017 } 53796 59018 else if (is_aff_rule(items, itemcnt, "COMPOUNDWORDMAX", 2) 53797 @@ -6270,7 +629 6,7 @@59019 @@ -6270,7 +6294,7 @@ 53798 59020 53799 59021 for (p = compflags; *p != NUL; ) … … 53804 59026 *tp++ = *p++; 53805 59027 else 53806 @@ -6299,7 +632 5,7 @@59028 @@ -6299,7 +6323,7 @@ 53807 59029 { 53808 59030 check_renumber(spin); … … 53813 59035 hash_add(&aff->af_comp, ci->ci_key); 53814 59036 } 53815 @@ -6458,23 +648 4,6 @@59037 @@ -6458,23 +6482,6 @@ 53816 59038 } 53817 59039 … … 53837 59059 */ 53838 59060 static void 53839 @@ -6930,7 +693 9,7 @@59061 @@ -6930,7 +6937,7 @@ 53840 59062 if (ae->ae_add == NULL) 53841 59063 *newword = NUL; … … 53846 59068 if (ae->ae_chop != NULL) 53847 59069 { 53848 @@ -6951,7 +69 60,7 @@59070 @@ -6951,7 +6958,7 @@ 53849 59071 else 53850 59072 { … … 53855 59077 { 53856 59078 /* Remove chop string. */ 53857 @@ -7343,10 +735 2,21 @@59079 @@ -7343,10 +7350,21 @@ 53858 59080 53859 59081 if (bl == NULL || bl->sb_used + len > SBLOCKSIZE) … … 53879 59101 spin->si_blocks = bl; 53880 59102 bl->sb_used = 0; 53881 @@ -7361,6 +73 81,7 @@59103 @@ -7361,6 +7379,7 @@ 53882 59104 53883 59105 /* … … 53887 59109 static char_u * 53888 59110 getroom_save(spin, s) 53889 @@ -7395,6 +741 6,7 @@59111 @@ -7395,6 +7414,7 @@ 53890 59112 53891 59113 /* … … 53895 59117 static wordnode_T * 53896 59118 wordtree_alloc(spin) 53897 @@ -7679,6 +7 701,7 @@59119 @@ -7679,6 +7699,7 @@ 53898 59120 /* 53899 59121 * Get a wordnode_T, either from the list of previously freed nodes or … … 53903 59125 static wordnode_T * 53904 59126 get_wordnode(spin) 53905 @@ -7696,7 +771 9,8 @@59127 @@ -7696,7 +7717,8 @@ 53906 59128 --spin->si_free_count; 53907 59129 } … … 53913 59135 return n; 53914 59136 } 53915 @@ -8548,7 +857 2,7 @@59137 @@ -8548,7 +8570,7 @@ 53916 59138 spellinfo_T *spin; 53917 59139 char_u *wfname; … … 53922 59144 slang_T *slang; 53923 59145 int free_slang = FALSE; 53924 @@ -8612,13 +863 6,17 @@59146 @@ -8612,13 +8634,17 @@ 53925 59147 * Write the .sug file. 53926 59148 * Make the file name by changing ".spl" to ".sug". … … 53941 59163 slang_free(slang); 53942 59164 free_blocks(spin->si_blocks); 53943 @@ -9057,15 +908 5,15 @@59165 @@ -9057,15 +9083,15 @@ 53944 59166 * and ".spl" is appended to make the output file name. 53945 59167 */ … … 53961 59183 int incount; 53962 59184 afffile_T *(afile[8]); 53963 @@ -9093,6 +91 21,10 @@59185 @@ -9093,6 +9119,10 @@ 53964 59186 innames = &fnames[1]; 53965 59187 incount = fcount - 1; … … 53972 59194 { 53973 59195 len = (int)STRLEN(fnames[0]); 53974 @@ -9102,32 +913 4,32 @@59196 @@ -9102,32 +9132,32 @@ 53975 59197 * "path/en.latin1.add.spl". */ 53976 59198 innames = &fnames[0]; … … 54013 59235 } 54014 59236 54015 @@ -9141,17 +917 3,21 @@59237 @@ -9141,17 +9171,21 @@ 54016 59238 { 54017 59239 /* Check for overwriting before doing things that may take a lot of … … 54038 59260 * Init the aff and dic pointers. 54039 59261 * Get the region names if there are more than 2 arguments. 54040 @@ -9167,7 +920 3,7 @@59262 @@ -9167,7 +9201,7 @@ 54041 59263 || innames[i][len - 3] != '_') 54042 59264 { … … 54047 59269 spin.si_region_name[i * 2] = TOLOWER_ASC(innames[i][len - 2]); 54048 59270 spin.si_region_name[i * 2 + 1] = 54049 @@ -9184,7 +92 20,7 @@59271 @@ -9184,7 +9218,7 @@ 54050 59272 || spin.si_prefroot == NULL) 54051 59273 { … … 54056 59278 54057 59279 /* When not producing a .add.spl file clear the character table when 54058 @@ -9205,7 +92 41,7 @@59280 @@ -9205,7 +9239,7 @@ 54059 59281 spin.si_conv.vc_type = CONV_NONE; 54060 59282 spin.si_region = 1 << i; … … 54065 59287 { 54066 59288 /* Read the .aff file. Will init "spin->si_conv" based on the 54067 @@ -9216,7 +925 2,7 @@59289 @@ -9216,7 +9250,7 @@ 54068 59290 else 54069 59291 { … … 54074 59296 if (spell_read_dic(&spin, fname, afile[i]) == FAIL) 54075 59297 error = TRUE; 54076 @@ -9298,6 +933 4,10 @@59298 @@ -9298,6 +9332,10 @@ 54077 59299 spell_make_sugfile(&spin, wfname); 54078 59300 … … 54085 59307 54086 59308 /* 54087 @@ -9350,7 +93 90,7 @@59309 @@ -9350,7 +9388,7 @@ 54088 59310 buf_T *buf = NULL; 54089 59311 int new_spf = FALSE; … … 54094 59316 long fpos, fpos_next = 0; 54095 59317 int i; 54096 @@ -9380,6 +94 20,9 @@59318 @@ -9380,6 +9418,9 @@ 54097 59319 EMSG2(_(e_notset), "spellfile"); 54098 59320 return; … … 54104 59326 for (spf = curwin->w_s->b_p_spf, i = 1; *spf != NUL; ++i) 54105 59327 { 54106 @@ -9389,6 +943 2,7 @@59328 @@ -9389,6 +9430,7 @@ 54107 59329 if (*spf == NUL) 54108 59330 { … … 54112 59334 } 54113 59335 } 54114 @@ -9400,6 +944 4,7 @@59336 @@ -9400,6 +9442,7 @@ 54115 59337 if (buf != NULL && bufIsChanged(buf)) 54116 59338 { … … 54120 59342 } 54121 59343 54122 @@ -9494,6 +953 9,7 @@59344 @@ -9494,6 +9537,7 @@ 54123 59345 54124 59346 redraw_all_later(SOME_VALID); … … 54128 59350 54129 59351 /* 54130 @@ -9502,7 +954 8,7 @@59352 @@ -9502,7 +9546,7 @@ 54131 59353 static void 54132 59354 init_spellfile() … … 54137 59359 char_u *fname; 54138 59360 char_u *rtp; 54139 @@ -9512,6 +955 8,10 @@59361 @@ -9512,6 +9556,10 @@ 54140 59362 54141 59363 if (*curwin->w_s->b_p_spl != NUL && curwin->w_s->b_langp.ga_len > 0) … … 54148 59370 * is a path separator remember the start of the tail. */ 54149 59371 for (lend = curwin->w_s->b_p_spl; *lend != NUL 54150 @@ -9530,7 +95 80,8 @@59372 @@ -9530,7 +9578,8 @@ 54151 59373 if (aspath) 54152 59374 /* Use directory of an entry with path, e.g., for … … 54158 59380 /* Copy the path from 'runtimepath' to buf[]. */ 54159 59381 copy_option_part(&rtp, buf, MAXPATHL, ","); 54160 @@ -9539,13 +95 90,14 @@59382 @@ -9539,13 +9588,14 @@ 54161 59383 /* Use the first language name from 'spelllang' and the 54162 59384 * encoding used in the first loaded .spl file. */ … … 54175 59397 54176 59398 l = (int)STRLEN(buf); 54177 @@ -9553,7 +960 5,8 @@59399 @@ -9553,7 +9603,8 @@ 54178 59400 "/%.*s", (int)(lend - lstart), lstart); 54179 59401 } … … 54185 59407 fname != NULL 54186 59408 && strstr((char *)gettail(fname), ".ascii.") != NULL 54187 @@ -9563,6 +961 6,8 @@59409 @@ -9563,6 +9614,8 @@ 54188 59410 } 54189 59411 aspath = FALSE; … … 54194 59416 } 54195 59417 54196 @@ -9837,10 +989 2,7 @@59418 @@ -9837,10 +9890,7 @@ 54197 59419 { 54198 59420 /* be quick for ASCII */ … … 54205 59427 else 54206 59428 { 54207 @@ -9848,10 +9 900,7 @@59429 @@ -9848,10 +9898,7 @@ 54208 59430 if (c < 256 ? wp->w_s->b_spell_ismw[c] 54209 59431 : (wp->w_s->b_spell_ismw_mb != NULL … … 54216 59438 54217 59439 c = mb_ptr2char(s); 54218 @@ -10223,7 +1027 2,7 @@59440 @@ -10223,7 +10270,7 @@ 54219 59441 54220 59442 /* The suggested word may replace only part of the bad word, add … … 54225 59447 vim_strncpy(wcopy + stp->st_wordlen, 54226 59448 sug.su_badptr + stp->st_orglen, 54227 @@ -11130,7 +1117 9,7 @@59449 @@ -11130,7 +11177,7 @@ 54228 59450 c = *s++; 54229 59451 … … 54234 59456 if (enc_latin1like && c == 0xdf) 54235 59457 { 54236 @@ -13124,7 +1317 3,7 @@59458 @@ -13124,7 +13171,7 @@ 54237 59459 pbad = badsound2; 54238 59460 } … … 54243 59465 /* Add part of the bad word to the good word, so that we soundfold 54244 59466 * 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 @@ 54246 59477 su->su_sfmaxscore = cleanup_suggestions(gap, 54247 59478 su->su_sfmaxscore, SUG_CLEAN_COUNT(su)); … … 54255 59486 } 54256 59487 } 54257 @@ -13840,7 +1388 6,7 @@59488 @@ -13840,7 +13884,7 @@ 54258 59489 for (i = gap->ga_len - 1; i >= 0; --i) 54259 59490 { … … 54264 59495 vim_strncpy(longword + len, su->su_badptr + stp[i].st_orglen, 54265 59496 MAXWLEN - len); 54266 @@ -14186,7 +1423 2,7 @@59497 @@ -14186,7 +14230,7 @@ 54267 59498 *t = NUL; 54268 59499 } … … 54273 59504 smp = (salitem_T *)slang->sl_sal.ga_data; 54274 59505 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 } 54275 59557 diff -Naur vim73.orig/src/structs.h vim73/src/structs.h 54276 --- vim73.orig/src/structs.h 2012-0 2-15 21:57:45.041435628+000054277 +++ vim73/src/structs.h 2012-0 2-15 21:57:46.873483950+000059558 --- 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 54278 59560 @@ -378,6 +378,35 @@ 54279 59561 typedef long blocknr_T; … … 54419 59701 PtWidget_t *submenu_id; 54420 59702 diff -Naur vim73.orig/src/syntax.c vim73/src/syntax.c 54421 --- vim73.orig/src/syntax.c 2012-0 2-15 21:57:45.057436051+000054422 +++ vim73/src/syntax.c 2012-0 2-15 21:57:46.789481734+000059703 --- 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 54423 59705 @@ -68,6 +68,8 @@ 54424 59706 … … 54676 59958 * Highlighting stuff * 54677 59959 **************************************/ 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 @@ 54679 60022 /* 54680 60023 * Copy characters from arg[] to buf[], translating <> codes. … … 54689 60032 else /* copy as normal char */ 54690 60033 buf[off++] = *p++; 54691 @@ -8545,8 +85 86,8 @@60034 @@ -8545,8 +8592,8 @@ 54692 60035 if (iarg & hl_attr_table[i]) 54693 60036 { … … 54700 60043 } 54701 60044 } 54702 @@ -8965,6 +90 06,13 @@60045 @@ -8965,6 +9012,13 @@ 54703 60046 highlight_ga.ga_growsize = 10; 54704 60047 } … … 54714 60057 * Make room for at least one other syntax_highlight entry. 54715 60058 */ 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); 54716 60068 diff -Naur vim73.orig/src/tag.c vim73/src/tag.c 54717 --- vim73.orig/src/tag.c 2012-0 2-15 21:57:45.053435946+000054718 +++ vim73/src/tag.c 2012-0 2-15 21:57:46.789481734+000060069 --- 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 54719 60071 @@ -11,10 +11,6 @@ 54720 60072 * Code to handle tags and the tag stack … … 55483 60835 /* 55484 60836 diff -Naur vim73.orig/src/term.c vim73/src/term.c 55485 --- vim73.orig/src/term.c 2012-0 2-15 21:57:45.061436156+000055486 +++ vim73/src/term.c 2012-0 2-15 21:57:46.913485005 +000060837 --- 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 55487 60839 @@ -52,7 +52,7 @@ 55488 60840 … … 55854 61206 return -1; 55855 61207 diff -Naur vim73.orig/src/termlib.c vim73/src/termlib.c 55856 --- vim73.orig/src/termlib.c 2012-0 2-15 21:57:45.041435628+000055857 +++ vim73/src/termlib.c 2012-0 2-15 21:57:45.957459790+000061208 --- 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 55858 61210 @@ -13,7 +13,7 @@ 55859 61211 #include "vim.h" … … 55866 61218 55867 61219 diff -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 @@ 55871 61231 test56.out test57.out test58.out test59.out test60.out \ 55872 61232 test61.out test62.out test63.out test64.out test65.out \ … … 55875 61235 + test71.out test72.out test73.out test74.out test75.out \ 55876 61236 + 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 55878 61238 55879 61239 .SUFFIXES: .in .out 55880 61240 55881 @@ -120,3 +12 2,13@@61241 @@ -120,3 +123,14 @@ 55882 61242 test71.out: test71.in 55883 61243 test72.out: test72.in … … 55893 61253 +test82.out: test82.in 55894 61254 +test83.out: test83.in 61255 +test84.out: test84.in 55895 61256 diff -Naur vim73.orig/src/testdir/Make_dos.mak vim73/src/testdir/Make_dos.mak 55896 --- vim73.orig/src/testdir/Make_dos.mak 2012-0 2-15 21:57:45.045435734+000055897 +++ vim73/src/testdir/Make_dos.mak 2012-0 2-15 21:57:46.537475088+000055898 @@ -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 @@ 55899 61260 test30.out test31.out test32.out test33.out test34.out \ 55900 61261 test37.out test38.out test39.out test40.out test41.out \ … … 55903 61264 + test68.out test69.out test71.out test72.out test73.out \ 55904 61265 + 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 55906 61268 55907 61269 SCRIPTS32 = test50.out test70.out 55908 61270 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 55909 61281 diff -Naur vim73.orig/src/testdir/Make_ming.mak vim73/src/testdir/Make_ming.mak 55910 --- vim73.orig/src/testdir/Make_ming.mak 2012-0 2-15 21:57:45.045435734+000055911 +++ vim73/src/testdir/Make_ming.mak 2012-0 2-15 21:57:46.537475088+000055912 @@ -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 @@ 55913 61285 test30.out test31.out test32.out test33.out test34.out \ 55914 61286 test37.out test38.out test39.out test40.out test41.out \ … … 55917 61289 + test68.out test69.out test71.out test72.out test73.out \ 55918 61290 + 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 55920 61293 55921 61294 SCRIPTS32 = test50.out test70.out 55922 61295 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 55923 61305 diff -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 @@ 55927 61317 test56.out test57.out test58.out test59.out test60.out \ 55928 61318 test61.out test62.out test63.out test64.out test65.out \ … … 55931 61321 + test71.out test72.out test73.out test74.out test75.out \ 55932 61322 + 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 55934 61324 55935 61325 .SUFFIXES: .in .out 55936 61326 55937 61327 diff -Naur vim73.orig/src/testdir/Make_vms.mms vim73/src/testdir/Make_vms.mms 55938 --- vim73.orig/src/testdir/Make_vms.mms 2012-0 2-15 21:57:45.045435734+000055939 +++ vim73/src/testdir/Make_vms.mms 2012-0 2-15 21:57:46.537475088+000061328 --- 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 55940 61330 @@ -4,7 +4,7 @@ 55941 61331 # Authors: Zoltan Arpadffy, <arpadffy@polarhome.com> … … 55943 61333 # 55944 61334 -# Last change: 2010 Aug 04 55945 +# Last change: 201 1 Jul 1561335 +# Last change: 2012 Apr 05 55946 61336 # 55947 61337 # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64. … … 55954 61344 + test71.out test72.out test74.out test75.out test76.out \ 55955 61345 + test77.out test78.out test79.out test80.out test81.out \ 55956 + test82.out test83.out 61346 + test82.out test83.out test84.out 55957 61347 55958 61348 # Known problems: 55959 61349 # 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 55960 61358 diff -Naur vim73.orig/src/testdir/Makefile vim73/src/testdir/Makefile 55961 --- vim73.orig/src/testdir/Makefile 2012-0 2-15 21:57:45.045435734+000055962 +++ vim73/src/testdir/Makefile 2012-0 2-15 21:57:46.537475088+000061359 --- 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 55963 61361 @@ -10,6 +10,7 @@ 55964 61362 # This will make testing about 10 times as slow. … … 55969 61367 test7.out test8.out test9.out test10.out test11.out \ 55970 61368 test12.out test13.out test14.out test15.out test17.out \ 55971 @@ -23,7 +24, 9@@61369 @@ -23,7 +24,10 @@ 55972 61370 test54.out test55.out test56.out test57.out test58.out \ 55973 61371 test59.out test60.out test61.out test62.out test63.out \ … … 55976 61374 + test69.out test70.out test71.out test72.out test73.out \ 55977 61375 + 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 55979 61378 55980 61379 SCRIPTS_GUI = test16.out 55981 61380 55982 @@ -44,7 +4 7,7 @@61381 @@ -44,7 +48,7 @@ 55983 61382 $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG) 55984 61383 … … 55989 61388 test1.out: test1.in 55990 61389 -rm -f $*.failed tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X* viminfo 55991 @@ -69,7 +7 2,7 @@61390 @@ -69,7 +73,7 @@ 55992 61391 fi \ 55993 61392 else echo $* NO OUTPUT >>test.log; \ … … 55999 61398 56000 61399 diff -Naur vim73.orig/src/testdir/main.aap vim73/src/testdir/main.aap 56001 --- vim73.orig/src/testdir/main.aap 2012-0 2-15 21:57:45.045435734+000056002 +++ vim73/src/testdir/main.aap 2012-0 2-15 21:57:45.245441010+000061400 --- 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 56003 61402 @@ -13,7 +13,7 @@ 56004 61403 test33.out test34.out test35.out test36.out test37.out … … 56010 61409 ScriptsGUI = test16.out 56011 61410 61411 diff -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 56012 61440 diff -Naur vim73.orig/src/testdir/test10.in vim73/src/testdir/test10.in 56013 --- vim73.orig/src/testdir/test10.in 2012-0 2-15 21:57:45.045435734+000056014 +++ vim73/src/testdir/test10.in 2012-0 2-15 21:57:46.353470235+000056015 @@ -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 @@ 56016 61444 56017 61445 STARTTEST … … 56025 61453 :/start of testfile/,/end of testfile/w! Xtestfile 56026 61454 -: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 56027 61458 +:cf Xerrorfile2 56028 61459 +:clast … … 56030 61461 +:let a=w:quickfix_title 56031 61462 +:wincmd p 56032 + gR=a61463 +lgR=a 56033 61464 56034 61465 +:cf Xerrorfile1 56035 61466 +grA 56036 61467 :cn 56037 rB 56038 @@ -14,13 +24,18 @@ 56039 rD 61468 -rB 61469 +gRLINE 6, COL 19 56040 61470 :cn 56041 rE 61471 -rC 61472 +gRNO COLUMN SPECIFIED 61473 :cn 61474 -rD 61475 +gRAGAIN NO COLUMN 61476 :cn 61477 -rE 61478 +gRCOL 1 56042 61479 +: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 56043 61498 +:wincmd w 56044 61499 +:let a=w:quickfix_title 56045 61500 +:wincmd p 56046 + gR=a61501 +lgR=a 56047 61502 56048 61503 :w! test.out " Write contents of this file … … 56053 61508 "Xtestfile", line 4.12: 1506-045 (S) Undeclared identifier fd_set. 56054 61509 -"Xtestfile", line 7 col 19; this is an error 56055 +"Xtestfile", line 7col 19; this is an error61510 +"Xtestfile", line 6 col 19; this is an error 56056 61511 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' 56058 61514 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 + ^ 56061 61541 56062 61542 Does anyone know what is the problem and how to correction it? … … 56066 61546 56067 61547 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 56075 61567 -line 21 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 56076 61568 -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 61591 diff -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 56079 61638 end of testfile 56080 61639 diff -Naur vim73.orig/src/testdir/test19.in vim73/src/testdir/test19.in 56081 --- vim73.orig/src/testdir/test19.in 2012-0 2-15 21:57:45.045435734+000056082 +++ vim73/src/testdir/test19.in 2012-0 2-15 21:57:46.425472133+000061640 --- 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 56083 61642 @@ -1,6 +1,7 @@ 56084 61643 Tests for "r<Tab>" with 'smarttab' and 'expandtab' set/not set. … … 56102 61661 56103 61662 diff -Naur vim73.orig/src/testdir/test19.ok vim73/src/testdir/test19.ok 56104 --- vim73.orig/src/testdir/test19.ok 2012-0 2-15 21:57:45.045435734+000056105 +++ vim73/src/testdir/test19.ok 2012-0 2-15 21:57:46.421472027 +000061663 --- 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 56106 61665 @@ -5,3 +5,5 @@ 56107 61666 a cde … … 56111 61670 + x 56112 61671 diff -Naur vim73.orig/src/testdir/test3.in vim73/src/testdir/test3.in 56113 --- vim73.orig/src/testdir/test3.in 2012-0 2-15 21:57:45.045435734+000056114 +++ vim73/src/testdir/test3.in 2012-0 2-15 21:57:46.689479097+000061672 --- 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 56115 61674 @@ -299,18 +299,25 @@ 56116 61675 … … 56236 61795 2kdd]]=][ 56237 61796 ENDTEST 56238 @@ -1315,6 +1399, 412@@61797 @@ -1315,6 +1399,626 @@ 56239 61798 } 56240 61799 … … 56412 61971 + foo(0); 56413 61972 +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 + } 56414 62187 +} 56415 62188 + … … 56650 62423 ENDTEST 56651 62424 diff -Naur vim73.orig/src/testdir/test3.ok vim73/src/testdir/test3.ok 56652 --- vim73.orig/src/testdir/test3.ok 2012-0 2-15 21:57:45.045435734+000056653 +++ vim73/src/testdir/test3.ok 2012-0 2-15 21:57:46.689479097+000062425 --- 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 56654 62427 @@ -299,6 +299,13 @@ 56655 62428 maybe … … 56753 62526 foo() 56754 62527 { 56755 @@ -1183,3 +1263, 346@@62528 @@ -1183,3 +1263,532 @@ 56756 62529 foo; 56757 62530 } … … 56902 62675 + foo(0); 56903 62676 + 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 + } 56904 62863 +} 56905 62864 + … … 57101 63060 + 57102 63061 diff -Naur vim73.orig/src/testdir/test31.in vim73/src/testdir/test31.in 57103 --- vim73.orig/src/testdir/test31.in 2012-0 2-15 21:57:45.045435734+000057104 +++ vim73/src/testdir/test31.in 2012-0 2-15 21:57:46.973486588+000063062 --- 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 57105 63064 @@ -63,6 +63,12 @@ 57106 63065 :" write "testtext 1" … … 57117 63076 57118 63077 diff -Naur vim73.orig/src/testdir/test31.ok vim73/src/testdir/test31.ok 57119 --- vim73.orig/src/testdir/test31.ok 2012-0 2-15 21:57:45.045435734+000057120 +++ vim73/src/testdir/test31.ok 2012-0 2-15 21:57:46.973486588+000063078 --- 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 57121 63080 @@ -9,3 +9,4 @@ 57122 63081 testtext 1 … … 57125 63084 +testtext 2 2 2 57126 63085 diff -Naur vim73.orig/src/testdir/test34.ok vim73/src/testdir/test34.ok 57127 --- vim73.orig/src/testdir/test34.ok 2012-0 2-15 21:57:45.045435734+000057128 +++ vim73/src/testdir/test34.ok 2012-0 2-15 21:57:46.545475298+000063086 --- 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 57129 63088 @@ -1,5 +1,5 @@ 57130 63089 xxx4asdf fail nop ok 9 333 … … 57135 63094 2. two 57136 63095 diff -Naur vim73.orig/src/testdir/test43.in vim73/src/testdir/test43.in 57137 --- vim73.orig/src/testdir/test43.in 2012-0 2-15 21:57:45.045435734+000057138 +++ vim73/src/testdir/test43.in 2012-0 2-15 21:57:46.857483528+000063096 --- 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 57139 63098 @@ -1,6 +1,7 @@ 57140 63099 Tests for regexp with various magic settings. … … 57165 63124 + 57166 63125 diff -Naur vim73.orig/src/testdir/test43.ok vim73/src/testdir/test43.ok 57167 --- vim73.orig/src/testdir/test43.ok 2012-0 2-15 21:57:45.045435734+000057168 +++ vim73/src/testdir/test43.ok 2012-0 2-15 21:57:46.737480364+000063126 --- 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 57169 63128 @@ -6,3 +6,6 @@ 57170 63129 6 x aa$ x … … 57175 63134 + 57176 63135 diff -Naur vim73.orig/src/testdir/test44.in vim73/src/testdir/test44.in 57177 --- vim73.orig/src/testdir/test44.in 2012-0 2-15 21:57:45.045435734+000057178 +++ vim73/src/testdir/test44.in 2012-0 2-15 21:57:46.277468229+000063136 --- 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 57179 63138 @@ -27,6 +27,8 @@ 57180 63139 x/\%U12345678 … … 57199 63158 áºáº xáºáº yÜÿŷáºáºá»³á»·á»¹ zźŌşƶáºáº 57200 63159 diff -Naur vim73.orig/src/testdir/test44.ok vim73/src/testdir/test44.ok 57201 --- vim73.orig/src/testdir/test44.ok 2012-0 2-15 21:57:45.045435734+000057202 +++ vim73/src/testdir/test44.ok 2012-0 2-15 21:57:46.277468229+000063160 --- 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 57203 63162 @@ -14,6 +14,8 @@ 57204 63163 e y … … 57216 63175 × 57217 63176 diff -Naur vim73.orig/src/testdir/test49.vim vim73/src/testdir/test49.vim 57218 --- vim73.orig/src/testdir/test49.vim 2012-0 2-15 21:57:45.045435734+000057219 +++ vim73/src/testdir/test49.vim 2012-0 2-15 21:57:45.181439321+000063177 --- 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 57220 63179 @@ -1,6 +1,6 @@ 57221 63180 " Vim script language tests … … 57236 63195 endif 57237 63196 diff -Naur vim73.orig/src/testdir/test55.in vim73/src/testdir/test55.in 57238 --- vim73.orig/src/testdir/test55.in 2012-0 2-15 21:57:45.045435734+000057239 +++ vim73/src/testdir/test55.in 2012-0 2-15 21:57:45.345443648+000057240 @@ -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 @@ 57241 63200 :$put =(d == d) 57242 63201 :$put =(l != deepcopy(l)) … … 57252 63211 +:$put =(l == lcopy) 57253 63212 +:$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) 57254 63231 :endfun 57255 63232 +:" … … 57258 63235 :delfunc Test 57259 63236 diff -Naur vim73.orig/src/testdir/test55.ok vim73/src/testdir/test55.ok 57260 --- vim73.orig/src/testdir/test55.ok 2012-0 2-15 21:57:45.045435734+000057261 +++ vim73/src/testdir/test55.ok 2012-0 2-15 21:57:45.345443648+000057262 @@ -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 @@ 57263 63240 1 57264 63241 0 … … 57266 63243 +1 57267 63244 +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'}} 57268 63249 diff -Naur vim73.orig/src/testdir/test57.in vim73/src/testdir/test57.in 57269 --- vim73.orig/src/testdir/test57.in 2012-0 2-15 21:57:45.045435734+000057270 +++ vim73/src/testdir/test57.in 2012-0 2-15 21:57:45.237440799+000063250 --- 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 57271 63252 @@ -53,15 +53,19 @@ 57272 63253 t02: numeric … … 57291 63272 b321b 57292 63273 diff -Naur vim73.orig/src/testdir/test57.ok vim73/src/testdir/test57.ok 57293 --- vim73.orig/src/testdir/test57.ok 2012-0 2-15 21:57:45.045435734+000057294 +++ vim73/src/testdir/test57.ok 2012-0 2-15 21:57:45.237440799+000063274 --- 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 57295 63276 @@ -21,6 +21,10 @@ 57296 63277 a … … 57305 63286 b123 57306 63287 diff -Naur vim73.orig/src/testdir/test61.in vim73/src/testdir/test61.in 57307 --- vim73.orig/src/testdir/test61.in 2012-0 2-15 21:57:45.045435734+000057308 +++ vim73/src/testdir/test61.in 2012-0 2-15 21:57:45.137438160+000063288 --- 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 57309 63290 @@ -4,6 +4,10 @@ 57310 63291 Also tests :earlier and :later. … … 57318 63299 Gx:set ul=100 57319 63300 x:set ul=100 63301 diff -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! 63354 diff -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 57320 63364 diff -Naur vim73.orig/src/testdir/test65.in vim73/src/testdir/test65.in 57321 --- vim73.orig/src/testdir/test65.in 2012-0 2-15 21:57:45.045435734+000057322 +++ vim73/src/testdir/test65.in 2012-0 2-15 21:57:46.669478570+000063365 --- 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 57323 63367 @@ -1,4 +1,4 @@ 57324 63368 -Test for floating point. … … 57352 63396 57353 63397 diff -Naur vim73.orig/src/testdir/test65.ok vim73/src/testdir/test65.ok 57354 --- vim73.orig/src/testdir/test65.ok 2012-0 2-15 21:57:45.045435734+000057355 +++ vim73/src/testdir/test65.ok 2012-0 2-15 21:57:46.669478570+000063398 --- 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 57356 63400 @@ -54,3 +54,20 @@ 57357 63401 float2nr … … 57376 63420 +0 57377 63421 diff -Naur vim73.orig/src/testdir/test68.in vim73/src/testdir/test68.in 57378 --- vim73.orig/src/testdir/test68.in 2012-0 2-15 21:57:45.045435734+000057379 +++ vim73/src/testdir/test68.in 2012-0 2-15 21:57:45.205439954+000063422 --- 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 57380 63424 @@ -51,6 +51,17 @@ 57381 63425 } … … 57397 63441 ENDTEST 57398 63442 diff -Naur vim73.orig/src/testdir/test68.ok vim73/src/testdir/test68.ok 57399 --- vim73.orig/src/testdir/test68.ok 2012-0 2-15 21:57:45.045435734+000057400 +++ vim73/src/testdir/test68.ok 2012-0 2-15 21:57:45.205439954+000063443 --- 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 57401 63445 @@ -33,3 +33,6 @@ 57402 63446 #a b … … 57407 63451 + 57408 63452 diff -Naur vim73.orig/src/testdir/test72.in vim73/src/testdir/test72.in 57409 --- vim73.orig/src/testdir/test72.in 2012-0 2-15 21:57:45.045435734+000057410 +++ vim73/src/testdir/test72.in 2012-0 2-15 21:57:46.729480152 +000063453 --- 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 57411 63455 @@ -51,6 +51,12 @@ 57412 63456 :e Xtestfile … … 57423 63467 :set undofile cm=zip 57424 63468 diff -Naur vim73.orig/src/testdir/test72.ok vim73/src/testdir/test72.ok 57425 --- vim73.orig/src/testdir/test72.ok 2012-0 2-15 21:57:45.045435734+000057426 +++ vim73/src/testdir/test72.ok 2012-0 2-15 21:57:46.729480152 +000063469 --- 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 57427 63471 @@ -7,6 +7,16 @@ 57428 63472 eight … … 57444 63488 diff -Naur vim73.orig/src/testdir/test74.in vim73/src/testdir/test74.in 57445 63489 --- vim73.orig/src/testdir/test74.in 1970-01-01 00:00:00.000000000 +0000 57446 +++ vim73/src/testdir/test74.in 2012-0 2-15 21:57:45.245441010+000063490 +++ vim73/src/testdir/test74.in 2012-06-03 23:09:53.184013549 +0000 57447 63491 @@ -0,0 +1,36 @@ 57448 63492 +" Tests for storing global variables in the .viminfo file vim: set ft=vim: … … 57484 63528 diff -Naur vim73.orig/src/testdir/test74.ok vim73/src/testdir/test74.ok 57485 63529 --- vim73.orig/src/testdir/test74.ok 1970-01-01 00:00:00.000000000 +0000 57486 +++ vim73/src/testdir/test74.ok 2012-0 2-15 21:57:45.245441010+000063530 +++ vim73/src/testdir/test74.ok 2012-06-03 23:09:53.184013549 +0000 57487 63531 @@ -0,0 +1,5 @@ 57488 63532 + … … 57493 63537 diff -Naur vim73.orig/src/testdir/test75.in vim73/src/testdir/test75.in 57494 63538 --- vim73.orig/src/testdir/test75.in 1970-01-01 00:00:00.000000000 +0000 57495 +++ vim73/src/testdir/test75.in 2012-0 2-15 21:57:46.373470762+000063539 +++ vim73/src/testdir/test75.in 2012-06-03 23:09:54.628051978 +0000 57496 63540 @@ -0,0 +1,22 @@ 57497 63541 +" Tests for functions. … … 57519 63563 diff -Naur vim73.orig/src/testdir/test75.ok vim73/src/testdir/test75.ok 57520 63564 --- vim73.orig/src/testdir/test75.ok 1970-01-01 00:00:00.000000000 +0000 57521 +++ vim73/src/testdir/test75.ok 2012-0 2-15 21:57:46.373470762+000063565 +++ vim73/src/testdir/test75.ok 2012-06-03 23:09:54.628051978 +0000 57522 63566 @@ -0,0 +1,5 @@ 57523 63567 +is<F4>foo … … 57528 63572 diff -Naur vim73.orig/src/testdir/test76.in vim73/src/testdir/test76.in 57529 63573 --- vim73.orig/src/testdir/test76.in 1970-01-01 00:00:00.000000000 +0000 57530 +++ vim73/src/testdir/test76.in 2012-0 2-15 21:57:45.333443330+000063574 +++ vim73/src/testdir/test76.in 2012-06-03 23:09:53.316017063 +0000 57531 63575 @@ -0,0 +1,46 @@ 57532 63576 +Tests for completefunc/omnifunc. vim: set ft=vim : … … 57578 63622 diff -Naur vim73.orig/src/testdir/test76.ok vim73/src/testdir/test76.ok 57579 63623 --- vim73.orig/src/testdir/test76.ok 1970-01-01 00:00:00.000000000 +0000 57580 +++ vim73/src/testdir/test76.ok 2012-0 2-15 21:57:45.333443330+000063624 +++ vim73/src/testdir/test76.ok 2012-06-03 23:09:53.316017063 +0000 57581 63625 @@ -0,0 +1,4 @@ 57582 63626 ++++ … … 57586 63630 diff -Naur vim73.orig/src/testdir/test77.in vim73/src/testdir/test77.in 57587 63631 --- vim73.orig/src/testdir/test77.in 1970-01-01 00:00:00.000000000 +0000 57588 +++ vim73/src/testdir/test77.in 2012-0 2-15 21:57:45.725453670+000057589 @@ -0,0 +1,2 7@@63632 +++ vim73/src/testdir/test77.in 2012-06-03 23:09:55.796083061 +0000 63633 @@ -0,0 +1,29 @@ 57590 63634 +Inserts 2 million lines with consecutive integers starting from 1 57591 63635 +(essentially, the output of GNU's seq 1 2000000), writes them to Xtest … … 57611 63655 +ggdd 57612 63656 +:w! Xtest 57613 +:!cksum Xtest > test.out 63657 +:r !cksum Xtest 63658 +:s/\s/ /g 63659 +:.w! test.out 57614 63660 +:qa! 57615 63661 +ENDTEST … … 57617 63663 diff -Naur vim73.orig/src/testdir/test77.ok vim73/src/testdir/test77.ok 57618 63664 --- vim73.orig/src/testdir/test77.ok 1970-01-01 00:00:00.000000000 +0000 57619 +++ vim73/src/testdir/test77.ok 2012-0 2-15 21:57:45.725453670+000063665 +++ vim73/src/testdir/test77.ok 2012-06-03 23:09:53.804030049 +0000 57620 63666 @@ -0,0 +1 @@ 57621 63667 +3678979763 14888896 Xtest 57622 63668 diff -Naur vim73.orig/src/testdir/test78.in vim73/src/testdir/test78.in 57623 63669 --- vim73.orig/src/testdir/test78.in 1970-01-01 00:00:00.000000000 +0000 57624 +++ vim73/src/testdir/test78.in 2012-0 2-15 21:57:46.233467068+000063670 +++ vim73/src/testdir/test78.in 2012-06-03 23:09:54.456047401 +0000 57625 63671 @@ -0,0 +1,46 @@ 57626 63672 +Inserts 10000 lines with text to fill the swap file with two levels of pointer … … 57672 63718 diff -Naur vim73.orig/src/testdir/test78.ok vim73/src/testdir/test78.ok 57673 63719 --- vim73.orig/src/testdir/test78.ok 1970-01-01 00:00:00.000000000 +0000 57674 +++ vim73/src/testdir/test78.ok 2012-0 2-15 21:57:46.113463904+000063720 +++ vim73/src/testdir/test78.ok 2012-06-03 23:09:54.288042929 +0000 57675 63721 @@ -0,0 +1,3 @@ 57676 63722 +recovery start … … 57679 63725 diff -Naur vim73.orig/src/testdir/test79.in vim73/src/testdir/test79.in 57680 63726 --- vim73.orig/src/testdir/test79.in 1970-01-01 00:00:00.000000000 +0000 57681 +++ vim73/src/testdir/test79.in 2012-0 2-15 21:57:46.153464960+000063727 +++ vim73/src/testdir/test79.in 2012-06-03 23:09:54.348044528 +0000 57682 63728 @@ -0,0 +1,213 @@ 57683 63729 +Test for *sub-replace-special* and *sub-replace-expression* on :substitute. … … 57907 63953 diff -Naur vim73.orig/src/testdir/test79.ok vim73/src/testdir/test79.ok 57908 63954 --- vim73.orig/src/testdir/test79.ok 1970-01-01 00:00:00.000000000 +0000 57909 +++ vim73/src/testdir/test79.ok 2012-0 2-15 21:57:46.153464960+000063955 +++ vim73/src/testdir/test79.ok 2012-06-03 23:09:54.348044528 +0000 57910 63956 @@ -0,0 +1,118 @@ 57911 63957 +Results of test71: … … 58031 64077 diff -Naur vim73.orig/src/testdir/test80.in vim73/src/testdir/test80.in 58032 64078 --- vim73.orig/src/testdir/test80.in 1970-01-01 00:00:00.000000000 +0000 58033 +++ vim73/src/testdir/test80.in 2012-0 2-15 21:57:46.153464960+000064079 +++ vim73/src/testdir/test80.in 2012-06-03 23:09:54.348044528 +0000 58034 64080 @@ -0,0 +1,150 @@ 58035 64081 +Test for *sub-replace-special* and *sub-replace-expression* on substitue(). … … 58196 64242 diff -Naur vim73.orig/src/testdir/test80.ok vim73/src/testdir/test80.ok 58197 64243 --- vim73.orig/src/testdir/test80.ok 1970-01-01 00:00:00.000000000 +0000 58198 +++ vim73/src/testdir/test80.ok 2012-0 2-15 21:57:46.153464960+000064244 +++ vim73/src/testdir/test80.ok 2012-06-03 23:09:54.348044528 +0000 58199 64245 @@ -0,0 +1,101 @@ 58200 64246 +Results of test72: … … 58319 64365 diff -Naur vim73.orig/src/testdir/test81.in vim73/src/testdir/test81.in 58320 64366 --- vim73.orig/src/testdir/test81.in 1970-01-01 00:00:00.000000000 +0000 58321 +++ vim73/src/testdir/test81.in 2012-0 2-15 21:57:46.233467068+000064367 +++ vim73/src/testdir/test81.in 2012-06-03 23:09:54.456047401 +0000 58322 64368 @@ -0,0 +1,22 @@ 58323 64369 +Test for t movement command and 'cpo-;' setting … … 58345 64391 diff -Naur vim73.orig/src/testdir/test81.ok vim73/src/testdir/test81.ok 58346 64392 --- vim73.orig/src/testdir/test81.ok 1970-01-01 00:00:00.000000000 +0000 58347 +++ vim73/src/testdir/test81.ok 2012-0 2-15 21:57:46.249467491+000064393 +++ vim73/src/testdir/test81.ok 2012-06-03 23:09:54.476047933 +0000 58348 64394 @@ -0,0 +1,6 @@ 58349 64395 +aaa two … … 58355 64401 diff -Naur vim73.orig/src/testdir/test82.in vim73/src/testdir/test82.in 58356 64402 --- vim73.orig/src/testdir/test82.in 1970-01-01 00:00:00.000000000 +0000 58357 +++ vim73/src/testdir/test82.in 2012-0 2-15 21:57:46.249467491+000064403 +++ vim73/src/testdir/test82.in 2012-06-03 23:09:54.480048039 +0000 58358 64404 @@ -0,0 +1,93 @@ 58359 64405 +Tests for case-insensitive UTF-8 comparisons (utf_strnicmp() in mbyte.c) … … 58452 64498 diff -Naur vim73.orig/src/testdir/test82.ok vim73/src/testdir/test82.ok 58453 64499 --- vim73.orig/src/testdir/test82.ok 1970-01-01 00:00:00.000000000 +0000 58454 +++ vim73/src/testdir/test82.ok 2012-0 2-15 21:57:46.253467597+000064500 +++ vim73/src/testdir/test82.ok 2012-06-03 23:09:54.480048039 +0000 58455 64501 @@ -0,0 +1,2 @@ 58456 64502 +3732 checks passed … … 58458 64504 diff -Naur vim73.orig/src/testdir/test83-tags2 vim73/src/testdir/test83-tags2 58459 64505 --- vim73.orig/src/testdir/test83-tags2 1970-01-01 00:00:00.000000000 +0000 58460 +++ vim73/src/testdir/test83-tags2 2012-0 2-15 21:57:46.537475088+000064506 +++ vim73/src/testdir/test83-tags2 2012-06-03 23:09:54.856058047 +0000 58461 64507 @@ -0,0 +1,2 @@ 58462 64508 +!_TAG_FILE_ENCODING cp932 // 58463 + Â`ÂaÂb Xtags2.txt /Â`ÂaÂb64509 +`ab Xtags2.txt /`ab 58464 64510 diff -Naur vim73.orig/src/testdir/test83-tags3 vim73/src/testdir/test83-tags3 58465 64511 --- vim73.orig/src/testdir/test83-tags3 1970-01-01 00:00:00.000000000 +0000 58466 +++ vim73/src/testdir/test83-tags3 2012-0 2-15 21:57:46.537475088+000064512 +++ vim73/src/testdir/test83-tags3 2012-06-03 23:09:54.856058047 +0000 58467 64513 @@ -0,0 +1,102 @@ 58468 64514 +!_TAG_FILE_SORTED 1 // 58469 64515 +!_TAG_FILE_ENCODING cp932 // 58470 +abc1 Xtags3.txt / Â`ÂaÂb58471 +abc2 Xtags3.txt / Â`ÂaÂb58472 +abc3 Xtags3.txt / Â`ÂaÂb58473 +abc4 Xtags3.txt / Â`ÂaÂb58474 +abc5 Xtags3.txt / Â`ÂaÂb58475 +abc6 Xtags3.txt / Â`ÂaÂb58476 +abc7 Xtags3.txt / Â`ÂaÂb58477 +abc8 Xtags3.txt / Â`ÂaÂb58478 +abc9 Xtags3.txt / Â`ÂaÂb58479 +abc10 Xtags3.txt / Â`ÂaÂb58480 +abc11 Xtags3.txt / Â`ÂaÂb58481 +abc12 Xtags3.txt / Â`ÂaÂb58482 +abc13 Xtags3.txt / Â`ÂaÂb58483 +abc14 Xtags3.txt / Â`ÂaÂb58484 +abc15 Xtags3.txt / Â`ÂaÂb58485 +abc16 Xtags3.txt / Â`ÂaÂb58486 +abc17 Xtags3.txt / Â`ÂaÂb58487 +abc18 Xtags3.txt / Â`ÂaÂb58488 +abc19 Xtags3.txt / Â`ÂaÂb58489 +abc20 Xtags3.txt / Â`ÂaÂb58490 +abc21 Xtags3.txt / Â`ÂaÂb58491 +abc22 Xtags3.txt / Â`ÂaÂb58492 +abc23 Xtags3.txt / Â`ÂaÂb58493 +abc24 Xtags3.txt / Â`ÂaÂb58494 +abc25 Xtags3.txt / Â`ÂaÂb58495 +abc26 Xtags3.txt / Â`ÂaÂb58496 +abc27 Xtags3.txt / Â`ÂaÂb58497 +abc28 Xtags3.txt / Â`ÂaÂb58498 +abc29 Xtags3.txt / Â`ÂaÂb58499 +abc30 Xtags3.txt / Â`ÂaÂb58500 +abc31 Xtags3.txt / Â`ÂaÂb58501 +abc32 Xtags3.txt / Â`ÂaÂb58502 +abc33 Xtags3.txt / Â`ÂaÂb58503 +abc34 Xtags3.txt / Â`ÂaÂb58504 +abc35 Xtags3.txt / Â`ÂaÂb58505 +abc36 Xtags3.txt / Â`ÂaÂb58506 +abc37 Xtags3.txt / Â`ÂaÂb58507 +abc38 Xtags3.txt / Â`ÂaÂb58508 +abc39 Xtags3.txt / Â`ÂaÂb58509 +abc40 Xtags3.txt / Â`ÂaÂb58510 +abc41 Xtags3.txt / Â`ÂaÂb58511 +abc42 Xtags3.txt / Â`ÂaÂb58512 +abc43 Xtags3.txt / Â`ÂaÂb58513 +abc44 Xtags3.txt / Â`ÂaÂb58514 +abc45 Xtags3.txt / Â`ÂaÂb58515 +abc46 Xtags3.txt / Â`ÂaÂb58516 +abc47 Xtags3.txt / Â`ÂaÂb58517 +abc48 Xtags3.txt / Â`ÂaÂb58518 +abc49 Xtags3.txt / Â`ÂaÂb58519 +abc50 Xtags3.txt / Â`ÂaÂb58520 +abc51 Xtags3.txt / Â`ÂaÂb58521 +abc52 Xtags3.txt / Â`ÂaÂb58522 +abc53 Xtags3.txt / Â`ÂaÂb58523 +abc54 Xtags3.txt / Â`ÂaÂb58524 +abc55 Xtags3.txt / Â`ÂaÂb58525 +abc56 Xtags3.txt / Â`ÂaÂb58526 +abc57 Xtags3.txt / Â`ÂaÂb58527 +abc58 Xtags3.txt / Â`ÂaÂb58528 +abc59 Xtags3.txt / Â`ÂaÂb58529 +abc60 Xtags3.txt / Â`ÂaÂb58530 +abc61 Xtags3.txt / Â`ÂaÂb58531 +abc62 Xtags3.txt / Â`ÂaÂb58532 +abc63 Xtags3.txt / Â`ÂaÂb58533 +abc64 Xtags3.txt / Â`ÂaÂb58534 +abc65 Xtags3.txt / Â`ÂaÂb58535 +abc66 Xtags3.txt / Â`ÂaÂb58536 +abc67 Xtags3.txt / Â`ÂaÂb58537 +abc68 Xtags3.txt / Â`ÂaÂb58538 +abc69 Xtags3.txt / Â`ÂaÂb58539 +abc70 Xtags3.txt / Â`ÂaÂb58540 +abc71 Xtags3.txt / Â`ÂaÂb58541 +abc72 Xtags3.txt / Â`ÂaÂb58542 +abc73 Xtags3.txt / Â`ÂaÂb58543 +abc74 Xtags3.txt / Â`ÂaÂb58544 +abc75 Xtags3.txt / Â`ÂaÂb58545 +abc76 Xtags3.txt / Â`ÂaÂb58546 +abc77 Xtags3.txt / Â`ÂaÂb58547 +abc78 Xtags3.txt / Â`ÂaÂb58548 +abc79 Xtags3.txt / Â`ÂaÂb58549 +abc80 Xtags3.txt / Â`ÂaÂb58550 +abc81 Xtags3.txt / Â`ÂaÂb58551 +abc82 Xtags3.txt / Â`ÂaÂb58552 +abc83 Xtags3.txt / Â`ÂaÂb58553 +abc84 Xtags3.txt / Â`ÂaÂb58554 +abc85 Xtags3.txt / Â`ÂaÂb58555 +abc86 Xtags3.txt / Â`ÂaÂb58556 +abc87 Xtags3.txt / Â`ÂaÂb58557 +abc88 Xtags3.txt / Â`ÂaÂb58558 +abc89 Xtags3.txt / Â`ÂaÂb58559 +abc90 Xtags3.txt / Â`ÂaÂb58560 +abc91 Xtags3.txt / Â`ÂaÂb58561 +abc92 Xtags3.txt / Â`ÂaÂb58562 +abc93 Xtags3.txt / Â`ÂaÂb58563 +abc94 Xtags3.txt / Â`ÂaÂb58564 +abc95 Xtags3.txt / Â`ÂaÂb58565 +abc96 Xtags3.txt / Â`ÂaÂb58566 +abc97 Xtags3.txt / Â`ÂaÂb58567 +abc98 Xtags3.txt / Â`ÂaÂb58568 +abc99 Xtags3.txt / Â`ÂaÂb58569 +abc100 Xtags3.txt / Â`ÂaÂb64516 +abc1 Xtags3.txt /`ab 64517 +abc2 Xtags3.txt /`ab 64518 +abc3 Xtags3.txt /`ab 64519 +abc4 Xtags3.txt /`ab 64520 +abc5 Xtags3.txt /`ab 64521 +abc6 Xtags3.txt /`ab 64522 +abc7 Xtags3.txt /`ab 64523 +abc8 Xtags3.txt /`ab 64524 +abc9 Xtags3.txt /`ab 64525 +abc10 Xtags3.txt /`ab 64526 +abc11 Xtags3.txt /`ab 64527 +abc12 Xtags3.txt /`ab 64528 +abc13 Xtags3.txt /`ab 64529 +abc14 Xtags3.txt /`ab 64530 +abc15 Xtags3.txt /`ab 64531 +abc16 Xtags3.txt /`ab 64532 +abc17 Xtags3.txt /`ab 64533 +abc18 Xtags3.txt /`ab 64534 +abc19 Xtags3.txt /`ab 64535 +abc20 Xtags3.txt /`ab 64536 +abc21 Xtags3.txt /`ab 64537 +abc22 Xtags3.txt /`ab 64538 +abc23 Xtags3.txt /`ab 64539 +abc24 Xtags3.txt /`ab 64540 +abc25 Xtags3.txt /`ab 64541 +abc26 Xtags3.txt /`ab 64542 +abc27 Xtags3.txt /`ab 64543 +abc28 Xtags3.txt /`ab 64544 +abc29 Xtags3.txt /`ab 64545 +abc30 Xtags3.txt /`ab 64546 +abc31 Xtags3.txt /`ab 64547 +abc32 Xtags3.txt /`ab 64548 +abc33 Xtags3.txt /`ab 64549 +abc34 Xtags3.txt /`ab 64550 +abc35 Xtags3.txt /`ab 64551 +abc36 Xtags3.txt /`ab 64552 +abc37 Xtags3.txt /`ab 64553 +abc38 Xtags3.txt /`ab 64554 +abc39 Xtags3.txt /`ab 64555 +abc40 Xtags3.txt /`ab 64556 +abc41 Xtags3.txt /`ab 64557 +abc42 Xtags3.txt /`ab 64558 +abc43 Xtags3.txt /`ab 64559 +abc44 Xtags3.txt /`ab 64560 +abc45 Xtags3.txt /`ab 64561 +abc46 Xtags3.txt /`ab 64562 +abc47 Xtags3.txt /`ab 64563 +abc48 Xtags3.txt /`ab 64564 +abc49 Xtags3.txt /`ab 64565 +abc50 Xtags3.txt /`ab 64566 +abc51 Xtags3.txt /`ab 64567 +abc52 Xtags3.txt /`ab 64568 +abc53 Xtags3.txt /`ab 64569 +abc54 Xtags3.txt /`ab 64570 +abc55 Xtags3.txt /`ab 64571 +abc56 Xtags3.txt /`ab 64572 +abc57 Xtags3.txt /`ab 64573 +abc58 Xtags3.txt /`ab 64574 +abc59 Xtags3.txt /`ab 64575 +abc60 Xtags3.txt /`ab 64576 +abc61 Xtags3.txt /`ab 64577 +abc62 Xtags3.txt /`ab 64578 +abc63 Xtags3.txt /`ab 64579 +abc64 Xtags3.txt /`ab 64580 +abc65 Xtags3.txt /`ab 64581 +abc66 Xtags3.txt /`ab 64582 +abc67 Xtags3.txt /`ab 64583 +abc68 Xtags3.txt /`ab 64584 +abc69 Xtags3.txt /`ab 64585 +abc70 Xtags3.txt /`ab 64586 +abc71 Xtags3.txt /`ab 64587 +abc72 Xtags3.txt /`ab 64588 +abc73 Xtags3.txt /`ab 64589 +abc74 Xtags3.txt /`ab 64590 +abc75 Xtags3.txt /`ab 64591 +abc76 Xtags3.txt /`ab 64592 +abc77 Xtags3.txt /`ab 64593 +abc78 Xtags3.txt /`ab 64594 +abc79 Xtags3.txt /`ab 64595 +abc80 Xtags3.txt /`ab 64596 +abc81 Xtags3.txt /`ab 64597 +abc82 Xtags3.txt /`ab 64598 +abc83 Xtags3.txt /`ab 64599 +abc84 Xtags3.txt /`ab 64600 +abc85 Xtags3.txt /`ab 64601 +abc86 Xtags3.txt /`ab 64602 +abc87 Xtags3.txt /`ab 64603 +abc88 Xtags3.txt /`ab 64604 +abc89 Xtags3.txt /`ab 64605 +abc90 Xtags3.txt /`ab 64606 +abc91 Xtags3.txt /`ab 64607 +abc92 Xtags3.txt /`ab 64608 +abc93 Xtags3.txt /`ab 64609 +abc94 Xtags3.txt /`ab 64610 +abc95 Xtags3.txt /`ab 64611 +abc96 Xtags3.txt /`ab 64612 +abc97 Xtags3.txt /`ab 64613 +abc98 Xtags3.txt /`ab 64614 +abc99 Xtags3.txt /`ab 64615 +abc100 Xtags3.txt /`ab 58570 64616 diff -Naur vim73.orig/src/testdir/test83.in vim73/src/testdir/test83.in 58571 64617 --- vim73.orig/src/testdir/test83.in 1970-01-01 00:00:00.000000000 +0000 58572 +++ vim73/src/testdir/test83.in 2012-0 2-15 21:57:46.709479625+000064618 +++ vim73/src/testdir/test83.in 2012-06-03 23:09:55.088064220 +0000 58573 64619 @@ -0,0 +1,76 @@ 58574 64620 +Tests for tag search with !_TAG_FILE_ENCODING. … … 58609 64655 +:set tags=test83-tags2 58610 64656 +:let v:errmsg = '' 58611 +:tag /. 58612 +:if v:errmsg =~ 'E426:' || getline('.') != ' '64657 +:tag /. 64658 +:if v:errmsg =~ 'E426:' || getline('.') != '' 58613 64659 +: close 58614 64660 +: put ='case2: failed' … … 58623 64669 +:let v:errmsg = '' 58624 64670 +:tag abc50 58625 +:if v:errmsg =~ 'E426:' || getline('.') != ' '64671 +:if v:errmsg =~ 'E426:' || getline('.') != '' 58626 64672 +: close 58627 64673 +: put ='case3: failed' … … 58639 64685 + 58640 64686 +text for tags2 58641 + 64687 + 58642 64688 + 58643 64689 +text for tags3 58644 + 64690 + 58645 64691 + 58646 64692 +tags1 … … 58650 64696 diff -Naur vim73.orig/src/testdir/test83.ok vim73/src/testdir/test83.ok 58651 64697 --- vim73.orig/src/testdir/test83.ok 1970-01-01 00:00:00.000000000 +0000 58652 +++ vim73/src/testdir/test83.ok 2012-0 2-15 21:57:46.537475088+000064698 +++ vim73/src/testdir/test83.ok 2012-06-03 23:09:54.856058047 +0000 58653 64699 @@ -0,0 +1,4 @@ 58654 64700 +Results of test83 … … 58656 64702 +case2: ok 58657 64703 +case3: ok 64704 diff -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 64743 diff -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 64750 diff -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 64796 diff -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 58658 64805 diff -Naur vim73.orig/src/typemap vim73/src/typemap 58659 --- vim73.orig/src/typemap 2012-0 2-15 21:57:45.041435628+000058660 +++ vim73/src/typemap 2012-0 2-15 21:57:46.949485954+000064806 --- vim73.orig/src/typemap 2012-06-03 23:09:52.924006631 +0000 64807 +++ vim73/src/typemap 2012-06-03 23:09:55.408072735 +0000 58661 64808 @@ -6,7 +6,7 @@ 58662 64809 T_VIOBJNOMUNGE … … 58669 64816 } 58670 64817 diff -Naur vim73.orig/src/ui.c vim73/src/ui.c 58671 --- vim73.orig/src/ui.c 2012-0 2-15 21:57:45.041435628+000058672 +++ vim73/src/ui.c 2012-0 2-15 21:57:46.953486059+000064818 --- 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 58673 64820 @@ -58,7 +58,7 @@ 58674 64821 #endif … … 58916 65063 return OK; 58917 65064 diff -Naur vim73.orig/src/undo.c vim73/src/undo.c 58918 --- vim73.orig/src/undo.c 2012-0 2-15 21:57:45.061436156+000058919 +++ vim73/src/undo.c 2012-0 2-15 21:57:46.637477726+000065065 --- 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 58920 65067 @@ -81,10 +81,6 @@ 58921 65068 #define UH_MAGIC 0x18dade /* value for uh_magic when in use */ … … 58947 65094 if (len < UF_START_MAGIC_LEN 58948 65095 || 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 @@ 58950 65105 curbuf->b_u_seq_cur = seq_cur; 58951 65106 curbuf->b_u_time_cur = seq_time; … … 58955 65110 curbuf->b_u_synced = TRUE; 58956 65111 vim_free(uhp_table); 58957 @@ -2794,7 +279 1,7 @@65112 @@ -2794,7 +2792,7 @@ 58958 65113 uhp->uh_time); 58959 65114 if (uhp->uh_save_nr > 0) … … 58964 65119 vim_snprintf_add((char *)IObuff, IOSIZE, 58965 65120 " %3ld", uhp->uh_save_nr); 58966 @@ -2849,7 +284 6,7 @@65121 @@ -2849,7 +2847,7 @@ 58967 65122 sort_strings((char_u **)ga.ga_data, ga.ga_len); 58968 65123 … … 58973 65128 for (i = 0; i < ga.ga_len && !got_int; ++i) 58974 65129 { 58975 @@ -2879,7 +287 6,15 @@65130 @@ -2879,7 +2877,15 @@ 58976 65131 if (time(NULL) - tt >= 100) 58977 65132 { … … 58990 65145 else 58991 65146 #endif 58992 @@ -3299,7 +330 4,7 @@65147 @@ -3299,7 +3305,7 @@ 58993 65148 #ifdef FEAT_QUICKFIX 58994 65149 !bt_dontwrite(buf) && … … 58999 65154 59000 65155 int 59001 @@ -3309,7 +331 4,7 @@65156 @@ -3309,7 +3315,7 @@ 59002 65157 #ifdef FEAT_QUICKFIX 59003 65158 !bt_dontwrite(curbuf) && … … 59009 65164 #if defined(FEAT_EVAL) || defined(PROTO) 59010 65165 diff -Naur vim73.orig/src/version.c vim73/src/version.c 59011 --- vim73.orig/src/version.c 2012-0 2-15 21:57:45.049435840+000059012 +++ vim73/src/version.c 2012-0 2-15 21:57:46.973486588+000065166 --- 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 59013 65168 @@ -379,6 +379,11 @@ 59014 65169 # else … … 59035 65190 "+path_extra", 59036 65191 #else 59037 @@ -715, 6 +715,894@@65192 @@ -715,127 +715,1200 @@ 59038 65193 static int included_patches[] = 59039 65194 { /* Add new patch number below this line */ 59040 65195 /**/ 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 - 59936 65315 -#ifdef RISCOS 59937 65316 - MSG_PUTS(_("\nRISC OS version")); 59938 65317 -#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 + 59939 66510 #ifdef VMS 59940 66511 MSG_PUTS(_("\nOpenVMS version")); 59941 66512 # ifdef HAVE_PATHDEF 59942 @@ -1262, 9 +2147,9@@66513 @@ -1262,14 +2335,11 @@ 59943 66514 if (highest_patch()) 59944 66515 { … … 59948 66519 { 59949 66520 - 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()); 59954 66532 diff -Naur vim73.orig/src/version.c.orig vim73/src/version.c.orig 59955 66533 --- vim73.orig/src/version.c.orig 1970-01-01 00:00:00.000000000 +0000 59956 +++ vim73/src/version.c.orig 2012-0 2-15 21:57:45.989460632+000066534 +++ vim73/src/version.c.orig 2012-06-03 23:09:54.144039098 +0000 59957 66535 @@ -0,0 +1,1691 @@ 59958 66536 +/* vi:set ts=8 sts=4 sw=4: … … 61648 68226 +} 61649 68227 diff -Naur vim73.orig/src/vim.h vim73/src/vim.h 61650 --- vim73.orig/src/vim.h 2012-0 2-15 21:57:45.053435946+000061651 +++ vim73/src/vim.h 2012-0 2-15 21:57:46.293468653+000068228 --- 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 61652 68230 @@ -27,6 +27,11 @@ 61653 68231 # endif … … 61714 68292 * Allow other (non-unix) systems to configure themselves now 61715 68293 * These are also in os_unix.h, because osdef.sh needs them there. 61716 @@ -776,6 +780, 7@@68294 @@ -776,6 +780,8 @@ 61717 68295 #define EXPAND_FILETYPE 37 61718 68296 #define EXPAND_FILES_IN_PATH 38 61719 68297 #define EXPAND_OWNSYNTAX 39 61720 68298 +#define EXPAND_LOCALES 40 68299 +#define EXPAND_HISTORY 41 61721 68300 61722 68301 /* Values for exmode_active (0 is no exmode) */ 61723 68302 #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 @@ 61725 68312 #define WILD_KEEP_ALL 32 61726 68313 #define WILD_SILENT 64 … … 61730 68317 /* Flags for expand_wildcards() */ 61731 68318 #define EW_DIR 0x01 /* include directory names */ 61732 @@ -808,6 +81 4,9 @@68319 @@ -808,6 +816,9 @@ 61733 68320 #define EW_SILENT 0x20 /* don't print "1 returned" from shell */ 61734 68321 #define EW_EXEC 0x40 /* executable files */ … … 61740 68327 * is used when executing commands and EW_SILENT for interactive expanding. */ 61741 68328 61742 @@ -1269,6 +12 78,7 @@68329 @@ -1269,6 +1280,7 @@ 61743 68330 EVENT_WINENTER, /* after entering a window */ 61744 68331 EVENT_WINLEAVE, /* before leaving a window */ … … 61748 68335 EVENT_CURSORHOLDI, /* idem, in Insert mode */ 61749 68336 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 @@ 61751 68355 61752 68356 #define IOSIZE (1024+1) /* file i/o and sprintf buffer size */ … … 61757 68361 # define MSG_BUF_LEN 480 /* length of buffer for small messages */ 61758 68362 # define MSG_BUF_CLEN (MSG_BUF_LEN / 6) /* cell length (worst case: utf-8 61759 @@ -1640,6 +165 2,11 @@68363 @@ -1640,6 +1655,11 @@ 61760 68364 # define USE_INPUT_BUF 61761 68365 #endif … … 61769 68373 /* On MS-Windows the third argument isn't size_t. This matters for Win64, 61770 68374 * 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 @@ 61772 68385 #define VV_OP 52 61773 68386 #define VV_SEARCHFORWARD 53 … … 61779 68392 #ifdef FEAT_CLIPBOARD 61780 68393 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 @@ 61782 68403 #define MSCR_LEFT -1 61783 68404 #define MSCR_RIGHT -2 … … 61795 68416 #endif /* VIM__H */ 61796 68417 diff -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)); 61799 68429 @@ -70,7 +70,8 @@ 61800 68430 #endif /* FEAT_WINDOWS */ … … 61945 68575 61946 68576 /* 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; 61948 68666 61949 68667 /* When closing the help window, try restoring a snapshot after closing … … 61954 68672 else 61955 68673 clear_snapshot(curtab, SNAP_HELP_IDX); 61956 @@ -2206,17 +22 12,25@@68674 @@ -2206,17 +2230,26 @@ 61957 68675 out_flush(); 61958 68676 #endif … … 61969 68687 - close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0); 61970 68688 + 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); 61972 68690 61973 68691 /* Autocommands may have closed the window already, or closed the only 61974 68692 * 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)) 61976 68696 return; 61977 68697 … … 61982 68702 61983 68703 /* 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 @@ 61985 68723 else 61986 68724 wp->w_farsi = W_CONV; … … 61992 68730 61993 68731 /* 61994 @@ -3277,9 +3 294,7 @@68732 @@ -3277,9 +3313,7 @@ 61995 68733 if (aucmd_win != NULL) 61996 68734 { … … 62003 68741 } 62004 68742 } 62005 @@ -3320,10 +33 35,8 @@68743 @@ -3320,10 +3354,8 @@ 62006 68744 /* First window in new tab page, initialize it from "oldwin". */ 62007 68745 win_init(curwin, oldwin, 0); … … 62016 68754 #endif 62017 68755 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 @@ 62019 68786 win_T *after UNUSED; 62020 68787 int hidden UNUSED; … … 62042 68809 #ifdef FEAT_AUTOCMD 62043 68810 /* Don't execute autocommands while the window is not properly 62044 @@ -4296,53 +43 09,53 @@68811 @@ -4296,53 +4329,53 @@ 62045 68812 */ 62046 68813 #ifdef FEAT_WINDOWS … … 62115 68882 62116 68883 #if defined(FEAT_WINDOWS) || defined(PROTO) 62117 @@ -4435,7 +44 48,6 @@68884 @@ -4435,7 +4468,6 @@ 62118 68885 #endif /* FEAT_GUI */ 62119 68886 … … 62123 68890 #endif 62124 68891 62125 @@ -5459,6 +54 71,19 @@68892 @@ -5459,6 +5491,19 @@ 62126 68893 62127 68894 #endif /* FEAT_WINDOWS */ … … 62143 68910 * Set the height of a window. 62144 68911 * This takes care of the things inside the window, not what happens to the 62145 @@ -5471,7 +5 496,6 @@68912 @@ -5471,7 +5516,6 @@ 62146 68913 { 62147 68914 linenr_T lnum; … … 62151 68918 /* Don't want a negative height. Happens when splitting a tiny window. 62152 68919 * Will equalize heights soon to fix it. */ 62153 @@ -5481,8 +55 05,7 @@68920 @@ -5481,8 +5525,7 @@ 62154 68921 return; /* nothing to do */ 62155 68922 … … 62162 68929 wp->w_skipcol = 0; 62163 68930 diff -Naur vim73.orig/src/workshop.c vim73/src/workshop.c 62164 --- vim73.orig/src/workshop.c 2012-0 2-15 21:57:45.041435628+000062165 +++ vim73/src/workshop.c 2012-0 2-15 21:57:45.493447550+000068931 --- 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 62166 68933 @@ -16,7 +16,6 @@ 62167 68934 #include <sys/types.h> … … 62173 68940 # include <libgen.h> 62174 68941 diff -Naur vim73.orig/src/xpm_w32.c vim73/src/xpm_w32.c 62175 --- vim73.orig/src/xpm_w32.c 2012-0 2-15 21:57:45.053435946+000062176 +++ vim73/src/xpm_w32.c 2012-0 2-15 21:57:46.897484584+000068942 --- 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 62177 68944 @@ -1,4 +1,5 @@ 62178 68945 -/* … … 62225 68992 diff -Naur vim73.orig/src/xxd/Make_ming.mak vim73/src/xxd/Make_ming.mak 62226 68993 --- vim73.orig/src/xxd/Make_ming.mak 1970-01-01 00:00:00.000000000 +0000 62227 +++ vim73/src/xxd/Make_ming.mak 2012-0 2-15 21:57:46.501474139+000068994 +++ vim73/src/xxd/Make_ming.mak 2012-06-03 23:09:54.804056662 +0000 62228 68995 @@ -0,0 +1,28 @@ 62229 68996 +# The most simplistic Makefile, for MinGW gcc on MS-DOS … … 62256 69023 + -$(DEL) xxd.exe 62257 69024 diff -Naur vim73.orig/src/xxd/xxd.c vim73/src/xxd/xxd.c 62258 --- vim73.orig/src/xxd/xxd.c 2012-0 2-15 21:57:45.057436051+000062259 +++ vim73/src/xxd/xxd.c 2012-0 2-15 21:57:45.841456730+000069025 --- 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 62260 69027 @@ -49,6 +49,8 @@ 62261 69028 * option -b added: 01000101 binary output in normal format.
Note:
See TracChangeset
for help on using the changeset viewer.