Changeset eb3c388
- Timestamp:
- Jun 4, 2012, 6:07:54 PM (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