- Timestamp:
- Jul 21, 2012, 9:15:17 PM (12 years ago)
- Branches:
- clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
- Children:
- 1752595
- Parents:
- c1c44b9
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
patches/vim-7.3-branch-update-5.patch
rc1c44b9 r4641a79 1 Submitted By: Jonathan Norman (jonathan at bluesquarelinux dot co dot uk)2 Date: 2012-06-033 Initial Package Version: 7.34 Origin: Upstream5 Upstream Status: Applied6 Description: Contains all upstream patches up to 7.3.5387 8 1 diff -Naur vim73.orig/Filelist vim73/Filelist 9 --- vim73.orig/Filelist 201 2-06-03 23:09:52.956007482+000010 +++ vim73/Filelist 2012-0 6-03 23:09:54.868058365+00002 --- vim73.orig/Filelist 2010-08-07 11:04:57.000000000 +0000 3 +++ vim73/Filelist 2012-07-20 20:31:18.230978438 +0000 11 4 @@ -39,6 +39,7 @@ 12 5 src/mark.c \ … … 62 55 src/toolbar.phi \ 63 56 64 @@ -686,6 +683,8 @@ 57 @@ -466,6 +463,7 @@ 58 runtime/macros/hanoi/hanoi.vim \ 59 runtime/macros/hanoi/poster \ 60 runtime/macros/justify.vim \ 61 + runtime/macros/less.bat \ 62 runtime/macros/less.sh \ 63 runtime/macros/less.vim \ 64 runtime/macros/life/click.me \ 65 @@ -669,6 +667,8 @@ 66 67 # generic language files 68 LANG_GEN = \ 69 + runtime/doc/*-de.1 \ 70 + runtime/doc/*-de.UTF-8.1 \ 71 runtime/doc/*-fr.1 \ 72 runtime/doc/*-fr.UTF-8.1 \ 73 runtime/doc/*-it.1 \ 74 @@ -686,6 +686,8 @@ 65 75 runtime/tutor/tutor.utf-8 \ 66 76 runtime/tutor/tutor.?? \ … … 72 82 runtime/spell/??/main.aap \ 73 83 diff -Naur vim73.orig/Makefile vim73/Makefile 74 --- vim73.orig/Makefile 201 2-06-03 23:09:53.028009398+000075 +++ vim73/Makefile 2012-0 6-03 23:09:53.712027602+000084 --- vim73.orig/Makefile 2010-08-15 12:23:34.000000000 +0000 85 +++ vim73/Makefile 2012-07-20 20:31:09.600972239 +0000 76 86 @@ -23,6 +23,9 @@ 77 87 # has run can result in compiling with $(CC) empty. … … 95 105 cd src && $(MAKE) $@ 96 106 diff -Naur vim73.orig/README_extra.txt vim73/README_extra.txt 97 --- vim73.orig/README_extra.txt 201 2-06-03 23:09:52.920006524+000098 +++ vim73/README_extra.txt 2012-0 6-03 23:09:54.124038565+0000107 --- vim73.orig/README_extra.txt 2010-08-15 12:23:19.000000000 +0000 108 +++ vim73/README_extra.txt 2012-07-20 20:31:10.880973163 +0000 99 109 @@ -13,9 +13,6 @@ 100 110 … … 108 118 109 119 diff -Naur vim73.orig/runtime/doc/autocmd.txt vim73/runtime/doc/autocmd.txt 110 --- vim73.orig/runtime/doc/autocmd.txt 201 2-06-03 23:09:53.024009292+0000111 +++ vim73/runtime/doc/autocmd.txt 2012-0 6-03 23:09:55.576077206+0000120 --- vim73.orig/runtime/doc/autocmd.txt 2010-08-15 12:23:19.000000000 +0000 121 +++ vim73/runtime/doc/autocmd.txt 2012-07-20 20:31:15.250976305 +0000 112 122 @@ -299,6 +299,8 @@ 113 123 |InsertEnter| starting Insert mode … … 183 193 the autocommands, not the buffers to which they are 184 194 diff -Naur vim73.orig/runtime/doc/change.txt vim73/runtime/doc/change.txt 185 --- vim73.orig/runtime/doc/change.txt 201 2-06-03 23:09:53.016009080 +0000186 +++ vim73/runtime/doc/change.txt 2012-0 6-03 23:09:53.976034626+0000195 --- vim73.orig/runtime/doc/change.txt 2010-08-15 12:23:19.000000000 +0000 196 +++ vim73/runtime/doc/change.txt 2012-07-20 20:31:16.577643922 +0000 187 197 @@ -916,8 +916,10 @@ 188 198 {Visual}["x]Y Yank the highlighted lines [into register x] (for … … 198 208 :[range]y[ank] [x] {count} 199 209 Yank {count} lines, starting with last line number 210 @@ -1493,6 +1495,12 @@ 211 characters. Overruled by the 'M' flag. 212 1 Don't break a line after a one-letter word. It's broken before it 213 instead (if possible). 214 +j Where it makes sense, remove a comment leader when joining lines. For 215 + example, joining: 216 + int i; // the index ~ 217 + // in the list ~ 218 + Becomes: 219 + int i; // the index in the list ~ 220 221 222 With 't' and 'c' you can specify when Vim performs auto-wrapping: 200 223 diff -Naur vim73.orig/runtime/doc/cmdline.txt vim73/runtime/doc/cmdline.txt 201 --- vim73.orig/runtime/doc/cmdline.txt 201 2-06-03 23:09:53.016009080 +0000202 +++ vim73/runtime/doc/cmdline.txt 2012-0 6-03 23:09:55.820083699+0000224 --- vim73.orig/runtime/doc/cmdline.txt 2010-08-15 12:23:19.000000000 +0000 225 +++ vim73/runtime/doc/cmdline.txt 2012-07-20 20:31:16.060976885 +0000 203 226 @@ -330,12 +330,12 @@ 204 227 … … 221 244 If the numbers {first} and/or {last} are given, the respective 222 245 diff -Naur vim73.orig/runtime/doc/diff.txt vim73/runtime/doc/diff.txt 223 --- vim73.orig/runtime/doc/diff.txt 201 2-06-03 23:09:53.024009292+0000224 +++ vim73/runtime/doc/diff.txt 2012-0 6-03 23:09:55.876085191+0000246 --- vim73.orig/runtime/doc/diff.txt 2010-08-15 12:23:20.000000000 +0000 247 +++ vim73/runtime/doc/diff.txt 2012-07-20 20:31:16.204310320 +0000 225 248 @@ -178,7 +178,7 @@ 226 249 nodiff" before hiding it. … … 243 266 present in another. These lines were inserted in another file or deleted in 244 267 diff -Naur vim73.orig/runtime/doc/eval.txt vim73/runtime/doc/eval.txt 245 --- vim73.orig/runtime/doc/eval.txt 201 2-06-03 23:09:53.016009080 +0000246 +++ vim73/runtime/doc/eval.txt 2012-0 6-03 23:09:55.556076674+0000268 --- vim73.orig/runtime/doc/eval.txt 2010-08-15 12:23:20.000000000 +0000 269 +++ vim73/runtime/doc/eval.txt 2012-07-20 20:31:17.304311108 +0000 247 270 @@ -798,11 +798,12 @@ 248 271 For |Lists| only "+" is possible and then both expr6 must be a list. The … … 321 344 islocked( {expr}) Number TRUE if {expr} is locked 322 345 items( {dict}) List key-value pairs in {dict} 323 @@ -1822,7 +1837,7 @@ 346 @@ -1821,9 +1836,11 @@ 347 localtime() Number current time 324 348 log( {expr}) Float natural logarithm (base e) of {expr} 325 349 log10( {expr}) Float logarithm of Float {expr} to base 10 350 +luaeval( {expr}[, {expr}]) any evaluate |Lua| expression 326 351 map( {expr}, {string}) List/Dict change each item in {expr} to {expr} 327 352 -maparg( {name}[, {mode} [, {abbr}]]) 353 - String rhs of mapping {name} in mode {mode} 328 354 +maparg( {name}[, {mode} [, {abbr} [, {dict}]]]) 329 String rhs of mapping {name} in mode {mode} 355 + String or Dict 356 + rhs of mapping {name} in mode {mode} 330 357 mapcheck( {name}[, {mode} [, {abbr}]]) 331 358 String check for mappings matching {name} 332 @@ -1846,6 +1861,7 @@ 359 match( {expr}, {pat}[, {start}[, {count}]]) 360 @@ -1846,11 +1863,14 @@ 333 361 mzeval( {expr}) any evaluate |MzScheme| expression 334 362 nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum} … … 338 366 pow( {x}, {y}) Float {x} to the power of {y} 339 367 prevnonblank( {lnum}) Number line nr of non-blank line <= {lnum} 340 @@ -1904,7 +1920,8 @@ 368 printf( {fmt}, {expr1}...) String format text 369 pumvisible() Number whether popup menu is visible 370 +pyeval( {expr}) any evaluate |Python| expression 371 +py3eval( {expr}) any evaluate |python3| expression 372 range( {expr} [, {max} [, {stride}]]) 373 List items from {expr} to {max} 374 readfile( {fname} [, {binary} [, {max}]]) 375 @@ -1904,7 +1924,8 @@ 341 376 simplify( {filename}) String simplify filename as much as possible 342 377 sin( {expr}) Float sine of {expr} … … 348 383 spellbadword() String badly spelled word at cursor 349 384 spellsuggest( {word} [, {max} [, {capital}]]) 350 @@ -1967,6 +198 4,7 @@385 @@ -1967,6 +1988,7 @@ 351 386 winwidth( {nr}) Number width of window {nr} 352 387 writefile( {list}, {fname} [, {binary}]) … … 356 391 abs({expr}) *abs()* 357 392 Return the absolute value of {expr}. When {expr} evaluates to 358 @@ -2006,6 +202 4,13 @@393 @@ -2006,6 +2028,13 @@ 359 394 Use |insert()| to add an item at another position. 360 395 … … 370 405 When {expr} is a |List|: Append each item of the |List| as a 371 406 text line below line {lnum} in the current buffer. 372 @@ -2708,13 +273 3,15 @@407 @@ -2708,13 +2737,15 @@ 373 408 {only available when compiled with the |+float| feature} 374 409 … … 391 426 If the expansion fails, the result is an empty string. A name 392 427 for a non-existing file is not included. 393 @@ -2731,6 +27 58,7 @@428 @@ -2731,6 +2762,7 @@ 394 429 <abuf> autocmd buffer number (as a String!) 395 430 <amatch> autocmd matched name … … 399 434 <cWORD> WORD under the cursor 400 435 <client> the {clientid} of the last received 401 @@ -2767,10 +279 5,10 @@436 @@ -2767,10 +2799,10 @@ 402 437 When {expr} does not start with '%', '#' or '<', it is 403 438 expanded like a file name is expanded on the command line. … … 414 449 < 415 450 Expand() can also be used to expand variables and environment 416 @@ -3414,17 +344 2,23 @@451 @@ -3414,17 +3446,23 @@ 417 452 :let list_is_on = getwinvar(2, '&list') 418 453 :echo "myvar = " . getwinvar(1, 'myvar') … … 444 479 445 480 For most systems backticks can be used to get files names from 446 @@ -3759,6 +379 3,11 @@481 @@ -3759,6 +3797,11 @@ 447 482 Note that when {item} is a |List| it is inserted as a single 448 483 item. Use |extend()| to concatenate |Lists|. … … 456 491 The result is a Number, which is non-zero when a directory 457 492 with the name {directory} exists. If {directory} doesn't 458 @@ -3966,23 +4005,51 @@ 493 @@ -3941,6 +3984,20 @@ 494 < -2.0 495 {only available when compiled with the |+float| feature} 496 497 +luaeval({expr}[, {expr}]) *luaeval()* 498 + Evaluate Lua expression {expr} and return its result converted 499 + to Vim data structures. Second {expr} may hold additional 500 + argument accessible as _A inside first {expr}. 501 + Strings are returned as they are. 502 + Boolean objects are converted to numbers. 503 + Numbers are converted to |Float| values if vim was compiled 504 + with |+float| and to numbers otherwise. 505 + Dictionaries and lists obtained by vim.eval() are returned 506 + as-is. 507 + Other objects are returned as zero without any errors. 508 + See |lua-luaeval| for more details. 509 + {only available when compiled with the |+lua| feature} 510 + 511 map({expr}, {string}) *map()* 512 {expr} must be a |List| or a |Dictionary|. 513 Replace each item in {expr} with the result of evaluating 514 @@ -3966,23 +4023,51 @@ 459 515 further items in {expr} are processed. 460 516 … … 515 571 then the global mappings. 516 572 This function can be used to map a key even when it's already 517 @@ -4295,6 +43 62,13 @@573 @@ -4295,6 +4380,13 @@ 518 574 call setpos('.', save_cursor) 519 575 < Also see |setpos()|. … … 529 585 Shorten directory names in the path {expr} and return the 530 586 result. The tail, the file name, is kept as-is. The other 531 @@ -5228,7 +5302,7 @@ 587 @@ -4500,6 +4592,29 @@ 588 This can be used to avoid some things that would remove the 589 popup menu. 590 591 + *E860* *E861* 592 +py3eval({expr}) *py3eval()* 593 + Evaluate Python expression {expr} and return its result 594 + converted to Vim data structures. 595 + Numbers and strings are returned as they are (strings are 596 + copied though, unicode strings are additionally converted to 597 + 'encoding'). 598 + Lists are represented as Vim |List| type. 599 + Dictionaries are represented as Vim |Dictionary| type with 600 + keys converted to strings. 601 + {only available when compiled with the |+python3| feature} 602 + 603 + *E858* *E859* 604 +pyeval({expr}) *pyeval()* 605 + Evaluate Python expression {expr} and return its result 606 + converted to Vim data structures. 607 + Numbers and strings are returned as they are (strings are 608 + copied though). 609 + Lists are represented as Vim |List| type. 610 + Dictionaries are represented as Vim |Dictionary| type with 611 + keys converted to strings. 612 + {only available when compiled with the |+python| feature} 613 + 614 *E726* *E727* 615 range({expr} [, {max} [, {stride}]]) *range()* 616 Returns a |List| with Numbers: 617 @@ -4733,6 +4848,10 @@ 618 Search for regexp pattern {pattern}. The search starts at the 619 cursor position (you can use |cursor()| to set it). 620 621 + If there is no match a 0 is returned and the cursor doesn't 622 + move. No error message is given. 623 + When a match has been found its line number is returned. 624 + 625 {flags} is a String, which can contain these character flags: 626 'b' search backward instead of forward 627 'c' accept a match at the cursor position 628 @@ -5228,7 +5347,7 @@ 532 629 {only available when compiled with the |+float| feature} 533 630 … … 538 635 want a list to remain unmodified make a copy first: > 539 636 :let sortedlist = sort(copy(mylist)) 540 @@ -5236,6 +53 10,8 @@637 @@ -5236,6 +5355,8 @@ 541 638 Numbers sort after Strings, |Lists| after Numbers. 542 639 For sorting text in the current buffer use |:sort|. … … 547 644 is called to compare items. The function is invoked with two 548 645 items as argument and must return zero if they are equal, 1 or 549 @@ -6056,7 +61 32,15 @@646 @@ -6056,7 +6177,15 @@ 550 647 To copy a file byte for byte: > 551 648 :let fl = readfile("foo", "b") … … 566 663 diff -Naur vim73.orig/runtime/doc/eval.txt.orig vim73/runtime/doc/eval.txt.orig 567 664 --- vim73.orig/runtime/doc/eval.txt.orig 1970-01-01 00:00:00.000000000 +0000 568 +++ vim73/runtime/doc/eval.txt.orig 2012-0 6-03 23:09:54.176039949+0000665 +++ vim73/runtime/doc/eval.txt.orig 2012-07-20 20:31:11.084306643 +0000 569 666 @@ -0,0 +1,8362 @@ 570 667 +*eval.txt* For Vim version 7.3. Last change: 2010 Aug 15 … … 8931 9028 + vim:tw=78:ts=8:ft=help:norl: 8932 9029 diff -Naur vim73.orig/runtime/doc/if_cscop.txt vim73/runtime/doc/if_cscop.txt 8933 --- vim73.orig/runtime/doc/if_cscop.txt 201 2-06-03 23:09:53.020009186+00008934 +++ vim73/runtime/doc/if_cscop.txt 2012-0 6-03 23:09:54.252041972+00009030 --- vim73.orig/runtime/doc/if_cscop.txt 2010-08-15 12:23:20.000000000 +0000 9031 +++ vim73/runtime/doc/if_cscop.txt 2012-07-20 20:31:11.324306815 +0000 8935 9032 @@ -272,6 +272,15 @@ 8936 9033 :set cst … … 9444 9541 + vim:tw=78:ts=8:ft=help:norl: 9445 9542 diff -Naur vim73.orig/runtime/doc/if_lua.txt vim73/runtime/doc/if_lua.txt 9446 --- vim73.orig/runtime/doc/if_lua.txt 201 2-06-03 23:09:53.020009186+00009447 +++ vim73/runtime/doc/if_lua.txt 2012-0 6-03 23:09:55.696080401+00009543 --- vim73.orig/runtime/doc/if_lua.txt 2010-08-15 12:23:20.000000000 +0000 9544 +++ vim73/runtime/doc/if_lua.txt 2012-07-20 20:31:15.670976605 +0000 9448 9545 @@ -1,4 +1,4 @@ 9449 9546 -*if_lua.txt* For Vim version 7.3. Last change: 2010 Jul 22 … … 9643 9740 +============================================================================== 9644 9741 + vim:tw=78:ts=8:noet:ft=help:norl: 9742 diff -Naur vim73.orig/runtime/doc/if_pyth.txt vim73/runtime/doc/if_pyth.txt 9743 --- vim73.orig/runtime/doc/if_pyth.txt 2010-08-15 12:23:20.000000000 +0000 9744 +++ vim73/runtime/doc/if_pyth.txt 2012-07-20 20:31:17.307644444 +0000 9745 @@ -1,4 +1,4 @@ 9746 -*if_pyth.txt* For Vim version 7.3. Last change: 2010 Aug 13 9747 +*if_pyth.txt* For Vim version 7.3. Last change: 2012 Feb 04 9748 9749 9750 VIM REFERENCE MANUAL by Paul Moore 9751 @@ -6,13 +6,14 @@ 9752 9753 The Python Interface to Vim *python* *Python* 9754 9755 -1. Commands |python-commands| 9756 -2. The vim module |python-vim| 9757 -3. Buffer objects |python-buffer| 9758 -4. Range objects |python-range| 9759 -5. Window objects |python-window| 9760 -6. Dynamic loading |python-dynamic| 9761 -7. Python 3 |python3| 9762 +1. Commands |python-commands| 9763 +2. The vim module |python-vim| 9764 +3. Buffer objects |python-buffer| 9765 +4. Range objects |python-range| 9766 +5. Window objects |python-window| 9767 +6. pyeval(), py3eval() Vim functions |python-pyeval| 9768 +7. Dynamic loading |python-dynamic| 9769 +8. Python 3 |python3| 9770 9771 {Vi does not have any of these commands} 9772 9773 @@ -150,6 +151,22 @@ 9774 [{'cmd': '/^eval_expr(arg, nextcmd)$/', 'static': 0, 'name': 9775 'eval_expr', 'kind': 'f', 'filename': './src/eval.c'}] 9776 9777 +vim.bindeval(str) *python-bindeval* 9778 + Like |python-eval|, but 9779 + 1. if expression evaluates to |List| or |Dictionary| it is returned as 9780 + vimlist or vimdictionary python type that are connected to original 9781 + list or dictionary. Thus modifications to these objects imply 9782 + modifications of the original. 9783 + 2. if expression evaluates to a function reference, then it returns 9784 + callable vimfunction object. Use self keyword argument to assign 9785 + |self| object for dictionary functions. 9786 + 9787 + Note: this function has the same behavior as |lua-eval| (except that 9788 + lua does not support running vim functions), |python-eval| is 9789 + kept for backwards compatibility in order not to make scripts 9790 + relying on outputs of vim.eval() being a copy of original or 9791 + vim.eval("1") returning a string. 9792 + 9793 9794 9795 Error object of the "vim" module 9796 @@ -222,8 +239,9 @@ 9797 - from indexing vim.buffers (|python-buffers|) 9798 - from the "buffer" attribute of a window (|python-window|) 9799 9800 -Buffer objects have one read-only attribute - name - the full file name for 9801 -the buffer. They also have three methods (append, mark, and range; see below). 9802 +Buffer objects have two read-only attributes - name - the full file name for 9803 +the buffer, and number - the buffer number. They also have three methods 9804 +(append, mark, and range; see below). 9805 9806 You can also treat buffer objects as sequence objects. In this context, they 9807 act as if they were lists (yes, they are mutable) of strings, with each 9808 @@ -318,7 +336,13 @@ 9809 The width attribute is writable only if the screen is split vertically. 9810 9811 ============================================================================== 9812 -6. Dynamic loading *python-dynamic* 9813 +6. pyeval() and py3eval() Vim functions *python-pyeval* 9814 + 9815 +To facilitate bi-directional interface, you can use |pyeval()| and |py3eval()| 9816 +functions to evaluate Python expressions and pass their values to VimL. 9817 + 9818 +============================================================================== 9819 +7. Dynamic loading *python-dynamic* 9820 9821 On MS-Windows the Python library can be loaded dynamically. The |:version| 9822 output then includes |+python/dyn|. 9823 @@ -335,13 +359,14 @@ 9824 sure edit "gvim.exe" and search for "python\d*.dll\c". 9825 9826 ============================================================================== 9827 -7. Python 3 *python3* 9828 +8. Python 3 *python3* 9829 9830 *:py3* *:python3* 9831 The |:py3| and |:python3| commands work similar to |:python|. 9832 *:py3file* 9833 The |:py3file| command works similar to |:pyfile|. 9834 9835 + 9836 Vim can be built in four ways (:version output): 9837 1. No Python support (-python, -python3) 9838 2. Python 2 support only (+python or +python/dyn, -python3) 9839 @@ -355,7 +380,7 @@ 9840 When doing this on Linux/Unix systems and importing global symbols, this leads 9841 to a crash when the second Python version is used. So either global symbols 9842 are loaded but only one Python version is activated, or no global symbols are 9843 -loaded. The latter makes Python's "import" fail on libaries that expect the 9844 +loaded. The latter makes Python's "import" fail on libraries that expect the 9845 symbols to be provided by Vim. 9846 *E836* *E837* 9847 Vim's configuration script makes a guess for all libraries based on one 9848 @@ -377,6 +402,18 @@ 9849 3. You undefine PY_NO_RTLD_GLOBAL in auto/config.h after configuration. This 9850 may crash Vim though. 9851 9852 + *has-python* 9853 +You can test what Python version is available with: > 9854 + if has('python') 9855 + echo 'there is Python 2.x' 9856 + elseif has('python3') 9857 + echo 'there is Python 3.x' 9858 + endif 9859 + 9860 +Note however, that when Python 2 and 3 are both available and loaded 9861 +dynamically, these has() calls will try to load them. If only one can be 9862 +loaded at a time, just checking if Python 2 or 3 are available will prevent 9863 +the other one from being available. 9864 9865 ============================================================================== 9866 vim:tw=78:ts=8:ft=help:norl: 9645 9867 diff -Naur vim73.orig/runtime/doc/indent.txt vim73/runtime/doc/indent.txt 9646 --- vim73.orig/runtime/doc/indent.txt 201 2-06-03 23:09:53.024009292+00009647 +++ vim73/runtime/doc/indent.txt 2012-0 6-03 23:09:55.712080826+00009868 --- vim73.orig/runtime/doc/indent.txt 2010-08-15 12:23:20.000000000 +0000 9869 +++ vim73/runtime/doc/indent.txt 2012-07-20 20:31:15.707643298 +0000 9648 9870 @@ -128,13 +128,20 @@ 9649 9871 used CTRL-T or CTRL-D. … … 10787 11009 + vim:tw=78:ts=8:ft=help:norl: 10788 11010 diff -Naur vim73.orig/runtime/doc/map.txt vim73/runtime/doc/map.txt 10789 --- vim73.orig/runtime/doc/map.txt 201 2-06-03 23:09:53.020009186+000010790 +++ vim73/runtime/doc/map.txt 2012-0 6-03 23:09:55.820083699+000011011 --- vim73.orig/runtime/doc/map.txt 2010-08-15 12:23:21.000000000 +0000 11012 +++ vim73/runtime/doc/map.txt 2012-07-20 20:31:16.060976885 +0000 10791 11013 @@ -226,7 +226,7 @@ 10792 11014 … … 10828 11050 -complete=tag_listfiles tags, file names are shown when CTRL-D is hit 10829 11051 diff -Naur vim73.orig/runtime/doc/motion.txt vim73/runtime/doc/motion.txt 10830 --- vim73.orig/runtime/doc/motion.txt 201 2-06-03 23:09:53.020009186+000010831 +++ vim73/runtime/doc/motion.txt 2012-0 6-03 23:09:54.380045379+000011052 --- vim73.orig/runtime/doc/motion.txt 2010-08-15 12:23:21.000000000 +0000 11053 +++ vim73/runtime/doc/motion.txt 2012-07-20 20:31:11.687640410 +0000 10832 11054 @@ -269,11 +269,11 @@ 10833 11055 {char} can be entered like with the |f| command. … … 10845 11067 3. Up-down motions *up-down-motions* 10846 11068 diff -Naur vim73.orig/runtime/doc/netbeans.txt vim73/runtime/doc/netbeans.txt 10847 --- vim73.orig/runtime/doc/netbeans.txt 201 2-06-03 23:09:53.016009080 +000010848 +++ vim73/runtime/doc/netbeans.txt 2012-0 6-03 23:09:54.892059004 +000011069 --- vim73.orig/runtime/doc/netbeans.txt 2010-08-15 12:23:21.000000000 +0000 11070 +++ vim73/runtime/doc/netbeans.txt 2012-07-20 20:31:13.184308154 +0000 10849 11071 @@ -1,4 +1,4 @@ 10850 11072 -*netbeans.txt* For Vim version 7.3. Last change: 2010 Jul 20 … … 10908 11130 ============================================================================== 10909 11131 diff -Naur vim73.orig/runtime/doc/options.txt vim73/runtime/doc/options.txt 10910 --- vim73.orig/runtime/doc/options.txt 201 2-06-03 23:09:53.020009186+000010911 +++ vim73/runtime/doc/options.txt 2012-0 6-03 23:09:55.460074120+000011132 --- vim73.orig/runtime/doc/options.txt 2010-08-15 12:23:21.000000000 +0000 11133 +++ vim73/runtime/doc/options.txt 2012-07-20 20:31:18.044311638 +0000 10912 11134 @@ -150,6 +150,18 @@ 10913 11135 (the ^[ is a real <Esc> here, use CTRL-V <Esc> to enter it) … … 10929 11151 security reasons. 10930 11152 10931 @@ -1434,6 +1446,15 @@ 11153 @@ -1425,6 +1437,7 @@ 11154 This option is a list of comma separated names. 11155 These names are recognized: 11156 11157 + *clipboard-unnamed* 11158 unnamed When included, Vim will use the clipboard register '*' 11159 for all yank, delete, change and put operations which 11160 would normally go to the unnamed register. When a 11161 @@ -1434,6 +1447,17 @@ 10932 11162 explicitly accessed using the "* notation. Also see 10933 11163 |gui-clipboard|. 10934 11164 11165 + *clipboard-unnamedplus* 10935 11166 + unnamedplus A variant of "unnamed" flag which uses the clipboard 10936 11167 + register '+' (|quoteplus|) instead of register '*' for … … 10938 11169 + into register '+' and also into '*' when "unnamed" is 10939 11170 + included. 10940 + Only available with the |+ x11| feature.11171 + Only available with the |+X11| feature. 10941 11172 + Availability can be checked with: > 10942 11173 + if has('unnamedplus') 10943 11174 +< 11175 + *clipboard-autoselect* 10944 11176 autoselect Works like the 'a' flag in 'guioptions': If present, 10945 11177 then whenever Visual mode is started, or the Visual 10946 11178 area extended, Vim tries to become the owner of the 10947 @@ -2069,6 +2090,12 @@ 11179 @@ -1445,9 +1469,16 @@ 11180 "autoselect" flag is used. 11181 Also applies to the modeless selection. 11182 11183 + *clipboard-autoselectplus* 11184 + autoselectplus Like "autoselect" but using the + register instead of 11185 + the * register. Compare to the 'P' flag in 11186 + 'guioptions'. 11187 + 11188 + *clipboard-autoselectml* 11189 autoselectml Like "autoselect", but for the modeless selection 11190 only. Compare to the 'A' flag in 'guioptions'. 11191 11192 + *clipboard-html* 11193 html When the clipboard contains HTML, use this when 11194 pasting. When putting text on the clipboard, mark it 11195 as HTML. This works to copy rendered HTML from 11196 @@ -1458,6 +1489,7 @@ 11197 Only supported for GTK version 2 and later. 11198 Only available with the |+multi_byte| feature. 11199 11200 + *clipboard-exclude* 11201 exclude:{pattern} 11202 Defines a pattern that is matched against the name of 11203 the terminal 'term'. If there is a match, no 11204 @@ -2069,6 +2101,12 @@ 10948 11205 *cpo->* 10949 11206 > When appending to a register, put a line break before … … 10958 11215 POSIX flags. These are not included in the Vi default value, except 10959 11216 when $VIM_POSIX was set on startup. |posix| 10960 @@ -2161,6 +21 88,16 @@11217 @@ -2161,6 +2199,16 @@ 10961 11218 Specifies whether to use quickfix window to show cscope results. 10962 11219 See |cscopequickfix|. … … 10975 11232 'cscopetag' 'cst' boolean (default off) 10976 11233 global 10977 @@ -5843,16 +5880,21 @@ 11234 @@ -3510,6 +3558,9 @@ 11235 windowing system's global selection unless explicitly told to 11236 by a yank or delete operation for the "* register. 11237 The same applies to the modeless selection. 11238 + *'go-P'* 11239 + 'P' Like autoselect but using the "+ register instead of the "* 11240 + register. 11241 *'go-A'* 11242 'A' Autoselect for the modeless selection. Like 'a', but only 11243 applies to the modeless selection. 11244 @@ -5843,16 +5894,21 @@ 10978 11245 security reasons. 10979 11246 … … 11001 11268 security reasons. 11002 11269 11003 @@ -5873,9 +59 15,10 @@11270 @@ -5873,9 +5929,10 @@ 11004 11271 For Unix the default it "| tee". The stdout of the compiler is saved 11005 11272 in a file and echoed to the screen. If the 'shell' option is "csh" or … … 11015 11282 and the other initializations, so that when the 'shell' option is set 11016 11283 there, the 'shellpipe' option changes automatically, unless it was 11017 @@ -5980,6 +60 23,7 @@11284 @@ -5980,6 +6037,7 @@ 11018 11285 11019 11286 *'shellxquote'* *'sxq'* … … 11023 11290 somewhere: "\"" 11024 11291 for Unix, when using system(): "\"") 11025 @@ -5989,14 +60 33,28 @@11292 @@ -5989,14 +6047,28 @@ 11026 11293 the "!" and ":!" commands. Includes the redirection. See 11027 11294 'shellquote' to exclude the redirection. It's probably not useful … … 11057 11324 'shiftround' 'sr' boolean (default off) 11058 11325 global 11059 @@ -7530,8 +7 588,9 @@11326 @@ -7530,8 +7602,9 @@ 11060 11327 ! When included, save and restore global variables that start 11061 11328 with an uppercase letter, and don't contain a lowercase … … 11069 11336 the '<' item, with the disadvantage that you need to put a 11070 11337 backslash before the ", otherwise it will be recognized as the 11071 @@ -7747,6 +78 06,17 @@11338 @@ -7747,6 +7820,17 @@ 11072 11339 a pattern from the list. This avoids problems when a future version 11073 11340 uses another default. … … 11089 11356 diff -Naur vim73.orig/runtime/doc/options.txt.orig vim73/runtime/doc/options.txt.orig 11090 11357 --- vim73.orig/runtime/doc/options.txt.orig 1970-01-01 00:00:00.000000000 +0000 11091 +++ vim73/runtime/doc/options.txt.orig 2012-0 6-03 23:09:53.792029731+000011358 +++ vim73/runtime/doc/options.txt.orig 2012-07-20 20:31:09.814305726 +0000 11092 11359 @@ -0,0 +1,8079 @@ 11093 11360 +*options.txt* For Vim version 7.3. Last change: 2010 Aug 15 … … 19172 19439 + vim:tw=78:ts=8:ft=help:norl: 19173 19440 diff -Naur vim73.orig/runtime/doc/os_risc.txt vim73/runtime/doc/os_risc.txt 19174 --- vim73.orig/runtime/doc/os_risc.txt 201 2-06-03 23:09:53.024009292+000019175 +++ vim73/runtime/doc/os_risc.txt 2012-0 6-03 23:09:54.112038245+000019441 --- vim73.orig/runtime/doc/os_risc.txt 2010-08-15 12:23:21.000000000 +0000 19442 +++ vim73/runtime/doc/os_risc.txt 2012-07-20 20:31:10.844306469 +0000 19176 19443 @@ -1,322 +1,12 @@ 19177 19444 -*os_risc.txt* For Vim version 7.3. Last change: 2010 Aug 07 … … 19501 19768 vim:tw=78:ts=8:ft=help:norl: 19502 19769 diff -Naur vim73.orig/runtime/doc/os_win32.txt vim73/runtime/doc/os_win32.txt 19503 --- vim73.orig/runtime/doc/os_win32.txt 201 2-06-03 23:09:53.016009080 +000019504 +++ vim73/runtime/doc/os_win32.txt 2012-0 6-03 23:09:54.368045058 +000019770 --- vim73.orig/runtime/doc/os_win32.txt 2010-08-15 12:23:21.000000000 +0000 19771 +++ vim73/runtime/doc/os_win32.txt 2012-07-20 20:31:11.650973718 +0000 19505 19772 @@ -313,6 +313,37 @@ 19506 19773 with :!start do not get passed Vim's open file handles, which means they do … … 19542 19809 Vim doesn't wait for it to finish! Help! 19543 19810 diff -Naur vim73.orig/runtime/doc/pattern.txt vim73/runtime/doc/pattern.txt 19544 --- vim73.orig/runtime/doc/pattern.txt 201 2-06-03 23:09:53.020009186+000019545 +++ vim73/runtime/doc/pattern.txt 2012-0 6-03 23:09:54.508048784+000019811 --- vim73.orig/runtime/doc/pattern.txt 2010-08-15 12:23:21.000000000 +0000 19812 +++ vim73/runtime/doc/pattern.txt 2012-07-20 20:31:12.107640712 +0000 19546 19813 @@ -1027,11 +1027,9 @@ 19547 19814 These items only work for 8-bit characters. … … 19558 19825 - A collation element. This currently simply accepts a single 19559 19826 character in the form: 19827 diff -Naur vim73.orig/runtime/doc/sign.txt vim73/runtime/doc/sign.txt 19828 --- vim73.orig/runtime/doc/sign.txt 2010-08-15 12:23:22.000000000 +0000 19829 +++ vim73/runtime/doc/sign.txt 2012-07-20 20:31:18.004311609 +0000 19830 @@ -150,8 +150,14 @@ 19831 Remove the previously placed sign {id} from file {fname}. 19832 See remark above about {fname} |:sign-fname|. 19833 19834 +:sign unplace * file={fname} 19835 + Remove all placed signs in file {fname}. 19836 + 19837 :sign unplace {id} buffer={nr} 19838 - Same, but use buffer {nr}. 19839 + Remove the previously placed sign {id} from buffer {nr}. 19840 + 19841 +:sign unplace * buffer={nr} 19842 + Remove all placed signs in buffer {nr}. 19843 19844 :sign unplace {id} 19845 Remove the previously placed sign {id} from all files it 19846 diff -Naur vim73.orig/runtime/doc/tabpage.txt vim73/runtime/doc/tabpage.txt 19847 --- vim73.orig/runtime/doc/tabpage.txt 2010-08-15 12:23:22.000000000 +0000 19848 +++ vim73/runtime/doc/tabpage.txt 2012-07-20 20:31:17.920978216 +0000 19849 @@ -173,10 +173,20 @@ 19850 REORDERING TAB PAGES: 19851 19852 :tabm[ove] [N] *:tabm* *:tabmove* 19853 +:[N]tabm[ove] 19854 Move the current tab page to after tab page N. Use zero to 19855 make the current tab page the first one. Without N the tab 19856 page is made the last one. 19857 19858 +:tabm[ove] +[N] 19859 +:tabm[ove] -[N] 19860 + Move the current tab page N places to the right (with +) or to 19861 + the left (with -). 19862 + 19863 +Note that although it is possible to move a tab behind the N-th one by using 19864 +:Ntabmove, it is impossible to move it by N places by using :+Ntabmove. For 19865 +clarification what +N means in this context see |[range]|. 19866 + 19867 19868 LOOPING OVER TAB PAGES: 19869 19560 19870 diff -Naur vim73.orig/runtime/filetype.vim vim73/runtime/filetype.vim 19561 --- vim73.orig/runtime/filetype.vim 201 2-06-03 23:09:52.976008014+000019562 +++ vim73/runtime/filetype.vim 2012-0 6-03 23:09:55.356071352+000019871 --- vim73.orig/runtime/filetype.vim 2010-08-03 20:44:00.000000000 +0000 19872 +++ vim73/runtime/filetype.vim 2012-07-20 20:31:14.564309144 +0000 19563 19873 @@ -2475,17 +2475,19 @@ 19564 19874 " detected filetypes. … … 22103 22413 +unlet s:cpo_save 22104 22414 diff -Naur vim73.orig/runtime/ftplugof.vim vim73/runtime/ftplugof.vim 22105 --- vim73.orig/runtime/ftplugof.vim 201 2-06-03 23:09:53.028009398+000022106 +++ vim73/runtime/ftplugof.vim 2012-0 6-03 23:09:54.868058365+000022415 --- vim73.orig/runtime/ftplugof.vim 2010-05-15 11:03:57.000000000 +0000 22416 +++ vim73/runtime/ftplugof.vim 2012-07-20 20:31:13.030974711 +0000 22107 22417 @@ -1,11 +1,13 @@ 22108 22418 " Vim support file to switch off loading plugins for file types … … 22124 22434 diff -Naur vim73.orig/src/GvimExt/Make_cyg.mak vim73/src/GvimExt/Make_cyg.mak 22125 22435 --- vim73.orig/src/GvimExt/Make_cyg.mak 1970-01-01 00:00:00.000000000 +0000 22126 +++ vim73/src/GvimExt/Make_cyg.mak 2012-0 6-03 23:09:54.804056662+000022436 +++ vim73/src/GvimExt/Make_cyg.mak 2012-07-20 20:31:12.867641259 +0000 22127 22437 @@ -0,0 +1,77 @@ 22128 22438 +# Project: gvimext … … 22204 22514 + -$(DEL) $(OBJ) $(RES) $(DLL) 22205 22515 diff -Naur vim73.orig/src/GvimExt/Make_ming.mak vim73/src/GvimExt/Make_ming.mak 22206 --- vim73.orig/src/GvimExt/Make_ming.mak 201 2-06-03 23:09:52.944007163+000022207 +++ vim73/src/GvimExt/Make_ming.mak 2012-0 6-03 23:09:54.804056662+000022516 --- vim73.orig/src/GvimExt/Make_ming.mak 2010-05-15 11:04:10.000000000 +0000 22517 +++ vim73/src/GvimExt/Make_ming.mak 2012-07-20 20:31:12.867641259 +0000 22208 22518 @@ -1,6 +1,6 @@ 22209 22519 # Project: gvimext … … 22273 22583 - 22274 22584 diff -Naur vim73.orig/src/GvimExt/gvimext.cpp vim73/src/GvimExt/gvimext.cpp 22275 --- vim73.orig/src/GvimExt/gvimext.cpp 201 2-06-03 23:09:52.944007163+000022276 +++ vim73/src/GvimExt/gvimext.cpp 2012-0 6-03 23:09:54.580050701+000022585 --- vim73.orig/src/GvimExt/gvimext.cpp 2010-07-10 17:21:34.000000000 +0000 22586 +++ vim73/src/GvimExt/gvimext.cpp 2012-07-20 20:31:12.297640849 +0000 22277 22587 @@ -142,6 +142,7 @@ 22278 22588 static int dyn_libintl_init(char *dir); … … 22359 22669 &pi) // Pointer to PROCESS_INFORMATION structure. 22360 22670 diff -Naur vim73.orig/src/GvimExt/gvimext.def vim73/src/GvimExt/gvimext.def 22361 --- vim73.orig/src/GvimExt/gvimext.def 201 2-06-03 23:09:52.944007163+000022362 +++ vim73/src/GvimExt/gvimext.def 2012-0 6-03 23:09:54.328043994+000022671 --- vim73.orig/src/GvimExt/gvimext.def 2010-05-15 11:04:10.000000000 +0000 22672 +++ vim73/src/GvimExt/gvimext.def 2012-07-20 20:31:11.500973609 +0000 22363 22673 @@ -1,7 +1,7 @@ 22364 22674 ;gvimdef.def : Declares the module parameters for the DLL. … … 22371 22681 DllCanUnloadNow private 22372 22682 diff -Naur vim73.orig/src/GvimExt/gvimext_ming.def vim73/src/GvimExt/gvimext_ming.def 22373 --- vim73.orig/src/GvimExt/gvimext_ming.def 201 2-06-03 23:09:52.944007163+000022374 +++ vim73/src/GvimExt/gvimext_ming.def 2012-0 6-03 23:09:54.328043994+000022683 --- vim73.orig/src/GvimExt/gvimext_ming.def 2010-05-15 11:04:10.000000000 +0000 22684 +++ vim73/src/GvimExt/gvimext_ming.def 2012-07-20 20:31:11.500973609 +0000 22375 22685 @@ -3,7 +3,7 @@ 22376 22686 ;Hence this is the same file as gvimext.def with private removed … … 22383 22693 DllCanUnloadNow = DllCanUnloadNow@0 22384 22694 diff -Naur vim73.orig/src/INSTALL vim73/src/INSTALL 22385 --- vim73.orig/src/INSTALL 201 2-06-03 23:09:52.940007057+000022386 +++ vim73/src/INSTALL 2012-0 6-03 23:09:54.124038565+000022695 --- vim73.orig/src/INSTALL 2010-06-26 04:04:51.000000000 +0000 22696 +++ vim73/src/INSTALL 2012-07-20 20:31:10.884306499 +0000 22387 22697 @@ -6,9 +6,8 @@ 22388 22698 Contents: … … 22434 22744 [NOTE: this is quite old, it might not work anymore] 22435 22745 diff -Naur vim73.orig/src/INSTALLpc.txt vim73/src/INSTALLpc.txt 22436 --- vim73.orig/src/INSTALLpc.txt 201 2-06-03 23:09:52.948007269+000022437 +++ vim73/src/INSTALLpc.txt 2012-0 6-03 23:09:55.528075930+000022746 --- vim73.orig/src/INSTALLpc.txt 2010-05-24 12:58:06.000000000 +0000 22747 +++ vim73/src/INSTALLpc.txt 2012-07-20 20:31:15.140976226 +0000 22438 22748 @@ -11,9 +11,9 @@ 22439 22749 this, then you will get the default behavior as is documented, which should … … 22548 22858 +Happy Vimming! 22549 22859 diff -Naur vim73.orig/src/Make_cyg.mak vim73/src/Make_cyg.mak 22550 --- vim73.orig/src/Make_cyg.mak 201 2-06-03 23:09:52.920006524+000022551 +++ vim73/src/Make_cyg.mak 2012-0 6-03 23:09:54.804056662+000022860 --- vim73.orig/src/Make_cyg.mak 2010-08-02 19:09:22.000000000 +0000 22861 +++ vim73/src/Make_cyg.mak 2012-07-20 20:31:17.854311501 +0000 22552 22862 @@ -1,6 +1,6 @@ 22553 22863 # 22554 22864 # Makefile for VIM on Win32, using Cygnus gcc 22555 22865 -# Last updated by Dan Sharp. Last Change: 2010 Feb 24 22556 +# Last updated by Dan Sharp. Last Change: 201 0 Nov 0322866 +# Last updated by Dan Sharp. Last Change: 2012 Jun 30 22557 22867 # 22558 22868 # Also read INSTALLpc.txt! … … 22566 22876 # LUA_VER define to version of Lua being used (51) 22567 22877 # DYNAMIC_LUA no or yes: use yes to load the Lua DLL dynamically (yes) 22878 @@ -47,7 +48,7 @@ 22879 # -L/lib/w32api to EXTRA_LIBS. 22880 # POSTSCRIPT no or yes: set to yes for PostScript printing (no) 22881 # FEATURES TINY, SMALL, NORMAL, BIG or HUGE (BIG) 22882 -# WINVER Lowest Win32 version to support. (0x0400) 22883 +# WINVER Lowest Win32 version to support. (0x0500) 22884 # CSCOPE no or yes: to include cscope interface support (yes) 22885 # OPTIMIZE SPACE, SPEED, or MAXSPEED: set optimization level (MAXSPEED) 22886 # NETBEANS no or yes: to include netbeans interface support (yes when GUI 22887 @@ -84,7 +85,7 @@ 22888 endif 22889 22890 ifndef WINVER 22891 -WINVER = 0x0400 22892 +WINVER = 0x0500 22893 endif 22894 22895 ifndef CSCOPE 22568 22896 @@ -254,16 +255,22 @@ 22569 22897 MZSCHEME_GENERATE_BASE=no … … 22611 22939 -$(DEL) obj$(DIRSLASH)*.o 22612 22940 diff -Naur vim73.orig/src/Make_ming.mak vim73/src/Make_ming.mak 22613 --- vim73.orig/src/Make_ming.mak 201 2-06-03 23:09:52.944007163+000022614 +++ vim73/src/Make_ming.mak 2012-0 6-03 23:09:55.744081677+000022941 --- vim73.orig/src/Make_ming.mak 2010-08-02 19:09:43.000000000 +0000 22942 +++ vim73/src/Make_ming.mak 2012-07-20 20:31:17.854311501 +0000 22615 22943 @@ -14,9 +14,11 @@ 22616 22944 # it's just run out of memory or something. Run again, and it will continue … … 22631 22959 OLE=no 22632 22960 # Set the default $(WINVER) to make it work with pre-Win2k 22961 -WINVER = 0x0400 22633 22962 +ifndef WINVER 22634 WINVER = 0x040022963 +WINVER = 0x0500 22635 22964 +endif 22636 22965 # Set to yes to enable Cscope support … … 22778 23107 $(OUTDIR)/netbeans.o: netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC) 22779 23108 diff -Naur vim73.orig/src/Make_mvc.mak vim73/src/Make_mvc.mak 22780 --- vim73.orig/src/Make_mvc.mak 201 2-06-03 23:09:52.924006631+000022781 +++ vim73/src/Make_mvc.mak 2012-0 6-03 23:09:55.492074972 +000023109 --- vim73.orig/src/Make_mvc.mak 2010-07-18 19:24:20.000000000 +0000 23110 +++ vim73/src/Make_mvc.mak 2012-07-20 20:31:14.987642782 +0000 22782 23111 @@ -380,9 +380,6 @@ 22783 23112 !if "$(_NMAKE_VER)" == "10.00.30319.01" … … 22901 23230 22902 23231 diff -Naur vim73.orig/src/Make_ro.mak vim73/src/Make_ro.mak 22903 --- vim73.orig/src/Make_ro.mak 201 2-06-03 23:09:52.940007057+000023232 --- vim73.orig/src/Make_ro.mak 2010-05-15 11:04:08.000000000 +0000 22904 23233 +++ vim73/src/Make_ro.mak 1970-01-01 00:00:00.000000000 +0000 22905 23234 @@ -1,135 +0,0 @@ … … 23040 23369 -o.window: c.window 23041 23370 diff -Naur vim73.orig/src/Makefile vim73/src/Makefile 23042 --- vim73.orig/src/Makefile 201 2-06-03 23:09:52.956007482+000023043 +++ vim73/src/Makefile 2012-0 6-03 23:09:55.668079655+000023371 --- vim73.orig/src/Makefile 2010-08-15 12:56:15.000000000 +0000 23372 +++ vim73/src/Makefile 2012-07-20 20:31:17.217644379 +0000 23044 23373 @@ -29,7 +29,7 @@ 23045 23374 # - Uncomment the line "CONF_OPT_X = --without-x" if you have X11 but … … 23147 23476 #CC= gcc -D_POSIX_SOURCE 23148 23477 #CFLAGS= -O2 23149 @@ -1047,8 +1052,9 @@ 23478 @@ -870,6 +875,10 @@ 23479 #CFLAGS = -O -Qtarget=m88110compat 23480 #EXTRA_LIBS = -lgen 23481 23482 +# The value of QUOTESED comes from auto/config.mk. 23483 +# Uncomment the next line to use the default value. 23484 +# QUOTESED = sed -e 's/[\\"]/\\&/g' -e 's/\\"/"/' -e 's/\\";$$/";/' 23485 + 23486 ##################### end of system specific lines ################### }}} 23487 23488 ### Names of the programs and targets {{{1 23489 @@ -1047,8 +1056,9 @@ 23150 23490 INSTALL_DATA = cp 23151 23491 INSTALL_DATA_R = cp -r … … 23158 23498 ### Permissions for binaries {{{1 23159 23499 BINMOD = 755 23160 @@ -1321,15 +13 27,15 @@23500 @@ -1321,15 +1331,15 @@ 23161 23501 .SUFFIXES: .c .o .pro 23162 23502 … … 23173 23513 23174 23514 -LINT_CFLAGS = -DLINT -I. $(PRE_DEFS) $(POST_DEFS) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) -Dinline= -D__extension__= -Dalloca=alloca 23175 +LINT_CFLAGS = -DLINT -I. $(PRE_DEFS) $(POST_DEFS) $(RUBY_CFLAGS) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) -Dinline= -D__extension__= -Dalloca=alloca23515 +LINT_CFLAGS = -DLINT -I. $(PRE_DEFS) $(POST_DEFS) $(RUBY_CFLAGS) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) -Dinline= -D__extension__= -Dalloca=alloca 23176 23516 23177 23517 LINT_EXTRA = -DUSE_SNIFF -DHANGUL_INPUT -D"__attribute__(x)=" 23178 23518 23179 @@ -1352,7 +13 58,8 @@23519 @@ -1352,7 +1362,8 @@ 23180 23520 $(PYTHON3_LIBS) \ 23181 23521 $(TCL_LIBS) \ … … 23187 23527 # abbreviations 23188 23528 DEST_BIN = $(DESTDIR)$(BINDIR) 23189 @@ -1474,8 +148 1,15 @@23529 @@ -1474,8 +1485,15 @@ 23190 23530 if_python.c if_python3.c if_tcl.c if_ruby.c if_sniff.c \ 23191 23531 gui_beval.c workshop.c wsdebug.c integration.c netbeans.c … … 23204 23544 # Which files to check with lint. Select one of these three lines. ALL_SRC 23205 23545 # checks more, but may not work well for checking a GUI that wasn't configured. 23206 @@ -1486,7 +150 0,7 @@23546 @@ -1486,7 +1504,7 @@ 23207 23547 #LINT_SRC = $(ALL_SRC) 23208 23548 #LINT_SRC = $(BASIC_SRC) … … 23213 23553 objects/blowfish.o \ 23214 23554 objects/charset.o \ 23215 @@ -1507,10 +152 1,8 @@23555 @@ -1507,10 +1525,8 @@ 23216 23556 $(HANGULIN_OBJ) \ 23217 23557 objects/if_cscope.o \ … … 23225 23565 objects/message.o \ 23226 23566 objects/misc1.o \ 23227 @@ -1535,6 +15 47,7 @@23567 @@ -1535,6 +1551,7 @@ 23228 23568 objects/term.o \ 23229 23569 objects/ui.o \ … … 23233 23573 $(GUI_OBJ) \ 23234 23574 $(LUA_OBJ) \ 23235 @@ -1549,6 +156 2,13 @@23575 @@ -1549,6 +1566,13 @@ 23236 23576 $(NETBEANS_OBJ) \ 23237 23577 $(WSDEBUG_OBJ) … … 23247 23587 blowfish.pro \ 23248 23588 buffer.pro \ 23249 @@ -1612,7 +163 2,7 @@23589 @@ -1612,7 +1636,7 @@ 23250 23590 RSRC_DIR = os_mac_rsrc 23251 23591 … … 23256 23596 # Default target is making the executable and tools 23257 23597 all: $(VIMTARGET) $(TOOLS) languages $(GUI_BUNDLE) 23258 @@ -1633,7 +165 3,8 @@23598 @@ -1633,7 +1657,8 @@ 23259 23599 CC="$(CC)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \ 23260 23600 LDFLAGS="$(LDFLAGS)" $(CONF_SHELL) srcdir="$(srcdir)" \ … … 23266 23606 $(CONF_OPT_CSCOPE) $(CONF_OPT_MULTIBYTE) $(CONF_OPT_INPUT) \ 23267 23607 $(CONF_OPT_OUTPUT) $(CONF_OPT_GPM) $(CONF_OPT_WORKSHOP) \ 23268 @@ -1694,11 +171 5,12 @@23608 @@ -1694,11 +1719,12 @@ 23269 23609 $(VIMTARGET): auto/config.mk objects $(OBJ) version.c version.h 23270 23610 $(CCC) version.c -o objects/version.o … … 23282 23622 23283 23623 # Build the language specific files if they were unpacked. 23284 @@ -1818,6 +184 0,15 @@23624 @@ -1818,6 +1844,15 @@ 23285 23625 ln -s $(VIMTARGET) vim; \ 23286 23626 fi … … 23298 23638 testclean: 23299 23639 cd testdir; $(MAKE) -f Makefile clean 23300 @@ -1825,6 +18 56,17 @@23640 @@ -1825,6 +1860,17 @@ 23301 23641 cd $(PODIR); $(MAKE) checkclean; \ 23302 23642 fi … … 23316 23656 23317 23657 install_normal: installvim installtools $(INSTALL_LANGS) install-icons 23318 @@ -2258,6 +230 0,7 @@23658 @@ -2258,6 +2304,7 @@ 23319 23659 -rm -f *.o objects/* core $(VIMTARGET).core $(VIMTARGET) vim xxd/*.o 23320 23660 -rm -f $(TOOLS) auto/osdef.h auto/pathdef.c auto/if_perl.c … … 23324 23664 -rm -rf $(APPDIR) 23325 23665 -rm -rf mzscheme_base.c 23326 @@ -2291,6 +233 4,7 @@23666 @@ -2291,6 +2338,7 @@ 23327 23667 ../../testdir/vimrc.unix \ 23328 23668 ../../testdir/*.in \ … … 23332 23672 23333 23673 # Link needed for doing "make install" in a shadow directory. 23334 @@ -2532,7 +2576,7 @@ 23674 @@ -2367,7 +2415,6 @@ 23675 auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in 23676 CC="$(CC) $(OSDEF_CFLAGS)" srcdir=$(srcdir) sh $(srcdir)/osdef.sh 23677 23678 -QUOTESED = sed -e 's/[\\"]/\\&/g' -e 's/\\"/"/' -e 's/\\";$$/";/' 23679 auto/pathdef.c: Makefile auto/config.mk 23680 -@echo creating $@ 23681 -@echo '/* pathdef.c */' > $@ 23682 @@ -2532,7 +2579,7 @@ 23335 23683 $(CCC) $(PYTHON3_CFLAGS) $(PYTHON3_CFLAGS_EXTRA) -o $@ if_python3.c 23336 23684 … … 23341 23689 objects/if_sniff.o: if_sniff.c 23342 23690 $(CCC) -o $@ if_sniff.c 23343 @@ -2552,6 +259 6,9 @@23691 @@ -2552,6 +2599,9 @@ 23344 23692 objects/memfile.o: memfile.c 23345 23693 $(CCC) -o $@ memfile.c … … 23351 23699 $(CCC) -o $@ memline.c 23352 23700 23353 @@ -2870,7 +29 17,7 @@23701 @@ -2870,7 +2920,7 @@ 23354 23702 objects/os_unix.o: os_unix.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ 23355 23703 ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ … … 23360 23708 auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ 23361 23709 regexp.h gui.h gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h \ 23362 @@ -3009,6 +305 6,10 @@23710 @@ -3009,6 +3059,10 @@ 23363 23711 objects/pty.o: pty.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h ascii.h \ 23364 23712 keymap.h term.h macros.h option.h structs.h regexp.h gui.h gui_beval.h \ … … 23371 23719 auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ 23372 23720 regexp.h gui.h gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h \ 23373 @@ -3020,7 +307 1,7 @@23721 @@ -3020,7 +3074,7 @@ 23374 23722 objects/if_mzsch.o: if_mzsch.c vim.h auto/config.h feature.h os_unix.h \ 23375 23723 auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ … … 23380 23728 auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ 23381 23729 regexp.h gui.h gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h \ 23382 @@ -3041,7 +309 2,7 @@23730 @@ -3041,7 +3095,7 @@ 23383 23731 ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ 23384 23732 gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h globals.h farsi.h \ … … 23390 23738 arabic.h version.h 23391 23739 diff -Naur vim73.orig/src/VisVim/Commands.cpp vim73/src/VisVim/Commands.cpp 23392 --- vim73.orig/src/VisVim/Commands.cpp 201 2-06-03 23:09:52.932006845+000023393 +++ vim73/src/VisVim/Commands.cpp 2012-0 6-03 23:09:54.592051020+000023740 --- vim73.orig/src/VisVim/Commands.cpp 2010-05-15 11:04:08.000000000 +0000 23741 +++ vim73/src/VisVim/Commands.cpp 2012-07-20 20:31:12.320974199 +0000 23394 23742 @@ -549,7 +549,7 @@ 23395 23743 if (g_bNewTabs) … … 23412 23760 else 23413 23761 diff -Naur vim73.orig/src/arabic.c vim73/src/arabic.c 23414 --- vim73.orig/src/arabic.c 201 2-06-03 23:09:52.924006631+000023415 +++ vim73/src/arabic.c 2012-0 6-03 23:09:55.924086467+000023762 --- vim73.orig/src/arabic.c 2010-05-15 11:04:09.000000000 +0000 23763 +++ vim73/src/arabic.c 2012-07-20 20:31:16.377643778 +0000 23416 23764 @@ -1066,7 +1066,7 @@ 23417 23765 … … 23424 23772 (*mb_char2bytes)(curr_c, buf); 23425 23773 diff -Naur vim73.orig/src/ascii.h vim73/src/ascii.h 23426 --- vim73.orig/src/ascii.h 201 2-06-03 23:09:52.948007269+000023427 +++ vim73/src/ascii.h 2012-0 6-03 23:09:55.076063900+000023774 --- vim73.orig/src/ascii.h 2010-05-15 11:04:07.000000000 +0000 23775 +++ vim73/src/ascii.h 2012-07-20 20:31:13.754308564 +0000 23428 23776 @@ -123,7 +123,7 @@ 23429 23777 #define DCS 0x90 /* Device Control String */ … … 23450 23798 #endif 23451 23799 diff -Naur vim73.orig/src/auto/config.mk vim73/src/auto/config.mk 23452 --- vim73.orig/src/auto/config.mk 201 2-06-03 23:09:52.948007269+000023800 --- vim73.orig/src/auto/config.mk 2010-08-15 13:02:25.000000000 +0000 23453 23801 +++ vim73/src/auto/config.mk 1970-01-01 00:00:00.000000000 +0000 23454 23802 @@ -1,5 +0,0 @@ … … 23459 23807 -VIEWNAME = view 23460 23808 diff -Naur vim73.orig/src/auto/configure vim73/src/auto/configure 23461 --- vim73.orig/src/auto/configure 201 2-06-03 23:09:52.948007269+000023462 +++ vim73/src/auto/configure 2012-0 6-03 23:09:55.372071777+000023809 --- vim73.orig/src/auto/configure 2010-08-13 14:17:15.000000000 +0000 23810 +++ vim73/src/auto/configure 2012-07-20 20:31:17.054310930 +0000 23463 23811 @@ -593,6 +593,7 @@ 23464 23812 … … 23515 23863 CFLAGS="-O" 23516 23864 test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall" 23517 @@ -4726,6 +4743,9 @@ 23865 @@ -4409,15 +4426,18 @@ 23866 echo "" 23867 echo "------------------------------------------" 23868 echo " On z/OS Unix, the environment variable" 23869 - echo " __CC_${ccn}MODE must be set to \"1\"!" 23870 + echo " _CC_${ccn}MODE must be set to \"1\"!" 23871 echo " Do:" 23872 echo " export _CC_${ccn}MODE=1" 23873 echo " and then call configure again." 23874 echo "------------------------------------------" 23875 exit 1 23876 fi 23877 - CFLAGS="$CFLAGS -D_ALL_SOURCE -Wc,float\\(IEEE\\)"; 23878 - LDFLAGS="$LDFLAGS -Wl,EDIT=NO" 23879 + # Set CFLAGS for configure process. 23880 + # This will be reset later for config.mk. 23881 + # Use haltonmsg to force error for missing H files. 23882 + CFLAGS="$CFLAGS -D_ALL_SOURCE -Wc,float(ieee),haltonmsg(3296)"; 23883 + LDFLAGS="$LDFLAGS -Wl,EDIT=NO" 23884 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 23885 $as_echo "yes" >&6; } 23886 ;; 23887 @@ -4726,6 +4746,9 @@ 23518 23888 LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"liblua${vi_cv_version_lua}.so$LUA_SONAME\\\" $LUA_CFLAGS" 23519 23889 fi … … 23525 23895 23526 23896 23527 @@ -4862,16 +488 2,36 @@23897 @@ -4862,16 +4885,36 @@ 23528 23898 else 23529 23899 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 … … 23567 23937 fi 23568 23938 fi 23569 @@ -4883,12 +492 3,22 @@23939 @@ -4883,12 +4926,22 @@ 23570 23940 elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"; then 23571 23941 MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a" … … 23591 23961 MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme -lmzgc" 23592 23962 fi 23593 @@ -4901,10 +495 1,20 @@23963 @@ -4901,10 +4954,20 @@ 23594 23964 fi 23595 23965 if test -d $vi_cv_path_mzscheme_pfx/lib/plt/collects; then … … 23614 23984 fi 23615 23985 MZSCHEME_CFLAGS="${MZSCHEME_CFLAGS} -I${SCHEME_INC} \ 23616 @@ -5099,6 +51 59,10 @@23986 @@ -5099,6 +5162,10 @@ 23617 23987 PERL_CFLAGS="-DDYNAMIC_PERL_DLL=\\\"$libperl\\\" $PERL_CFLAGS" 23618 23988 fi … … 23625 23995 23626 23996 23627 @@ -5285,9 +53 49,9 @@23997 @@ -5285,9 +5352,9 @@ 23628 23998 23629 23999 PYTHON_LIBS="${vi_cv_path_python_plibs}" … … 23637 24007 PYTHON_SRC="if_python.c" 23638 24008 if test "x$MACOSX" = "xyes"; then 23639 @@ -5298,7 +536 2,7 @@24009 @@ -5298,7 +5365,7 @@ 23640 24010 if test "${vi_cv_var_python_version}" = "1.4"; then 23641 24011 PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o" … … 23646 24016 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -pthread should be used" >&5 23647 24017 $as_echo_n "checking if -pthread should be used... " >&6; } 23648 @@ -5388,6 +545 2,10 @@24018 @@ -5388,6 +5455,10 @@ 23649 24019 $as_echo "too old" >&6; } 23650 24020 fi … … 23657 24027 23658 24028 23659 @@ -5464,6 +553 2,23 @@24029 @@ -5464,6 +5535,23 @@ 23660 24030 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_version" >&5 23661 24031 $as_echo "$vi_cv_var_python3_version" >&6; } … … 23681 24051 $as_echo_n "checking Python's install prefix... " >&6; } 23682 24052 if test "${vi_cv_path_python3_pfx+set}" = set; then : 23683 @@ -5514,9 +5 599,13 @@24053 @@ -5514,9 +5602,13 @@ 23684 24054 else 23685 24055 … … 23696 24066 vi_cv_path_python3_conf="$d" 23697 24067 fi 23698 @@ -5545,13 +563 4,12 @@24068 @@ -5545,13 +5637,12 @@ 23699 24069 @echo "python3_BASEMODLIBS='$(BASEMODLIBS)'" 23700 24070 @echo "python3_LIBS='$(LIBS)'" … … 23712 24082 vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//` 23713 24083 23714 @@ -5560,9 +56 48,9 @@24084 @@ -5560,9 +5651,9 @@ 23715 24085 23716 24086 PYTHON3_LIBS="${vi_cv_path_python3_plibs}" … … 23724 24094 PYTHON3_SRC="if_python3.c" 23725 24095 if test "x$MACOSX" = "xyes"; then 23726 @@ -5667,12 +575 5,12 @@24096 @@ -5667,12 +5758,12 @@ 23727 24097 23728 24098 $as_echo "#define DYNAMIC_PYTHON3 1" >>confdefs.h … … 23741 24111 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 23742 24112 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 23743 @@ -5689,15 +57 77,17 @@24113 @@ -5689,15 +5780,17 @@ 23744 24114 * Only the first pyhton version used will be switched on. 23745 24115 */ … … 23760 24130 needed = (*simple)("import termios") == -1; 23761 24131 (*final)(); 23762 @@ -5709,7 +5 799,7 @@24132 @@ -5709,7 +5802,7 @@ 23763 24133 int main(int argc, char** argv) 23764 24134 { … … 23769 24139 return !not_needed; 23770 24140 } 23771 @@ -5726,8 +581 6,76 @@24141 @@ -5726,8 +5819,76 @@ 23772 24142 conftest.$ac_objext conftest.beam conftest.$ac_ext 23773 24143 fi 23774 24144 23775 24145 + 23776 23777 24146 + CFLAGS=$cflags_save 24147 + LDFLAGS=$ldflags_save 23778 24148 + 23779 24149 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can do without RTLD_GLOBAL for Python3" >&5 … … 23840 24210 + 23841 24211 + 23842 +CFLAGS=$cflags_save23843 +LDFLAGS=$ldflags_save24212 CFLAGS=$cflags_save 24213 LDFLAGS=$ldflags_save 23844 24214 + 23845 24215 PYTHON_SRC="if_python.c" 23846 24216 PYTHON_OBJ="objects/if_python.o" 23847 24217 PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${python_INSTSONAME}\\\"" 23848 @@ -6085,6 +624 3,9 @@24218 @@ -6085,6 +6246,9 @@ 23849 24219 $as_echo "too old; need Tcl version 8.0 or later" >&6; } 23850 24220 fi … … 23856 24226 23857 24227 23858 @@ -6103,20 +626 4,20 @@24228 @@ -6103,20 +6267,20 @@ 23859 24229 23860 24230 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_rubyinterp" >&5 … … 23880 24250 set dummy $RUBY_CMD; ac_word=$2 23881 24251 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 23882 @@ -6181,17 +634 2,14 @@24252 @@ -6181,17 +6345,14 @@ 23883 24253 RUBY_LIBS="$rubylibs" 23884 24254 fi … … 23906 24276 23907 24277 if test "X$librubyarg" != "X"; then 23908 @@ -6209,6 +63 67,13 @@24278 @@ -6209,6 +6370,13 @@ 23909 24279 RUBY_PRO="if_ruby.pro" 23910 24280 $as_echo "#define FEAT_RUBY 1" >>confdefs.h … … 23920 24290 { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found; disabling Ruby" >&5 23921 24291 $as_echo "not found; disabling Ruby" >&6; } 23922 @@ -6218,6 +638 3,10 @@24292 @@ -6218,6 +6386,10 @@ 23923 24293 $as_echo "too old; need Ruby version 1.6.0 or later" >&6; } 23924 24294 fi … … 23931 24301 23932 24302 23933 @@ -9768,9 +9937,9 @@ 24303 @@ -8528,8 +8700,13 @@ 24304 if test -z "$SKIP_MOTIF"; then 24305 cppflags_save=$CPPFLAGS 24306 CPPFLAGS="$CPPFLAGS $X_CFLAGS" 24307 - for ac_header in Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h \ 24308 - Xm/UnhighlightT.h Xm/Notebook.h 24309 + if test "$zOSUnix" = "yes"; then 24310 + xmheader="Xm/Xm.h" 24311 + else 24312 + xmheader="Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h 24313 + Xm/UnhighlightT.h Xm/Notebook.h" 24314 + fi 24315 + for ac_header in $xmheader 24316 do : 24317 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` 24318 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" 24319 @@ -8544,7 +8721,7 @@ 24320 done 24321 24322 24323 - if test $ac_cv_header_Xm_XpmP_h = yes; then 24324 + if test "x$ac_cv_header_Xm_XpmP_h" = "xyes"; then 24325 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XpmAttributes_21 in Xm/XpmP.h" >&5 24326 $as_echo_n "checking for XpmAttributes_21 in Xm/XpmP.h... " >&6; } 24327 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 24328 @@ -9768,9 +9945,9 @@ 23934 24329 else 23935 24330 { $as_echo "$as_me:${as_lineno-$LINENO}: result: empty: automatic terminal library selection" >&5 … … 23944 24339 for libname in $tlibs; do 23945 24340 as_ac_Lib=`$as_echo "ac_cv_lib_${libname}''_tgetent" | $as_tr_sh` 23946 @@ -11159,7 +113 28,47 @@24341 @@ -11159,7 +11336,47 @@ 23947 24342 rm -f core conftest.err conftest.$ac_objext \ 23948 24343 conftest$ac_exeext conftest.$ac_ext … … 23993 24388 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 23994 24389 /* end confdefs.h. */ 23995 @@ -11186,6 +11 395,8 @@24390 @@ -11186,6 +11403,8 @@ 23996 24391 fi 23997 24392 rm -f core conftest.err conftest.$ac_objext \ … … 24002 24397 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AIX ACL support" >&5 24003 24398 $as_echo_n "checking for AIX ACL support... " >&6; } 24004 @@ -11642,7 +118 53,8 @@24399 @@ -11642,7 +11861,8 @@ 24005 24400 { $as_echo "$as_me:${as_lineno-$LINENO}: checking uint32_t is 32 bits" >&5 24006 24401 $as_echo_n "checking uint32_t is 32 bits... " >&6; } … … 24012 24407 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 24013 24408 /* end confdefs.h. */ 24014 @@ -11915,6 +121 27,10 @@24409 @@ -11915,6 +12135,10 @@ 24015 24410 test -f tags && mv tags tags.save 24016 24411 if (eval ctags --version /dev/null | grep Exuberant) < /dev/null 1>&5 2>&1; then … … 24023 24418 TAGPRG="ctags" 24024 24419 (eval etags /dev/null) < /dev/null 1>&5 2>&1 && TAGPRG="etags" 24025 @@ -12344,10 +1256 0,10 @@24420 @@ -12344,10 +12568,10 @@ 24026 24421 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 24027 24422 $as_echo "no" >&6; } … … 24036 24431 $as_echo "yes" >&6; } 24037 24432 else 24038 @@ -12357,6 +125 73,23@@24433 @@ -12357,6 +12581,28 @@ 24039 24434 fi 24040 24435 … … 24057 24452 + 24058 24453 + 24454 +# IBM z/OS reset CFLAGS for config.mk 24455 +if test "$zOSUnix" = "yes"; then 24456 + CFLAGS="-D_ALL_SOURCE -Wc,float\(ieee\),dll" 24457 +fi 24458 + 24059 24459 ac_config_files="$ac_config_files auto/config.mk:config.mk.in" 24060 24460 24061 24461 cat >confcache <<\_ACEOF 24062 24462 diff -Naur vim73.orig/src/blowfish.c vim73/src/blowfish.c 24063 --- vim73.orig/src/blowfish.c 201 2-06-03 23:09:52.932006845+000024064 +++ vim73/src/blowfish.c 2012-0 6-03 23:09:53.732028133+000024463 --- vim73.orig/src/blowfish.c 2010-07-14 14:45:39.000000000 +0000 24464 +++ vim73/src/blowfish.c 2012-07-20 20:31:09.647638940 +0000 24065 24465 @@ -413,6 +413,7 @@ 24066 24466 int salt_len; … … 24083 24483 mch_memmove(sbx, sbi, 4 * 4 * 256); 24084 24484 diff -Naur vim73.orig/src/buffer.c vim73/src/buffer.c 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 @@ 24485 --- vim73.orig/src/buffer.c 2010-08-13 09:14:35.000000000 +0000 24486 +++ vim73/src/buffer.c 2012-07-20 20:31:18.240978445 +0000 24487 @@ -57,13 +57,15 @@ 24488 24489 #if defined(FEAT_SIGNS) 24490 static void insert_sign __ARGS((buf_T *buf, signlist_T *prev, signlist_T *next, int id, linenr_T lnum, int typenr)); 24491 -static void buf_delete_signs __ARGS((buf_T *buf)); 24492 #endif 24493 24494 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) 24088 24495 static char *msg_loclist = N_("[Location List]"); 24089 24496 static char *msg_qflist = N_("[Quickfix List]"); … … 24095 24502 /* 24096 24503 * Open current buffer, that is: open the memfile and read the file into 24097 @@ -96,7 +9 9,7 @@24504 @@ -96,7 +98,7 @@ 24098 24505 * There MUST be a memfile, otherwise we can't do anything 24099 24506 * If we can't create one for the current buffer, take another buffer … … 24104 24511 if (curbuf->b_ml.ml_mfp != NULL) 24105 24512 break; 24106 @@ -316,12 +31 9,17 @@24513 @@ -316,12 +318,17 @@ 24107 24514 * get a new buffer very soon! 24108 24515 * … … 24123 24530 #ifdef FEAT_AUTOCMD 24124 24531 int is_curbuf; 24125 @@ -371,8 +379,12 @@ 24532 @@ -369,19 +376,35 @@ 24533 /* When the buffer is no longer in a window, trigger BufWinLeave */ 24534 if (buf->b_nwindows == 1) 24126 24535 { 24536 + buf->b_closing = TRUE; 24127 24537 apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname, buf->b_fname, 24128 24538 FALSE, buf); 24129 24539 - 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())) 24540 + if (!buf_valid(buf)) 24132 24541 + { 24542 + /* Autocommands deleted the buffer. */ 24543 +aucmd_abort: 24133 24544 + EMSG(_(e_auabort)); 24134 24545 return; 24135 24546 + } 24547 + buf->b_closing = FALSE; 24548 + if (abort_if_last && one_window()) 24549 + /* Autocommands made this the only window. */ 24550 + goto aucmd_abort; 24136 24551 24137 24552 /* When the buffer becomes hidden, but is not unloaded, trigger 24138 24553 * BufHidden */ 24139 @@ -380,8 +392,13 @@ 24554 if (!unload_buf) 24140 24555 { 24556 + buf->b_closing = TRUE; 24141 24557 apply_autocmds(EVENT_BUFHIDDEN, buf->b_fname, buf->b_fname, 24142 24558 FALSE, buf); 24143 24559 - 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 + } 24560 - return; 24561 + if (!buf_valid(buf)) 24562 + /* Autocommands deleted the buffer. */ 24563 + goto aucmd_abort; 24564 + buf->b_closing = FALSE; 24565 + if (abort_if_last && one_window()) 24566 + /* Autocommands made this the only window. */ 24567 + goto aucmd_abort; 24151 24568 } 24152 24569 # ifdef FEAT_EVAL 24153 24570 if (aborting()) /* autocmds may abort script processing */ 24154 @@ -416,6 +43 3,14 @@24571 @@ -416,6 +439,14 @@ 24155 24572 #endif 24156 24573 … … 24167 24584 #ifdef FEAT_AUTOCMD 24168 24585 /* Autocommands may have deleted the buffer. */ 24169 @@ -560,6 +585,11 @@ 24586 @@ -527,6 +558,7 @@ 24587 #ifdef FEAT_AUTOCMD 24588 int is_curbuf = (buf == curbuf); 24589 24590 + buf->b_closing = TRUE; 24591 apply_autocmds(EVENT_BUFUNLOAD, buf->b_fname, buf->b_fname, FALSE, buf); 24592 if (!buf_valid(buf)) /* autocommands may delete the buffer */ 24593 return; 24594 @@ -543,6 +575,7 @@ 24595 if (!buf_valid(buf)) /* autocommands may delete the buffer */ 24596 return; 24597 } 24598 + buf->b_closing = FALSE; 24599 # ifdef FEAT_EVAL 24600 if (aborting()) /* autocmds may abort script processing */ 24601 return; 24602 @@ -560,6 +593,11 @@ 24170 24603 #ifdef FEAT_DIFF 24171 24604 diff_buf_delete(buf); /* Can't use 'diff' for unloaded buffer. */ … … 24179 24612 #ifdef FEAT_FOLDING 24180 24613 /* No folds in an empty buffer. */ 24181 @@ -639,6 +6 69,9 @@24614 @@ -639,6 +677,9 @@ 24182 24615 { 24183 24616 clear_wininfo(buf); /* including window-local options */ … … 24189 24622 #ifdef FEAT_EVAL 24190 24623 vars_clear(&buf->b_vars.dv_hashtab); /* free all internal variables */ 24191 @@ -661,9 + 694,6 @@24624 @@ -661,9 +702,6 @@ 24192 24625 vim_free(buf->b_start_fenc); 24193 24626 buf->b_start_fenc = NULL; … … 24199 24632 24200 24633 /* 24201 @@ -762,7 + 792,7 @@24634 @@ -762,7 +800,7 @@ 24202 24635 * open a new, empty buffer. */ 24203 24636 swap_exists_action = SEA_NONE; /* don't want it again */ … … 24208 24641 old_curbuf = buflist_new(NULL, NULL, 1L, BLN_CURBUF | BLN_LISTED); 24209 24642 if (old_curbuf != NULL) 24210 @@ -1109,7 +11 39,7 @@24643 @@ -1109,7 +1147,7 @@ 24211 24644 * if the buffer still exists. 24212 24645 */ … … 24217 24650 } 24218 24651 24219 @@ -1133,7 +1163,7 @@ 24652 @@ -1120,6 +1158,9 @@ 24653 * a window with this buffer. 24654 */ 24655 while (buf == curbuf 24656 +# ifdef FEAT_AUTOCMD 24657 + && !(curwin->w_closing || curwin->w_buffer->b_closing) 24658 +# endif 24659 && (firstwin != lastwin || first_tabpage->tp_next != NULL)) 24660 win_close(curwin, FALSE); 24661 #endif 24662 @@ -1133,7 +1174,7 @@ 24220 24663 close_windows(buf, FALSE); 24221 24664 #endif … … 24226 24669 } 24227 24670 24228 @@ -1288,9 +13 18,12 @@24671 @@ -1288,9 +1329,12 @@ 24229 24672 /* Go to the other buffer. */ 24230 24673 set_curbuf(buf, action); … … 24241 24684 24242 24685 #if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL) 24243 @@ -1343,6 +13 76,10 @@24686 @@ -1343,6 +1387,10 @@ 24244 24687 # endif 24245 24688 #endif … … 24252 24695 if (unload) 24253 24696 close_windows(prevbuf, FALSE); 24254 @@ -1358,7 +1395,7 @@ 24697 @@ -1353,22 +1401,34 @@ 24698 if (buf_valid(prevbuf)) 24699 #endif 24700 { 24701 +#ifdef FEAT_WINDOWS 24702 + win_T *previouswin = curwin; 24703 +#endif 24704 if (prevbuf == curbuf) 24705 u_sync(FALSE); 24255 24706 close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL, prevbuf, 24256 24707 unload ? action : (action == DOBUF_GOTO … … 24258 24709 - && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0); 24259 24710 + && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0, FALSE); 24711 +#ifdef FEAT_WINDOWS 24712 + if (curwin != previouswin && win_valid(previouswin)) 24713 + /* autocommands changed curwin, Grr! */ 24714 + curwin = previouswin; 24715 +#endif 24260 24716 } 24261 24717 } 24262 24718 #ifdef FEAT_AUTOCMD 24263 @@ -1392,10 +1429,6 @@ 24719 /* An autocommand may have deleted "buf", already entered it (e.g., when 24720 - * it did ":bunload") or aborted the script processing! */ 24721 + * it did ":bunload") or aborted the script processing! 24722 + * If curwin->w_buffer is null, enter_buffer() will make it valid again */ 24723 + if ((buf_valid(buf) && buf != curbuf 24724 # ifdef FEAT_EVAL 24725 - if (buf_valid(buf) && buf != curbuf && !aborting()) 24726 -# else 24727 - if (buf_valid(buf) && buf != curbuf) 24728 + && !aborting() 24729 +# endif 24730 +# ifdef FEAT_WINDOWS 24731 + ) || curwin->w_buffer == NULL 24732 # endif 24733 + ) 24734 #endif 24735 enter_buffer(buf); 24736 } 24737 @@ -1392,10 +1452,6 @@ 24264 24738 foldUpdateAll(curwin); /* update folds (later). */ 24265 24739 #endif … … 24272 24746 curwin->w_buffer = buf; 24273 24747 curbuf = buf; 24274 @@ -1406,6 +14 39,10 @@24748 @@ -1406,6 +1462,10 @@ 24275 24749 diff_buf_add(curbuf); 24276 24750 #endif … … 24283 24757 curwin->w_cursor.lnum = 1; 24284 24758 curwin->w_cursor.col = 0; 24285 @@ -1805,9 +1842,6 @@ 24759 @@ -1687,7 +1747,8 @@ 24760 buf->b_wininfo->wi_win = curwin; 24761 24762 #ifdef FEAT_EVAL 24763 - init_var_dict(&buf->b_vars, &buf->b_bufvar); /* init b: variables */ 24764 + /* init b: variables */ 24765 + init_var_dict(&buf->b_vars, &buf->b_bufvar, VAR_SCOPE); 24766 #endif 24767 #ifdef FEAT_SYN_HL 24768 hash_init(&buf->b_s.b_keywtab); 24769 @@ -1805,9 +1866,6 @@ 24286 24770 #ifdef FEAT_AUTOCMD 24287 24771 clear_string_option(&buf->b_p_ft); … … 24293 24777 clear_string_option(&buf->b_p_cink); 24294 24778 clear_string_option(&buf->b_p_cino); 24295 @@ -1917,9 +19 51,7 @@24779 @@ -1917,9 +1975,7 @@ 24296 24780 tabpage_new(); 24297 24781 else if (win_split(0, 0) == FAIL) /* Open in a new window */ … … 24304 24788 } 24305 24789 #endif 24306 @@ -2526,6 +25 58,9 @@24790 @@ -2526,6 +2582,9 @@ 24307 24791 if (p_fdls >= 0) 24308 24792 curwin->w_p_fdl = p_fdls; … … 24314 24798 24315 24799 /* 24316 @@ -2690,7 +27 25,8 @@24800 @@ -2690,7 +2749,8 @@ 24317 24801 vim_free(ffname); 24318 24802 return FAIL; … … 24324 24808 sfname = vim_strsave(sfname); 24325 24809 if (ffname == NULL || sfname == NULL) 24326 @@ -3175,7 +32 11,7 @@24810 @@ -3175,7 +3235,7 @@ 24327 24811 /* format: "fname + (path) (1 of 2) - VIM" */ 24328 24812 … … 24333 24817 { 24334 24818 p = transstr(gettail(curbuf->b_fname)); 24335 @@ -3231,7 +32 67,7 @@24819 @@ -3231,7 +3291,7 @@ 24336 24820 if (serverName != NULL) 24337 24821 { … … 24342 24826 else 24343 24827 #endif 24344 @@ -3240,9 +3 276,8 @@24828 @@ -3240,9 +3300,8 @@ 24345 24829 if (maxlen > 0) 24346 24830 { … … 24354 24838 } 24355 24839 } 24356 @@ -3363,7 +3 398,8 @@24840 @@ -3363,7 +3422,8 @@ 24357 24841 * or truncated if too long, fillchar is used for all whitespace. 24358 24842 */ … … 24364 24848 char_u *out; /* buffer to write into != NameBuff */ 24365 24849 size_t outlen; /* length of out[] */ 24366 @@ -3458,6 +3 494,18 @@24850 @@ -3458,6 +3518,18 @@ 24367 24851 prevchar_isitem = FALSE; 24368 24852 for (s = usefmt; *s; ) … … 24383 24867 prevchar_isflag = prevchar_isitem = FALSE; 24384 24868 24385 @@ -3473,6 +35 21,8 @@24869 @@ -3473,6 +3545,8 @@ 24386 24870 * Handle one '%' item. 24387 24871 */ … … 24392 24876 { 24393 24877 if (p + 1 >= out + outlen) 24394 @@ -4355,7 +44 05,12 @@24878 @@ -4355,7 +4429,12 @@ 24395 24879 { 24396 24880 int i; … … 24406 24890 int use_firstwin = FALSE; /* use first window for arglist */ 24407 24891 int split_ret = OK; 24408 @@ -4364,6 +44 19,8 @@24892 @@ -4364,6 +4443,8 @@ 24409 24893 buf_T *buf; 24410 24894 tabpage_T *tpnext; … … 24415 24899 tabpage_T *new_curtab = NULL; 24416 24900 24417 @@ -4380,6 +44 37,15 @@24901 @@ -4380,6 +4461,15 @@ 24418 24902 if (opened == NULL) 24419 24903 return; … … 24431 24915 need_mouse_correct = TRUE; 24432 24916 #endif 24433 @@ -4401,36 +4467,51 @@ 24917 @@ -4392,7 +4482,7 @@ 24918 * When the ":tab" modifier was used do this for all tab pages. 24919 */ 24920 if (had_tab > 0) 24921 - goto_tabpage_tp(first_tabpage); 24922 + goto_tabpage_tp(first_tabpage, TRUE); 24923 for (;;) 24924 { 24925 tpnext = curtab->tp_next; 24926 @@ -4401,36 +4491,51 @@ 24434 24927 wpnext = wp->w_next; 24435 24928 buf = wp->w_buffer; … … 24461 24954 + 24462 24955 + if (old_curtab == curtab) 24463 { 24464 - opened[i] = TRUE; 24956 + { 24465 24957 + ++weight; 24466 24958 + if (old_curwin == wp) … … 24469 24961 + 24470 24962 + if (weight > (int)opened[i]) 24471 + { 24963 { 24964 - opened[i] = TRUE; 24472 24965 + opened[i] = (char_u)weight; 24473 24966 if (i == 0) … … 24493 24986 } 24494 24987 break; 24495 @@ -4439,7 +45 20,7 @@24988 @@ -4439,7 +4544,7 @@ 24496 24989 } 24497 24990 wp->w_arg_idx = i; … … 24502 24995 if (P_HID(buf) || forceit || buf->b_nwindows > 1 24503 24996 || !bufIsChanged(buf)) 24504 @@ -4461,7 +45 42,8 @@24997 @@ -4461,7 +4566,8 @@ 24505 24998 } 24506 24999 #ifdef FEAT_WINDOWS … … 24512 25005 use_firstwin = TRUE; 24513 25006 #ifdef FEAT_WINDOWS 24514 @@ -4495,20 +4577,16 @@ 25007 @@ -4488,27 +4594,23 @@ 25008 if (!valid_tabpage(tpnext)) 25009 tpnext = first_tabpage; /* start all over...*/ 25010 # endif 25011 - goto_tabpage_tp(tpnext); 25012 + goto_tabpage_tp(tpnext, TRUE); 25013 } 25014 25015 /* 24515 25016 * Open a window for files in the argument list that don't have one. 24516 25017 * ARGCOUNT may change while doing this, because of autocommands. … … 24537 25038 #ifdef FEAT_WINDOWS 24538 25039 /* ":drop all" should re-use an empty window to avoid "--remote-tab" 24539 @@ -4518,11 +4 596,11 @@25040 @@ -4518,11 +4620,11 @@ 24540 25041 use_firstwin = TRUE; 24541 25042 #endif … … 24551 25052 /* Move the already present window to below the current window */ 24552 25053 if (curwin->w_arg_idx != i) 24553 @@ -4531,7 +46 09,13 @@25054 @@ -4531,7 +4633,13 @@ 24554 25055 { 24555 25056 if (wpnext->w_arg_idx == i) … … 24566 25067 } 24567 25068 } 24568 @@ -4586, 6 +4670,14@@25069 @@ -4586,9 +4694,17 @@ 24569 25070 #ifdef FEAT_AUTOCMD 24570 25071 --autocmd_no_enter; … … 24574 25075 + { 24575 25076 + if (valid_tabpage(last_curtab)) 24576 + goto_tabpage_tp(last_curtab );25077 + goto_tabpage_tp(last_curtab, TRUE); 24577 25078 + if (win_valid(last_curwin)) 24578 25079 + win_enter(last_curwin, FALSE); … … 24580 25081 /* to window with first arg */ 24581 25082 if (valid_tabpage(new_curtab)) 24582 goto_tabpage_tp(new_curtab); 24583 @@ -5465,7 +5557,7 @@ 25083 - goto_tabpage_tp(new_curtab); 25084 + goto_tabpage_tp(new_curtab, TRUE); 25085 if (win_valid(new_curwin)) 25086 win_enter(new_curwin, FALSE); 25087 25088 @@ -4640,7 +4756,7 @@ 25089 */ 25090 #ifdef FEAT_WINDOWS 25091 if (had_tab > 0) 25092 - goto_tabpage_tp(first_tabpage); 25093 + goto_tabpage_tp(first_tabpage, TRUE); 25094 for (;;) 25095 { 25096 #endif 25097 @@ -4658,7 +4774,11 @@ 25098 #ifdef FEAT_WINDOWS 25099 || (had_tab > 0 && wp != firstwin) 25100 #endif 25101 - ) && firstwin != lastwin) 25102 + ) && firstwin != lastwin 25103 +#ifdef FEAT_AUTOCMD 25104 + && !(wp->w_closing || wp->w_buffer->b_closing) 25105 +#endif 25106 + ) 25107 { 25108 win_close(wp, FALSE); 25109 #ifdef FEAT_AUTOCMD 25110 @@ -4676,7 +4796,7 @@ 25111 /* Without the ":tab" modifier only do the current tab page. */ 25112 if (had_tab == 0 || tpnext == NULL) 25113 break; 25114 - goto_tabpage_tp(tpnext); 25115 + goto_tabpage_tp(tpnext, TRUE); 25116 } 25117 #endif 25118 25119 @@ -5417,7 +5537,7 @@ 25120 /* 25121 * Delete signs in buffer "buf". 25122 */ 25123 - static void 25124 + void 25125 buf_delete_signs(buf) 25126 buf_T *buf; 25127 { 25128 @@ -5465,7 +5585,7 @@ 24584 25129 buf = firstbuf; 24585 25130 else … … 24590 25135 if (buf->b_signlist != NULL) 24591 25136 { 24592 @@ -5473,7 +55 65,7 @@25137 @@ -5473,7 +5593,7 @@ 24593 25138 MSG_PUTS_ATTR(lbuf, hl_attr(HLF_D)); 24594 25139 msg_putchar('\n'); … … 24599 25144 vim_snprintf(lbuf, BUFSIZ, _(" line=%ld id=%d name=%s"), 24600 25145 (long)p->lnum, p->id, sign_typenr2name(p->typenr)); 24601 @@ -5606,7 +5 698,7 @@25146 @@ -5606,7 +5726,7 @@ 24602 25147 if (!aucmd) /* Don't trigger BufDelete autocommands here. */ 24603 25148 block_autocmds(); … … 24609 25154 unblock_autocmds(); 24610 25155 diff -Naur vim73.orig/src/charset.c vim73/src/charset.c 24611 --- vim73.orig/src/charset.c 201 2-06-03 23:09:52.948007269+000024612 +++ vim73/src/charset.c 2012-0 6-03 23:09:55.892085615+000025156 --- vim73.orig/src/charset.c 2010-08-12 18:16:04.000000000 +0000 25157 +++ vim73/src/charset.c 2012-07-20 20:31:16.277643707 +0000 24613 25158 @@ -463,41 +463,42 @@ 24614 25159 if (enc_utf8) … … 24712 25257 } 24713 25258 diff -Naur vim73.orig/src/config.h.in vim73/src/config.h.in 24714 --- vim73.orig/src/config.h.in 201 2-06-03 23:09:52.956007482+000024715 +++ vim73/src/config.h.in 2012-0 6-03 23:09:55.372071777+000025259 --- vim73.orig/src/config.h.in 2010-08-13 13:45:27.000000000 +0000 25260 +++ vim73/src/config.h.in 2012-07-20 20:31:14.604309173 +0000 24716 25261 @@ -346,9 +346,15 @@ 24717 25262 /* Define if dynamic python does not require RTLD_GLOBAL */ … … 24739 25284 24740 25285 diff -Naur vim73.orig/src/config.mk.in vim73/src/config.mk.in 24741 --- vim73.orig/src/config.mk.in 201 2-06-03 23:09:52.952007375+000024742 +++ vim73/src/config.mk.in 2012-0 6-03 23:09:53.304016743+000025286 --- vim73.orig/src/config.mk.in 2010-07-17 15:28:51.000000000 +0000 25287 +++ vim73/src/config.mk.in 2012-07-20 20:31:08.224304578 +0000 24743 25288 @@ -30,6 +30,7 @@ 24744 25289 CPP = @CPP@ … … 24750 25295 X_PRE_LIBS = @X_PRE_LIBS@ 24751 25296 diff -Naur vim73.orig/src/configure.in vim73/src/configure.in 24752 --- vim73.orig/src/configure.in 201 2-06-03 23:09:52.948007269+000024753 +++ vim73/src/configure.in 2012-0 6-03 23:09:55.368071671+000025297 --- vim73.orig/src/configure.in 2010-08-13 14:15:17.000000000 +0000 25298 +++ vim73/src/configure.in 2012-07-20 20:31:17.044310922 +0000 24754 25299 @@ -28,6 +28,16 @@ 24755 25300 AC_HEADER_STDC … … 24769 25314 if test -z "$CFLAGS"; then 24770 25315 CFLAGS="-O" 24771 @@ -491,6 +501,9 @@ 25316 @@ -319,15 +329,18 @@ 25317 echo "" 25318 echo "------------------------------------------" 25319 echo " On z/OS Unix, the environment variable" 25320 - echo " __CC_${ccn}MODE must be set to \"1\"!" 25321 + echo " _CC_${ccn}MODE must be set to \"1\"!" 25322 echo " Do:" 25323 echo " export _CC_${ccn}MODE=1" 25324 echo " and then call configure again." 25325 echo "------------------------------------------" 25326 exit 1 25327 fi 25328 - CFLAGS="$CFLAGS -D_ALL_SOURCE -Wc,float\\(IEEE\\)"; 25329 - LDFLAGS="$LDFLAGS -Wl,EDIT=NO" 25330 + # Set CFLAGS for configure process. 25331 + # This will be reset later for config.mk. 25332 + # Use haltonmsg to force error for missing H files. 25333 + CFLAGS="$CFLAGS -D_ALL_SOURCE -Wc,float(ieee),haltonmsg(3296)"; 25334 + LDFLAGS="$LDFLAGS -Wl,EDIT=NO" 25335 AC_MSG_RESULT(yes) 25336 ;; 25337 *) zOSUnix="no"; 25338 @@ -491,6 +504,9 @@ 24772 25339 LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"liblua${vi_cv_version_lua}.so$LUA_SONAME\\\" $LUA_CFLAGS" 24773 25340 fi … … 24779 25346 AC_SUBST(LUA_OBJ) 24780 25347 AC_SUBST(LUA_PRO) 24781 @@ -568,13 +58 1,27 @@25348 @@ -568,13 +584,27 @@ 24782 25349 SCHEME_INC=${vi_cv_path_mzscheme_pfx}/include/plt 24783 25350 else … … 24811 25378 fi 24812 25379 fi 24813 @@ -586,13 +61 3,23 @@25380 @@ -586,13 +616,23 @@ 24814 25381 elif test -f "${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a"; then 24815 25382 MZSCHEME_LIBS="${vi_cv_path_mzscheme_pfx}/lib/libmzscheme3m.a" … … 24836 25403 MZSCHEME_LIBS="-L${vi_cv_path_mzscheme_pfx}/lib -lmzscheme -lmzgc" 24837 25404 fi 24838 @@ -607,10 +64 4,20 @@25405 @@ -607,10 +647,20 @@ 24839 25406 fi 24840 25407 if test -d $vi_cv_path_mzscheme_pfx/lib/plt/collects; then … … 24858 25425 MZSCHEME_MZC="${vi_cv_path_mzscheme_pfx}/bin/mzc" 24859 25426 fi 24860 @@ -747,6 +79 4,10 @@25427 @@ -747,6 +797,10 @@ 24861 25428 PERL_CFLAGS="-DDYNAMIC_PERL_DLL=\\\"$libperl\\\" $PERL_CFLAGS" 24862 25429 fi … … 24869 25436 AC_SUBST(shrpenv) 24870 25437 AC_SUBST(PERL_SRC) 24871 @@ -857,9 +9 08,9 @@25438 @@ -857,9 +911,9 @@ 24872 25439 24873 25440 PYTHON_LIBS="${vi_cv_path_python_plibs}" … … 24881 25448 PYTHON_SRC="if_python.c" 24882 25449 dnl For Mac OSX 10.2 config.o is included in the Python library. 24883 @@ -871,7 +92 2,7 @@25450 @@ -871,7 +925,7 @@ 24884 25451 if test "${vi_cv_var_python_version}" = "1.4"; then 24885 25452 PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o" … … 24890 25457 dnl On FreeBSD linking with "-pthread" is required to use threads. 24891 25458 dnl _THREAD_SAFE must be used for compiling then. 24892 @@ -932,6 +98 3,10 @@25459 @@ -932,6 +986,10 @@ 24893 25460 AC_MSG_RESULT(too old) 24894 25461 fi … … 24901 25468 24902 25469 AC_SUBST(PYTHON_CONFDIR) 24903 @@ -958,6 +101 3,17 @@25470 @@ -958,6 +1016,17 @@ 24904 25471 ${vi_cv_path_python3} -c 'import sys; print(sys.version[:3])'` 24905 25472 ]]) … … 24919 25486 AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python3_pfx, 24920 25487 [ vi_cv_path_python3_pfx=` 24921 @@ -987,9 +105 3,13 @@25488 @@ -987,9 +1056,13 @@ 24922 25489 AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python3_conf, 24923 25490 [ … … 24934 25501 vi_cv_path_python3_conf="$d" 24935 25502 fi 24936 @@ -1014,14 +108 4,13 @@25503 @@ -1014,14 +1087,13 @@ 24937 25504 @echo "python3_BASEMODLIBS='$(BASEMODLIBS)'" 24938 25505 @echo "python3_LIBS='$(LIBS)'" … … 24951 25518 vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//` 24952 25519 vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//` 24953 @@ -1029,9 +1 098,9 @@25520 @@ -1029,9 +1101,9 @@ 24954 25521 24955 25522 PYTHON3_LIBS="${vi_cv_path_python3_plibs}" … … 24963 25530 PYTHON3_SRC="if_python3.c" 24964 25531 dnl For Mac OSX 10.2 config.o is included in the Python library. 24965 @@ -1109,11 +11 78,12 @@25532 @@ -1109,11 +1181,12 @@ 24966 25533 if test "$python_ok" = yes && test "$python3_ok" = yes; then 24967 25534 AC_DEFINE(DYNAMIC_PYTHON) … … 24979 25546 #include <dlfcn.h> 24980 25547 /* If this program fails, then RTLD_GLOBAL is needed. 24981 @@ -1122,15 +119 2,17 @@25548 @@ -1122,15 +1195,17 @@ 24982 25549 * Only the first pyhton version used will be switched on. 24983 25550 */ … … 24998 25565 needed = (*simple)("import termios") == -1; 24999 25566 (*final)(); 25000 @@ -1142,13 +121 4,61 @@25567 @@ -1142,13 +1217,61 @@ 25001 25568 int main(int argc, char** argv) 25002 25569 { … … 25009 25576 [AC_MSG_RESULT(yes);AC_DEFINE(PY_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)]) 25010 25577 + 25011 25012 25578 + CFLAGS=$cflags_save 25579 + LDFLAGS=$ldflags_save 25013 25580 + 25014 25581 + AC_MSG_CHECKING(whether we can do without RTLD_GLOBAL for Python3) … … 25055 25622 + [AC_MSG_RESULT(yes);AC_DEFINE(PY3_NO_RTLD_GLOBAL)], [AC_MSG_RESULT(no)]) 25056 25623 + 25057 +CFLAGS=$cflags_save25058 +LDFLAGS=$ldflags_save25624 CFLAGS=$cflags_save 25625 LDFLAGS=$ldflags_save 25059 25626 + 25060 25627 PYTHON_SRC="if_python.c" 25061 25628 PYTHON_OBJ="objects/if_python.o" 25062 25629 PYTHON_CFLAGS="$PYTHON_CFLAGS -DDYNAMIC_PYTHON_DLL=\\\"${python_INSTSONAME}\\\"" 25063 @@ -1290,6 +141 0,9 @@25630 @@ -1290,6 +1413,9 @@ 25064 25631 AC_MSG_RESULT(too old; need Tcl version 8.0 or later) 25065 25632 fi … … 25071 25638 AC_SUBST(TCL_SRC) 25072 25639 AC_SUBST(TCL_OBJ) 25073 @@ -1299,15 +142 2,15 @@25640 @@ -1299,15 +1425,15 @@ 25074 25641 25075 25642 AC_MSG_CHECKING(--enable-rubyinterp argument) … … 25091 25658 if test "X$vi_cv_path_ruby" != "X"; then 25092 25659 AC_MSG_CHECKING(Ruby version) 25093 @@ -1329,18 +145 2,15 @@25660 @@ -1329,18 +1455,15 @@ 25094 25661 RUBY_LIBS="$rubylibs" 25095 25662 fi … … 25119 25686 25120 25687 if test "X$librubyarg" != "X"; then 25121 @@ -1360,6 +148 0,12 @@25688 @@ -1360,6 +1483,12 @@ 25122 25689 RUBY_OBJ="objects/if_ruby.o" 25123 25690 RUBY_PRO="if_ruby.pro" … … 25132 25699 AC_MSG_RESULT(not found; disabling Ruby) 25133 25700 fi 25134 @@ -1367,6 +149 3,10 @@25701 @@ -1367,6 +1496,10 @@ 25135 25702 AC_MSG_RESULT(too old; need Ruby version 1.6.0 or later) 25136 25703 fi … … 25143 25710 AC_SUBST(RUBY_SRC) 25144 25711 AC_SUBST(RUBY_OBJ) 25145 @@ -2529,13 +2659,14 @@ 25712 @@ -2248,10 +2381,15 @@ 25713 if test -z "$SKIP_MOTIF"; then 25714 cppflags_save=$CPPFLAGS 25715 CPPFLAGS="$CPPFLAGS $X_CFLAGS" 25716 - AC_CHECK_HEADERS(Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h \ 25717 - Xm/UnhighlightT.h Xm/Notebook.h) 25718 + if test "$zOSUnix" = "yes"; then 25719 + xmheader="Xm/Xm.h" 25720 + else 25721 + xmheader="Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h 25722 + Xm/UnhighlightT.h Xm/Notebook.h" 25723 + fi 25724 + AC_CHECK_HEADERS($xmheader) 25725 25726 - if test $ac_cv_header_Xm_XpmP_h = yes; then 25727 + if test "x$ac_cv_header_Xm_XpmP_h" = "xyes"; then 25728 dnl Solaris uses XpmAttributes_21, very annoying. 25729 AC_MSG_CHECKING([for XpmAttributes_21 in Xm/XpmP.h]) 25730 AC_TRY_COMPILE([#include <Xm/XpmP.h>], [XpmAttributes_21 attr;], 25731 @@ -2529,13 +2667,14 @@ 25146 25732 AC_MSG_RESULT([empty: automatic terminal library selection]) 25147 25733 dnl On HP-UX 10.10 termcap or termlib should be used instead of … … 25161 25747 for libname in $tlibs; do 25162 25748 AC_CHECK_LIB(${libname}, tgetent,,) 25163 @@ -2975,6 +31 06,7 @@25749 @@ -2975,6 +3114,7 @@ 25164 25750 25165 25751 dnl Link with -lposix1e for ACL stuff; if not found, try -lacl for SGI … … 25169 25755 AC_ARG_ENABLE(acl, 25170 25756 [ --disable-acl Don't check for ACL support.], 25171 @@ -2997,6 +31 29,7 @@25757 @@ -2997,6 +3137,7 @@ 25172 25758 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_POSIX_ACL), 25173 25759 AC_MSG_RESULT(no)) … … 25177 25763 AC_TRY_LINK([ 25178 25764 #ifdef HAVE_SYS_ACL_H 25179 @@ -3004,7 +31 37,7 @@25765 @@ -3004,7 +3145,7 @@ 25180 25766 #endif], [acl("foo", GETACLCNT, 0, NULL); 25181 25767 ], … … 25186 25772 AC_MSG_CHECKING(for AIX ACL support) 25187 25773 AC_TRY_LINK([ 25188 @@ -3180,7 +33 13,7 @@25774 @@ -3180,7 +3321,7 @@ 25189 25775 }], 25190 25776 AC_MSG_RESULT(ok), … … 25195 25781 dnl Check for memmove() before bcopy(), makes memmove() be used when both are 25196 25782 dnl present, fixes problem with incompatibility between Solaris 2.4 and 2.5. 25197 @@ -3280,7 +34 13,7 @@25783 @@ -3280,7 +3421,7 @@ 25198 25784 AC_CHECK_LIB(xpg4, _xpg4_setrunelocale, [LIBS="$LIBS -lxpg4"],,) 25199 25785 … … 25204 25790 dnl -t for typedefs (many ctags have this) 25205 25791 dnl -s for static functions (Elvis ctags only?) 25206 @@ -3290,6 +34 23,10 @@25792 @@ -3290,6 +3431,10 @@ 25207 25793 test -f tags && mv tags tags.save 25208 25794 if (eval ctags --version /dev/null | grep Exuberant) < /dev/null 1>&AC_FD_CC 2>&1; then … … 25215 25801 TAGPRG="ctags" 25216 25802 (eval etags /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && TAGPRG="etags" 25217 @@ -3477,9 +36 14,10 @@25803 @@ -3477,9 +3622,10 @@ 25218 25804 dnl -D_FORTIFY_SOURCE=2 crashes Vim on strcpy(buf, "000") when buf is 25219 25805 dnl declared as char x[1] but actually longer. Introduced in gcc 4.0. … … 25227 25813 else 25228 25814 AC_MSG_RESULT(no) 25229 @@ -3487,6 +36 25,23@@25815 @@ -3487,6 +3633,28 @@ 25230 25816 fi 25231 25817 AC_SUBST(DEPEND_CFLAGS_FILTER) … … 25248 25834 +AC_SUBST(LINK_AS_NEEDED) 25249 25835 + 25836 +# IBM z/OS reset CFLAGS for config.mk 25837 +if test "$zOSUnix" = "yes"; then 25838 + CFLAGS="-D_ALL_SOURCE -Wc,float\(ieee\),dll" 25839 +fi 25840 + 25250 25841 dnl write output files 25251 25842 AC_OUTPUT(auto/config.mk:config.mk.in) 25252 25843 25844 diff -Naur vim73.orig/src/dehqx.py vim73/src/dehqx.py 25845 --- vim73.orig/src/dehqx.py 2010-05-15 11:04:12.000000000 +0000 25846 +++ vim73/src/dehqx.py 2012-07-20 20:31:17.260977744 +0000 25847 @@ -1,7 +1,10 @@ 25848 # Python script to get both the data and resource fork from a BinHex encoded 25849 # file. 25850 -# Author: Taro Muraoka 25851 -# Last Change: 2003 Oct 25 25852 +# Author: MURAOKA Taro <koron.kaoriya@gmail.com> 25853 +# Last Change: 2012 Jun 29 25854 +# 25855 +# Copyright (C) 2003,12 MURAOKA Taro <koron.kaoriya@gmail.com> 25856 +# THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. 25857 25858 import sys 25859 import binhex 25253 25860 diff -Naur vim73.orig/src/diff.c vim73/src/diff.c 25254 --- vim73.orig/src/diff.c 201 2-06-03 23:09:52.920006524+000025255 +++ vim73/src/diff.c 2012-0 6-03 23:09:55.880085297+000025861 --- vim73.orig/src/diff.c 2010-07-31 13:35:21.000000000 +0000 25862 +++ vim73/src/diff.c 2012-07-20 20:31:16.204310320 +0000 25256 25863 @@ -783,6 +783,15 @@ 25257 25864 goto theend; … … 25299 25906 curwin = wp; 25300 25907 diff -Naur vim73.orig/src/digraph.c vim73/src/digraph.c 25301 --- vim73.orig/src/digraph.c 201 2-06-03 23:09:52.952007375+000025302 +++ vim73/src/digraph.c 2012-0 6-03 23:09:55.156066030+000025908 --- vim73.orig/src/digraph.c 2010-05-15 11:04:09.000000000 +0000 25909 +++ vim73/src/digraph.c 2012-07-20 20:31:14.044308771 +0000 25303 25910 @@ -2080,13 +2080,13 @@ 25304 25911 /* … … 25349 25956 } 25350 25957 diff -Naur vim73.orig/src/edit.c vim73/src/edit.c 25351 --- vim73.orig/src/edit.c 201 2-06-03 23:09:52.952007375+000025352 +++ vim73/src/edit.c 2012-0 6-03 23:09:55.928086574+000025958 --- vim73.orig/src/edit.c 2010-08-08 12:55:05.000000000 +0000 25959 +++ vim73/src/edit.c 2012-07-20 20:31:18.157645052 +0000 25353 25960 @@ -58,6 +58,10 @@ 25354 25961 }; … … 25489 26096 #endif 25490 26097 - c)) 25491 + 26098 + c) && c != Ctrl_RSB)) 25492 26099 { 25493 26100 insert_special(c, FALSE, FALSE); … … 25594 26201 * Show the popup menu with a different set of matches. 25595 26202 * May also search for matches again if the previous search was interrupted. 25596 @@ -3397,14 +3473,20 @@ 26203 @@ -3391,20 +3467,32 @@ 26204 (*mb_char2bytes)(c, buf); 26205 buf[cc] = NUL; 26206 ins_char_bytes(buf, cc); 26207 + if (compl_opt_refresh_always) 26208 + AppendToRedobuff(buf); 26209 } 26210 else 26211 #endif 26212 + { 25597 26213 ins_char(c); 26214 + if (compl_opt_refresh_always) 26215 + AppendCharToRedobuff(c); 26216 + } 25598 26217 25599 26218 /* If we didn't complete finding matches we must search again. */ … … 25605 26224 - compl_leader = vim_strnsave(ml_get_curline() + compl_col, 25606 26225 + /* When 'always' is set, don't reset compl_leader. While completing, 25607 + * cursor do n't point original position, changing compl_leader would26226 + * cursor doesn't point original position, changing compl_leader would 25608 26227 + * break redo. */ 25609 26228 + if (!compl_opt_refresh_always) … … 25620 26239 25621 26240 /* 25622 @@ -3480,11 +356 2,7 @@26241 @@ -3480,11 +3568,7 @@ 25623 26242 return; 25624 26243 } … … 25633 26252 } 25634 26253 25635 @@ -3653,9 +373 1,6 @@26254 @@ -3653,9 +3737,6 @@ 25636 26255 * memory that was used, and make sure we can redo the insert. */ 25637 26256 if (compl_curr_match != NULL || compl_leader != NULL || c == Ctrl_E) … … 25643 26262 * If any of the original typed text has been changed, eg when 25644 26263 * ignorecase is set, we must add back-spaces to the redo 25645 @@ -3666,25 +374 1,9 @@26264 @@ -3666,25 +3747,9 @@ 25646 26265 */ 25647 26266 if (compl_curr_match != NULL && compl_used_match && c != Ctrl_E) … … 25671 26290 25672 26291 #ifdef FEAT_CINDENT 25673 @@ -3774,6 +3833,44 @@ 26292 @@ -3759,6 +3824,11 @@ 26293 if (want_cindent && in_cinkeys(KEY_COMPLETE, ' ', inindent(0))) 26294 do_c_expr_indent(); 26295 #endif 26296 +#ifdef FEAT_AUTOCMD 26297 + /* Trigger the CompleteDone event to give scripts a chance to act 26298 + * upon the completion. */ 26299 + apply_autocmds(EVENT_COMPLETEDONE, NULL, NULL, FALSE, curbuf); 26300 +#endif 26301 } 26302 } 26303 26304 @@ -3774,6 +3844,44 @@ 25674 26305 } 25675 26306 … … 25716 26347 * (depending on flag) starting from buf and looking for a non-scanned 25717 26348 * buffer (other than curbuf). curbuf is special, if it is called with 25718 @@ -3829,10 +39 26,14 @@26349 @@ -3829,10 +3937,14 @@ 25719 26350 int type; /* CTRL_X_OMNI or CTRL_X_FUNCTION */ 25720 26351 char_u *base; … … 25732 26363 funcname = (type == CTRL_X_FUNCTION) ? curbuf->b_p_cfu : curbuf->b_p_ofu; 25733 26364 if (*funcname == NUL) 25734 @@ -3843,13 +39 44,50 @@26365 @@ -3843,13 +3955,50 @@ 25735 26366 args[1] = base; 25736 26367 … … 25788 26419 #endif /* FEAT_COMPL_FUNC */ 25789 26420 25790 @@ -3876,6 +40 14,33 @@26421 @@ -3876,6 +4025,33 @@ 25791 26422 } 25792 26423 … … 25822 26453 * If the given string is already in the list of completions, then return 25823 26454 * NOTDONE, otherwise add it to the list and return OK. If there is an error, 25824 @@ -3889,6 +40 54,7 @@26455 @@ -3889,6 +4065,7 @@ 25825 26456 char_u *word; 25826 26457 int icase = FALSE; … … 25830 26461 25831 26462 if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL) 25832 @@ -3906,13 +40 72,15 @@26463 @@ -3906,13 +4083,15 @@ 25833 26464 icase = get_dict_number(tv->vval.v_dict, (char_u *)"icase"); 25834 26465 if (get_dict_string(tv->vval.v_dict, (char_u *)"dup", FALSE) != NULL) … … 25847 26478 return ins_compl_add(word, -1, icase, NULL, cptext, dir, 0, adup); 25848 26479 } 25849 @@ -4403,6 +45 71,11 @@26480 @@ -4403,6 +4582,11 @@ 25850 26481 int found_end = FALSE; 25851 26482 int advance; … … 25859 26490 && (compl_shown_match->cp_flags & ORIGINAL_TEXT) == 0) 25860 26491 { 25861 @@ -4994,6 +51 67,8 @@26492 @@ -4994,6 +5178,8 @@ 25862 26493 int col; 25863 26494 char_u *funcname; … … 25868 26499 /* Call 'completefunc' or 'omnifunc' and get pattern length as a 25869 26500 * string */ 25870 @@ -5009,8 +51 84,40 @@26501 @@ -5009,8 +5195,40 @@ 25871 26502 args[0] = (char_u *)"1"; 25872 26503 args[1] = NULL; … … 25909 26540 if (col < 0) 25910 26541 col = curs_col; 25911 @@ -5089,6 +5 296,10 @@26542 @@ -5089,6 +5307,10 @@ 25912 26543 else 25913 26544 edit_submode = (char_u *)_(CTRL_X_MSG(ctrl_x_mode)); … … 25920 26551 vim_free(compl_orig_text); 25921 26552 compl_orig_text = vim_strnsave(line + compl_col, compl_length); 25922 @@ -5249,7 +54 60,7 @@26553 @@ -5249,7 +5471,7 @@ 25923 26554 compl_curr_match->cp_number); 25924 26555 edit_submode_extra = match_ref; … … 25929 26560 } 25930 26561 } 25931 @@ -5691,6 +5902,8 @@ 26562 @@ -5558,6 +5780,16 @@ 26563 # define WHITECHAR(cc) vim_iswhite(cc) 26564 #endif 26565 26566 +/* 26567 + * "flags": INSCHAR_FORMAT - force formatting 26568 + * INSCHAR_CTRLV - char typed just after CTRL-V 26569 + * INSCHAR_NO_FEX - don't use 'formatexpr' 26570 + * 26571 + * NOTE: passes the flags value straight through to internal_format() which, 26572 + * beside INSCHAR_FORMAT (above), is also looking for these: 26573 + * INSCHAR_DO_COM - format comments 26574 + * INSCHAR_COM_LIST - format comments with num list or 2nd line indent 26575 + */ 26576 void 26577 insertchar(c, flags, second_indent) 26578 int c; /* character to insert or NUL */ 26579 @@ -5636,7 +5868,7 @@ 26580 * Need to remove existing (middle) comment leader and insert end 26581 * comment leader. First, check what comment leader we can find. 26582 */ 26583 - i = get_leader_len(line = ml_get_curline(), &p, FALSE); 26584 + i = get_leader_len(line = ml_get_curline(), &p, FALSE, TRUE); 26585 if (i > 0 && vim_strchr(p, COM_MIDDLE) != NULL) /* Just checking */ 26586 { 26587 /* Skip middle-comment string */ 26588 @@ -5691,6 +5923,8 @@ 25932 26589 * Don't do this when 'cindent' or 'indentexpr' is set, because we might 25933 26590 * need to re-indent at a ':', or any other character (but not what … … 25938 26595 #ifdef USE_ON_FLY_SCROLL 25939 26596 dont_scroll = FALSE; /* allow scrolling here */ 25940 @@ -5708,6 +59 21,9 @@26597 @@ -5708,6 +5942,9 @@ 25941 26598 #ifdef FEAT_RIGHTLEFT 25942 26599 && !p_ri … … 25948 26605 { 25949 26606 #define INPUT_BUFLEN 100 25950 @@ -5902,6 +6118,7 @@ 26607 @@ -5795,6 +6032,9 @@ 26608 26609 /* 26610 * Format text at the current insert position. 26611 + * 26612 + * If the INSCHAR_COM_LIST flag is present, then the value of second_indent 26613 + * will be the comment leader length sent to open_line(). 26614 */ 26615 static void 26616 internal_format(textwidth, second_indent, flags, format_only, c) 26617 @@ -5869,7 +6109,7 @@ 26618 26619 /* Don't break until after the comment leader */ 26620 if (do_comments) 26621 - leader_len = get_leader_len(ml_get_curline(), NULL, FALSE); 26622 + leader_len = get_leader_len(ml_get_curline(), NULL, FALSE, TRUE); 26623 else 26624 leader_len = 0; 26625 26626 @@ -5902,6 +6142,7 @@ 25951 26627 * Stop at first entered white when 'formatoptions' has 'v' 25952 26628 */ … … 25956 26632 || curwin->w_cursor.col >= Insstart.col) 25957 26633 { 25958 @@ -6598,11 +6815,7 @@ 26634 @@ -6072,23 +6313,59 @@ 26635 + (fo_white_par ? OPENLINE_KEEPTRAIL : 0) 26636 #ifdef FEAT_COMMENTS 26637 + (do_comments ? OPENLINE_DO_COM : 0) 26638 + + ((flags & INSCHAR_COM_LIST) ? OPENLINE_COM_LIST : 0) 26639 #endif 26640 - , old_indent); 26641 - old_indent = 0; 26642 + , ((flags & INSCHAR_COM_LIST) ? second_indent : old_indent)); 26643 + if (!(flags & INSCHAR_COM_LIST)) 26644 + old_indent = 0; 26645 26646 replace_offset = 0; 26647 if (first_line) 26648 { 26649 - if (second_indent < 0 && has_format_option(FO_Q_NUMBER)) 26650 - second_indent = get_number_indent(curwin->w_cursor.lnum -1); 26651 - if (second_indent >= 0) 26652 + if (!(flags & INSCHAR_COM_LIST)) 26653 { 26654 + /* 26655 + * This section is for auto-wrap of numeric lists. When not 26656 + * in insert mode (i.e. format_lines()), the INSCHAR_COM_LIST 26657 + * flag will be set and open_line() will handle it (as seen 26658 + * above). The code here (and in get_number_indent()) will 26659 + * recognize comments if needed... 26660 + */ 26661 + if (second_indent < 0 && has_format_option(FO_Q_NUMBER)) 26662 + second_indent = 26663 + get_number_indent(curwin->w_cursor.lnum - 1); 26664 + if (second_indent >= 0) 26665 + { 26666 #ifdef FEAT_VREPLACE 26667 - if (State & VREPLACE_FLAG) 26668 - change_indent(INDENT_SET, second_indent, FALSE, NUL, TRUE); 26669 - else 26670 + if (State & VREPLACE_FLAG) 26671 + change_indent(INDENT_SET, second_indent, 26672 + FALSE, NUL, TRUE); 26673 + else 26674 +#endif 26675 +#ifdef FEAT_COMMENTS 26676 + if (leader_len > 0 && second_indent - leader_len > 0) 26677 + { 26678 + int i; 26679 + int padding = second_indent - leader_len; 26680 + 26681 + /* We started at the first_line of a numbered list 26682 + * that has a comment. the open_line() function has 26683 + * inserted the proper comment leader and positioned 26684 + * the cursor at the end of the split line. Now we 26685 + * add the additional whitespace needed after the 26686 + * comment leader for the numbered list. */ 26687 + for (i = 0; i < padding; i++) 26688 + ins_str((char_u *)" "); 26689 + changed_bytes(curwin->w_cursor.lnum, leader_len); 26690 + } 26691 + else 26692 + { 26693 #endif 26694 - (void)set_indent(second_indent, SIN_CHANGED); 26695 + (void)set_indent(second_indent, SIN_CHANGED); 26696 +#ifdef FEAT_COMMENTS 26697 + } 26698 +#endif 26699 + } 26700 } 26701 first_line = FALSE; 26702 } 26703 @@ -6194,7 +6471,7 @@ 26704 /* With the 'c' flag in 'formatoptions' and 't' missing: only format 26705 * comments. */ 26706 if (has_format_option(FO_WRAP_COMS) && !has_format_option(FO_WRAP) 26707 - && get_leader_len(old, NULL, FALSE) == 0) 26708 + && get_leader_len(old, NULL, FALSE, TRUE) == 0) 26709 return; 26710 #endif 26711 26712 @@ -6598,11 +6875,7 @@ 25959 26713 char_u *s; 25960 26714 … … 25968 26722 { 25969 26723 s = last_insert; 25970 @@ -6640,7 +6 853,7 @@26724 @@ -6640,7 +6913,7 @@ 25971 26725 char_u *s; 25972 26726 { … … 25977 26731 int len; 25978 26732 25979 @@ -7202,7 +74 15,7 @@26733 @@ -7202,7 +7475,7 @@ 25980 26734 int cc; 25981 26735 { … … 25986 26740 int c; 25987 26741 25988 @@ -8768,7 +8981,7 @@ 26742 @@ -8352,7 +8625,7 @@ 26743 { 26744 temp = curwin->w_cursor.col; 26745 if (!can_bs(BS_EOL) /* only if "eol" included */ 26746 - || do_join(2, FALSE, TRUE) == FAIL) 26747 + || do_join(2, FALSE, TRUE, FALSE) == FAIL) 26748 vim_beep(); 26749 else 26750 curwin->w_cursor.col = temp; 26751 @@ -8533,7 +8806,7 @@ 26752 ptr[len - 1] = NUL; 26753 } 26754 26755 - (void)do_join(2, FALSE, FALSE); 26756 + (void)do_join(2, FALSE, FALSE, FALSE); 26757 if (temp == NUL && gchar_cursor() != NUL) 26758 inc_cursor(); 26759 } 26760 @@ -8768,7 +9041,7 @@ 25989 26761 * We can emulate the vi behaviour by pretending there is a dollar 25990 26762 * displayed even when there isn't. … … 25995 26767 25996 26768 #ifdef FEAT_FOLDING 25997 @@ -9598,6 +98 11,7 @@26769 @@ -9598,6 +9871,7 @@ 25998 26770 { 25999 26771 int c; … … 26003 26775 pc_status = PC_STATUS_UNSET; 26004 26776 if (redrawing() && !char_avail()) 26005 @@ -9606,6 +98 20,7 @@26777 @@ -9606,6 +9880,7 @@ 26006 26778 ins_redraw(FALSE); 26007 26779 … … 26011 26783 add_to_showcmd_c(Ctrl_K); 26012 26784 #endif 26013 @@ -9622,8 +98 37,10 @@26785 @@ -9622,8 +9897,10 @@ 26014 26786 c = plain_vgetc(); 26015 26787 --no_mapping; … … 26024 26796 if (IS_SPECIAL(c) || mod_mask) /* special key */ 26025 26797 { 26026 @@ -9635,6 +9 852,7 @@26798 @@ -9635,6 +9912,7 @@ 26027 26799 } 26028 26800 if (c != ESC) … … 26032 26804 { 26033 26805 /* may need to redraw when no more chars available now */ 26034 @@ -9642,11 +9 860,9 @@26806 @@ -9642,11 +9920,9 @@ 26035 26807 26036 26808 if (char2cells(c) == 1) … … 26045 26817 #ifdef FEAT_CMDL_INFO 26046 26818 add_to_showcmd_c(c); 26047 @@ -9657,8 +9 873,10 @@26819 @@ -9657,8 +9933,10 @@ 26048 26820 cc = plain_vgetc(); 26049 26821 --no_mapping; … … 26058 26830 { 26059 26831 AppendToRedobuff((char_u *)CTRL_V_STR); 26060 @@ -9680,7 +9 898,7 @@26832 @@ -9680,7 +9958,7 @@ 26061 26833 * Handle CTRL-E and CTRL-Y in Insert mode: copy char from other line. 26062 26834 * Returns the char to be inserted, or NUL if none found. … … 26067 26839 linenr_T lnum; 26068 26840 { 26069 @@ -9870,3 +10 088,52 @@26841 @@ -9870,3 +10148,52 @@ 26070 26842 validate_virtcol(); 26071 26843 return curwin->w_virtcol; … … 26121 26893 +#endif 26122 26894 diff -Naur vim73.orig/src/eval.c vim73/src/eval.c 26123 --- vim73.orig/src/eval.c 201 2-06-03 23:09:52.952007375+000026124 +++ vim73/src/eval.c 2012-0 6-03 23:09:55.932086681 +000026895 --- vim73.orig/src/eval.c 2010-08-09 20:12:14.000000000 +0000 26896 +++ vim73/src/eval.c 2012-07-20 20:31:18.337645181 +0000 26125 26897 @@ -10,9 +10,6 @@ 26126 26898 /* … … 26159 26931 static char_u *skip_var_list __ARGS((char_u *arg, int *var_count, int *semicolon)); 26160 26932 static char_u *skip_var_one __ARGS((char_u *arg)); 26161 @@ -433,9 +428,9 @@ 26933 @@ -429,31 +424,22 @@ 26934 static int get_lit_string_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate)); 26935 static int get_list_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate)); 26936 static int rettv_list_alloc __ARGS((typval_T *rettv)); 26937 -static listitem_T *listitem_alloc __ARGS((void)); 26162 26938 static void listitem_free __ARGS((listitem_T *item)); 26163 26939 -static void listitem_remove __ARGS((list_T *l, listitem_T *item)); 26164 26940 static long list_len __ARGS((list_T *l)); 26165 26941 -static int list_equal __ARGS((list_T *l1, list_T *l2, int ic)); 26166 26942 -static int dict_equal __ARGS((dict_T *d1, dict_T *d2, int ic)); 26167 26943 -static int tv_equal __ARGS((typval_T *tv1, typval_T *tv2, int ic)); 26944 -static listitem_T *list_find __ARGS((list_T *l, long n)); 26168 26945 +static int list_equal __ARGS((list_T *l1, list_T *l2, int ic, int recursive)); 26169 26946 +static int dict_equal __ARGS((dict_T *d1, dict_T *d2, int ic, int recursive)); 26170 26947 +static int tv_equal __ARGS((typval_T *tv1, typval_T *tv2, int ic, int recursive)); 26171 static listitem_T *list_find __ARGS((list_T *l, long n));26172 26948 static long list_find_nr __ARGS((list_T *l, long idx, int *errorp)); 26173 26949 static long list_idx_of_item __ARGS((list_T *l, listitem_T *item)); 26174 @@ -447,13 +442,13 @@ 26950 -static void list_append __ARGS((list_T *l, listitem_T *item)); 26951 static int list_append_number __ARGS((list_T *l, varnumber_T n)); 26952 -static int list_insert_tv __ARGS((list_T *l, typval_T *tv, listitem_T *item)); 26953 static int list_extend __ARGS((list_T *l1, list_T *l2, listitem_T *bef)); 26954 static int list_concat __ARGS((list_T *l1, list_T *l2, typval_T *tv)); 26175 26955 static list_T *list_copy __ARGS((list_T *orig, int deep, int copyID)); 26176 26956 -static void list_remove __ARGS((list_T *l, listitem_T *item, listitem_T *item2)); 26177 26957 static char_u *list2string __ARGS((typval_T *tv, int copyID)); 26178 26958 +static int list_join_inner __ARGS((garray_T *gap, list_T *l, char_u *sep, int echo_style, int copyID, garray_T *join_gap)); 26179 26959 static int list_join __ARGS((garray_T *gap, list_T *l, char_u *sep, int echo, int copyID)); 26180 26960 static int free_unref_items __ARGS((int copyID)); 26181 26182 26183 26961 -static void set_ref_in_ht __ARGS((hashtab_T *ht, int copyID)); 26962 -static void set_ref_in_list __ARGS((list_T *l, int copyID)); 26963 -static void set_ref_in_item __ARGS((typval_T *tv, int copyID)); 26184 26964 static int rettv_dict_alloc __ARGS((typval_T *rettv)); 26185 26965 -static void dict_unref __ARGS((dict_T *d)); … … 26187 26967 static dictitem_T *dictitem_copy __ARGS((dictitem_T *org)); 26188 26968 static void dictitem_remove __ARGS((dict_T *dict, dictitem_T *item)); 26189 @@ -480,6 +4 75,7 @@26969 @@ -480,6 +466,7 @@ 26190 26970 static void f_acos __ARGS((typval_T *argvars, typval_T *rettv)); 26191 26971 #endif … … 26195 26975 static void f_argc __ARGS((typval_T *argvars, typval_T *rettv)); 26196 26976 static void f_argidx __ARGS((typval_T *argvars, typval_T *rettv)); 26197 @@ -608,6 + 604,7 @@26977 @@ -608,6 +595,7 @@ 26198 26978 static void f_inputsave __ARGS((typval_T *argvars, typval_T *rettv)); 26199 26979 static void f_inputsecret __ARGS((typval_T *argvars, typval_T *rettv)); … … 26203 26983 static void f_islocked __ARGS((typval_T *argvars, typval_T *rettv)); 26204 26984 static void f_items __ARGS((typval_T *argvars, typval_T *rettv)); 26205 @@ -625,6 +6 22,9 @@26985 @@ -625,6 +613,9 @@ 26206 26986 static void f_log __ARGS((typval_T *argvars, typval_T *rettv)); 26207 26987 static void f_log10 __ARGS((typval_T *argvars, typval_T *rettv)); … … 26213 26993 static void f_maparg __ARGS((typval_T *argvars, typval_T *rettv)); 26214 26994 static void f_mapcheck __ARGS((typval_T *argvars, typval_T *rettv)); 26215 @@ -646,6 +6 46,7 @@26995 @@ -646,6 +637,7 @@ 26216 26996 #endif 26217 26997 static void f_nextnonblank __ARGS((typval_T *argvars, typval_T *rettv)); … … 26221 27001 #ifdef FEAT_FLOAT 26222 27002 static void f_pow __ARGS((typval_T *argvars, typval_T *rettv)); 26223 @@ -757,6 +758,7 @@ 27003 @@ -653,6 +645,12 @@ 27004 static void f_prevnonblank __ARGS((typval_T *argvars, typval_T *rettv)); 27005 static void f_printf __ARGS((typval_T *argvars, typval_T *rettv)); 27006 static void f_pumvisible __ARGS((typval_T *argvars, typval_T *rettv)); 27007 +#ifdef FEAT_PYTHON3 27008 +static void f_py3eval __ARGS((typval_T *argvars, typval_T *rettv)); 27009 +#endif 27010 +#ifdef FEAT_PYTHON 27011 +static void f_pyeval __ARGS((typval_T *argvars, typval_T *rettv)); 27012 +#endif 27013 static void f_range __ARGS((typval_T *argvars, typval_T *rettv)); 27014 static void f_readfile __ARGS((typval_T *argvars, typval_T *rettv)); 27015 static void f_reltime __ARGS((typval_T *argvars, typval_T *rettv)); 27016 @@ -757,6 +755,7 @@ 26224 27017 static void f_winsaveview __ARGS((typval_T *argvars, typval_T *rettv)); 26225 27018 static void f_winwidth __ARGS((typval_T *argvars, typval_T *rettv)); … … 26229 27022 static int list2fpos __ARGS((typval_T *arg, pos_T *posp, int *fnump)); 26230 27023 static pos_T *var2fpos __ARGS((typval_T *varp, int dollar_lnum, int *fnum)); 26231 @@ -791,6 +79 3,8 @@27024 @@ -791,6 +790,8 @@ 26232 27025 static void set_var __ARGS((char_u *name, typval_T *varp, int copy)); 26233 27026 static int var_check_ro __ARGS((int flags, char_u *name)); … … 26238 27031 static int item_copy __ARGS((typval_T *from, typval_T *to, int deep, int copyID)); 26239 27032 static char_u *find_option_end __ARGS((char_u **arg, int *opt_flags)); 26240 @@ -853,6 +857,7 @@ 26241 26242 init_var_dict(&globvardict, &globvars_var); 26243 init_var_dict(&vimvardict, &vimvars_var); 27033 @@ -820,8 +821,6 @@ 27034 static char_u *autoload_name __ARGS((char_u *name)); 27035 static void cat_func_name __ARGS((char_u *buf, ufunc_T *fp)); 27036 static void func_free __ARGS((ufunc_T *fp)); 27037 -static void func_unref __ARGS((char_u *name)); 27038 -static void func_ref __ARGS((char_u *name)); 27039 static void call_user_func __ARGS((ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rettv, linenr_T firstline, linenr_T lastline, dict_T *selfdict)); 27040 static int can_free_funccal __ARGS((funccall_T *fc, int copyID)) ; 27041 static void free_funccal __ARGS((funccall_T *fc, int free_val)); 27042 @@ -851,8 +850,9 @@ 27043 int i; 27044 struct vimvar *p; 27045 27046 - init_var_dict(&globvardict, &globvars_var); 27047 - init_var_dict(&vimvardict, &vimvars_var); 27048 + init_var_dict(&globvardict, &globvars_var, VAR_DEF_SCOPE); 27049 + init_var_dict(&vimvardict, &vimvars_var, VAR_SCOPE); 26244 27050 + vimvardict.dv_lock = VAR_FIXED; 26245 27051 hash_init(&compat_hashtab); 26246 27052 hash_init(&func_hashtab); 26247 27053 26248 @@ -875,10 +8 80,11 @@27054 @@ -875,10 +875,11 @@ 26249 27055 hash_add(&compat_hashtab, p->vv_di.di_key); 26250 27056 } … … 26259 27065 sortFunctions(); 26260 27066 #endif 26261 @@ -910,6 +91 6,7 @@27067 @@ -910,6 +911,7 @@ 26262 27068 hash_clear(&compat_hashtab); 26263 27069 … … 26267 27073 /* global variables */ 26268 27074 vars_clear(&globvarht); 26269 @@ -1355,7 +13 62,11 @@27075 @@ -1355,7 +1357,11 @@ 26270 27076 { 26271 27077 ga_init2(&ga, (int)sizeof(char), 80); … … 26279 27085 retval = (char_u *)ga.ga_data; 26280 27086 } 26281 @@ -1557,7 +156 8,7 @@27087 @@ -1557,7 +1563,7 @@ 26282 27088 * arguments are currently supported. 26283 27089 * Returns OK or FAIL. … … 26288 27094 char_u *func; 26289 27095 int argc; 26290 @@ -2325,7 +233 6,7 @@27096 @@ -2325,7 +2331,7 @@ 26291 27097 else if (endchars != NULL 26292 27098 && vim_strchr(endchars, *skipwhite(arg)) == NULL) … … 26297 27103 c1 = name[len]; 26298 27104 name[len] = NUL; 26299 @@ -2718,8 +272 9,27@@27105 @@ -2718,8 +2724,39 @@ 26300 27106 lp->ll_list = NULL; 26301 27107 lp->ll_dict = lp->ll_tv->vval.v_dict; 26302 27108 lp->ll_di = dict_find(lp->ll_dict, key, len); 26303 27109 + 26304 + /* When assigning to g: check that a function and variable name is 26305 + * valid. */ 26306 + if (rettv != NULL && lp->ll_dict == &globvardict) 27110 + /* When assigning to a scope dictionary check that a function and 27111 + * variable name is valid (only variable name unless it is l: or 27112 + * g: dictionary). Disallow overwriting a builtin function. */ 27113 + if (rettv != NULL && lp->ll_dict->dv_scope != 0) 26307 27114 + { 26308 + if (rettv->v_type == VAR_FUNC 27115 + int prevval; 27116 + int wrong; 27117 + 27118 + if (len != -1) 27119 + { 27120 + prevval = key[len]; 27121 + key[len] = NUL; 27122 + } 27123 + wrong = (lp->ll_dict->dv_scope == VAR_DEF_SCOPE 27124 + && rettv->v_type == VAR_FUNC 26309 27125 + && var_check_func_name(key, lp->ll_di == NULL)) 26310 + return NULL; 26311 + if (!valid_varname(key)) 27126 + || !valid_varname(key); 27127 + if (len != -1) 27128 + key[len] = prevval; 27129 + if (wrong) 26312 27130 + return NULL; 26313 27131 + } … … 26325 27143 if (*p == '[' || *p == '.' || unlet) 26326 27144 { 26327 @@ -2739,6 +27 69,10 @@27145 @@ -2739,6 +2776,10 @@ 26328 27146 p = NULL; 26329 27147 break; … … 26336 27154 clear_tv(&var1); 26337 27155 lp->ll_tv = &lp->ll_di->di_tv; 26338 @@ -2770,6 +28 04,8 @@27156 @@ -2770,6 +2811,8 @@ 26339 27157 { 26340 27158 if (lp->ll_range && !lp->ll_empty2) … … 26345 27163 } 26346 27164 26347 @@ -2787,7 +28 23,11 @@27165 @@ -2787,7 +2830,11 @@ 26348 27166 { 26349 27167 ni = list_find(lp->ll_list, lp->ll_n2); … … 26357 27175 } 26358 27176 26359 @@ -2795,7 +28 35,11 @@27177 @@ -2795,7 +2842,11 @@ 26360 27178 if (lp->ll_n1 < 0) 26361 27179 lp->ll_n1 = list_idx_of_item(lp->ll_list, lp->ll_li); … … 26369 27187 26370 27188 lp->ll_tv = &lp->ll_li->li_tv; 26371 @@ -3337,6 +338 1,18 @@27189 @@ -3337,6 +3388,18 @@ 26372 27190 int failed = FALSE; 26373 27191 funcdict_T fudi; … … 26388 27206 if (fudi.fd_newkey != NULL) 26389 27207 { 26390 @@ -3386,6 +344 2,9 @@27208 @@ -3386,6 +3449,9 @@ 26391 27209 { 26392 27210 curwin->w_cursor.lnum = lnum; … … 26398 27216 arg = startarg; 26399 27217 if (get_func_tv(name, (int)STRLEN(name), &rettv, &arg, 26400 @@ -4349,7 +44 08,8 @@27218 @@ -4349,7 +4415,8 @@ 26401 27219 else 26402 27220 { … … 26408 27226 n1 = !n1; 26409 27227 } 26410 @@ -4378,7 +44 38,8 @@27228 @@ -4378,7 +4445,8 @@ 26411 27229 else 26412 27230 { … … 26418 27236 n1 = !n1; 26419 27237 } 26420 @@ -5097,9 +51 58,7 @@27238 @@ -5097,9 +5165,7 @@ 26421 27239 else 26422 27240 ret = OK; … … 26429 27247 26430 27248 *arg = skipwhite(*arg); 26431 @@ -5913,10 +5972,11 @@ 27249 @@ -5868,7 +5934,7 @@ 27250 /* 27251 * Allocate a list item. 27252 */ 27253 - static listitem_T * 27254 + listitem_T * 27255 listitem_alloc() 27256 { 27257 return (listitem_T *)alloc(sizeof(listitem_T)); 27258 @@ -5888,7 +5954,7 @@ 27259 /* 27260 * Remove a list item from a List and free it. Also clears the value. 27261 */ 27262 - static void 27263 + void 27264 listitem_remove(l, item) 27265 list_T *l; 27266 listitem_T *item; 27267 @@ -5913,10 +5979,11 @@ 26432 27268 * Return TRUE when two lists have exactly the same values. 26433 27269 */ … … 26442 27278 listitem_T *item1, *item2; 26443 27279 26444 @@ -5930,7 +599 0,7 @@27280 @@ -5930,7 +5997,7 @@ 26445 27281 for (item1 = l1->lv_first, item2 = l2->lv_first; 26446 27282 item1 != NULL && item2 != NULL; … … 26451 27287 return item1 == NULL && item2 == NULL; 26452 27288 } 26453 @@ -5952,10 +601 2,11 @@27289 @@ -5952,10 +6019,11 @@ 26454 27290 * Return TRUE when two dictionaries have exactly the same key/values. 26455 27291 */ … … 26464 27300 hashitem_T *hi; 26465 27301 dictitem_T *item2; 26466 @@ -5976,7 +60 37,7 @@27302 @@ -5976,7 +6044,7 @@ 26467 27303 item2 = dict_find(d2, hi->hi_key, -1); 26468 27304 if (item2 == NULL) … … 26473 27309 --todo; 26474 27310 } 26475 @@ -5984,41 +60 45,54 @@27311 @@ -5984,41 +6052,54 @@ 26476 27312 return TRUE; 26477 27313 } … … 26539 27375 26540 27376 case VAR_FUNC: 26541 @@ -6502,47 +6576,119 @@ 27377 @@ -6049,7 +6130,7 @@ 27378 * A negative index is counted from the end; -1 is the last item. 27379 * Returns NULL when "n" is out of range. 27380 */ 27381 - static listitem_T * 27382 + listitem_T * 27383 list_find(l, n) 27384 list_T *l; 27385 long n; 27386 @@ -6191,7 +6272,7 @@ 27387 /* 27388 * Append item "item" to the end of list "l". 27389 */ 27390 - static void 27391 + void 27392 list_append(l, item) 27393 list_T *l; 27394 listitem_T *item; 27395 @@ -6304,7 +6385,7 @@ 27396 * If "item" is NULL append at the end. 27397 * Return FAIL when out of memory. 27398 */ 27399 - static int 27400 + int 27401 list_insert_tv(l, tv, item) 27402 list_T *l; 27403 typval_T *tv; 27404 @@ -6449,7 +6530,7 @@ 27405 * Remove items "item" to "item2" from list "l". 27406 * Does not free the listitem or the value! 27407 */ 27408 - static void 27409 + void 27410 list_remove(l, item, item2) 27411 list_T *l; 27412 listitem_T *item; 27413 @@ -6502,47 +6583,119 @@ 26542 27414 return (char_u *)ga.ga_data; 26543 27415 } … … 26676 27548 * 26677 27549 * We use reference counts to be able to free most items right away when they 26678 @@ -6635,6 +678 1,10@@27550 @@ -6635,6 +6788,18 @@ 26679 27551 /* v: vars */ 26680 27552 set_ref_in_ht(&vimvarht, copyID); … … 26684 27556 +#endif 26685 27557 + 27558 +#ifdef FEAT_PYTHON 27559 + set_ref_in_python(copyID); 27560 +#endif 27561 + 27562 +#ifdef FEAT_PYTHON3 27563 + set_ref_in_python3(copyID); 27564 +#endif 27565 + 26686 27566 /* 26687 27567 * 2. Free lists and dictionaries that are not referenced. 26688 27568 */ 26689 @@ -6837,7 +6987,7 @@ 27569 @@ -6720,7 +6885,7 @@ 27570 /* 27571 * Mark all lists and dicts referenced through hashtab "ht" with "copyID". 27572 */ 27573 - static void 27574 + void 27575 set_ref_in_ht(ht, copyID) 27576 hashtab_T *ht; 27577 int copyID; 27578 @@ -6740,7 +6905,7 @@ 27579 /* 27580 * Mark all lists and dicts referenced through list "l" with "copyID". 27581 */ 27582 - static void 27583 + void 27584 set_ref_in_list(l, copyID) 27585 list_T *l; 27586 int copyID; 27587 @@ -6754,7 +6919,7 @@ 27588 /* 27589 * Mark all lists and dicts referenced through typval "tv" with "copyID". 27590 */ 27591 - static void 27592 + void 27593 set_ref_in_item(tv, copyID) 27594 typval_T *tv; 27595 int copyID; 27596 @@ -6798,7 +6963,7 @@ 27597 d = (dict_T *)alloc(sizeof(dict_T)); 27598 if (d != NULL) 27599 { 27600 - /* Add the list to the list of dicts for garbage collection. */ 27601 + /* Add the dict to the list of dicts for garbage collection. */ 27602 if (first_dict != NULL) 27603 first_dict->dv_used_prev = d; 27604 d->dv_used_next = first_dict; 27605 @@ -6807,6 +6972,7 @@ 27606 27607 hash_init(&d->dv_hashtab); 27608 d->dv_lock = 0; 27609 + d->dv_scope = 0; 27610 d->dv_refcount = 0; 27611 d->dv_copyID = 0; 27612 } 27613 @@ -6837,7 +7003,7 @@ 26690 27614 * Unreference a Dictionary: decrement the reference count and free it when it 26691 27615 * becomes zero. … … 26696 27620 dict_T *d; 26697 27621 { 26698 @@ -7075,7 +72 25,7 @@27622 @@ -7075,7 +7241,7 @@ 26699 27623 } 26700 27624 … … 26705 27629 */ 26706 27630 int 26707 @@ -7097,6 +72 47,7 @@27631 @@ -7097,6 +7263,7 @@ 26708 27632 dictitem_free(item); 26709 27633 return FAIL; … … 26713 27637 } 26714 27638 26715 @@ -7649,6 +78 00,7 @@27639 @@ -7649,6 +7816,7 @@ 26716 27640 {"acos", 1, 1, f_acos}, /* WJMc */ 26717 27641 #endif … … 26721 27645 {"argc", 0, 0, f_argc}, 26722 27646 {"argidx", 0, 0, f_argidx}, 26723 @@ -7708,7 +78 60,7 @@27647 @@ -7708,7 +7876,7 @@ 26724 27648 #ifdef FEAT_FLOAT 26725 27649 {"exp", 1, 1, f_exp}, … … 26730 27654 {"feedkeys", 1, 2, f_feedkeys}, 26731 27655 {"file_readable", 1, 1, f_filereadable}, /* obsolete */ 26732 @@ -7759,7 +79 11,7 @@27656 @@ -7759,7 +7927,7 @@ 26733 27657 {"getwinposx", 0, 0, f_getwinposx}, 26734 27658 {"getwinposy", 0, 0, f_getwinposy}, … … 26739 27663 {"has", 1, 1, f_has}, 26740 27664 {"has_key", 2, 2, f_has_key}, 26741 @@ -7784,6 +79 36,7 @@27665 @@ -7784,6 +7952,7 @@ 26742 27666 {"inputsave", 0, 0, f_inputsave}, 26743 27667 {"inputsecret", 1, 2, f_inputsecret}, … … 26747 27671 {"islocked", 1, 1, f_islocked}, 26748 27672 {"items", 1, 1, f_items}, 26749 @@ -7801,8 +79 54,11 @@27673 @@ -7801,8 +7970,11 @@ 26750 27674 {"log", 1, 1, f_log}, 26751 27675 {"log10", 1, 1, f_log10}, … … 26760 27684 {"match", 2, 4, f_match}, 26761 27685 {"matchadd", 2, 4, f_matchadd}, 26762 @@ -7822,6 +79 78,7 @@27686 @@ -7822,6 +7994,7 @@ 26763 27687 #endif 26764 27688 {"nextnonblank", 1, 1, f_nextnonblank}, … … 26768 27692 #ifdef FEAT_FLOAT 26769 27693 {"pow", 2, 2, f_pow}, 26770 @@ -7870,7 +8027,7 @@ 27694 @@ -7829,6 +8002,12 @@ 27695 {"prevnonblank", 1, 1, f_prevnonblank}, 27696 {"printf", 2, 19, f_printf}, 27697 {"pumvisible", 0, 0, f_pumvisible}, 27698 +#ifdef FEAT_PYTHON3 27699 + {"py3eval", 1, 1, f_py3eval}, 27700 +#endif 27701 +#ifdef FEAT_PYTHON 27702 + {"pyeval", 1, 1, f_pyeval}, 27703 +#endif 27704 {"range", 1, 3, f_range}, 27705 {"readfile", 1, 3, f_readfile}, 27706 {"reltime", 0, 2, f_reltime}, 27707 @@ -7870,7 +8049,7 @@ 26771 27708 {"sin", 1, 1, f_sin}, 26772 27709 {"sinh", 1, 1, f_sinh}, … … 26777 27714 {"spellbadword", 0, 1, f_spellbadword}, 26778 27715 {"spellsuggest", 1, 3, f_spellsuggest}, 26779 @@ -7933,6 +8 090,7 @@27716 @@ -7933,6 +8112,7 @@ 26780 27717 {"winsaveview", 0, 0, f_winsaveview}, 26781 27718 {"winwidth", 1, 1, f_winwidth}, … … 26785 27722 26786 27723 #if defined(FEAT_CMDL_COMPL) || defined(PROTO) 26787 @@ -8497,7 +86 55,7 @@27724 @@ -8497,7 +8677,7 @@ 26788 27725 if (argvars[0].v_type == VAR_LIST) 26789 27726 { … … 26794 27731 copy_tv(&argvars[0], rettv); 26795 27732 } 26796 @@ -8506,6 +86 64,18 @@27733 @@ -8506,6 +8686,18 @@ 26797 27734 } 26798 27735 … … 26813 27750 */ 26814 27751 static void 26815 @@ -9298,7 +9468,7 @@ 27752 @@ -8980,6 +9172,45 @@ 27753 #endif 27754 } 27755 27756 + int 27757 +func_call(name, args, selfdict, rettv) 27758 + char_u *name; 27759 + typval_T *args; 27760 + dict_T *selfdict; 27761 + typval_T *rettv; 27762 +{ 27763 + listitem_T *item; 27764 + typval_T argv[MAX_FUNC_ARGS + 1]; 27765 + int argc = 0; 27766 + int dummy; 27767 + int r = 0; 27768 + 27769 + for (item = args->vval.v_list->lv_first; item != NULL; 27770 + item = item->li_next) 27771 + { 27772 + if (argc == MAX_FUNC_ARGS) 27773 + { 27774 + EMSG(_("E699: Too many arguments")); 27775 + break; 27776 + } 27777 + /* Make a copy of each argument. This is needed to be able to set 27778 + * v_lock to VAR_FIXED in the copy without changing the original list. 27779 + */ 27780 + copy_tv(&item->li_tv, &argv[argc++]); 27781 + } 27782 + 27783 + if (item == NULL) 27784 + r = call_func(name, (int)STRLEN(name), rettv, argc, argv, 27785 + curwin->w_cursor.lnum, curwin->w_cursor.lnum, 27786 + &dummy, TRUE, selfdict); 27787 + 27788 + /* Free the arguments. */ 27789 + while (argc > 0) 27790 + clear_tv(&argv[--argc]); 27791 + 27792 + return r; 27793 +} 27794 + 27795 /* 27796 * "call(func, arglist)" function 27797 */ 27798 @@ -8989,10 +9220,6 @@ 27799 typval_T *rettv; 27800 { 27801 char_u *func; 27802 - typval_T argv[MAX_FUNC_ARGS + 1]; 27803 - int argc = 0; 27804 - listitem_T *item; 27805 - int dummy; 27806 dict_T *selfdict = NULL; 27807 27808 if (argvars[1].v_type != VAR_LIST) 27809 @@ -9020,28 +9247,7 @@ 27810 selfdict = argvars[2].vval.v_dict; 27811 } 27812 27813 - for (item = argvars[1].vval.v_list->lv_first; item != NULL; 27814 - item = item->li_next) 27815 - { 27816 - if (argc == MAX_FUNC_ARGS) 27817 - { 27818 - EMSG(_("E699: Too many arguments")); 27819 - break; 27820 - } 27821 - /* Make a copy of each argument. This is needed to be able to set 27822 - * v_lock to VAR_FIXED in the copy without changing the original list. 27823 - */ 27824 - copy_tv(&item->li_tv, &argv[argc++]); 27825 - } 27826 - 27827 - if (item == NULL) 27828 - (void)call_func(func, (int)STRLEN(func), rettv, argc, argv, 27829 - curwin->w_cursor.lnum, curwin->w_cursor.lnum, 27830 - &dummy, TRUE, selfdict); 27831 - 27832 - /* Free the arguments. */ 27833 - while (argc > 0) 27834 - clear_tv(&argv[--argc]); 27835 + (void)func_call(func, &argvars[1], selfdict, rettv); 27836 } 27837 27838 #ifdef FEAT_FLOAT 27839 @@ -9298,7 +9504,7 @@ 26816 27840 26817 27841 if (!error) … … 26822 27846 } 26823 27847 26824 @@ -9389,7 +95 59,7 @@27848 @@ -9389,7 +9595,7 @@ 26825 27849 } 26826 27850 … … 26831 27855 } 26832 27856 } 26833 @@ -9416,7 +9 586,7 @@27857 @@ -9416,7 +9622,7 @@ 26834 27858 if (!HASHITEM_EMPTY(hi)) 26835 27859 { … … 26840 27864 } 26841 27865 } 26842 @@ -9857,17 +100 27,36 @@27866 @@ -9857,17 +10063,36 @@ 26843 27867 char_u *s; 26844 27868 int len; … … 26879 27903 else 26880 27904 { 26881 @@ -9875,12 +10 064,25 @@27905 @@ -9875,12 +10100,25 @@ 26882 27906 * for 'wildignore' and don't put matches for 'suffixes' at the end. */ 26883 27907 if (argvars[1].v_type != VAR_UNKNOWN … … 26907 27931 else 26908 27932 rettv->vval.v_string = NULL; 26909 @@ -9896,6 +10 098,8 @@27933 @@ -9896,6 +10134,8 @@ 26910 27934 typval_T *argvars; 26911 27935 typval_T *rettv; … … 26916 27940 { 26917 27941 list_T *l1, *l2; 26918 @@ -9905,7 +101 09,7 @@27942 @@ -9905,7 +10145,7 @@ 26919 27943 26920 27944 l1 = argvars[0].vval.v_list; … … 26925 27949 { 26926 27950 if (argvars[2].v_type != VAR_UNKNOWN) 26927 @@ -9944,7 +101 48,7 @@27951 @@ -9944,7 +10184,7 @@ 26928 27952 26929 27953 d1 = argvars[0].vval.v_dict; … … 26934 27958 { 26935 27959 /* Check the third argument. */ 26936 @@ -9987,7 +10191,7 @@ 27960 @@ -9976,6 +10216,19 @@ 27961 { 27962 --todo; 27963 di1 = dict_find(d1, hi2->hi_key, -1); 27964 + if (d1->dv_scope != 0) 27965 + { 27966 + /* Disallow replacing a builtin function in l: and g:. 27967 + * Check the key to be valid when adding to any 27968 + * scope. */ 27969 + if (d1->dv_scope == VAR_DEF_SCOPE 27970 + && HI2DI(hi2)->di_tv.v_type == VAR_FUNC 27971 + && var_check_func_name(hi2->hi_key, 27972 + di1 == NULL)) 27973 + break; 27974 + if (!valid_varname(hi2->hi_key)) 27975 + break; 27976 + } 27977 if (di1 == NULL) 27978 { 27979 di1 = dictitem_copy(HI2DI(hi2)); 27980 @@ -9987,7 +10240,7 @@ 26937 27981 EMSG2(_("E737: Key already exists: %s"), hi2->hi_key); 26938 27982 break; … … 26943 27987 clear_tv(&di1->di_tv); 26944 27988 copy_tv(&HI2DI(hi2)->di_tv, &di1->di_tv); 26945 @@ -10186,20 +10 390,22 @@27989 @@ -10186,20 +10439,22 @@ 26946 27990 typval_T save_key; 26947 27991 int rem; … … 26969 28013 } 26970 28014 else 26971 @@ -10236,7 +104 42,8 @@28015 @@ -10236,7 +10491,8 @@ 26972 28016 { 26973 28017 --todo; … … 26979 28023 vimvars[VV_KEY].vv_str = vim_strsave(di->di_key); 26980 28024 if (filter_map_one(&di->di_tv, expr, map, &rem) == FAIL 26981 @@ -10255,7 +10 462,7 @@28025 @@ -10255,7 +10511,7 @@ 26982 28026 26983 28027 for (li = l->lv_first; li != NULL; li = nli) … … 26988 28032 nli = li->li_next; 26989 28033 vimvars[VV_KEY].vv_nr = idx; 26990 @@ -10839,6 +110 46,11 @@28034 @@ -10839,6 +11095,11 @@ 26991 28035 26992 28036 if (*varname == '&') /* buffer-local-option */ … … 27000 28044 { 27001 28045 if (*varname == NUL) 27002 @@ -11039,18 +11 251,22 @@28046 @@ -11039,18 +11300,22 @@ 27003 28047 typval_T *argvars UNUSED; 27004 28048 typval_T *rettv; … … 27030 28074 } 27031 28075 27032 @@ -11653,22 +11 869,44 @@28076 @@ -11653,22 +11918,44 @@ 27033 28077 typval_T *argvars; 27034 28078 typval_T *rettv; … … 27082 28126 else 27083 28127 rettv->vval.v_string = NULL; 27084 @@ -11741,9 +1 1979,6 @@28128 @@ -11741,9 +12028,6 @@ 27085 28129 #ifdef __QNX__ 27086 28130 "qnx", … … 27092 28136 "unix", 27093 28137 #endif 27094 @@ -11856,7 +12091,7 @@ 28138 @@ -11786,6 +12070,11 @@ 28139 "all_builtin_terms", 28140 # endif 28141 #endif 28142 +#if defined(FEAT_BROWSE) && (defined(USE_FILE_CHOOSER) \ 28143 + || defined(FEAT_GUI_W32) \ 28144 + || defined(FEAT_GUI_MOTIF)) 28145 + "browsefilter", 28146 +#endif 28147 #ifdef FEAT_BYTEOFF 28148 "byte_offset", 28149 #endif 28150 @@ -11856,7 +12145,7 @@ 27095 28151 #ifdef FEAT_SEARCHPATH 27096 28152 "file_in_path", … … 27101 28157 #endif 27102 28158 #ifdef FEAT_FIND_ID 27103 @@ -12002,9 +122 37,6 @@28159 @@ -12002,9 +12291,6 @@ 27104 28160 #ifdef FEAT_OLE 27105 28161 "ole", … … 27111 28167 "path_extra", 27112 28168 #endif 27113 @@ -12116,6 +12 348,9 @@28169 @@ -12116,6 +12402,9 @@ 27114 28170 #ifdef FEAT_TOOLBAR 27115 28171 "toolbar", … … 27121 28177 "user-commands", /* was accidentally included in 5.4 */ 27122 28178 "user_commands", 27123 @@ -12159,6 +12 394,9 @@28179 @@ -12159,6 +12448,9 @@ 27124 28180 #ifdef FEAT_XFONTSET 27125 28181 "xfontset", … … 27131 28187 "xsmp", 27132 28188 #endif 27133 @@ -12572,7 +128 10,7 @@28189 @@ -12572,7 +12864,7 @@ 27134 28190 } 27135 28191 … … 27140 28196 rettv->vval.v_number = idx; 27141 28197 break; 27142 @@ -12712,7 +12950,7 @@ 28198 @@ -12648,6 +12940,7 @@ 28199 int xp_namelen; 28200 long argt; 28201 28202 + /* input() with a third argument: completion */ 28203 rettv->vval.v_string = NULL; 28204 28205 xp_name = get_tv_string_buf_chk(&argvars[2], buf); 28206 @@ -12666,6 +12959,11 @@ 28207 rettv->vval.v_string = 28208 getcmdline_prompt(inputsecret_flag ? NUL : '@', p, echo_attr, 28209 xp_type, xp_arg); 28210 + if (rettv->vval.v_string == NULL 28211 + && argvars[1].v_type != VAR_UNKNOWN 28212 + && argvars[2].v_type != VAR_UNKNOWN) 28213 + rettv->vval.v_string = vim_strsave(get_tv_string_buf( 28214 + &argvars[2], buf)); 28215 28216 vim_free(xp_arg); 28217 28218 @@ -12712,7 +13010,7 @@ 27143 28219 IObuff[0] = NUL; 27144 28220 if (message != NULL && defstr != NULL … … 27149 28225 else 27150 28226 { 27151 @@ -12850,7 +13 088,7 @@28227 @@ -12850,7 +13148,7 @@ 27152 28228 if (argvars[0].v_type != VAR_LIST) 27153 28229 EMSG2(_(e_listarg), "insert()"); … … 27158 28234 if (argvars[2].v_type != VAR_UNKNOWN) 27159 28235 before = get_tv_number_chk(&argvars[2], &error); 27160 @@ -12877,6 +131 15,17 @@28236 @@ -12877,6 +13175,17 @@ 27161 28237 } 27162 28238 … … 27176 28252 */ 27177 28253 static void 27178 @@ -13290,8 +135 39,10 @@28254 @@ -13290,8 +13599,10 @@ 27179 28255 char_u *keys_buf = NULL; 27180 28256 char_u *rhs; … … 27188 28264 /* return empty string for failure */ 27189 28265 rettv->v_type = VAR_STRING; 27190 @@ -13305,7 +13 556,11 @@28266 @@ -13305,7 +13616,11 @@ 27191 28267 { 27192 28268 which = get_tv_string_buf_chk(&argvars[1], buf); … … 27200 28276 else 27201 28277 which = (char_u *)""; 27202 @@ -13315,19 +13 570,34 @@28278 @@ -13315,19 +13630,34 @@ 27203 28279 mode = get_map_mode(&which, 0); 27204 28280 … … 27245 28321 } 27246 28322 27247 @@ -13367,6 +136 37,23 @@28323 @@ -13367,6 +13697,23 @@ 27248 28324 } 27249 28325 #endif … … 27269 28345 * "map()" function 27270 28346 */ 27271 @@ -14006,6 +14 293,18 @@28347 @@ -14006,6 +14353,18 @@ 27272 28348 } 27273 28349 … … 27288 28364 */ 27289 28365 static void 27290 @@ -14177,22 +14476,19 @@ 28366 @@ -14125,6 +14484,40 @@ 28367 #endif 28368 } 28369 28370 +#ifdef FEAT_PYTHON3 28371 +/* 28372 + * "py3eval()" function 28373 + */ 28374 + static void 28375 +f_py3eval(argvars, rettv) 28376 + typval_T *argvars; 28377 + typval_T *rettv; 28378 +{ 28379 + char_u *str; 28380 + char_u buf[NUMBUFLEN]; 28381 + 28382 + str = get_tv_string_buf(&argvars[0], buf); 28383 + do_py3eval(str, rettv); 28384 +} 28385 +#endif 28386 + 28387 +#ifdef FEAT_PYTHON 28388 +/* 28389 + * "pyeval()" function 28390 + */ 28391 + static void 28392 +f_pyeval(argvars, rettv) 28393 + typval_T *argvars; 28394 + typval_T *rettv; 28395 +{ 28396 + char_u *str; 28397 + char_u buf[NUMBUFLEN]; 28398 + 28399 + str = get_tv_string_buf(&argvars[0], buf); 28400 + do_pyeval(str, rettv); 28401 +} 28402 +#endif 28403 + 28404 /* 28405 * "range()" function 28406 */ 28407 @@ -14177,22 +14570,19 @@ 27291 28408 typval_T *rettv; 27292 28409 { … … 27322 28439 if (argvars[1].v_type != VAR_UNKNOWN) 27323 28440 { 27324 @@ -14214,49 +14 510,61 @@28441 @@ -14214,49 +14604,61 @@ 27325 28442 return; 27326 28443 } … … 27415 28532 } 27416 28533 li->li_tv.v_type = VAR_STRING; 27417 @@ -14264,71 +14 572,111 @@28534 @@ -14264,71 +14666,111 @@ 27418 28535 li->li_tv.vval.v_string = s; 27419 28536 list_append(rettv->vval.v_list, li); … … 27514 28631 + prevsize = (long)(p - start); 27515 28632 + else 27516 + { 28633 { 28634 - mch_memmove(s, prev, prevlen); 28635 - mch_memmove(s + prevlen, buf, buflen); 28636 - vim_free(prev); 28637 - prev = s; 28638 - prevlen += buflen; 27517 28639 + long grow50pc = (prevsize * 3) / 2; 27518 28640 + long growmin = (long)((p - start) * 2 + prevlen); … … 27522 28644 + : vim_realloc(prev, prevsize); 27523 28645 + if (newprev == NULL) 27524 { 27525 - mch_memmove(s, prev, prevlen); 27526 - mch_memmove(s + prevlen, buf, buflen); 27527 - vim_free(prev); 27528 - prev = s; 27529 - prevlen += buflen; 28646 + { 27530 28647 + do_outofmem_msg((long_u)prevsize); 27531 28648 + failed = TRUE; … … 27569 28686 fclose(fd); 27570 28687 } 27571 @@ -14691,13 +15 039,14 @@28688 @@ -14691,13 +15133,14 @@ 27572 28689 char_u *key; 27573 28690 dict_T *d; … … 27585 28702 key = get_tv_string_chk(&argvars[1]); 27586 28703 if (key != NULL) 27587 @@ -14717,7 +15 066,7 @@28704 @@ -14717,7 +15160,7 @@ 27588 28705 else if (argvars[0].v_type != VAR_LIST) 27589 28706 EMSG2(_(e_listdictarg), "remove()"); … … 27594 28711 int error = FALSE; 27595 28712 27596 @@ -14847,6 +15 196,9 @@28713 @@ -14847,6 +15290,9 @@ 27597 28714 typval_T *rettv; 27598 28715 { … … 27604 28721 p = get_tv_string(&argvars[0]); 27605 28722 #ifdef FEAT_SHORTCUT 27606 @@ -14862,7 +15 214,6 @@28723 @@ -14862,7 +15308,6 @@ 27607 28724 #else 27608 28725 # ifdef HAVE_READLINK … … 27612 28729 int len; 27613 28730 char_u *remain = NULL; 27614 @@ -14879,7 +15 230,10 @@28731 @@ -14879,7 +15324,10 @@ 27615 28732 27616 28733 len = STRLEN(p); … … 27623 28740 q = getnextcomp(p); 27624 28741 if (*q != NUL) 27625 @@ -14890,6 +15 244,10 @@28742 @@ -14890,6 +15338,10 @@ 27626 28743 q[-1] = NUL; 27627 28744 } … … 27634 28751 { 27635 28752 for (;;) 27636 @@ -15033,6 +15 391,7 @@28753 @@ -15033,6 +15485,7 @@ 27637 28754 27638 28755 #ifdef HAVE_READLINK … … 27642 28759 rettv->v_type = VAR_STRING; 27643 28760 } 27644 @@ -15051,7 +15 410,7 @@28761 @@ -15051,7 +15504,7 @@ 27645 28762 if (argvars[0].v_type != VAR_LIST) 27646 28763 EMSG2(_(e_listarg), "reverse()"); … … 27651 28768 li = l->lv_last; 27652 28769 l->lv_first = l->lv_last = NULL; 27653 @@ -16256,6 +16615,7 @@ 28770 @@ -16056,7 +16509,7 @@ 28771 if (tp != NULL && varname != NULL && varp != NULL) 28772 { 28773 save_curtab = curtab; 28774 - goto_tabpage_tp(tp); 28775 + goto_tabpage_tp(tp, TRUE); 28776 28777 tabvarname = alloc((unsigned)STRLEN(varname) + 3); 28778 if (tabvarname != NULL) 28779 @@ -16069,7 +16522,7 @@ 28780 28781 /* Restore current tabpage */ 28782 if (valid_tabpage(save_curtab)) 28783 - goto_tabpage_tp(save_curtab); 28784 + goto_tabpage_tp(save_curtab, TRUE); 28785 } 28786 } 28787 28788 @@ -16133,7 +16586,7 @@ 28789 /* set curwin to be our win, temporarily */ 28790 save_curwin = curwin; 28791 save_curtab = curtab; 28792 - goto_tabpage_tp(tp); 28793 + goto_tabpage_tp(tp, TRUE); 28794 if (!win_valid(win)) 28795 return; 28796 curwin = win; 28797 @@ -16168,7 +16621,7 @@ 28798 /* Restore current tabpage and window, if still valid (autocomands can 28799 * make them invalid). */ 28800 if (valid_tabpage(save_curtab)) 28801 - goto_tabpage_tp(save_curtab); 28802 + goto_tabpage_tp(save_curtab, TRUE); 28803 if (win_valid(save_curwin)) 28804 { 28805 curwin = save_curwin; 28806 @@ -16256,6 +16709,7 @@ 27654 28807 27655 28808 static int item_compare_ic; … … 27659 28812 #define ITEM_COMPARE_FAIL 999 27660 28813 27661 @@ -16315,7 +16 675,8 @@28814 @@ -16315,7 +16769,8 @@ 27662 28815 27663 28816 rettv.v_type = VAR_UNKNOWN; /* clear_tv() uses this */ … … 27669 28822 clear_tv(&argv[1]); 27670 28823 27671 @@ -16348,7 +16 709,8 @@28824 @@ -16348,7 +16803,8 @@ 27672 28825 else 27673 28826 { … … 27679 28832 rettv->vval.v_list = l; 27680 28833 rettv->v_type = VAR_LIST; 27681 @@ -16360,8 +16 722,10 @@28834 @@ -16360,8 +16816,10 @@ 27682 28835 27683 28836 item_compare_ic = FALSE; … … 27690 28843 item_compare_func = argvars[1].vval.v_string; 27691 28844 else 27692 @@ -16376,6 +16 740,17 @@28845 @@ -16376,6 +16834,17 @@ 27693 28846 else 27694 28847 item_compare_func = get_tv_string(&argvars[1]); … … 27708 28861 27709 28862 /* Make an array with each entry pointing to an item in the List. */ 27710 @@ -17512,18 +17 887,22 @@28863 @@ -17512,18 +17981,22 @@ 27711 28864 typval_T *argvars UNUSED; 27712 28865 typval_T *rettv; … … 27732 28885 27733 28886 /* 27734 @@ -17711,7 +18 090,7 @@28887 @@ -17711,7 +18184,7 @@ 27735 28888 typval_T *argvars; 27736 28889 typval_T *rettv; … … 27741 28894 char_u *tostr; 27742 28895 char_u *p; 27743 @@ -17728,7 +18 107,7 @@28896 @@ -17728,7 +18201,7 @@ 27744 28897 char_u buf2[NUMBUFLEN]; 27745 28898 garray_T ga; … … 27750 28903 tostr = get_tv_string_buf_chk(&argvars[2], buf2); 27751 28904 27752 @@ -17754,19 +18 133,19 @@28905 @@ -17754,19 +18227,19 @@ 27753 28906 } 27754 28907 … … 27774 28927 for (p = tostr; *p != NUL; p += tolen) 27775 28928 { 27776 @@ -17785,11 +18 164,11 @@28929 @@ -17785,11 +18258,11 @@ 27777 28930 ++idx; 27778 28931 } … … 27788 28941 for (p = tostr; *p != NUL; p += tolen) 27789 28942 { 27790 @@ -17804,18 +18 183,18 @@28943 @@ -17804,18 +18277,18 @@ 27791 28944 mch_memmove((char *)ga.ga_data + ga.ga_len, cpstr, (size_t)cplen); 27792 28945 ga.ga_len += cplen; … … 27811 28964 } 27812 28965 27813 @@ -17882,11 +18 261,21 @@28966 @@ -17882,11 +18355,21 @@ 27814 28967 rettv->v_type = VAR_STRING; 27815 28968 #ifdef FEAT_PERSISTENT_UNDO … … 27817 28970 - char_u *ffname = FullName_save(get_tv_string(&argvars[0]), FALSE); 27818 28971 + char_u *fname = get_tv_string(&argvars[0]); 27819 + 28972 28973 - if (ffname != NULL) 28974 - rettv->vval.v_string = u_get_undo_file_name(ffname, FALSE); 28975 - vim_free(ffname); 27820 28976 + if (*fname == NUL) 27821 28977 + { … … 27826 28982 + { 27827 28983 + 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); 28984 + 27832 28985 + if (ffname != NULL) 27833 28986 + rettv->vval.v_string = u_get_undo_file_name(ffname, FALSE); … … 27837 28990 #else 27838 28991 rettv->vval.v_string = NULL; 27839 @@ -18258,6 +18647,19 @@ 28992 @@ -18118,9 +18601,11 @@ 28993 curwin->w_skipcol = get_dict_number(dict, (char_u *)"skipcol"); 28994 28995 check_cursor(); 28996 - changed_cline_bef_curs(); 28997 - invalidate_botline(); 28998 - redraw_later(VALID); 28999 + win_new_height(curwin, curwin->w_height); 29000 +# ifdef FEAT_VERTSPLIT 29001 + win_new_width(curwin, W_WIDTH(curwin)); 29002 +# endif 29003 + changed_window_setting(); 29004 29005 if (curwin->w_topline == 0) 29006 curwin->w_topline = 1; 29007 @@ -18258,6 +18743,19 @@ 27840 29008 } 27841 29009 … … 27857 29025 * Returns NULL when there is an error. 27858 29026 */ 27859 @@ -18768,11 +19 170,7 @@29027 @@ -18768,11 +19266,7 @@ 27860 29028 set_vim_var_char(c) 27861 29029 int c; … … 27870 29038 #ifdef FEAT_MBYTE 27871 29039 if (has_mbyte) 27872 @@ -19453,9 +19 851,14 @@29040 @@ -19453,9 +19947,14 @@ 27873 29041 * worked find the variable again. Don't auto-load a script if it was 27874 29042 * loaded already, otherwise it would be loaded every time when … … 27887 29055 return NULL; 27888 29056 } 27889 @@ -19730,7 +20133,6 @@ 29057 @@ -19564,7 +20063,7 @@ 29058 { 29059 sv = SCRIPT_SV(ga_scripts.ga_len + 1) = 29060 (scriptvar_T *)alloc_clear(sizeof(scriptvar_T)); 29061 - init_var_dict(&sv->sv_dict, &sv->sv_var); 29062 + init_var_dict(&sv->sv_dict, &sv->sv_var, VAR_SCOPE); 29063 ++ga_scripts.ga_len; 29064 } 29065 } 29066 @@ -19575,11 +20074,14 @@ 29067 * point to it. 29068 */ 29069 void 29070 -init_var_dict(dict, dict_var) 29071 +init_var_dict(dict, dict_var, scope) 29072 dict_T *dict; 29073 dictitem_T *dict_var; 29074 + int scope; 29075 { 29076 hash_init(&dict->dv_hashtab); 29077 + dict->dv_lock = 0; 29078 + dict->dv_scope = scope; 29079 dict->dv_refcount = DO_NOT_FREE_CNT; 29080 dict->dv_copyID = 0; 29081 dict_var->di_tv.vval.v_dict = dict; 29082 @@ -19730,7 +20232,6 @@ 27890 29083 dictitem_T *v; 27891 29084 char_u *varname; … … 27895 29088 ht = find_var_ht(name, &varname); 27896 29089 if (ht == NULL || *varname == NUL) 27897 @@ -19740,25 +20 142,8 @@29090 @@ -19740,25 +20241,8 @@ 27898 29091 } 27899 29092 v = find_var_in_ht(ht, varname, TRUE); … … 27923 29116 if (v != NULL) 27924 29117 { 27925 @@ -19824,13 +20 209,8 @@29118 @@ -19824,13 +20308,8 @@ 27926 29119 } 27927 29120 … … 27939 29132 v = (dictitem_T *)alloc((unsigned)(sizeof(dictitem_T) 27940 29133 + STRLEN(varname))); 27941 @@ -19895,6 +20 275,55 @@29134 @@ -19895,6 +20374,55 @@ 27942 29135 } 27943 29136 … … 27995 29188 * Also give an error message, using "name". 27996 29189 */ 27997 @@ -20099,7 +20 528,13 @@29190 @@ -20099,7 +20627,13 @@ 27998 29191 /* Call msg_start() after eval1(), evaluating the expression 27999 29192 * may cause a message to appear. */ … … 28009 29202 else if (eap->cmdidx == CMD_echo) 28010 29203 msg_puts_attr((char_u *)" ", echo_attr); 28011 @@ -20302,6 +20 737,7 @@29204 @@ -20302,6 +20836,7 @@ 28012 29205 exarg_T *eap; 28013 29206 { … … 28017 29210 int c; 28018 29211 int saved_did_emsg; 28019 @@ -20548,6 +2 0984,15 @@29212 @@ -20548,6 +21083,15 @@ 28020 29213 arg = vim_strsave(arg); 28021 29214 if (arg == NULL) … … 28033 29226 *p = c; 28034 29227 newargs.ga_len++; 28035 @@ -20623,7 +21 068,8 @@29228 @@ -20623,7 +21167,8 @@ 28036 29229 nesting = 0; 28037 29230 for (;;) … … 28043 29236 sourcing_lnum_off = sourcing_lnum; 28044 29237 28045 @@ -20726,6 +21 172,8 @@29238 @@ -20726,6 +21271,8 @@ 28046 29239 && (!ASCII_ISALPHA(p[2]) || p[2] == 'r')) 28047 29240 || (p[0] == 't' && p[1] == 'c' … … 28052 29245 && (!ASCII_ISALPHA(p[3]) || p[3] == 'y')) 28053 29246 || (p[0] == 'm' && p[1] == 'z' 28054 @@ -21562,6 +22 010,9 @@29247 @@ -21562,6 +22109,9 @@ 28055 29248 ++hi; 28056 29249 fp = HI2UF(hi); … … 28062 29255 return fp->uf_name; /* prevents overflow */ 28063 29256 28064 @@ -21921,8 +22372,12 @@ 29257 @@ -21689,7 +22239,7 @@ 29258 * Unreference a Function: decrement the reference count and free it when it 29259 * becomes zero. Only for numbered functions. 29260 */ 29261 - static void 29262 + void 29263 func_unref(name) 29264 char_u *name; 29265 { 29266 @@ -21713,7 +22263,7 @@ 29267 /* 29268 * Count a reference to a Function. 29269 */ 29270 - static void 29271 + void 29272 func_ref(name) 29273 char_u *name; 29274 { 29275 @@ -21792,7 +22342,7 @@ 29276 /* 29277 * Init l: variables. 29278 */ 29279 - init_var_dict(&fc->l_vars, &fc->l_vars_var); 29280 + init_var_dict(&fc->l_vars, &fc->l_vars_var, VAR_DEF_SCOPE); 29281 if (selfdict != NULL) 29282 { 29283 /* Set l:self to "selfdict". Use "name" to avoid a warning from 29284 @@ -21813,7 +22363,7 @@ 29285 * Set a:0 to "argcount". 29286 * Set a:000 to a list with room for the "..." arguments. 29287 */ 29288 - init_var_dict(&fc->l_avars, &fc->l_avars_var); 29289 + init_var_dict(&fc->l_avars, &fc->l_avars_var, VAR_SCOPE); 29290 add_nr_var(&fc->l_avars, &fc->fixvar[fixvar_idx++].var, "0", 29291 (varnumber_T)(argcount - fp->uf_args.ga_len)); 29292 /* Use "name" to avoid a warning from some compiler that checks the 29293 @@ -21921,8 +22471,12 @@ 28065 29294 s = tv2string(&argvars[i], &tofree, numbuf2, 0); 28066 29295 if (s != NULL) … … 28077 29306 } 28078 29307 } 28079 @@ -22010,8 +22 465,12 @@29308 @@ -22010,8 +22564,12 @@ 28080 29309 s = tv2string(fc->rettv, &tofree, numbuf2, 0); 28081 29310 if (s != NULL) … … 28092 29321 } 28093 29322 } 28094 @@ -22519,18 +2 2978,21 @@29323 @@ -22519,18 +23077,21 @@ 28095 29324 if (tab != NULL) 28096 29325 { … … 28119 29348 (int)(tab - virp->vir_line + 1), TRUE); 28120 29349 #ifdef FEAT_FLOAT 28121 @@ -22539,9 +23 001,28 @@29350 @@ -22539,9 +23100,28 @@ 28122 29351 #endif 28123 29352 else … … 28149 29378 } 28150 29379 } 28151 @@ -22583,8 +23 064,10 @@29380 @@ -22583,8 +23163,10 @@ 28152 29381 case VAR_STRING: s = "STR"; break; 28153 29382 case VAR_NUMBER: s = "NUM"; break; … … 28161 29390 } 28162 29391 fprintf(fp, "!%s\t%s\t", this_var->di_key, s); 28163 @@ -22656,7 +23 139,7 @@29392 @@ -22656,7 +23238,7 @@ 28164 29393 f = -f; 28165 29394 sign = '-'; … … 28170 29399 || put_eol(fd) == FAIL) 28171 29400 return FAIL; 28172 @@ -23019,6 +23 502,7 @@29401 @@ -23019,6 +23601,7 @@ 28173 29402 int c; 28174 29403 int has_fullname = 0; … … 28178 29407 #endif 28179 29408 28180 @@ -23193,24 +23677,25 @@ 29409 @@ -23072,6 +23655,27 @@ 29410 return -1; 29411 } 29412 29413 +#ifdef WIN3264 29414 +# if _WIN32_WINNT >= 0x0500 29415 + if (vim_strchr(*fnamep, '~') != NULL) 29416 + { 29417 + /* Expand 8.3 filename to full path. Needed to make sure the same 29418 + * file does not have two different names. 29419 + * Note: problem does not occur if _WIN32_WINNT < 0x0500. */ 29420 + p = alloc(_MAX_PATH + 1); 29421 + if (p != NULL) 29422 + { 29423 + if (GetLongPathName(*fnamep, p, MAXPATHL)) 29424 + { 29425 + vim_free(*bufp); 29426 + *bufp = *fnamep = p; 29427 + } 29428 + else 29429 + vim_free(p); 29430 + } 29431 + } 29432 +# endif 29433 +#endif 29434 /* Append a path separator to a directory. */ 29435 if (mch_isdir(*fnamep)) 29436 { 29437 @@ -23193,24 +23797,25 @@ 28181 29438 } 28182 29439 … … 28211 29468 { 28212 29469 if (shortpath_for_partial(fnamep, bufp, fnamelen) == FAIL) 28213 @@ -23218,18 +23 703,16 @@29470 @@ -23218,18 +23823,16 @@ 28214 29471 } 28215 29472 else … … 28234 29491 return -1; 28235 29492 diff -Naur vim73.orig/src/ex_cmds.c vim73/src/ex_cmds.c 28236 --- vim73.orig/src/ex_cmds.c 201 2-06-03 23:09:52.940007057+000028237 +++ vim73/src/ex_cmds.c 2012-0 6-03 23:09:55.848084445+000029493 --- vim73.orig/src/ex_cmds.c 2010-08-13 09:14:35.000000000 +0000 29494 +++ vim73/src/ex_cmds.c 2012-07-20 20:31:18.014311616 +0000 28238 29495 @@ -11,10 +11,6 @@ 28239 29496 * ex_cmds.c: some functions for command line commands … … 28701 29958 - p = p_rtp; 28702 29959 - while (*p != NUL) 28703 + if (strstr((char *)line, "*local-additions*") == NULL) 28704 + continue; 28705 + 28706 + /* Go through all directories in 'runtimepath', skipping 28707 + * $VIMRUNTIME. */ 28708 + p = p_rtp; 28709 + while (*p != NUL) 28710 + { 28711 + copy_option_part(&p, NameBuff, MAXPATHL, ","); 28712 + mustfree = FALSE; 28713 + rt = vim_getenv((char_u *)"VIMRUNTIME", &mustfree); 28714 + if (fullpathcmp(rt, NameBuff, FALSE) != FPC_SAME) 28715 { 29960 - { 28716 29961 - copy_option_part(&p, NameBuff, MAXPATHL, ","); 28717 29962 - mustfree = FALSE; … … 28724 29969 - char_u *s; 28725 29970 - int fi; 29971 + if (strstr((char *)line, "*local-additions*") == NULL) 29972 + continue; 29973 + 29974 + /* Go through all directories in 'runtimepath', skipping 29975 + * $VIMRUNTIME. */ 29976 + p = p_rtp; 29977 + while (*p != NUL) 29978 + { 29979 + copy_option_part(&p, NameBuff, MAXPATHL, ","); 29980 + mustfree = FALSE; 29981 + rt = vim_getenv((char_u *)"VIMRUNTIME", &mustfree); 29982 + if (fullpathcmp(rt, NameBuff, FALSE) != FPC_SAME) 29983 + { 28726 29984 + int fcount; 28727 29985 + char_u **fnames; … … 29085 30343 29086 30344 /* set values for a defined sign. */ 29087 @@ -6886,6 +7004,8 @@ 30345 @@ -6879,6 +6997,16 @@ 30346 lnum = atoi((char *)arg); 30347 arg = skiptowhite(arg); 30348 } 30349 + else if (STRNCMP(arg, "*", 1) == 0 && idx == SIGNCMD_UNPLACE) 30350 + { 30351 + if (id != -1) 30352 + { 30353 + EMSG(_(e_invarg)); 30354 + return; 30355 + } 30356 + id = -2; 30357 + arg = skiptowhite(arg + 1); 30358 + } 30359 else if (STRNCMP(arg, "name=", 5) == 0) 30360 { 30361 arg += 5; 30362 @@ -6886,6 +7014,8 @@ 29088 30363 arg = skiptowhite(arg); 29089 30364 if (*arg != NUL) … … 29094 30369 else if (STRNCMP(arg, "file=", 5) == 0) 29095 30370 { 30371 @@ -6913,7 +7043,7 @@ 30372 { 30373 EMSG2(_("E158: Invalid buffer name: %s"), arg); 30374 } 30375 - else if (id <= 0) 30376 + else if (id <= 0 && !(idx == SIGNCMD_UNPLACE && id == -2)) 30377 { 30378 if (lnum >= 0 || sign_name != NULL) 30379 EMSG(_(e_invarg)); 30380 @@ -6954,11 +7084,17 @@ 30381 } 30382 else if (idx == SIGNCMD_UNPLACE) 30383 { 30384 - /* ":sign unplace {id} file={fname}" */ 30385 if (lnum >= 0 || sign_name != NULL) 30386 EMSG(_(e_invarg)); 30387 + else if (id == -2) 30388 + { 30389 + /* ":sign unplace * file={fname}" */ 30390 + redraw_buf_later(buf, NOT_VALID); 30391 + buf_delete_signs(buf); 30392 + } 30393 else 30394 { 30395 + /* ":sign unplace {id} file={fname}" */ 30396 lnum = buf_delsign(buf, id); 30397 update_debug_sign(buf, lnum); 30398 } 29096 30399 diff -Naur vim73.orig/src/ex_cmds.h vim73/src/ex_cmds.h 29097 --- vim73.orig/src/ex_cmds.h 201 2-06-03 23:09:52.948007269+000029098 +++ vim73/src/ex_cmds.h 2012-0 6-03 23:09:55.880085297+000030400 --- vim73.orig/src/ex_cmds.h 2010-07-21 13:48:02.000000000 +0000 30401 +++ vim73/src/ex_cmds.h 2012-07-20 20:31:17.920978216 +0000 29099 30402 @@ -102,7 +102,7 @@ 29100 30403 EX(CMD_aboveleft, "aboveleft", ex_wrongmodifier, … … 29133 30436 NEEDARG|EXTRA|NOTRLCOM), 29134 30437 EX(CMD_saveas, "saveas", ex_write, 30438 @@ -944,7 +944,7 @@ 30439 EX(CMD_tabfirst, "tabfirst", ex_tabnext, 30440 TRLBAR), 30441 EX(CMD_tabmove, "tabmove", ex_tabmove, 30442 - RANGE|NOTADR|ZEROR|COUNT|TRLBAR|ZEROR), 30443 + RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR), 30444 EX(CMD_tablast, "tablast", ex_tabnext, 30445 TRLBAR), 30446 EX(CMD_tabnext, "tabnext", ex_tabnext, 29135 30447 @@ -1078,7 +1078,7 @@ 29136 30448 EX(CMD_wsverb, "wsverb", ex_wsverb, … … 29143 30455 EX(CMD_xit, "xit", ex_exit, 29144 30456 diff -Naur vim73.orig/src/ex_cmds2.c vim73/src/ex_cmds2.c 29145 --- vim73.orig/src/ex_cmds2.c 201 2-06-03 23:09:52.948007269+000029146 +++ vim73/src/ex_cmds2.c 2012-0 6-03 23:09:55.780082635+000030457 --- vim73.orig/src/ex_cmds2.c 2010-07-27 19:43:38.000000000 +0000 30458 +++ vim73/src/ex_cmds2.c 2012-07-20 20:31:17.370977822 +0000 29147 30459 @@ -11,10 +11,6 @@ 29148 30460 * ex_cmds2.c: some more functions for command line commands … … 29175 30487 if (p == NULL) 29176 30488 return FAIL; 29177 @@ -694,10 +682,12 @@ 30489 @@ -608,10 +596,15 @@ 30490 garray_T *gap; 30491 30492 gap = &dbg_breakp; 30493 -#ifdef FEAT_PROFILE 30494 if (eap->cmdidx == CMD_profdel) 30495 + { 30496 +#ifdef FEAT_PROFILE 30497 gap = &prof_ga; 30498 +#else 30499 + ex_ni(eap); 30500 + return; 30501 #endif 30502 + } 30503 30504 if (vim_isdigit(*eap->arg)) 30505 { 30506 @@ -694,10 +687,12 @@ 29178 30507 for (i = 0; i < dbg_breakp.ga_len; ++i) 29179 30508 { … … 29189 30518 } 29190 30519 } 29191 @@ -1119,7 +11 09,7 @@30520 @@ -1119,7 +1114,7 @@ 29192 30521 static enum 29193 30522 { … … 29198 30527 29199 30528 static char *pexpand_cmds[] = { 29200 @@ -1488,7 +14 78,7 @@30529 @@ -1488,7 +1483,7 @@ 29201 30530 #endif 29202 30531 … … 29207 30536 */ 29208 30537 void 29209 @@ -1496,9 +14 86,10 @@30538 @@ -1496,9 +1491,10 @@ 29210 30539 buf_T *buf; 29211 30540 int checkall; /* may abandon all changed buffers */ … … 29219 30548 dialog_msg(buff, _("Save changes to \"%s\"?"), 29220 30549 (buf->b_fname != NULL) ? 29221 @@ -1508,13 +1 499,19 @@30550 @@ -1508,13 +1504,19 @@ 29222 30551 else 29223 30552 ret = vim_dialog_yesnocancel(VIM_QUESTION, NULL, buff, 1); … … 29240 30569 } 29241 30570 else if (ret == VIM_NO) 29242 @@ -1542,7 +15 39,9 @@30571 @@ -1542,7 +1544,9 @@ 29243 30572 /* May get file name, when there is none */ 29244 30573 browse_save_fname(buf2); … … 29251 30580 #ifdef FEAT_AUTOCMD 29252 30581 /* an autocommand may have deleted the buffer */ 29253 @@ -1579,6 +15 78,26 @@30582 @@ -1579,6 +1583,26 @@ 29254 30583 || forceit); 29255 30584 } … … 29278 30607 * Return TRUE if any buffer was changed and cannot be abandoned. 29279 30608 * That changed buffer becomes the current buffer. 29280 @@ -1587,32 +16 06,64 @@30609 @@ -1587,32 +1611,64 @@ 29281 30610 check_changed_any(hidden) 29282 30611 int hidden; /* Only check hidden buffers */ … … 29358 30687 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) 29359 30688 /* 29360 @@ -1645,24 +1 696,29 @@30689 @@ -1645,24 +1701,29 @@ 29361 30690 #ifdef FEAT_WINDOWS 29362 30691 /* Try to find a window that contains the buffer. */ … … 29393 30722 29394 30723 /* 29395 @@ -1949,7 +2005,7 @@ 30724 @@ -1789,22 +1850,28 @@ 30725 #if defined(FEAT_QUICKFIX) || defined(FEAT_SYN_HL) || defined(PROTO) 30726 /* 30727 * Parse a list of arguments (file names), expand them and return in 30728 - * "fnames[fcountp]". 30729 + * "fnames[fcountp]". When "wig" is TRUE, removes files matching 'wildignore'. 30730 * Return FAIL or OK. 30731 */ 30732 int 30733 -get_arglist_exp(str, fcountp, fnamesp) 30734 +get_arglist_exp(str, fcountp, fnamesp, wig) 30735 char_u *str; 30736 int *fcountp; 30737 char_u ***fnamesp; 30738 + int wig; 30739 { 30740 garray_T ga; 30741 int i; 30742 30743 if (get_arglist(&ga, str) == FAIL) 30744 return FAIL; 30745 - i = gen_expand_wildcards(ga.ga_len, (char_u **)ga.ga_data, 30746 - fcountp, fnamesp, EW_FILE|EW_NOTFOUND); 30747 + if (wig == TRUE) 30748 + i = expand_wildcards(ga.ga_len, (char_u **)ga.ga_data, 30749 + fcountp, fnamesp, EW_FILE|EW_NOTFOUND); 30750 + else 30751 + i = gen_expand_wildcards(ga.ga_len, (char_u **)ga.ga_data, 30752 + fcountp, fnamesp, EW_FILE|EW_NOTFOUND); 30753 + 30754 ga_clear(&ga); 30755 return i; 30756 } 30757 @@ -1949,7 +2016,7 @@ 29396 30758 } 29397 30759 … … 29402 30764 */ 29403 30765 static int 29404 @@ -2165,9 +22 21,7 @@30766 @@ -2165,9 +2232,7 @@ 29405 30767 { 29406 30768 if (win_split(0, 0) == FAIL) … … 29413 30775 else 29414 30776 #endif 29415 @@ -2946,11 +3000,7 @@ 30777 @@ -2422,7 +2487,7 @@ 30778 /* go to window "tp" */ 30779 if (!valid_tabpage(tp)) 30780 break; 30781 - goto_tabpage_tp(tp); 30782 + goto_tabpage_tp(tp, TRUE); 30783 tp = tp->tp_next; 30784 } 30785 #endif 30786 @@ -2946,11 +3011,7 @@ 29416 30787 proftime_T wait_start; 29417 30788 #endif … … 29425 30796 return retval; 29426 30797 fname_exp = fix_fname(p); 29427 @@ -3286,7 +33 36,11 @@30798 @@ -3286,7 +3347,11 @@ 29428 30799 29429 30800 for (i = 1; i <= script_items.ga_len && !got_int; ++i) … … 29438 30809 29439 30810 # if defined(BACKSLASH_IN_FILENAME) || defined(PROTO) 29440 @@ -3412,7 +34 66,7 @@30811 @@ -3412,7 +3477,7 @@ 29441 30812 { 29442 30813 struct source_cookie *sp = (struct source_cookie *)cookie; … … 29447 30818 #ifdef FEAT_EVAL 29448 30819 /* If breakpoints have been added/deleted need to check for it. */ 29449 @@ -3451,28 +35 05,49 @@30820 @@ -3451,28 +3516,49 @@ 29450 30821 { 29451 30822 /* compensate for the one line read-ahead */ … … 29512 30883 s = string_convert(&sp->conv, line, NULL); 29513 30884 if (s != NULL) 29514 @@ -4166,11 +42 41,90 @@30885 @@ -4166,11 +4252,90 @@ 29515 30886 /* Set v:lang, v:lc_time and v:ctype to the final result. */ 29516 30887 set_lang_var(); … … 29603 30974 * Function given to ExpandGeneric() to obtain the possible arguments of the 29604 30975 * ":language" command. 29605 @@ -4186,7 +43 40,25 @@30976 @@ -4186,7 +4351,25 @@ 29606 30977 return (char_u *)"ctype"; 29607 30978 if (idx == 2) … … 29631 31002 29632 31003 diff -Naur vim73.orig/src/ex_docmd.c vim73/src/ex_docmd.c 29633 --- vim73.orig/src/ex_docmd.c 201 2-06-03 23:09:52.924006631+000029634 +++ vim73/src/ex_docmd.c 2012-0 6-03 23:09:55.824083805+000031004 --- vim73.orig/src/ex_docmd.c 2010-08-07 14:59:47.000000000 +0000 31005 +++ vim73/src/ex_docmd.c 2012-07-20 20:31:18.217645094 +0000 29635 31006 @@ -61,6 +61,7 @@ 29636 31007 static char_u *do_one_cmd __ARGS((char_u **, int, char_u *(*fgetline)(int, void *, int), void *cookie)); … … 30263 31634 uc_add_command(name, end - name, p, argt, def, flags, compl, compl_arg, 30264 31635 eap->forceit); 30265 @@ -5888,7 +5983,14 @@ 31636 @@ -5750,8 +5845,14 @@ 31637 } 31638 else 31639 { 31640 +#ifdef FEAT_MBYTE 31641 + int charlen = (*mb_ptr2len)(p); 31642 + len += charlen; 31643 + p += charlen; 31644 +#else 31645 ++len; 31646 ++p; 31647 +#endif 31648 } 31649 } 31650 31651 @@ -5794,7 +5895,7 @@ 31652 } 31653 else 31654 { 31655 - *q++ = *p++; 31656 + MB_COPY_CHAR(p, q); 31657 } 31658 } 31659 *q++ = '"'; 31660 @@ -5888,7 +5989,14 @@ 30266 31661 result = STRLEN(eap->arg) + 2; 30267 31662 for (p = eap->arg; *p; ++p) … … 30279 31674 } 30280 31675 30281 @@ -5897,7 + 5999,14 @@31676 @@ -5897,7 +6005,14 @@ 30282 31677 *buf++ = '"'; 30283 31678 for (p = eap->arg; *p; ++p) … … 30295 31690 *buf++ = *p; 30296 31691 } 30297 @@ -6039,15 +61 48,17 @@31692 @@ -6039,15 +6154,17 @@ 30298 31693 end = vim_strchr(start + 1, '>'); 30299 31694 if (buf != NULL) … … 30316 31711 * do_cmdline() doesn't handle that, so convert it back. 30317 31712 * Also change K_SPECIAL KS_EXTRA KE_CSI into CSI. */ 30318 @@ -6439,7 +6550,7 @@ 31713 @@ -6347,7 +6464,10 @@ 31714 return; 31715 } 31716 #ifdef FEAT_AUTOCMD 31717 - if (curbuf_locked()) 31718 + apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf); 31719 + /* Refuse to quick when locked or when the buffer in the last window is 31720 + * being closed (can only happen in autocommands). */ 31721 + if (curbuf_locked() || (curbuf->b_nwindows == 1 && curbuf->b_closing)) 31722 return; 31723 #endif 31724 31725 @@ -6439,7 +6559,7 @@ 30319 31726 { 30320 31727 # ifdef FEAT_CMDWIN … … 30325 31732 # endif 30326 31733 if (!text_locked() 30327 @@ -6897,9 +70 08,7 @@31734 @@ -6897,9 +7017,7 @@ 30328 31735 # ifdef FEAT_WINDOWS 30329 31736 if (win_split(0, 0) == FAIL) … … 30336 31743 /* When splitting the window, create a new alist. Otherwise the 30337 31744 * existing one is overwritten. */ 30338 @@ -7026,7 +71 35,7 @@31745 @@ -7026,7 +7144,7 @@ 30339 31746 old_arg_count = GARGCOUNT; 30340 31747 if (expand_wildcards(old_arg_count, old_arg_files, … … 30345 31752 { 30346 31753 alist_set(&global_alist, new_arg_file_count, new_arg_files, 30347 @@ -7299,7 +74 08,9 @@31754 @@ -7299,7 +7417,9 @@ 30348 31755 || cmdmod.browse 30349 31756 # endif … … 30356 31763 do_check_scrollbind(FALSE); 30357 31764 # endif 30358 @@ -8122,6 +8233,12 @@ 31765 @@ -7364,7 +7484,42 @@ 31766 ex_tabmove(eap) 31767 exarg_T *eap; 31768 { 31769 - tabpage_move(eap->addr_count == 0 ? 9999 : (int)eap->line2); 31770 + int tab_number = 9999; 31771 + 31772 + if (eap->arg && *eap->arg != NUL) 31773 + { 31774 + char_u *p = eap->arg; 31775 + int relative = 0; /* argument +N/-N means: move N places to the 31776 + * right/left relative to the current position. */ 31777 + 31778 + if (*eap->arg == '-') 31779 + { 31780 + relative = -1; 31781 + p = eap->arg + 1; 31782 + } 31783 + else if (*eap->arg == '+') 31784 + { 31785 + relative = 1; 31786 + p = eap->arg + 1; 31787 + } 31788 + else 31789 + p = eap->arg; 31790 + 31791 + if (p == skipdigits(p)) 31792 + { 31793 + /* No numbers as argument. */ 31794 + eap->errmsg = e_invarg; 31795 + return; 31796 + } 31797 + 31798 + tab_number = getdigits(&p); 31799 + if (relative != 0) 31800 + tab_number = tab_number * relative + tabpage_index(curtab) - 1;; 31801 + } 31802 + else if (eap->addr_count != 0) 31803 + tab_number = eap->line2; 31804 + 31805 + tabpage_move(tab_number); 31806 } 31807 31808 /* 31809 @@ -8122,6 +8277,12 @@ 30359 31810 { 30360 31811 ui_delay(msec - done > 1000L ? 1000L : msec - done, TRUE); … … 30369 31820 } 30370 31821 30371 @@ -8193,7 +83 10,7 @@31822 @@ -8193,7 +8354,7 @@ 30372 31823 p = skipwhite(p); 30373 31824 if (*p != NUL && *p != '"' && eap->nextcmd == NULL) … … 30378 31829 /* Pass flags on for ":vertical wincmd ]". */ 30379 31830 postponed_split_flags = cmdmod.split; 30380 @@ -8907,35 +9024,42 @@ 31831 @@ -8428,7 +8589,7 @@ 31832 } 31833 ++eap->line2; 31834 } 31835 - (void)do_join(eap->line2 - eap->line1 + 1, !eap->forceit, TRUE); 31836 + (void)do_join(eap->line2 - eap->line1 + 1, !eap->forceit, TRUE, TRUE); 31837 beginline(BL_WHITE | BL_FIX); 31838 ex_may_print(eap); 31839 } 31840 @@ -8907,35 +9068,42 @@ 30381 31841 failed = TRUE; 30382 31842 if (eap->cmdidx == CMD_mksession) … … 30445 31905 } 30446 31906 else 30447 @@ -8966,10 +9 090,15 @@31907 @@ -8966,10 +9134,15 @@ 30448 31908 else if (eap->cmdidx == CMD_mksession) 30449 31909 { … … 30464 31924 #endif 30465 31925 #ifdef MKSESSION_NL 30466 @@ -9295,7 +94 24,7 @@31926 @@ -9295,7 +9468,7 @@ 30467 31927 && !got_int) 30468 31928 { … … 30473 31933 } 30474 31934 #endif 30475 @@ -9393,7 +95 22,7 @@31935 @@ -9393,7 +9566,7 @@ 30476 31936 ex_ptag(eap) 30477 31937 exarg_T *eap; … … 30482 31942 } 30483 31943 30484 @@ -9525,17 +96 54,23 @@31944 @@ -9525,17 +9698,23 @@ 30485 31945 #define SPEC_CFILE 4 30486 31946 "<sfile>", /* ":so" file name */ … … 30510 31970 }; 30511 31971 30512 @@ -9560,6 +9 695,7 @@31972 @@ -9560,6 +9739,7 @@ 30513 31973 * '<cWORD>' to WORD under the cursor 30514 31974 * '<cfile>' to path name under the cursor … … 30518 31978 * '<abuf>' to buffer number for autocommand 30519 31979 * '<amatch>' to matching name for autocommand 30520 @@ -9591,10 +97 27,7 @@31980 @@ -9591,10 +9771,7 @@ 30521 31981 #ifdef FEAT_MODIFY_FNAME 30522 31982 int skip_mod = FALSE; … … 30529 31989 *errormsg = NULL; 30530 31990 if (escaped != NULL) 30531 @@ -9653,14 +9 786,7 @@31991 @@ -9653,14 +9830,7 @@ 30532 31992 valid = 0; /* Must have ":p:h" to be valid */ 30533 31993 } … … 30544 32004 30545 32005 case SPEC_HASH: /* '#' or "#99": alternate file */ 30546 @@ -9783,6 +99 09,15 @@32006 @@ -9783,6 +9953,15 @@ 30547 32007 return NULL; 30548 32008 } … … 30560 32020 case SPEC_CLIENT: /* Source of last submitted input */ 30561 32021 sprintf((char *)strbuf, PRINTF_HEX_LONG_U, 30562 @@ -9796,11 +99 31,7 @@32022 @@ -9796,11 +9975,7 @@ 30563 32023 if (src[*usedlen] == '<') /* remove the file name extension */ 30564 32024 { … … 30572 32032 } 30573 32033 #ifdef FEAT_MODIFY_FNAME 30574 @@ -10645,7 +10 776,7 @@32034 @@ -10645,7 +10820,7 @@ 30575 32035 unsigned *flagp; 30576 32036 { … … 30581 32041 30582 32042 if (gap->ga_len == 0) 30583 @@ -10660,11 +10 791,19 @@32043 @@ -10660,11 +10835,19 @@ 30584 32044 { 30585 32045 if (fullname) … … 30603 32063 } 30604 32064 return put_eol(fd); 30605 @@ -10707,7 +108 46,7 @@32065 @@ -10707,7 +10890,7 @@ 30606 32066 * Write a file name to the session file. 30607 32067 * Takes care of the "slash" option in 'sessionoptions' and escapes special … … 30612 32072 static int 30613 32073 ses_put_fname(fd, name, flagp) 30614 @@ -10716,49 +108 55,32 @@32074 @@ -10716,49 +10899,32 @@ 30615 32075 unsigned *flagp; 30616 32076 { … … 30682 32142 } 30683 32143 30684 @@ -10826,8 +109 48,7 @@32144 @@ -10826,8 +10992,7 @@ 30685 32145 else if (vim_ispathsep(*p)) 30686 32146 { … … 30692 32152 *s++ = '-'; 30693 32153 else 30694 @@ -10910,7 +110 31,7 @@32154 @@ -10910,7 +11075,7 @@ 30695 32155 30696 32156 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) || defined(PROTO) … … 30701 32161 */ 30702 32162 void 30703 @@ -10921,7 +110 42,7 @@32163 @@ -10921,7 +11086,7 @@ 30704 32164 { 30705 32165 if (fname == NULL) … … 30711 32171 30712 32172 diff -Naur vim73.orig/src/ex_getln.c vim73/src/ex_getln.c 30713 --- vim73.orig/src/ex_getln.c 201 2-06-03 23:09:52.956007482+000030714 +++ vim73/src/ex_getln.c 2012-0 6-03 23:09:55.884085403 +000032173 --- vim73.orig/src/ex_getln.c 2010-08-14 15:25:45.000000000 +0000 32174 +++ vim73/src/ex_getln.c 2012-07-20 20:31:17.557644623 +0000 30715 32175 @@ -25,7 +25,7 @@ 30716 32176 int cmdlen; /* number of chars in command line */ … … 30893 32353 } 30894 32354 30895 @@ -2843,6 +2888,7 @@ 32355 @@ -2719,6 +2764,11 @@ 32356 msg_no_more = TRUE; 32357 if (ccline.cmdlen == ccline.cmdpos) 32358 msg_putchar(' '); 32359 +#ifdef FEAT_MBYTE 32360 + else if (has_mbyte) 32361 + draw_cmdline(ccline.cmdpos, 32362 + (*mb_ptr2len)(ccline.cmdbuff + ccline.cmdpos)); 32363 +#endif 32364 else 32365 draw_cmdline(ccline.cmdpos, 1); 32366 msg_no_more = FALSE; 32367 @@ -2843,6 +2893,7 @@ 30896 32368 { 30897 32369 msg_no_more = TRUE; … … 30901 32373 /* Avoid clearing the rest of the line too often. */ 30902 32374 if (cmdline_row != i || ccline.overstrike) 30903 @@ -3023,7 +30 69,7 @@32375 @@ -3023,7 +3074,7 @@ 30904 32376 int len; 30905 32377 … … 30910 32382 #ifdef FEAT_MBYTE 30911 32383 if (has_mbyte) 30912 @@ -3041,7 +30 87,7 @@32384 @@ -3041,7 +3092,7 @@ 30913 32385 --w; 30914 32386 } … … 30919 32391 p += len; 30920 32392 } 30921 @@ -3258,6 +3304,24 @@ 32393 @@ -3082,7 +3133,8 @@ 32394 else 32395 #endif 32396 c = *s++; 32397 - if (cv == Ctrl_V || c == ESC || c == Ctrl_C || c == CAR || c == NL 32398 + if (cv == Ctrl_V || c == ESC || c == Ctrl_C 32399 + || c == CAR || c == NL || c == Ctrl_L 32400 #ifdef UNIX 32401 || c == intr_char 32402 #endif 32403 @@ -3258,6 +3310,24 @@ 30922 32404 return check_abbr(c, ccline.cmdbuff, ccline.cmdpos, 0); 30923 32405 } … … 30944 32426 * Return FAIL if this is not an appropriate context in which to do 30945 32427 * completion of anything, return OK if it is (even if there are no matches). 30946 @@ -3316,10 +338 0,14 @@32428 @@ -3316,10 +3386,14 @@ 30947 32429 p2 = NULL; 30948 32430 else … … 30961 32443 /* longest match: make sure it is not shorter, happens with :help */ 30962 32444 if (p2 != NULL && type == WILD_LONGEST) 30963 @@ -3396,6 +34 64,7 @@32445 @@ -3396,6 +3470,7 @@ 30964 32446 * mode = WILD_PREV: use previous match in multiple match, wrap to first 30965 32447 * mode = WILD_ALL: return all matches concatenated … … 30969 32451 * options = WILD_LIST_NOTFOUND: list entries without a match 30970 32452 * options = WILD_HOME_REPLACE: do home_replace() for buffer names 30971 @@ -3405,6 +34 74,7 @@32453 @@ -3405,6 +3480,7 @@ 30972 32454 * options = WILD_KEEP_ALL: don't remove 'wildignore' entries 30973 32455 * options = WILD_SILENT: don't print warning messages … … 30977 32459 * The variables xp->xp_context and xp->xp_backslash must have been set! 30978 32460 */ 30979 @@ -3518,7 +35 88,8 @@32461 @@ -3518,7 +3594,8 @@ 30980 32462 /* 30981 32463 * Check for matching suffixes in file names. … … 30987 32469 if (xp->xp_numfiles) 30988 32470 non_suf_match = xp->xp_numfiles; 30989 @@ -3674,6 +37 45,7 @@32471 @@ -3674,6 +3751,7 @@ 30990 32472 if (options & WILD_ESCAPE) 30991 32473 { … … 30995 32477 || xp->xp_context == EXPAND_BUFFERS 30996 32478 || xp->xp_context == EXPAND_DIRECTORIES) 30997 @@ -4338,6 +441 0,7 @@32479 @@ -4338,6 +4416,7 @@ 30998 32480 char_u ***matches; /* return: array of pointers to matches */ 30999 32481 { … … 31003 32485 if (xp->xp_context == EXPAND_UNSUCCESSFUL) 31004 32486 { 31005 @@ -4356,9 +44 29,11 @@32487 @@ -4356,9 +4435,11 @@ 31006 32488 if (file_str == NULL) 31007 32489 return EXPAND_UNSUCCESSFUL; … … 31017 32499 *matchcount = 0; 31018 32500 *matches = NULL; 31019 @@ -4410,7 +44 85,7 @@32501 @@ -4410,7 +4491,7 @@ 31020 32502 char_u *pat; 31021 32503 int *num_file; … … 31026 32508 #ifdef FEAT_CMDL_COMPL 31027 32509 regmatch_T regmatch; 31028 @@ -4464,6 +45 39,9 @@32510 @@ -4464,6 +4545,9 @@ 31029 32511 flags |= (EW_FILE | EW_PATH); 31030 32512 else … … 31036 32518 ret = expand_wildcards_eval(&pat, num_file, file, flags); 31037 32519 if (free_pat) 31038 @@ -4501,13 +45 79,25 @@32520 @@ -4501,13 +4585,25 @@ 31039 32521 || xp->xp_context == EXPAND_TAGS_LISTFILES) 31040 32522 return expand_tags(xp->xp_context == EXPAND_TAGS, pat, num_file, file); … … 31066 32548 if (xp->xp_context == EXPAND_USER_LIST) 31067 32549 return ExpandUserList(xp, num_file, file); 31068 @@ -4536,48 +46 26,53 @@32550 @@ -4536,48 +4632,53 @@ 31069 32551 int context; 31070 32552 char_u *((*func)__ARGS((expand_T *, int))); … … 31141 32623 int i; 31142 32624 31143 @@ -4591,7 +46 86,8 @@32625 @@ -4591,7 +4692,8 @@ 31144 32626 { 31145 32627 if (tab[i].ic) … … 31147 32629 - ret = ExpandGeneric(xp, ®match, num_file, file, tab[i].func); 31148 32630 + ret = ExpandGeneric(xp, ®match, num_file, file, 31149 + 32631 + tab[i].func, tab[i].escaped); 31150 32632 break; 31151 32633 } 31152 32634 } 31153 @@ -4613,13 +47 09,14 @@32635 @@ -4613,13 +4715,14 @@ 31154 32636 * Returns OK when no problems encountered, FAIL for error (out of memory). 31155 32637 */ … … 31167 32649 int i; 31168 32650 int count = 0; 31169 @@ -4644,7 +474 1,10 @@32651 @@ -4644,7 +4747,10 @@ 31170 32652 { 31171 32653 if (round) … … 31179 32661 #ifdef FEAT_MENU 31180 32662 if (func == get_menu_names && str != NULL) 31181 @@ -4676,7 +47 76,16 @@32663 @@ -4676,7 +4782,16 @@ 31182 32664 31183 32665 /* Sort the results. Keep menu's in the specified order. */ … … 31197 32679 #ifdef FEAT_CMDL_COMPL 31198 32680 /* Reset the variables used for special highlight names expansion, so that 31199 @@ -4728,7 +48 37,11 @@32681 @@ -4728,7 +4843,11 @@ 31200 32682 || (pat[1] == '.' && vim_ispathsep(pat[2]))))) 31201 32683 path = (char_u *)"."; … … 31209 32691 /* 31210 32692 * Go over all directories in $PATH. Expand matches in that directory and 31211 @@ -4949,57 +506 2,68 @@32693 @@ -4949,57 +5068,68 @@ 31212 32694 /* 31213 32695 * Expand color scheme, compiler or filetype names: … … 31300 32782 - vim_free(all); 31301 32783 + if (ga.ga_len == 0) 31302 + 32784 + return FAIL; 31303 32785 31304 32786 /* Sort and remove duplicates which can happen when specifying multiple … … 31308 32790 31309 32791 *file = ga.ga_data; 31310 @@ -5127,6 +525 1,34 @@32792 @@ -5127,6 +5257,34 @@ 31311 32793 NULL 31312 32794 }; … … 31343 32825 * init_history() - Initialize the command line history. 31344 32826 * Also used to re-allocate the history when the size changes. 31345 @@ -5220,13 +537 2,15 @@32827 @@ -5220,13 +5378,15 @@ 31346 32828 * If 'move_to_front' is TRUE, matching entry is moved to end of history. 31347 32829 */ … … 31360 32842 if (hisidx[type] < 0) 31361 32843 return FALSE; 31362 @@ -5235,7 +53 89,12 @@32844 @@ -5235,7 +5395,12 @@ 31363 32845 { 31364 32846 if (history[type][i].hisstr == NULL) … … 31374 32856 if (!move_to_front) 31375 32857 return TRUE; 31376 @@ -5329,7 +54 88,7 @@32858 @@ -5329,7 +5494,7 @@ 31377 32859 } 31378 32860 last_maptick = -1; … … 31383 32865 if (++hisidx[histype] == hislen) 31384 32866 hisidx[histype] = 0; 31385 @@ -5803,7 +596 2,7 @@32867 @@ -5803,7 +5968,7 @@ 31386 32868 hist[i].hisnum); 31387 32869 if (vim_strsize(hist[i].hisstr) > (int)Columns - 10) … … 31392 32874 STRCAT(IObuff, hist[i].hisstr); 31393 32875 msg_outtrans(IObuff); 31394 @@ -5907,8 +60 66,10 @@32876 @@ -5907,8 +6072,10 @@ 31395 32877 val = viminfo_readstring(virp, 1, TRUE); 31396 32878 if (val != NULL && *val != NUL) … … 31404 32886 /* Need to re-allocate to append the separator byte. */ 31405 32887 len = STRLEN(val); 31406 @@ -5920,7 +608 1,7 @@32888 @@ -5920,7 +6087,7 @@ 31407 32889 /* Search entry: Move the separator from the first 31408 32890 * column to after the NUL. */ … … 31413 32895 else 31414 32896 { 31415 @@ -6147,9 +63 08,7 @@32897 @@ -6147,9 +6314,7 @@ 31416 32898 curwin->w_p_rl = cmdmsg_rl; 31417 32899 cmdmsg_rl = FALSE; … … 31424 32906 # ifdef FEAT_AUTOCMD 31425 32907 /* Do execute autocommands for setting the filetype (load syntax). */ 31426 @@ -6287,6 +64 46,12 @@32908 @@ -6287,6 +6452,12 @@ 31427 32909 ccline.cmdbuff = vim_strsave((char_u *)"qa"); 31428 32910 cmdwin_result = CAR; … … 31437 32919 ccline.cmdbuff = vim_strsave(ml_get_curline()); 31438 32920 if (ccline.cmdbuff == NULL) 31439 @@ -6317,7 +648 2,7 @@32921 @@ -6317,7 +6488,7 @@ 31440 32922 /* win_close() may have already wiped the buffer when 'bh' is 31441 32923 * set to 'wipe' */ … … 31446 32928 /* Restore window sizes. */ 31447 32929 win_size_restore(&winsizes); 32930 diff -Naur vim73.orig/src/farsi.c vim73/src/farsi.c 32931 --- vim73.orig/src/farsi.c 2010-05-15 11:04:10.000000000 +0000 32932 +++ vim73/src/farsi.c 2012-07-20 20:31:18.224311766 +0000 32933 @@ -1813,7 +1813,7 @@ 32934 ptr[i] = toF_leading(ptr[i]); 32935 ++i; 32936 32937 - while(canF_Rjoin(ptr[i]) && (i < llen)) 32938 + while (canF_Rjoin(ptr[i]) && i < llen) 32939 { 32940 ptr[i] = toF_Rjoin(ptr[i]); 32941 if (F_isterm(ptr[i]) || !F_isalpha(ptr[i])) 31448 32942 diff -Naur vim73.orig/src/feature.h vim73/src/feature.h 31449 --- vim73.orig/src/feature.h 201 2-06-03 23:09:52.952007375+000031450 +++ vim73/src/feature.h 2012-0 6-03 23:09:55.760082103+000032943 --- vim73.orig/src/feature.h 2010-07-27 19:45:42.000000000 +0000 32944 +++ vim73/src/feature.h 2012-07-20 20:31:15.827643384 +0000 31451 32945 @@ -506,15 +506,6 @@ 31452 32946 #endif … … 31516 33010 +#endif 31517 33011 diff -Naur vim73.orig/src/fileio.c vim73/src/fileio.c 31518 --- vim73.orig/src/fileio.c 201 2-06-03 23:09:52.924006631+000031519 +++ vim73/src/fileio.c 2012-0 6-03 23:09:55.800083168+000033012 --- vim73.orig/src/fileio.c 2010-08-14 12:20:54.000000000 +0000 33013 +++ vim73/src/fileio.c 2012-07-20 20:31:18.164311724 +0000 31520 33014 @@ -11,14 +11,6 @@ 31521 33015 * fileio.c: read from and write to a file … … 31974 33468 # else 31975 33469 char_u *p; 31976 @@ -7682,6 +7674,7 @@ 33470 @@ -7651,6 +7643,7 @@ 33471 {"CmdwinEnter", EVENT_CMDWINENTER}, 33472 {"CmdwinLeave", EVENT_CMDWINLEAVE}, 33473 {"ColorScheme", EVENT_COLORSCHEME}, 33474 + {"CompleteDone", EVENT_COMPLETEDONE}, 33475 {"CursorHold", EVENT_CURSORHOLD}, 33476 {"CursorHoldI", EVENT_CURSORHOLDI}, 33477 {"CursorMoved", EVENT_CURSORMOVED}, 33478 @@ -7682,9 +7675,11 @@ 31977 33479 {"InsertChange", EVENT_INSERTCHANGE}, 31978 33480 {"InsertEnter", EVENT_INSERTENTER}, … … 31982 33484 {"QuickFixCmdPost", EVENT_QUICKFIXCMDPOST}, 31983 33485 {"QuickFixCmdPre", EVENT_QUICKFIXCMDPRE}, 31984 @@ -8744,6 +8737,8 @@ 33486 + {"QuitPre", EVENT_QUITPRE}, 33487 {"RemoteReply", EVENT_REMOTEREPLY}, 33488 {"SessionLoadPost", EVENT_SESSIONLOADPOST}, 33489 {"ShellCmdPost", EVENT_SHELLCMDPOST}, 33490 @@ -8744,6 +8739,8 @@ 31985 33491 int retval; 31986 33492 aco_save_T aco; … … 31991 33497 /* 31992 33498 * This is a bit tricky: For some commands curwin->w_buffer needs to be 31993 @@ -8760,11 +875 5,15 @@33499 @@ -8760,11 +8757,15 @@ 31994 33500 aucmd_prepbuf(&aco, buf); 31995 33501 … … 32011 33517 /* restore the current window */ 32012 33518 aucmd_restbuf(&aco); 32013 @@ -8779,6 +87 78,23 @@33519 @@ -8779,6 +8780,23 @@ 32014 33520 } 32015 33521 … … 32035 33541 * Search for a visible window containing the current buffer. If there isn't 32036 33542 * one then use "aucmd_win". 32037 @@ -8903,10 +8919,11 @@ 33543 @@ -8901,12 +8919,13 @@ 33544 if (wp == aucmd_win) 33545 { 32038 33546 if (tp != curtab) 32039 goto_tabpage_tp(tp); 33547 - goto_tabpage_tp(tp); 33548 + goto_tabpage_tp(tp, TRUE); 32040 33549 win_goto(aucmd_win); 32041 33550 - break; … … 32048 33557 /* Remove the window and frame from the tree of frames. */ 32049 33558 (void)winframe_remove(curwin, &dummy, NULL); 32050 @@ -8965,6 +898 2,10 @@33559 @@ -8965,6 +8984,10 @@ 32051 33560 && buf_valid(aco->new_curbuf) 32052 33561 && aco->new_curbuf->b_ml.ml_mfp != NULL) … … 32059 33568 curbuf = aco->new_curbuf; 32060 33569 curwin->w_buffer = curbuf; 32061 @@ -9063,7 +908 4,10 @@33570 @@ -9063,7 +9086,10 @@ 32062 33571 { 32063 33572 int state; … … 32071 33580 && !ins_compl_active() 32072 33581 #endif 32073 @@ -9094,6 +91 18,15 @@33582 @@ -9094,6 +9120,15 @@ 32074 33583 return (first_autopat[(int)EVENT_CURSORMOVEDI] != NULL); 32075 33584 } … … 32087 33596 apply_autocmds_group(event, fname, fname_io, force, group, buf, eap) 32088 33597 event_T event; 32089 @@ -9954,6 +998 7,8 @@33598 @@ -9954,6 +9989,8 @@ 32090 33599 if ((c == ';' || c == '>') && match == FALSE) 32091 33600 { … … 32096 33605 *pattern = c; /* Restore the terminator */ 32097 33606 type_start = pattern + 1; 32098 @@ -10181,19 +1021 6,11 @@33607 @@ -10181,19 +10218,11 @@ 32099 33608 ++p; 32100 33609 break; … … 32116 33625 break; 32117 33626 case '\\': 32118 @@ -10304,3 +1033 1,55 @@33627 @@ -10304,3 +10333,55 @@ 32119 33628 } 32120 33629 return reg_pat; … … 32173 33682 +#endif 32174 33683 diff -Naur vim73.orig/src/fold.c vim73/src/fold.c 32175 --- vim73.orig/src/fold.c 201 2-06-03 23:09:52.944007163+000032176 +++ vim73/src/fold.c 2012-0 6-03 23:09:55.544076354+000033684 --- vim73.orig/src/fold.c 2010-06-22 04:20:24.000000000 +0000 33685 +++ vim73/src/fold.c 2012-07-20 20:31:15.170976247 +0000 32177 33686 @@ -1033,10 +1033,10 @@ 32178 33687 * Init the fold info in a new window. … … 32322 33831 /* }}}1 */ 32323 33832 diff -Naur vim73.orig/src/getchar.c vim73/src/getchar.c 32324 --- vim73.orig/src/getchar.c 201 2-06-03 23:09:52.952007375+000032325 +++ vim73/src/getchar.c 2012-0 6-03 23:09:55.936086788+000033833 --- vim73.orig/src/getchar.c 2010-08-08 13:00:33.000000000 +0000 33834 +++ vim73/src/getchar.c 2012-07-20 20:31:16.570977250 +0000 32326 33835 @@ -418,12 +418,12 @@ 32327 33836 … … 32611 34120 : p_tm)), typebuf.tb_change_cnt); 32612 34121 32613 @@ -3168,6 +3188,7 @@ 34122 @@ -2799,7 +2819,8 @@ 34123 edit_unputchar(); 34124 if (State & CMDLINE) 34125 unputcmdline(); 34126 - setcursor(); /* put cursor back where it belongs */ 34127 + else 34128 + setcursor(); /* put cursor back where it belongs */ 34129 } 34130 34131 if (c < 0) 34132 @@ -3168,6 +3189,7 @@ 32614 34133 int expr = FALSE; 32615 34134 #endif … … 32619 34138 keys = arg; 32620 34139 map_table = maphash; 32621 @@ -3251,9 +327 2,9 @@34140 @@ -3251,9 +3273,9 @@ 32622 34141 validate_maphash(); 32623 34142 … … 32631 34150 p = keys; 32632 34151 do_backslash = (vim_strchr(p_cpo, CPO_BSLASH) == NULL); 32633 @@ -3266,6 +328 7,7 @@34152 @@ -3266,6 +3288,7 @@ 32634 34153 } 32635 34154 if (*p != NUL) … … 32639 34158 rhs = p; 32640 34159 hasarg = (*rhs != NUL); 32641 @@ -3288,6 +331 0,7 @@34160 @@ -3288,6 +3311,7 @@ 32642 34161 */ 32643 34162 if (haskey) … … 32647 34166 { 32648 34167 if (STRICMP(rhs, "<nop>") == 0) /* "<Nop>" means nothing */ 32649 @@ -3298,7 +332 1,7 @@34168 @@ -3298,7 +3322,7 @@ 32650 34169 32651 34170 #ifdef FEAT_FKMAP … … 32656 34175 */ 32657 34176 if (p_altkeymap && curwin->w_p_rl) 32658 @@ -3556,6 +35 79,8 @@34177 @@ -3556,6 +3580,8 @@ 32659 34178 } 32660 34179 vim_free(mp->m_str); … … 32665 34184 mp->m_silent = silent; 32666 34185 mp->m_mode = mode; 32667 @@ -3633,10 +365 8,12 @@34186 @@ -3633,10 +3659,12 @@ 32668 34187 32669 34188 mp->m_keys = vim_strsave(keys); … … 32678 34197 retval = 4; /* no mem */ 32679 34198 goto theend; 32680 @@ -3682,6 +37 09,7 @@34199 @@ -3682,6 +3710,7 @@ 32681 34200 mp = *mpp; 32682 34201 vim_free(mp->m_keys); … … 32686 34205 vim_free(mp); 32687 34206 } 32688 @@ -3851,12 +38 79,57 @@34207 @@ -3851,12 +3880,57 @@ 32689 34208 } 32690 34209 } … … 32745 34264 if (msg_didout || msg_silent != 0) 32746 34265 { 32747 @@ -3864,49 +393 7,15 @@34266 @@ -3864,49 +3938,15 @@ 32748 34267 if (got_int) /* 'q' typed at MORE prompt */ 32749 34268 return; … … 32802 34321 msg_putchar(' '); 32803 34322 32804 @@ -3931,12 +397 0,21 @@34323 @@ -3931,12 +3971,21 @@ 32805 34324 msg_putchar(' '); 32806 34325 … … 32827 34346 if (p_verbose > 0) 32828 34347 last_set_msg(mp->m_script_ID); 32829 @@ -4287,11 +433 5,7 @@34348 @@ -4287,11 +4336,7 @@ 32830 34349 int scol; /* starting column of the abbr. */ 32831 34350 int j; … … 32839 34358 #ifdef FEAT_LOCALMAP 32840 34359 mapblock_T *mp2; 32841 @@ -4304,8 +434 8,9 @@34360 @@ -4304,8 +4349,9 @@ 32842 34361 32843 34362 if (typebuf.tb_no_abbr_cnt) /* abbrev. are not recursive */ … … 32851 34370 32852 34371 /* 32853 @@ -4478,12 +452 3,25 @@34372 @@ -4478,12 +4524,25 @@ 32854 34373 { 32855 34374 char_u *res; … … 32877 34396 /* Forbid changing text or using ":normal" to avoid most of the bad side 32878 34397 * effects. Also restore the cursor position. */ 32879 @@ -4493,16 +455 1,23 @@34398 @@ -4493,16 +4552,23 @@ 32880 34399 #endif 32881 34400 set_vim_var_char(c); /* set v:char to the typed character */ … … 32902 34421 vim_free(p); 32903 34422 32904 @@ -4995,19 +506 0,21 @@34423 @@ -4995,19 +5061,21 @@ 32905 34424 sourcing_name = save_name; 32906 34425 } … … 32929 34448 int hash; 32930 34449 int len, minlen; 32931 @@ -5062,7 +51 29,17 @@34450 @@ -5062,7 +5130,17 @@ 32932 34451 minlen = mp->m_keylen - 3; 32933 34452 } … … 32948 34467 } 32949 34468 diff -Naur vim73.orig/src/globals.h vim73/src/globals.h 32950 --- vim73.orig/src/globals.h 201 2-06-03 23:09:52.952007375+000032951 +++ vim73/src/globals.h 2012-0 6-03 23:09:55.404072629+000034469 --- vim73.orig/src/globals.h 2010-07-23 19:20:45.000000000 +0000 34470 +++ vim73/src/globals.h 2012-07-20 20:31:18.067644988 +0000 32952 34471 @@ -113,9 +113,9 @@ 32953 34472 * When '$' is included in 'cpoptions' option set: … … 32962 34481 #ifdef FEAT_INS_EXPAND 32963 34482 /* 32964 @@ -510, 8 +510,13@@34483 @@ -510,9 +510,15 @@ 32965 34484 EXTERN VimClipboard clip_plus; /* CLIPBOARD selection in X11 */ 32966 34485 # else … … 32969 34488 # endif 32970 34489 -EXTERN int clip_unnamed INIT(= FALSE); 32971 + 32972 +#define CLIP_UNNAMED 1 32973 +#define CLIP_UNNAMED_PLUS 2 34490 -EXTERN int clip_autoselect INIT(= FALSE); 34491 + 34492 +# define CLIP_UNNAMED 1 34493 +# define CLIP_UNNAMED_PLUS 2 32974 34494 +EXTERN int clip_unnamed INIT(= 0); /* above two values or'ed */ 32975 34495 + 32976 EXTERN int clip_autoselect INIT(= FALSE); 34496 +EXTERN int clip_autoselect_star INIT(= FALSE); 34497 +EXTERN int clip_autoselect_plus INIT(= FALSE); 32977 34498 EXTERN int clip_autoselectml INIT(= FALSE); 32978 34499 EXTERN int clip_html INIT(= FALSE); 32979 @@ -530,6 +535,10 @@ 34500 EXTERN regprog_T *clip_exclude_prog INIT(= NULL); 34501 @@ -530,6 +536,10 @@ 32980 34502 EXTERN win_T *prevwin INIT(= NULL); /* previous window */ 32981 34503 # define W_NEXT(wp) ((wp)->w_next) … … 32988 34510 for ((tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next) \ 32989 34511 for ((wp) = ((tp) == curtab) \ 32990 @@ -1052,10 +1061,6 @@ 34512 @@ -728,9 +738,9 @@ 34513 #endif 34514 34515 EXTERN pos_T saved_cursor /* w_cursor before formatting text. */ 34516 -# ifdef DO_INIT 34517 +#ifdef DO_INIT 34518 = INIT_POS_T(0, 0, 0) 34519 -# endif 34520 +#endif 34521 ; 34522 34523 /* 34524 @@ -798,9 +808,9 @@ 34525 # endif 34526 EXTERN int has_mbyte INIT(= 0); /* any multi-byte encoding */ 34527 34528 -#if defined(WIN3264) && defined(FEAT_MBYTE) 34529 +# if defined(WIN3264) && defined(FEAT_MBYTE) 34530 EXTERN int wide_WindowProc INIT(= FALSE); /* use wide WindowProc() */ 34531 -#endif 34532 +# endif 34533 34534 /* 34535 * To speed up BYTELEN() we fill a table with the byte lengths whenever 34536 @@ -1052,10 +1062,6 @@ 32991 34537 ; 32992 34538 #endif … … 32999 34545 EXTERN int postponed_split INIT(= 0); /* for CTRL-W CTRL-] command */ 33000 34546 EXTERN int postponed_split_flags INIT(= 0); /* args for win_split() */ 33001 @@ -1512,7 +1517,7 @@ 34547 @@ -1094,8 +1100,8 @@ 34548 EXTERN int save_p_ls INIT(= -1); /* Save 'laststatus' setting */ 34549 EXTERN int save_p_wmh INIT(= -1); /* Save 'winminheight' setting */ 34550 EXTERN int wild_menu_showing INIT(= 0); 34551 -#define WM_SHOWN 1 /* wildmenu showing */ 34552 -#define WM_SCROLLED 2 /* wildmenu showing with scroll */ 34553 +# define WM_SHOWN 1 /* wildmenu showing */ 34554 +# define WM_SCROLLED 2 /* wildmenu showing with scroll */ 34555 #endif 34556 34557 #ifdef MSWIN 34558 @@ -1305,9 +1311,9 @@ 34559 EXTERN Atom commProperty INIT(= None); 34560 EXTERN char_u *serverDelayedStartName INIT(= NULL); 34561 # else 34562 -# ifdef PROTO 34563 +# ifdef PROTO 34564 typedef int HWND; 34565 -# endif 34566 +# endif 34567 EXTERN HWND clientWindow INIT(= 0); 34568 # endif 34569 #endif 34570 @@ -1512,7 +1518,7 @@ 33002 34571 EXTERN char_u e_sandbox[] INIT(= N_("E48: Not allowed in sandbox")); 33003 34572 #endif … … 33008 34577 EXTERN char_u e_screenmode[] INIT(= N_("E359: Screen mode setting not supported")); 33009 34578 #endif 33010 @@ -1560,6 +156 5,9 @@34579 @@ -1560,6 +1566,9 @@ 33011 34580 (defined(FEAT_INS_EXPAND) && defined(FEAT_COMPL_FUNC)) 33012 34581 EXTERN char_u e_notset[] INIT(= N_("E764: Option '%s' is not set")); … … 33019 34588 EXTERN short disallow_gui INIT(= FALSE); 33020 34589 diff -Naur vim73.orig/src/gui.c vim73/src/gui.c 33021 --- vim73.orig/src/gui.c 201 2-06-03 23:09:52.924006631+000033022 +++ vim73/src/gui.c 2012-0 6-03 23:09:55.908086042+000034590 --- vim73.orig/src/gui.c 2010-08-08 13:01:18.000000000 +0000 34591 +++ vim73/src/gui.c 2012-07-20 20:31:18.074311659 +0000 33023 34592 @@ -37,6 +37,24 @@ 33024 34593 static void gui_set_bg_color __ARGS((char_u *name)); … … 33505 35074 /* Always allow pasting */ 33506 35075 if (button != MOUSE_MIDDLE) 35076 @@ -3008,7 +3154,7 @@ 35077 } 35078 35079 if (clip_star.state != SELECT_CLEARED && !did_clip) 35080 - clip_clear_selection(); 35081 + clip_clear_selection(&clip_star); 35082 #endif 35083 35084 /* Don't put events in the input queue now. */ 33507 35085 @@ -4893,7 +5039,7 @@ 33508 35086 if (STRLEN(p) > 2000) … … 33515 35093 ga_clear(&error_ga); 33516 35094 diff -Naur vim73.orig/src/gui.h vim73/src/gui.h 33517 --- vim73.orig/src/gui.h 201 2-06-03 23:09:52.924006631+000033518 +++ vim73/src/gui.h 2012-0 6-03 23:09:54.376045272+000035095 --- vim73.orig/src/gui.h 2010-07-17 19:40:58.000000000 +0000 35096 +++ vim73/src/gui.h 2012-07-20 20:31:11.674307068 +0000 33519 35097 @@ -52,10 +52,6 @@ 33520 35098 # include <SegLoad.h>*/ … … 33572 35150 PtWidget_t *vimTextArea; /* PtRaw */ 33573 35151 diff -Naur vim73.orig/src/gui_athena.c vim73/src/gui_athena.c 33574 --- vim73.orig/src/gui_athena.c 201 2-06-03 23:09:52.944007163+000033575 +++ vim73/src/gui_athena.c 2012-0 6-03 23:09:53.612024941+000035152 --- vim73.orig/src/gui_athena.c 2010-08-08 13:01:39.000000000 +0000 35153 +++ vim73/src/gui_athena.c 2012-07-20 20:31:09.277638673 +0000 33576 35154 @@ -2117,13 +2117,14 @@ 33577 35155 } … … 33591 35169 char_u *p, *next; 33592 35170 diff -Naur vim73.orig/src/gui_gtk.c vim73/src/gui_gtk.c 33593 --- vim73.orig/src/gui_gtk.c 201 2-06-03 23:09:52.952007375+000033594 +++ vim73/src/gui_gtk.c 2012-0 6-03 23:09:55.776082529+000033595 @@ -90,6 +90,1 1@@35171 --- vim73.orig/src/gui_gtk.c 2010-07-20 11:15:22.000000000 +0000 35172 +++ vim73/src/gui_gtk.c 2012-07-20 20:31:17.964311580 +0000 35173 @@ -90,6 +90,13 @@ 33596 35174 static void entry_activate_cb(GtkWidget *widget, gpointer data); 33597 35175 static void entry_changed_cb(GtkWidget *entry, GtkWidget *dialog); 33598 35176 static void find_replace_cb(GtkWidget *widget, gpointer data); 35177 +#if defined(FEAT_BROWSE) || defined(PROTO) 33599 35178 +static void recent_func_log_func( 33600 35179 + const gchar *log_domain, … … 33602 35181 + const gchar *message, 33603 35182 + gpointer user_data); 35183 +#endif 33604 35184 33605 35185 #if defined(FEAT_TOOLBAR) 33606 35186 /* 33607 @@ -839,6 +844,8 @@ 35187 @@ -772,9 +779,6 @@ 35188 /* 35189 * Implementation of the file selector related stuff 35190 */ 35191 -#if GTK_CHECK_VERSION(2,4,0) 35192 -# define USE_FILE_CHOOSER 35193 -#endif 35194 35195 #ifndef USE_FILE_CHOOSER 35196 static void 35197 @@ -833,12 +837,15 @@ 35198 char_u *dflt, 35199 char_u *ext UNUSED, 35200 char_u *initdir, 35201 - char_u *filter UNUSED) 35202 + char_u *filter) 35203 { 35204 #ifdef USE_FILE_CHOOSER 33608 35205 GtkWidget *fc; 33609 35206 #endif … … 33611 35208 + guint log_handler; 33612 35209 + const gchar *domain = "Gtk"; 35210 + GtkFileFilter *gfilter; 33613 35211 33614 35212 title = CONVERT_TO_UTF8(title); … … 33626 35224 /* We create the dialog each time, so that the button text can be "Open" 33627 35225 * or "Save" according to the action. */ 33628 @@ -916,6 +928,7 @@ 35226 @@ -865,6 +877,45 @@ 35227 NULL); 35228 gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(fc), 35229 (const gchar *)dirbuf); 35230 + 35231 + if (filter != NULL && *filter != NUL) 35232 + { 35233 + int i = 0; 35234 + char_u *patt; 35235 + char_u *p = filter; 35236 + 35237 + gfilter = gtk_file_filter_new(); 35238 + patt = alloc(STRLEN(filter)); 35239 + while (p != NULL && *p != NUL) 35240 + { 35241 + if (*p == '\n' || *p == ';' || *p == '\t') 35242 + { 35243 + STRNCPY(patt, filter, i); 35244 + patt[i] = '\0'; 35245 + if (*p == '\t') 35246 + gtk_file_filter_set_name(gfilter, (gchar *)patt); 35247 + else 35248 + { 35249 + gtk_file_filter_add_pattern(gfilter, (gchar *)patt); 35250 + if (*p == '\n') 35251 + { 35252 + gtk_file_chooser_add_filter((GtkFileChooser *)fc, 35253 + gfilter); 35254 + if (*(p + 1) != NUL) 35255 + gfilter = gtk_file_filter_new(); 35256 + } 35257 + } 35258 + filter = ++p; 35259 + i = 0; 35260 + } 35261 + else 35262 + { 35263 + p++; 35264 + i++; 35265 + } 35266 + } 35267 + vim_free(patt); 35268 + } 35269 if (saving && dflt != NULL && *dflt != NUL) 35270 gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(fc), (char *)dflt); 35271 35272 @@ -916,6 +967,7 @@ 33629 35273 gtk_widget_show(gui.filedlg); 33630 35274 gtk_main(); … … 33634 35278 CONVERT_TO_UTF8_FREE(title); 33635 35279 if (gui.browse_fname == NULL) 33636 @@ -1268,7 +1 281,8 @@35280 @@ -1268,7 +1320,8 @@ 33637 35281 char_u *message, /* message text */ 33638 35282 char_u *buttons, /* names of buttons */ … … 33644 35288 GtkWidget *dialog; 33645 35289 GtkWidget *entry = NULL; 33646 @@ -1287,6 +13 01,9 @@35290 @@ -1287,6 +1340,9 @@ 33647 35291 entry = gtk_entry_new(); 33648 35292 gtk_widget_show(entry); 33649 35293 33650 35294 + /* Make Enter work like pressing OK. */ 33651 + 35295 + gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE); 33652 35296 + 33653 35297 text = CONVERT_TO_UTF8(textfield); 33654 35298 gtk_entry_set_text(GTK_ENTRY(entry), (const char *)text); 33655 35299 CONVERT_TO_UTF8_FREE(text); 33656 @@ -1387,7 +14 04,7 @@35300 @@ -1387,7 +1443,7 @@ 33657 35301 gtk_menu_popup(GTK_MENU(menu->submenu_id), 33658 35302 NULL, NULL, … … 33663 35307 33664 35308 /* Ugly global variable to pass "mouse_pos" flag from gui_make_popup() to 33665 @@ -1795,7 +18 12,6 @@35309 @@ -1795,7 +1851,6 @@ 33666 35310 char_u *repl_text; 33667 35311 gboolean direction_down; … … 33671 35315 flags = (int)(long)data; /* avoid a lint warning here */ 33672 35316 33673 @@ -1821,7 +18 37,7 @@35317 @@ -1821,7 +1876,7 @@ 33674 35318 33675 35319 repl_text = CONVERT_FROM_UTF8(repl_text); … … 33680 35324 CONVERT_FROM_UTF8_FREE(find_text); 33681 35325 } 33682 @@ -1879,3 +1 895,14@@35326 @@ -1879,3 +1934,15 @@ 33683 35327 * backwards compatibility anyway. */ 33684 35328 do_cmdline_cmd((char_u *)"emenu ToolBar.FindHelp"); 33685 35329 } 33686 35330 + 35331 +#if defined(FEAT_BROWSE) || defined(PROTO) 33687 35332 + static void 33688 35333 +recent_func_log_func(const gchar *log_domain UNUSED, … … 33694 35339 + /* http://bugzilla.gnome.org/show_bug.cgi?id=664587 */ 33695 35340 +} 33696 + 35341 +#endif 33697 35342 diff -Naur vim73.orig/src/gui_gtk_x11.c vim73/src/gui_gtk_x11.c 33698 --- vim73.orig/src/gui_gtk_x11.c 201 2-06-03 23:09:52.948007269+000033699 +++ vim73/src/gui_gtk_x11.c 2012-0 6-03 23:09:55.860084763+000035343 --- vim73.orig/src/gui_gtk_x11.c 2010-08-15 11:52:15.000000000 +0000 35344 +++ vim73/src/gui_gtk_x11.c 2012-07-20 20:31:16.157643621 +0000 33700 35345 @@ -86,7 +86,6 @@ 33701 35346 … … 33874 35519 } 33875 35520 diff -Naur vim73.orig/src/gui_mac.c vim73/src/gui_mac.c 33876 --- vim73.orig/src/gui_mac.c 201 2-06-03 23:09:52.920006524+000033877 +++ vim73/src/gui_mac.c 2012-0 6-03 23:09:55.024062516+000035521 --- vim73.orig/src/gui_mac.c 2010-08-14 19:39:54.000000000 +0000 35522 +++ vim73/src/gui_mac.c 2012-07-20 20:31:13.584308441 +0000 33878 35523 @@ -1480,7 +1480,7 @@ 33879 35524 * … … 33997 35642 // of the tabs, not pointers to the tabs (which are invalid for a short time). 33998 35643 diff -Naur vim73.orig/src/gui_motif.c vim73/src/gui_motif.c 33999 --- vim73.orig/src/gui_motif.c 201 2-06-03 23:09:52.944007163+000034000 +++ vim73/src/gui_motif.c 2012-0 6-03 23:09:53.616025047+000035644 --- vim73.orig/src/gui_motif.c 2010-08-08 13:04:15.000000000 +0000 35645 +++ vim73/src/gui_motif.c 2012-07-20 20:31:09.287638679 +0000 34001 35646 @@ -2549,13 +2549,14 @@ 34002 35647 #endif … … 34016 35661 char_u *p, *next; 34017 35662 diff -Naur vim73.orig/src/gui_photon.c vim73/src/gui_photon.c 34018 --- vim73.orig/src/gui_photon.c 201 2-06-03 23:09:52.952007375+000034019 +++ vim73/src/gui_photon.c 2012-0 6-03 23:09:54.736054852 +000035663 --- vim73.orig/src/gui_photon.c 2010-05-15 11:04:08.000000000 +0000 35664 +++ vim73/src/gui_photon.c 2012-07-20 20:31:12.694307802 +0000 34020 35665 @@ -32,9 +32,9 @@ 34021 35666 #endif … … 37184 38829 37185 38830 diff -Naur vim73.orig/src/gui_riscos.c vim73/src/gui_riscos.c 37186 --- vim73.orig/src/gui_riscos.c 201 2-06-03 23:09:52.944007163+000038831 --- vim73.orig/src/gui_riscos.c 2010-05-15 11:04:09.000000000 +0000 37187 38832 +++ vim73/src/gui_riscos.c 1970-01-01 00:00:00.000000000 +0000 37188 38833 @@ -1,3558 +0,0 @@ … … 40746 42391 -} 40747 42392 diff -Naur vim73.orig/src/gui_riscos.h vim73/src/gui_riscos.h 40748 --- vim73.orig/src/gui_riscos.h 201 2-06-03 23:09:52.948007269+000042393 --- vim73.orig/src/gui_riscos.h 2010-05-15 11:04:10.000000000 +0000 40749 42394 +++ vim73/src/gui_riscos.h 1970-01-01 00:00:00.000000000 +0000 40750 42395 @@ -1,32 +0,0 @@ … … 40782 42427 -void ro_open_main(int *block); 40783 42428 diff -Naur vim73.orig/src/gui_w16.c vim73/src/gui_w16.c 40784 --- vim73.orig/src/gui_w16.c 201 2-06-03 23:09:52.944007163+000040785 +++ vim73/src/gui_w16.c 2012-0 6-03 23:09:55.320070394+000042429 --- vim73.orig/src/gui_w16.c 2010-07-18 13:03:38.000000000 +0000 42430 +++ vim73/src/gui_w16.c 2012-07-20 20:31:14.477642416 +0000 40786 42431 @@ -21,6 +21,12 @@ 40787 42432 * … … 40808 42453 LPWORD p, pnumitems; 40809 42454 diff -Naur vim73.orig/src/gui_w32.c vim73/src/gui_w32.c 40810 --- vim73.orig/src/gui_w32.c 201 2-06-03 23:09:52.952007375+000040811 +++ vim73/src/gui_w32.c 2012-0 6-03 23:09:55.120065072+000042455 --- vim73.orig/src/gui_w32.c 2010-08-08 13:05:26.000000000 +0000 42456 +++ vim73/src/gui_w32.c 2012-07-20 20:31:13.890975327 +0000 40812 42457 @@ -289,13 +289,13 @@ 40813 42458 … … 41092 42737 41093 42738 diff -Naur vim73.orig/src/gui_w48.c vim73/src/gui_w48.c 41094 --- vim73.orig/src/gui_w48.c 201 2-06-03 23:09:52.940007057+000041095 +++ vim73/src/gui_w48.c 2012-0 6-03 23:09:55.244068371+000042739 --- vim73.orig/src/gui_w48.c 2010-07-27 19:46:04.000000000 +0000 42740 +++ vim73/src/gui_w48.c 2012-07-20 20:31:14.280975607 +0000 41096 42741 @@ -328,6 +328,10 @@ 41097 42742 static LRESULT _OnImeNotify(HWND hWnd, DWORD dwCommand, DWORD dwData); … … 41289 42934 41290 42935 diff -Naur vim73.orig/src/gui_x11.c vim73/src/gui_x11.c 41291 --- vim73.orig/src/gui_x11.c 201 2-06-03 23:09:52.920006524+000041292 +++ vim73/src/gui_x11.c 2012-0 6-03 23:09:53.348017915+000042936 --- vim73.orig/src/gui_x11.c 2010-08-08 13:05:45.000000000 +0000 42937 +++ vim73/src/gui_x11.c 2012-07-20 20:31:08.337637993 +0000 41293 42938 @@ -2895,6 +2895,11 @@ 41294 42939 focus = gui.in_focus; … … 41304 42949 * char arrives, instead we use XtAppProcessEvent() to hang until an 41305 42950 diff -Naur vim73.orig/src/gui_xmdlg.c vim73/src/gui_xmdlg.c 41306 --- vim73.orig/src/gui_xmdlg.c 201 2-06-03 23:09:52.948007269+000041307 +++ vim73/src/gui_xmdlg.c 2012-0 6-03 23:09:53.604024727+000042951 --- vim73.orig/src/gui_xmdlg.c 2010-06-26 03:53:50.000000000 +0000 42952 +++ vim73/src/gui_xmdlg.c 2012-07-20 20:31:09.267638665 +0000 41308 42953 @@ -688,7 +688,7 @@ 41309 42954 do_dialog(VIM_ERROR, … … 41324 42969 } 41325 42970 else 42971 diff -Naur vim73.orig/src/gui_xmebw.c vim73/src/gui_xmebw.c 42972 --- vim73.orig/src/gui_xmebw.c 2010-07-14 14:48:14.000000000 +0000 42973 +++ vim73/src/gui_xmebw.c 2012-07-20 20:31:17.487644573 +0000 42974 @@ -375,11 +375,8 @@ 42975 42976 XGetGeometry(dpy, pix, &root, &x, &y, &width, &height, &border, &depth); 42977 42978 - if (eb->enhancedbutton.label_location == (int)XmTOP 42979 - || eb->enhancedbutton.label_location == (int)XmBOTTOM) 42980 - shift = eb->primitive.shadow_thickness / 2; 42981 - else 42982 - shift = eb->primitive.shadow_thickness / 2; 42983 + /* TODO: does the shift depend on label_location somehow? */ 42984 + shift = eb->primitive.shadow_thickness / 2; 42985 42986 if (shift < 1) 42987 shift = 1; 41326 42988 diff -Naur vim73.orig/src/hardcopy.c vim73/src/hardcopy.c 41327 --- vim73.orig/src/hardcopy.c 201 2-06-03 23:09:52.948007269+000041328 +++ vim73/src/hardcopy.c 2012-0 6-03 23:09:53.916033030 +000042989 --- vim73.orig/src/hardcopy.c 2010-07-31 14:10:59.000000000 +0000 42990 +++ vim73/src/hardcopy.c 2012-07-20 20:31:10.217639350 +0000 41329 42991 @@ -1759,18 +1759,25 @@ 41330 42992 char *name; … … 41374 43036 + struct prt_ps_resource_S *res_cidfont; 41375 43037 + struct prt_ps_resource_S *res_cmap; 41376 +#endif43038 #endif 41377 43039 + int retval = FALSE; 41378 43040 + … … 41390 43052 +#ifdef FEAT_MBYTE 41391 43053 + || res_cidfont == NULL || res_cmap == NULL 41392 43054 +#endif 41393 43055 + ) 41394 43056 + goto theend; … … 41583 43245 void 41584 43246 diff -Naur vim73.orig/src/if_cscope.c vim73/src/if_cscope.c 41585 --- vim73.orig/src/if_cscope.c 201 2-06-03 23:09:52.940007057+000041586 +++ vim73/src/if_cscope.c 2012-0 6-03 23:09:54.260042184+000043247 --- vim73.orig/src/if_cscope.c 2010-07-25 14:32:31.000000000 +0000 43248 +++ vim73/src/if_cscope.c 2012-07-20 20:31:11.340973493 +0000 41587 43249 @@ -13,16 +13,10 @@ 41588 43250 … … 41749 43411 /* 41750 43412 diff -Naur vim73.orig/src/if_lua.c vim73/src/if_lua.c 41751 --- vim73.orig/src/if_lua.c 201 2-06-03 23:09:52.924006631+000041752 +++ vim73/src/if_lua.c 2012-0 6-03 23:09:55.724081145+000043413 --- vim73.orig/src/if_lua.c 2010-08-12 20:12:04.000000000 +0000 43414 +++ vim73/src/if_lua.c 2012-07-20 20:31:17.324311122 +0000 41753 43415 @@ -1,4 +1,4 @@ 41754 43416 -/* vi:set ts=8 sts=4 sw=4: … … 41949 43611 +lua_Integer (*dll_lua_tointegerx) (lua_State *L, int idx, int *isnum); 41950 43612 +void (*dll_lua_callk) (lua_State *L, int nargs, int nresults, int ctx, 41951 + 43613 + lua_CFunction k); 41952 43614 +int (*dll_lua_pcallk) (lua_State *L, int nargs, int nresults, int errfunc, 41953 + 43615 + int ctx, lua_CFunction k); 41954 43616 +void (*dll_lua_getglobal) (lua_State *L, const char *var); 41955 43617 +void (*dll_lua_setglobal) (lua_State *L, const char *var); … … 42077 43739 +{ 42078 43740 + const char *msg = lua_pushfstring(L, "%s expected, got %s", 42079 + 43741 + tname, luaL_typename(L, narg)); 42080 43742 + return luaL_argerror(L, narg, msg); 42081 43743 +} … … 42246 43908 } 42247 43909 42248 @@ -479,89 +606, 508@@43910 @@ -479,89 +606,372 @@ 42249 43911 lua_pop(L, 2); /* original and modified strings */ 42250 43912 } … … 42289 43951 + return 1; \ 42290 43952 + } 43953 + 43954 +/* ======= List type ======= */ 43955 + 43956 + static luaV_List * 43957 +luaV_newlist (lua_State *L, list_T *lis) 43958 +{ 43959 + luaV_List *l = (luaV_List *) lua_newuserdata(L, sizeof(luaV_List)); 43960 + *l = lis; 43961 + lis->lv_refcount++; /* reference in Lua */ 43962 + luaV_setudata(L, lis); /* cache[lis] = udata */ 43963 + luaV_getfield(L, LUAVIM_LIST); 43964 + lua_setmetatable(L, -2); 43965 + return l; 43966 +} 43967 + 43968 +luaV_pushtype(list_T, list, luaV_List) 43969 +luaV_type_tostring(list, LUAVIM_LIST) 42291 43970 42292 43971 -/* ======= Buffer type ======= */ 43972 + static int 43973 +luaV_list_gc (lua_State *L) 43974 +{ 43975 + list_unref(luaV_unbox(L, luaV_List, 1)); 43976 + return 0; 43977 +} 42293 43978 42294 43979 - static luaV_Buffer * 42295 43980 -luaV_newbuffer(lua_State *L, buf_T *buf) 42296 +/* adapted from eval.c */ 42297 + 42298 +#define listitem_alloc() (listitem_T *)alloc(sizeof(listitem_T)) 42299 + 42300 + static listitem_T * 42301 +list_find (list_T *l, long n) 42302 +{ 42303 + listitem_T *li; 42304 + if (l == NULL || n < -l->lv_len || n >= l->lv_len) 42305 + return NULL; 42306 + if (n < 0) /* search backward? */ 42307 + for (li = l->lv_last; n < -1; li = li->li_prev) 42308 + n++; 42309 + else /* search forward */ 42310 + for (li = l->lv_first; n > 0; li = li->li_next) 42311 + n--; 42312 + return li; 42313 +} 42314 + 42315 + static void 42316 +list_remove (list_T *l, listitem_T *li) 43981 + static int 43982 +luaV_list_len (lua_State *L) 42317 43983 { 42318 43984 - luaV_Buffer *b = (luaV_Buffer *) lua_newuserdata(L, sizeof(luaV_Buffer)); … … 42327 43993 - /* set metatable */ 42328 43994 - luaV_getfield(L, LUAVIM_BUFFER); 42329 + listwatch_T *lw; 42330 + --l->lv_len; 42331 + /* fix watchers */ 42332 + for (lw = l->lv_watch; lw != NULL; lw = lw->lw_next) 42333 + if (lw->lw_item == li) 42334 + lw->lw_item = li->li_next; 42335 + /* fix list pointers */ 42336 + if (li->li_next == NULL) /* last? */ 42337 + l->lv_last = li->li_prev; 42338 + else 42339 + li->li_next->li_prev = li->li_prev; 42340 + if (li->li_prev == NULL) /* first? */ 42341 + l->lv_first = li->li_next; 42342 + else 42343 + li->li_prev->li_next = li->li_next; 42344 + l->lv_idx_item = NULL; 42345 +} 42346 + 42347 + static void 42348 +list_append(list_T *l, listitem_T *item) 42349 +{ 42350 + if (l->lv_last == NULL) /* empty list? */ 42351 + l->lv_first = item; 42352 + else 42353 + l->lv_last->li_next = item; 42354 + item->li_prev = l->lv_last; 42355 + item->li_next = NULL; 42356 + l->lv_last = item; 42357 + ++l->lv_len; 42358 +} 42359 + 42360 + static int 42361 +list_insert_tv(list_T *l, typval_T *tv, listitem_T *item) 42362 +{ 42363 + listitem_T *ni = listitem_alloc(); 42364 + 42365 + if (ni == NULL) 42366 + return FAIL; 42367 + copy_tv(tv, &ni->li_tv); 42368 + if (item == NULL) 42369 + list_append(l, ni); 42370 + else 42371 + { 42372 + ni->li_prev = item->li_prev; 42373 + ni->li_next = item; 42374 + if (item->li_prev == NULL) 42375 + { 42376 + l->lv_first = ni; 42377 + ++l->lv_idx; 42378 + } 42379 + else 42380 + { 42381 + item->li_prev->li_next = ni; 42382 + l->lv_idx_item = NULL; 42383 + } 42384 + item->li_prev = ni; 42385 + ++l->lv_len; 42386 + } 42387 + return OK; 42388 +} 42389 + 42390 +/* set references */ 42391 + 42392 +static void set_ref_in_tv (typval_T *tv, int copyID); 42393 + 42394 + static void 42395 +set_ref_in_dict(dict_T *d, int copyID) 42396 +{ 42397 + hashtab_T *ht = &d->dv_hashtab; 42398 + int n = ht->ht_used; 42399 + hashitem_T *hi; 42400 + for (hi = ht->ht_array; n > 0; ++hi) 42401 + if (!HASHITEM_EMPTY(hi)) 42402 + { 42403 + dictitem_T *di = dict_lookup(hi); 42404 + set_ref_in_tv(&di->di_tv, copyID); 42405 + --n; 42406 + } 42407 +} 42408 + 42409 + static void 42410 +set_ref_in_list(list_T *l, int copyID) 42411 +{ 42412 + listitem_T *li; 42413 + for (li = l->lv_first; li != NULL; li = li->li_next) 42414 + set_ref_in_tv(&li->li_tv, copyID); 42415 +} 42416 + 42417 + static void 42418 +set_ref_in_tv(typval_T *tv, int copyID) 42419 +{ 42420 + if (tv->v_type == VAR_LIST) 42421 + { 42422 + list_T *l = tv->vval.v_list; 42423 + if (l != NULL && l->lv_copyID != copyID) 42424 + { 42425 + l->lv_copyID = copyID; 42426 + set_ref_in_list(l, copyID); 42427 + } 42428 + } 42429 + else if (tv->v_type == VAR_DICT) 42430 + { 42431 + dict_T *d = tv->vval.v_dict; 42432 + if (d != NULL && d->dv_copyID != copyID) 42433 + { 42434 + d->dv_copyID = copyID; 42435 + set_ref_in_dict(d, copyID); 42436 + } 42437 + } 42438 +} 42439 + 42440 + 42441 +/* ======= List type ======= */ 42442 + 42443 + static luaV_List * 42444 +luaV_newlist (lua_State *L, list_T *lis) 42445 +{ 42446 + luaV_List *l = (luaV_List *) lua_newuserdata(L, sizeof(luaV_List)); 42447 + *l = lis; 42448 + lis->lv_refcount++; /* reference in Lua */ 42449 + luaV_setudata(L, lis); /* cache[lis] = udata */ 42450 + luaV_getfield(L, LUAVIM_LIST); 42451 lua_setmetatable(L, -2); 43995 - lua_setmetatable(L, -2); 42452 43996 - return b; 42453 + return l; 43997 + list_T *l = luaV_unbox(L, luaV_List, 1); 43998 + lua_pushinteger(L, (l == NULL) ? 0 : (int) l->lv_len); 43999 + return 1; 42454 44000 } 42455 44001 42456 44002 - static luaV_Buffer * 42457 44003 -luaV_pushbuffer (lua_State *L, buf_T *buf) 42458 +luaV_pushtype(list_T, list, luaV_List)42459 +luaV_type_tostring(list, LUAVIM_LIST)42460 +42461 44004 + static int 42462 +luaV_list_ gc(lua_State *L)44005 +luaV_list_iter (lua_State *L) 42463 44006 { 42464 44007 - luaV_Buffer *b = NULL; … … 42469 44012 - lua_rawget(L, LUA_ENVIRONINDEX); 42470 44013 - if (lua_isnil(L, -1)) /* not interned? */ 42471 + list_unref(luaV_unbox(L, luaV_List, 1));42472 + return 0;42473 +}42474 +42475 + static int42476 +luaV_list_len (lua_State *L)42477 +{42478 + list_T *l = luaV_unbox(L, luaV_List, 1);42479 + lua_pushinteger(L, (l == NULL) ? 0 : (int) l->lv_len);42480 + return 1;42481 +}42482 +42483 + static int42484 +luaV_list_iter (lua_State *L)42485 +{42486 44014 + listitem_T *li = (listitem_T *) lua_touserdata(L, lua_upvalueindex(2)); 42487 44015 + if (li == NULL) return 0; … … 42529 44057 - b = (luaV_Buffer *) lua_touserdata(L, -1); 42530 44058 + lua_pushnil(L); 42531 } 42532 - return b; 44059 + } 42533 44060 + else 42534 44061 + lua_pushnil(L); … … 42548 44075 + if (lua_isnil(L, 3)) /* remove? */ 42549 44076 + { 42550 + list_remove(l, li );44077 + list_remove(l, li, li); 42551 44078 + clear_tv(&li->li_tv); 42552 44079 + vim_free(li); 42553 + } 44080 } 44081 - return b; 42554 44082 + else 42555 44083 + { … … 42576 44104 + lua_settop(L, 2); 42577 44105 + luaV_totypval(L, 2, &v); 42578 + copy_tv(&v, &li->li_tv); 42579 + list_append(l, li); 44106 + list_append_tv(l, &v); 42580 44107 + } 42581 44108 + lua_settop(L, 1); … … 42796 44323 else if (strncmp(s, "insert", 6) == 0 42797 44324 || strncmp(s, "next", 4) == 0 42798 @@ -582,17 + 1128,17 @@44325 @@ -582,17 +992,17 @@ 42799 44326 static int 42800 44327 luaV_buffer_newindex(lua_State *L) … … 42817 44344 { 42818 44345 curbuf = buf; 42819 @@ -605,7 +1 151,7 @@44346 @@ -605,7 +1015,7 @@ 42820 44347 } 42821 44348 else { … … 42826 44353 if (curwin->w_cursor.lnum >= n) 42827 44354 { 42828 @@ -625,7 +1 171,7 @@44355 @@ -625,7 +1035,7 @@ 42829 44356 else if (lua_isstring(L, 3)) /* update line */ 42830 44357 { … … 42835 44362 { 42836 44363 curbuf = buf; 42837 @@ -638,7 +1 184,7 @@44364 @@ -638,7 +1048,7 @@ 42838 44365 } 42839 44366 else changed_bytes(n, 0); … … 42844 44371 } 42845 44372 else 42846 @@ -649,8 +1 195,9 @@44373 @@ -649,8 +1059,9 @@ 42847 44374 static int 42848 44375 luaV_buffer_insert(lua_State *L) … … 42856 44383 buf_T *buf; 42857 44384 luaL_checktype(L, 2, LUA_TSTRING); 42858 @@ -662,7 +1 209,7 @@44385 @@ -662,7 +1073,7 @@ 42859 44386 if (n > last) n = last; 42860 44387 /* insert */ … … 42865 44392 { 42866 44393 curbuf = buf; 42867 @@ -684,7 +1 231,8 @@44394 @@ -684,7 +1095,8 @@ 42868 44395 luaV_buffer_next(lua_State *L) 42869 44396 { … … 42875 44402 } 42876 44403 42877 @@ -692,7 +1 240,8 @@44404 @@ -692,7 +1104,8 @@ 42878 44405 luaV_buffer_previous(lua_State *L) 42879 44406 { … … 42885 44412 } 42886 44413 42887 @@ -700,8 +1 249,7 @@44414 @@ -700,8 +1113,7 @@ 42888 44415 luaV_buffer_isvalid(lua_State *L) 42889 44416 { … … 42895 44422 return 1; 42896 44423 } 42897 @@ -722,78 +1 270,36 @@44424 @@ -722,78 +1134,36 @@ 42898 44425 42899 44426 /* ======= Window type ======= */ … … 42985 44512 else if (strncmp(s, "next", 4) == 0 42986 44513 || strncmp(s, "previous", 8) == 0 42987 @@ -810,7 +1 316,7 @@44514 @@ -810,7 +1180,7 @@ 42988 44515 static int 42989 44516 luaV_window_newindex (lua_State *L) … … 42994 44521 int v = luaL_checkinteger(L, 3); 42995 44522 if (strncmp(s, "line", 4) == 0) 42996 @@ -818,9 +1 324,9 @@44523 @@ -818,9 +1188,9 @@ 42997 44524 #ifdef HAVE_SANDBOX 42998 44525 luaV_checksandbox(L); … … 43006 44533 } 43007 44534 else if (strncmp(s, "col", 3) == 0) 43008 @@ -828,7 +1 334,7 @@44535 @@ -828,7 +1198,7 @@ 43009 44536 #ifdef HAVE_SANDBOX 43010 44537 luaV_checksandbox(L); … … 43015 44542 } 43016 44543 #ifdef FEAT_VERTSPLIT 43017 @@ -838,7 +1 344,7 @@44544 @@ -838,7 +1208,7 @@ 43018 44545 #ifdef FEAT_GUI 43019 44546 need_mouse_correct = TRUE; … … 43024 44551 curwin = win; 43025 44552 } 43026 @@ -849,7 +1 355,7 @@44553 @@ -849,7 +1219,7 @@ 43027 44554 #ifdef FEAT_GUI 43028 44555 need_mouse_correct = TRUE; … … 43033 44560 curwin = win; 43034 44561 } 43035 @@ -862,7 +1 368,8 @@44562 @@ -862,7 +1232,8 @@ 43036 44563 luaV_window_next(lua_State *L) 43037 44564 { … … 43043 44570 } 43044 44571 43045 @@ -870,7 +1 377,8 @@44572 @@ -870,7 +1241,8 @@ 43046 44573 luaV_window_previous(lua_State *L) 43047 44574 { … … 43053 44580 } 43054 44581 43055 @@ -878,8 +1 386,7 @@44582 @@ -878,8 +1250,7 @@ 43056 44583 luaV_window_isvalid(lua_State *L) 43057 44584 { … … 43063 44590 return 1; 43064 44591 } 43065 @@ -925,6 +1 432,31 @@44592 @@ -925,6 +1296,31 @@ 43066 44593 } 43067 44594 … … 43095 44622 { 43096 44623 do_cmdline_cmd((char_u *) luaL_checkstring(L, 1)); 43097 @@ -956,6 +1 488,28 @@44624 @@ -956,6 +1352,28 @@ 43098 44625 } 43099 44626 … … 43124 44651 { 43125 44652 buf_T *buf; 43126 @@ -981,15 +1 535,10 @@44653 @@ -981,15 +1399,10 @@ 43127 44654 break; 43128 44655 } … … 43142 44669 } 43143 44670 43144 @@ -1002,59 +1 551,62 @@44671 @@ -1002,59 +1415,62 @@ 43145 44672 int n = lua_tointeger(L, 1); 43146 44673 for (win = firstwin; win != NULL; win = win->w_next, n--) … … 43170 44697 if (lua_isstring(L, 1)) s = (char_u *) lua_tostring(L, 1); 43171 44698 - b = luaV_pushbuffer(L, buflist_new(s, NULL, 1L, BLN_LISTED)); 43172 + luaV_pushbuffer(L, buflist_new(s, NULL, 1L, BLN_LISTED)); 43173 return 1; 43174 } 43175 43176 static int 44699 - return 1; 44700 -} 44701 - 44702 - static int 43177 44703 -luaV_isbuffer(lua_State *L) 43178 +luaV_type(lua_State *L) 43179 { 44704 -{ 43180 44705 - lua_pushboolean(L, luaV_toudata(L, 1, LUAVIM_BUFFER) != NULL); 43181 44706 - return 1; … … 43186 44711 -{ 43187 44712 - lua_pushboolean(L, luaV_toudata(L, 1, LUAVIM_WINDOW) != NULL); 43188 - return 1; 43189 -} 43190 - 44713 + luaV_pushbuffer(L, buflist_new(s, NULL, 1L, BLN_LISTED)); 44714 return 1; 44715 } 44716 43191 44717 -/* for freeing buffer and window objects; lightuserdata as arg */ 43192 -static int44718 static int 43193 44719 -luaV_free(lua_State *L) 43194 -{ 44720 +luaV_type(lua_State *L) 44721 { 43195 44722 - lua_pushvalue(L, 1); /* lightudata */ 43196 44723 - lua_rawget(L, LUA_ENVIRONINDEX); … … 43238 44765 43239 44766 static const luaL_Reg luaV_module[] = { 43240 @@ -1062,37 +1 614,128 @@44767 @@ -1062,37 +1478,128 @@ 43241 44768 {"eval", luaV_eval}, 43242 44769 {"beep", luaV_beep}, … … 43312 44839 + } 43313 44840 + lua_pop(L, 2); /* metatable and value */ 43314 + set_ref_in_ tv(&tv, copyID);44841 + set_ref_in_item(&tv, copyID); 43315 44842 + } 43316 44843 + return 0; … … 43377 44904 } 43378 44905 43379 @@ -1123,7 +1 766,7 @@44906 @@ -1123,7 +1630,7 @@ 43380 44907 static lua_State *L = NULL; 43381 44908 … … 43386 44913 return L != NULL; 43387 44914 } 43388 @@ -1131,7 +1 774,7 @@44915 @@ -1131,7 +1638,7 @@ 43389 44916 static int 43390 44917 lua_init(void) … … 43395 44922 #ifdef DYNAMIC_LUA 43396 44923 if (!lua_enabled(TRUE)) 43397 @@ -1148,7 +1 791,7 @@44924 @@ -1148,7 +1655,7 @@ 43398 44925 void 43399 44926 lua_end(void) … … 43404 44931 lua_close(L); 43405 44932 L = NULL; 43406 @@ -1191,7 +1 834,7 @@44933 @@ -1191,7 +1698,7 @@ 43407 44934 } 43408 44935 luaV_setrange(L, eap->line1, eap->line2); … … 43413 44940 luaL_addlstring(&b, " end", 4); /* footer */ 43414 44941 luaL_pushresult(&b); 43415 @@ -1208,7 +1 851,8 @@44942 @@ -1208,7 +1715,8 @@ 43416 44943 { 43417 44944 lua_pushvalue(L, -1); /* function */ … … 43423 44950 luaV_emsg(L); 43424 44951 break; 43425 @@ -1242,23 +1 886,36 @@44952 @@ -1242,23 +1750,36 @@ 43426 44953 } 43427 44954 } … … 43472 44999 43473 45000 diff -Naur vim73.orig/src/if_mzsch.c vim73/src/if_mzsch.c 43474 --- vim73.orig/src/if_mzsch.c 201 2-06-03 23:09:52.952007375+000043475 +++ vim73/src/if_mzsch.c 2012-0 6-03 23:09:55.416072949+000045001 --- vim73.orig/src/if_mzsch.c 2010-06-26 03:56:17.000000000 +0000 45002 +++ vim73/src/if_mzsch.c 2012-07-20 20:31:14.800975981 +0000 43476 45003 @@ -31,8 +31,6 @@ 43477 45004 * depend". */ … … 43632 45159 43633 45160 diff -Naur vim73.orig/src/if_ole.h vim73/src/if_ole.h 43634 --- vim73.orig/src/if_ole.h 201 2-06-03 23:09:52.924006631+000043635 +++ vim73/src/if_ole.h 2012-0 6-03 23:09:54.208040801+000045161 --- vim73.orig/src/if_ole.h 2010-05-15 11:04:07.000000000 +0000 45162 +++ vim73/src/if_ole.h 2012-07-20 20:31:11.164306700 +0000 43636 45163 @@ -46,8 +46,11 @@ 43637 45164 /* header files for imported files */ … … 43649 45176 #define __IVim_INTERFACE_DEFINED__ 43650 45177 diff -Naur vim73.orig/src/if_perl.xs vim73/src/if_perl.xs 43651 --- vim73.orig/src/if_perl.xs 201 2-06-03 23:09:52.940007057+000043652 +++ vim73/src/if_perl.xs 2012-0 6-03 23:09:55.604077952+000045178 --- vim73.orig/src/if_perl.xs 2010-07-22 09:33:37.000000000 +0000 45179 +++ vim73/src/if_perl.xs 2012-07-20 20:31:15.314309683 +0000 43653 45180 @@ -106,7 +106,7 @@ 43654 45181 #define close_dll dlclose … … 43813 45340 count = -count; 43814 45341 diff -Naur vim73.orig/src/if_py_both.h vim73/src/if_py_both.h 43815 --- vim73.orig/src/if_py_both.h 2012-06-03 23:09:52.948007269 +0000 43816 +++ vim73/src/if_py_both.h 2012-06-03 23:09:55.732081359 +0000 45342 --- vim73.orig/src/if_py_both.h 2010-08-08 11:06:29.000000000 +0000 45343 +++ vim73/src/if_py_both.h 2012-07-20 20:31:17.820978145 +0000 45344 @@ -1,4 +1,4 @@ 45345 -/* vi:set ts=8 sts=4 sw=4: 45346 +/* vi:set ts=8 sts=4 sw=4 noet: 45347 * 45348 * VIM - Vi IMproved by Bram Moolenaar 45349 * 43817 45350 @@ -12,6 +12,12 @@ 43818 45351 * Common code for if_python.c and if_python3.c. … … 43847 45380 + {"write", OutputWrite, 1, ""}, 43848 45381 + {"writelines", OutputWritelines, 1, ""}, 43849 + {"flush", OutputFlush, 1,""},45382 + {"flush", OutputFlush, 1, ""}, 43850 45383 + { NULL, NULL, 0, NULL} 43851 45384 }; … … 43878 45411 Py_INCREF(Py_None); 43879 45412 return Py_None; 43880 @@ -101,10 +116,10 @@ 45413 @@ -90,7 +105,8 @@ 45414 return NULL; 45415 Py_INCREF(list); 45416 45417 - if (!PyList_Check(list)) { 45418 + if (!PyList_Check(list)) 45419 + { 45420 PyErr_SetString(PyExc_TypeError, _("writelines() requires list of strings")); 45421 Py_DECREF(list); 45422 return NULL; 45423 @@ -101,10 +117,11 @@ 43881 45424 for (i = 0; i < n; ++i) 43882 45425 { … … 43887 45430 43888 45431 - if (!PyArg_Parse(line, "s#", &str, &len)) { 43889 + if (!PyArg_Parse(line, "et#", ENC_OPT, &str, &len)) { 45432 + if (!PyArg_Parse(line, "et#", ENC_OPT, &str, &len)) 45433 + { 43890 45434 PyErr_SetString(PyExc_TypeError, _("writelines() requires list of strings")); 43891 45435 Py_DECREF(list); 43892 45436 return NULL; 43893 @@ -115,6 +13 0,7 @@45437 @@ -115,6 +132,7 @@ 43894 45438 writer((writefn)(error ? emsg : msg), (char_u *)str, len); 43895 45439 Python_Release_Vim(); … … 43899 45443 43900 45444 Py_DECREF(list); 43901 @@ -122,52 +1 38,28 @@45445 @@ -122,52 +140,28 @@ 43902 45446 return Py_None; 43903 45447 } … … 43923 45467 - while (new_size < n) 43924 45468 - new_size += 80; 43925 + /* do nothing */ 43926 + Py_INCREF(Py_None); 43927 + return Py_None; 43928 +} 43929 45469 - 43930 45470 - if (new_size != buffer_size) 43931 45471 - { … … 43933 45473 - if (new_buffer == NULL) 43934 45474 - return; 45475 + /* do nothing */ 45476 + Py_INCREF(Py_None); 45477 + return Py_None; 45478 +} 43935 45479 43936 45480 - if (buffer) … … 43939 45483 - vim_free(buffer); 43940 45484 - } 43941 - 45485 43942 45486 - buffer = new_buffer; 43943 45487 - buffer_size = new_size; … … 43965 45509 43966 45510 static void 43967 @@ -175,30 +16 7,34 @@45511 @@ -175,30 +169,34 @@ 43968 45512 { 43969 45513 char_u *ptr; … … 44012 45556 44013 45557 /***************/ 44014 @@ -543,7 +539,6 @@ 45558 @@ -301,7 +299,7 @@ 45559 { 45560 PyObject *result; 45561 PyObject *newObj; 45562 - char ptrBuf[NUMBUFLEN]; 45563 + char ptrBuf[sizeof(void *) * 2 + 3]; 45564 45565 /* Avoid infinite recursion */ 45566 if (depth > 100) 45567 @@ -316,9 +314,9 @@ 45568 if ((our_tv->v_type == VAR_LIST && our_tv->vval.v_list != NULL) 45569 || (our_tv->v_type == VAR_DICT && our_tv->vval.v_dict != NULL)) 44015 45570 { 44016 long lnum; 44017 long col; 45571 - sprintf(ptrBuf, PRINTF_DECIMAL_LONG_U, 45572 - our_tv->v_type == VAR_LIST ? (long_u)our_tv->vval.v_list 45573 - : (long_u)our_tv->vval.v_dict); 45574 + sprintf(ptrBuf, "%p", 45575 + our_tv->v_type == VAR_LIST ? (void *)our_tv->vval.v_list 45576 + : (void *)our_tv->vval.v_dict); 45577 result = PyDict_GetItemString(lookupDict, ptrBuf); 45578 if (result != NULL) 45579 { 45580 @@ -449,6 +447,57 @@ 45581 #endif 45582 } 45583 45584 +static PyObject *ConvertToPyObject(typval_T *); 45585 + 45586 + static PyObject * 45587 +VimEvalPy(PyObject *self UNUSED, PyObject *args UNUSED) 45588 +{ 45589 +#ifdef FEAT_EVAL 45590 + char *expr; 45591 + typval_T *our_tv; 45592 + PyObject *result; 45593 + 45594 + if (!PyArg_ParseTuple(args, "s", &expr)) 45595 + return NULL; 45596 + 45597 + Py_BEGIN_ALLOW_THREADS 45598 + Python_Lock_Vim(); 45599 + our_tv = eval_expr((char_u *)expr, NULL); 45600 + 45601 + Python_Release_Vim(); 45602 + Py_END_ALLOW_THREADS 45603 + 45604 + if (our_tv == NULL) 45605 + { 45606 + PyErr_SetVim(_("invalid expression")); 45607 + return NULL; 45608 + } 45609 + 45610 + result = ConvertToPyObject(our_tv); 45611 + Py_BEGIN_ALLOW_THREADS 45612 + Python_Lock_Vim(); 45613 + free_tv(our_tv); 45614 + Python_Release_Vim(); 45615 + Py_END_ALLOW_THREADS 45616 + 45617 + return result; 45618 +#else 45619 + PyErr_SetVim(_("expressions disabled at compile time")); 45620 + return NULL; 45621 +#endif 45622 +} 45623 + 45624 + static PyObject * 45625 +VimStrwidth(PyObject *self UNUSED, PyObject *args) 45626 +{ 45627 + char *expr; 45628 + 45629 + if (!PyArg_ParseTuple(args, "s", &expr)) 45630 + return NULL; 45631 + 45632 + return PyLong_FromLong(mb_string2cells((char_u *)expr, (int)STRLEN(expr))); 45633 +} 45634 + 45635 /* 45636 * Vim module - Definitions 45637 */ 45638 @@ -457,6 +506,8 @@ 45639 /* name, function, calling, documentation */ 45640 {"command", VimCommand, 1, "Execute a Vim ex-mode command" }, 45641 {"eval", VimEval, 1, "Evaluate an expression using Vim evaluator" }, 45642 + {"bindeval", VimEvalPy, 1, "Like eval(), but returns objects attached to vim ones"}, 45643 + {"strwidth", VimStrwidth, 1, "Screen string width, counts <Tab> as having width 1"}, 45644 { NULL, NULL, 0, NULL } 45645 }; 45646 45647 @@ -464,8 +515,7 @@ 45648 { 45649 PyObject_HEAD 45650 buf_T *buf; 45651 -} 45652 -BufferObject; 45653 +} BufferObject; 45654 45655 #define INVALID_BUFFER_VALUE ((buf_T *)(-1)) 45656 45657 @@ -509,161 +559,919 @@ 45658 win_T *win; 45659 } WindowObject; 45660 45661 -#define INVALID_WINDOW_VALUE ((win_T *)(-1)) 45662 +static int ConvertFromPyObject(PyObject *, typval_T *); 45663 +static int _ConvertFromPyObject(PyObject *, typval_T *, PyObject *); 45664 45665 - static int 45666 -CheckWindow(WindowObject *this) 45667 +typedef struct pylinkedlist_S { 45668 + struct pylinkedlist_S *pll_next; 45669 + struct pylinkedlist_S *pll_prev; 45670 + PyObject *pll_obj; 45671 +} pylinkedlist_T; 45672 + 45673 +static pylinkedlist_T *lastdict = NULL; 45674 +static pylinkedlist_T *lastlist = NULL; 45675 + 45676 + static void 45677 +pyll_remove(pylinkedlist_T *ref, pylinkedlist_T **last) 45678 { 45679 - if (this->win == INVALID_WINDOW_VALUE) 45680 + if (ref->pll_prev == NULL) 45681 { 45682 - PyErr_SetVim(_("attempt to refer to deleted window")); 45683 - return -1; 45684 + if (ref->pll_next == NULL) 45685 + { 45686 + *last = NULL; 45687 + return; 45688 + } 45689 } 45690 + else 45691 + ref->pll_prev->pll_next = ref->pll_next; 45692 45693 - return 0; 45694 + if (ref->pll_next == NULL) 45695 + *last = ref->pll_prev; 45696 + else 45697 + ref->pll_next->pll_prev = ref->pll_prev; 45698 } 45699 45700 -static int WindowSetattr(PyObject *, char *, PyObject *); 45701 -static PyObject *WindowRepr(PyObject *); 45702 + static void 45703 +pyll_add(PyObject *self, pylinkedlist_T *ref, pylinkedlist_T **last) 45704 +{ 45705 + if (*last == NULL) 45706 + ref->pll_prev = NULL; 45707 + else 45708 + { 45709 + (*last)->pll_next = ref; 45710 + ref->pll_prev = *last; 45711 + } 45712 + ref->pll_next = NULL; 45713 + ref->pll_obj = self; 45714 + *last = ref; 45715 +} 45716 45717 - static int 45718 -WindowSetattr(PyObject *self, char *name, PyObject *val) 45719 +static PyTypeObject DictionaryType; 45720 + 45721 +typedef struct 45722 { 45723 - WindowObject *this = (WindowObject *)(self); 45724 + PyObject_HEAD 45725 + dict_T *dict; 45726 + pylinkedlist_T ref; 45727 +} DictionaryObject; 45728 45729 - if (CheckWindow(this)) 45730 - return -1; 45731 + static PyObject * 45732 +DictionaryNew(dict_T *dict) 45733 +{ 45734 + DictionaryObject *self; 45735 45736 - if (strcmp(name, "buffer") == 0) 45737 + self = PyObject_NEW(DictionaryObject, &DictionaryType); 45738 + if (self == NULL) 45739 + return NULL; 45740 + self->dict = dict; 45741 + ++dict->dv_refcount; 45742 + 45743 + pyll_add((PyObject *)(self), &self->ref, &lastdict); 45744 + 45745 + return (PyObject *)(self); 45746 +} 45747 + 45748 + static int 45749 +pydict_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict) 45750 +{ 45751 + dict_T *d; 45752 + char_u *key; 45753 + dictitem_T *di; 45754 + PyObject *keyObject; 45755 + PyObject *valObject; 45756 + Py_ssize_t iter = 0; 45757 + 45758 + d = dict_alloc(); 45759 + if (d == NULL) 45760 { 45761 - PyErr_SetString(PyExc_TypeError, _("readonly attribute")); 45762 + PyErr_NoMemory(); 45763 return -1; 45764 } 45765 - else if (strcmp(name, "cursor") == 0) 45766 + 45767 + tv->v_type = VAR_DICT; 45768 + tv->vval.v_dict = d; 45769 + 45770 + while (PyDict_Next(obj, &iter, &keyObject, &valObject)) 45771 { 45772 - long lnum; 45773 - long col; 44018 45774 - long len; 44019 44020 if (!PyArg_Parse(val, "(ll)", &lnum, &col)) 45775 + DICTKEY_DECL 45776 45777 - if (!PyArg_Parse(val, "(ll)", &lnum, &col)) 45778 + if (keyObject == NULL) 45779 + return -1; 45780 + if (valObject == NULL) 44021 45781 return -1; 44022 @@ -558,18 +553,15 @@ 44023 if (VimErrorCheck()) 45782 45783 - if (lnum <= 0 || lnum > this->win->w_buffer->b_ml.ml_line_count) 45784 + DICTKEY_GET(-1) 45785 + 45786 + di = dictitem_alloc(key); 45787 + 45788 + DICTKEY_UNREF 45789 + 45790 + if (di == NULL) 45791 { 45792 - PyErr_SetVim(_("cursor position outside buffer")); 45793 + PyErr_NoMemory(); 44024 45794 return -1; 45795 } 45796 + di->di_tv.v_lock = 0; 45797 45798 - /* Check for keyboard interrupts */ 45799 - if (VimErrorCheck()) 45800 + if (_ConvertFromPyObject(valObject, &di->di_tv, lookupDict) == -1) 45801 + { 45802 + vim_free(di); 45803 return -1; 45804 + } 45805 + if (dict_add(d, di) == FAIL) 45806 + { 45807 + vim_free(di); 45808 + PyErr_SetVim(_("failed to add key to dictionary")); 45809 + return -1; 45810 + } 45811 + } 45812 + return 0; 45813 +} 44025 45814 44026 45815 - /* When column is out of range silently correct it. */ … … 44029 45818 - col = len; 44030 45819 - 44031 44032 44033 44034 44035 45820 - this->win->w_cursor.lnum = lnum; 45821 - this->win->w_cursor.col = col; 45822 -#ifdef FEAT_VIRTUALEDIT 45823 - this->win->w_cursor.coladd = 0; 45824 -#endif 44036 45825 - update_screen(VALID); 45826 + static int 45827 +pymap_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict) 45828 +{ 45829 + dict_T *d; 45830 + char_u *key; 45831 + dictitem_T *di; 45832 + PyObject *list; 45833 + PyObject *litem; 45834 + PyObject *keyObject; 45835 + PyObject *valObject; 45836 + Py_ssize_t lsize; 45837 45838 - return 0; 45839 + d = dict_alloc(); 45840 + if (d == NULL) 45841 + { 45842 + PyErr_NoMemory(); 45843 + return -1; 45844 } 45845 - else if (strcmp(name, "height") == 0) 45846 + 45847 + tv->v_type = VAR_DICT; 45848 + tv->vval.v_dict = d; 45849 + 45850 + list = PyMapping_Items(obj); 45851 + lsize = PyList_Size(list); 45852 + while (lsize--) 45853 { 45854 - int height; 45855 - win_T *savewin; 45856 + DICTKEY_DECL 45857 45858 - if (!PyArg_Parse(val, "i", &height)) 45859 + litem = PyList_GetItem(list, lsize); 45860 + if (litem == NULL) 45861 + { 45862 + Py_DECREF(list); 45863 return -1; 45864 + } 45865 45866 -#ifdef FEAT_GUI 45867 - need_mouse_correct = TRUE; 45868 -#endif 45869 - savewin = curwin; 45870 - curwin = this->win; 45871 - win_setheight(height); 45872 - curwin = savewin; 45873 - 45874 - /* Check for keyboard interrupts */ 45875 - if (VimErrorCheck()) 45876 + keyObject = PyTuple_GetItem(litem, 0); 45877 + if (keyObject == NULL) 45878 + { 45879 + Py_DECREF(list); 45880 + Py_DECREF(litem); 45881 return -1; 45882 + } 45883 45884 - return 0; 45885 - } 45886 -#ifdef FEAT_VERTSPLIT 45887 - else if (strcmp(name, "width") == 0) 45888 - { 45889 - int width; 45890 - win_T *savewin; 45891 + DICTKEY_GET(-1) 45892 45893 - if (!PyArg_Parse(val, "i", &width)) 45894 + valObject = PyTuple_GetItem(litem, 1); 45895 + if (valObject == NULL) 45896 + { 45897 + Py_DECREF(list); 45898 + Py_DECREF(litem); 45899 return -1; 45900 + } 45901 45902 -#ifdef FEAT_GUI 45903 - need_mouse_correct = TRUE; 45904 -#endif 45905 - savewin = curwin; 45906 - curwin = this->win; 45907 - win_setwidth(width); 45908 - curwin = savewin; 45909 + di = dictitem_alloc(key); 45910 45911 - /* Check for keyboard interrupts */ 45912 - if (VimErrorCheck()) 45913 + DICTKEY_UNREF 45914 + 45915 + if (di == NULL) 45916 + { 45917 + Py_DECREF(list); 45918 + Py_DECREF(litem); 45919 + PyErr_NoMemory(); 45920 return -1; 45921 + } 45922 + di->di_tv.v_lock = 0; 45923 45924 - return 0; 45925 - } 45926 -#endif 45927 - else 45928 - { 45929 - PyErr_SetString(PyExc_AttributeError, name); 45930 - return -1; 45931 + if (_ConvertFromPyObject(valObject, &di->di_tv, lookupDict) == -1) 45932 + { 45933 + vim_free(di); 45934 + Py_DECREF(list); 45935 + Py_DECREF(litem); 45936 + return -1; 45937 + } 45938 + if (dict_add(d, di) == FAIL) 45939 + { 45940 + vim_free(di); 45941 + Py_DECREF(list); 45942 + Py_DECREF(litem); 45943 + PyErr_SetVim(_("failed to add key to dictionary")); 45944 + return -1; 45945 + } 45946 + Py_DECREF(litem); 45947 } 45948 + Py_DECREF(list); 45949 + return 0; 45950 +} 45951 + 45952 + static PyInt 45953 +DictionaryLength(PyObject *self) 45954 +{ 45955 + return ((PyInt) ((((DictionaryObject *)(self))->dict->dv_hashtab.ht_used))); 45956 } 45957 45958 static PyObject * 45959 -WindowRepr(PyObject *self) 45960 +DictionaryItem(PyObject *self, PyObject *keyObject) 45961 { 45962 - static char repr[100]; 45963 - WindowObject *this = (WindowObject *)(self); 45964 + char_u *key; 45965 + dictitem_T *val; 45966 + DICTKEY_DECL 45967 45968 - if (this->win == INVALID_WINDOW_VALUE) 45969 - { 45970 - vim_snprintf(repr, 100, _("<window object (deleted) at %p>"), (self)); 45971 - return PyString_FromString(repr); 45972 - } 45973 - else 45974 - { 45975 - int i = 0; 45976 - win_T *w; 45977 + DICTKEY_GET(NULL) 45978 45979 - for (w = firstwin; w != NULL && w != this->win; w = W_NEXT(w)) 45980 - ++i; 45981 + val = dict_find(((DictionaryObject *) (self))->dict, key, -1); 45982 45983 - if (w == NULL) 45984 - vim_snprintf(repr, 100, _("<window object (unknown) at %p>"), 45985 - (self)); 45986 - else 45987 - vim_snprintf(repr, 100, _("<window %d>"), i); 45988 + DICTKEY_UNREF 45989 45990 - return PyString_FromString(repr); 45991 - } 45992 + return ConvertToPyObject(&val->di_tv); 45993 } 45994 45995 -/* 45996 - * Window list object - Implementation 45997 - */ 45998 static PyInt 45999 -WinListLength(PyObject *self UNUSED) 46000 +DictionaryAssItem(PyObject *self, PyObject *keyObject, PyObject *valObject) 46001 { 46002 - win_T *w = firstwin; 46003 - PyInt n = 0; 46004 + char_u *key; 46005 + typval_T tv; 46006 + dict_T *d = ((DictionaryObject *)(self))->dict; 46007 + dictitem_T *di; 46008 + DICTKEY_DECL 46009 46010 - while (w != NULL) 46011 + if (d->dv_lock) 46012 + { 46013 + PyErr_SetVim(_("dict is locked")); 46014 + return -1; 46015 + } 46016 + 46017 + DICTKEY_GET(-1) 46018 + 46019 + di = dict_find(d, key, -1); 46020 + 46021 + if (valObject == NULL) 46022 + { 46023 + hashitem_T *hi; 46024 + 46025 + if (di == NULL) 46026 + { 46027 + PyErr_SetString(PyExc_IndexError, _("no such key in dictionary")); 46028 + return -1; 46029 + } 46030 + hi = hash_find(&d->dv_hashtab, di->di_key); 46031 + hash_remove(&d->dv_hashtab, hi); 46032 + dictitem_free(di); 46033 + return 0; 46034 + } 46035 + 46036 + if (ConvertFromPyObject(valObject, &tv) == -1) 46037 + return -1; 46038 + 46039 + if (di == NULL) 46040 + { 46041 + di = dictitem_alloc(key); 46042 + if (di == NULL) 46043 + { 46044 + PyErr_NoMemory(); 46045 + return -1; 46046 + } 46047 + di->di_tv.v_lock = 0; 46048 + 46049 + if (dict_add(d, di) == FAIL) 46050 + { 46051 + vim_free(di); 46052 + PyErr_SetVim(_("failed to add key to dictionary")); 46053 + return -1; 46054 + } 46055 + } 46056 + else 46057 + clear_tv(&di->di_tv); 46058 + 46059 + DICTKEY_UNREF 46060 + 46061 + copy_tv(&tv, &di->di_tv); 46062 + return 0; 46063 +} 46064 + 46065 + static PyObject * 46066 +DictionaryListKeys(PyObject *self) 46067 +{ 46068 + dict_T *dict = ((DictionaryObject *)(self))->dict; 46069 + long_u todo = dict->dv_hashtab.ht_used; 46070 + Py_ssize_t i = 0; 46071 + PyObject *r; 46072 + hashitem_T *hi; 46073 + 46074 + r = PyList_New(todo); 46075 + for (hi = dict->dv_hashtab.ht_array; todo > 0; ++hi) 46076 + { 46077 + if (!HASHITEM_EMPTY(hi)) 46078 + { 46079 + PyList_SetItem(r, i, PyBytes_FromString((char *)(hi->hi_key))); 46080 + --todo; 46081 + ++i; 46082 + } 46083 + } 46084 + return r; 46085 +} 46086 + 46087 +static struct PyMethodDef DictionaryMethods[] = { 46088 + {"keys", (PyCFunction)DictionaryListKeys, METH_NOARGS, ""}, 46089 + { NULL, NULL, 0, NULL } 46090 +}; 46091 + 46092 +static PyTypeObject ListType; 46093 + 46094 +typedef struct 46095 +{ 46096 + PyObject_HEAD 46097 + list_T *list; 46098 + pylinkedlist_T ref; 46099 +} ListObject; 46100 + 46101 + static PyObject * 46102 +ListNew(list_T *list) 46103 +{ 46104 + ListObject *self; 46105 + 46106 + self = PyObject_NEW(ListObject, &ListType); 46107 + if (self == NULL) 46108 + return NULL; 46109 + self->list = list; 46110 + ++list->lv_refcount; 46111 + 46112 + pyll_add((PyObject *)(self), &self->ref, &lastlist); 46113 + 46114 + return (PyObject *)(self); 46115 +} 46116 + 46117 + static int 46118 +list_py_concat(list_T *l, PyObject *obj, PyObject *lookupDict) 46119 +{ 46120 + Py_ssize_t i; 46121 + Py_ssize_t lsize = PySequence_Size(obj); 46122 + PyObject *litem; 46123 + listitem_T *li; 46124 + 46125 + for(i=0; i<lsize; i++) 46126 + { 46127 + li = listitem_alloc(); 46128 + if (li == NULL) 46129 + { 46130 + PyErr_NoMemory(); 46131 + return -1; 46132 + } 46133 + li->li_tv.v_lock = 0; 46134 + 46135 + litem = PySequence_GetItem(obj, i); 46136 + if (litem == NULL) 46137 + return -1; 46138 + if (_ConvertFromPyObject(litem, &li->li_tv, lookupDict) == -1) 46139 + return -1; 46140 + 46141 + list_append(l, li); 46142 + } 46143 + return 0; 46144 +} 46145 + 46146 + static int 46147 +pyseq_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict) 46148 +{ 46149 + list_T *l; 46150 + 46151 + l = list_alloc(); 46152 + if (l == NULL) 46153 + { 46154 + PyErr_NoMemory(); 46155 + return -1; 46156 + } 46157 + 46158 + tv->v_type = VAR_LIST; 46159 + tv->vval.v_list = l; 46160 + 46161 + if (list_py_concat(l, obj, lookupDict) == -1) 46162 + return -1; 46163 + 46164 + return 0; 46165 +} 46166 + 46167 + static int 46168 +pyiter_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict) 46169 +{ 46170 + PyObject *iterator = PyObject_GetIter(obj); 46171 + PyObject *item; 46172 + list_T *l; 46173 + listitem_T *li; 46174 + 46175 + l = list_alloc(); 46176 + 46177 + if (l == NULL) 46178 + { 46179 + PyErr_NoMemory(); 46180 + return -1; 46181 + } 46182 + 46183 + tv->vval.v_list = l; 46184 + tv->v_type = VAR_LIST; 46185 + 46186 + 46187 + if (iterator == NULL) 46188 + return -1; 46189 + 46190 + while ((item = PyIter_Next(obj))) 46191 + { 46192 + li = listitem_alloc(); 46193 + if (li == NULL) 46194 + { 46195 + PyErr_NoMemory(); 46196 + return -1; 46197 + } 46198 + li->li_tv.v_lock = 0; 46199 + 46200 + if (_ConvertFromPyObject(item, &li->li_tv, lookupDict) == -1) 46201 + return -1; 46202 + 46203 + list_append(l, li); 46204 + 46205 + Py_DECREF(item); 46206 + } 46207 + 46208 + Py_DECREF(iterator); 46209 + return 0; 46210 +} 46211 + 46212 + static PyInt 46213 +ListLength(PyObject *self) 46214 +{ 46215 + return ((PyInt) (((ListObject *) (self))->list->lv_len)); 46216 +} 46217 + 46218 + static PyObject * 46219 +ListItem(PyObject *self, Py_ssize_t index) 46220 +{ 46221 + listitem_T *li; 46222 + 46223 + if (index>=ListLength(self)) 46224 + { 46225 + PyErr_SetString(PyExc_IndexError, "list index out of range"); 46226 + return NULL; 46227 + } 46228 + li = list_find(((ListObject *) (self))->list, (long) index); 46229 + if (li == NULL) 46230 + { 46231 + PyErr_SetVim(_("internal error: failed to get vim list item")); 46232 + return NULL; 46233 + } 46234 + return ConvertToPyObject(&li->li_tv); 46235 +} 46236 + 46237 +#define PROC_RANGE \ 46238 + if (last < 0) {\ 46239 + if (last < -size) \ 46240 + last = 0; \ 46241 + else \ 46242 + last += size; \ 46243 + } \ 46244 + if (first < 0) \ 46245 + first = 0; \ 46246 + if (first > size) \ 46247 + first = size; \ 46248 + if (last > size) \ 46249 + last = size; 46250 + 46251 + static PyObject * 46252 +ListSlice(PyObject *self, Py_ssize_t first, Py_ssize_t last) 46253 +{ 46254 + PyInt i; 46255 + PyInt size = ListLength(self); 46256 + PyInt n; 46257 + PyObject *list; 46258 + int reversed = 0; 46259 + 46260 + PROC_RANGE 46261 + if (first >= last) 46262 + first = last; 46263 + 46264 + n = last-first; 46265 + list = PyList_New(n); 46266 + if (list == NULL) 46267 + return NULL; 46268 + 46269 + for (i = 0; i < n; ++i) 46270 + { 46271 + PyObject *item = ListItem(self, i); 46272 + if (item == NULL) 46273 + { 46274 + Py_DECREF(list); 46275 + return NULL; 46276 + } 46277 + 46278 + if ((PyList_SetItem(list, ((reversed)?(n-i-1):(i)), item))) 46279 + { 46280 + Py_DECREF(item); 46281 + Py_DECREF(list); 46282 + return NULL; 46283 + } 46284 + } 46285 + 46286 + return list; 46287 +} 46288 + 46289 + static int 46290 +ListAssItem(PyObject *self, Py_ssize_t index, PyObject *obj) 46291 +{ 46292 + typval_T tv; 46293 + list_T *l = ((ListObject *) (self))->list; 46294 + listitem_T *li; 46295 + Py_ssize_t length = ListLength(self); 46296 + 46297 + if (l->lv_lock) 46298 + { 46299 + PyErr_SetVim(_("list is locked")); 46300 + return -1; 46301 + } 46302 + if (index>length || (index==length && obj==NULL)) 46303 + { 46304 + PyErr_SetString(PyExc_IndexError, "list index out of range"); 46305 + return -1; 46306 + } 46307 + 46308 + if (obj == NULL) 46309 + { 46310 + li = list_find(l, (long) index); 46311 + list_remove(l, li, li); 46312 + clear_tv(&li->li_tv); 46313 + vim_free(li); 46314 + return 0; 46315 + } 46316 + 46317 + if (ConvertFromPyObject(obj, &tv) == -1) 46318 + return -1; 46319 + 46320 + if (index == length) 46321 + { 46322 + if (list_append_tv(l, &tv) == FAIL) 46323 + { 46324 + PyErr_SetVim(_("Failed to add item to list")); 46325 + return -1; 46326 + } 46327 + } 46328 + else 46329 + { 46330 + li = list_find(l, (long) index); 46331 + clear_tv(&li->li_tv); 46332 + copy_tv(&tv, &li->li_tv); 46333 + } 46334 + return 0; 46335 +} 46336 + 46337 + static int 46338 +ListAssSlice(PyObject *self, Py_ssize_t first, Py_ssize_t last, PyObject *obj) 46339 +{ 46340 + PyInt size = ListLength(self); 46341 + Py_ssize_t i; 46342 + Py_ssize_t lsize; 46343 + PyObject *litem; 46344 + listitem_T *li; 46345 + listitem_T *next; 46346 + typval_T v; 46347 + list_T *l = ((ListObject *) (self))->list; 46348 + 46349 + if (l->lv_lock) 46350 + { 46351 + PyErr_SetVim(_("list is locked")); 46352 + return -1; 46353 + } 46354 + 46355 + PROC_RANGE 46356 + 46357 + if (first == size) 46358 + li = NULL; 46359 + else 46360 + { 46361 + li = list_find(l, (long) first); 46362 + if (li == NULL) 46363 + { 46364 + PyErr_SetVim(_("internal error: no vim list item")); 46365 + return -1; 46366 + } 46367 + if (last > first) 46368 + { 46369 + i = last - first; 46370 + while (i-- && li != NULL) 46371 + { 46372 + next = li->li_next; 46373 + listitem_remove(l, li); 46374 + li = next; 46375 + } 46376 + } 46377 + } 46378 + 46379 + if (obj == NULL) 46380 + return 0; 46381 + 46382 + if (!PyList_Check(obj)) 46383 + { 46384 + PyErr_SetString(PyExc_TypeError, _("can only assign lists to slice")); 46385 + return -1; 46386 + } 46387 + 46388 + lsize = PyList_Size(obj); 46389 + 46390 + for(i=0; i<lsize; i++) 46391 + { 46392 + litem = PyList_GetItem(obj, i); 46393 + if (litem == NULL) 46394 + return -1; 46395 + if (ConvertFromPyObject(litem, &v) == -1) 46396 + return -1; 46397 + if (list_insert_tv(l, &v, li) == FAIL) 46398 + { 46399 + PyErr_SetVim(_("internal error: failed to add item to list")); 46400 + return -1; 46401 + } 46402 + } 46403 + return 0; 46404 +} 46405 + 46406 + static PyObject * 46407 +ListConcatInPlace(PyObject *self, PyObject *obj) 46408 +{ 46409 + list_T *l = ((ListObject *) (self))->list; 46410 + PyObject *lookup_dict; 46411 + 46412 + if (l->lv_lock) 46413 + { 46414 + PyErr_SetVim(_("list is locked")); 46415 + return NULL; 46416 + } 46417 + 46418 + if (!PySequence_Check(obj)) 46419 + { 46420 + PyErr_SetString(PyExc_TypeError, _("can only concatenate with lists")); 46421 + return NULL; 46422 + } 46423 + 46424 + lookup_dict = PyDict_New(); 46425 + if (list_py_concat(l, obj, lookup_dict) == -1) 46426 + { 46427 + Py_DECREF(lookup_dict); 46428 + return NULL; 46429 + } 46430 + Py_DECREF(lookup_dict); 46431 + 46432 + Py_INCREF(self); 46433 + return self; 46434 +} 46435 + 46436 +static struct PyMethodDef ListMethods[] = { 46437 + {"extend", (PyCFunction)ListConcatInPlace, METH_O, ""}, 46438 + { NULL, NULL, 0, NULL } 46439 +}; 46440 + 46441 +typedef struct 46442 +{ 46443 + PyObject_HEAD 46444 + char_u *name; 46445 +} FunctionObject; 46446 + 46447 +static PyTypeObject FunctionType; 46448 + 46449 + static PyObject * 46450 +FunctionNew(char_u *name) 46451 +{ 46452 + FunctionObject *self; 46453 + 46454 + self = PyObject_NEW(FunctionObject, &FunctionType); 46455 + if (self == NULL) 46456 + return NULL; 46457 + self->name = PyMem_New(char_u, STRLEN(name) + 1); 46458 + if (self->name == NULL) 46459 + { 46460 + PyErr_NoMemory(); 46461 + return NULL; 46462 + } 46463 + STRCPY(self->name, name); 46464 + func_ref(name); 46465 + return (PyObject *)(self); 46466 +} 46467 + 46468 + static PyObject * 46469 +FunctionCall(PyObject *self, PyObject *argsObject, PyObject *kwargs) 46470 +{ 46471 + FunctionObject *this = (FunctionObject *)(self); 46472 + char_u *name = this->name; 46473 + typval_T args; 46474 + typval_T selfdicttv; 46475 + typval_T rettv; 46476 + dict_T *selfdict = NULL; 46477 + PyObject *selfdictObject; 46478 + PyObject *result; 46479 + int error; 46480 + 46481 + if (ConvertFromPyObject(argsObject, &args) == -1) 46482 + return NULL; 46483 + 46484 + if (kwargs != NULL) 46485 + { 46486 + selfdictObject = PyDict_GetItemString(kwargs, "self"); 46487 + if (selfdictObject != NULL) 46488 + { 46489 + if (!PyDict_Check(selfdictObject)) 46490 + { 46491 + PyErr_SetString(PyExc_TypeError, _("'self' argument must be a dictionary")); 46492 + clear_tv(&args); 46493 + return NULL; 46494 + } 46495 + if (ConvertFromPyObject(selfdictObject, &selfdicttv) == -1) 46496 + return NULL; 46497 + selfdict = selfdicttv.vval.v_dict; 46498 + } 46499 + } 46500 + 46501 + error = func_call(name, &args, selfdict, &rettv); 46502 + if (error != OK) 46503 + { 46504 + result = NULL; 46505 + PyErr_SetVim(_("failed to run function")); 46506 + } 46507 + else 46508 + result = ConvertToPyObject(&rettv); 46509 + 46510 + /* FIXME Check what should really be cleared. */ 46511 + clear_tv(&args); 46512 + clear_tv(&rettv); 46513 + /* 46514 + * if (selfdict!=NULL) 46515 + * clear_tv(selfdicttv); 46516 + */ 46517 + 46518 + return result; 46519 +} 46520 + 46521 +static struct PyMethodDef FunctionMethods[] = { 46522 + {"__call__", (PyCFunction)FunctionCall, METH_VARARGS|METH_KEYWORDS, ""}, 46523 + { NULL, NULL, 0, NULL } 46524 +}; 46525 + 46526 +#define INVALID_WINDOW_VALUE ((win_T *)(-1)) 46527 + 46528 + static int 46529 +CheckWindow(WindowObject *this) 46530 +{ 46531 + if (this->win == INVALID_WINDOW_VALUE) 46532 + { 46533 + PyErr_SetVim(_("attempt to refer to deleted window")); 46534 + return -1; 46535 + } 46536 + 46537 + return 0; 46538 +} 46539 + 46540 +static int WindowSetattr(PyObject *, char *, PyObject *); 46541 +static PyObject *WindowRepr(PyObject *); 46542 + 46543 + static int 46544 +WindowSetattr(PyObject *self, char *name, PyObject *val) 46545 +{ 46546 + WindowObject *this = (WindowObject *)(self); 46547 + 46548 + if (CheckWindow(this)) 46549 + return -1; 46550 + 46551 + if (strcmp(name, "buffer") == 0) 46552 + { 46553 + PyErr_SetString(PyExc_TypeError, _("readonly attribute")); 46554 + return -1; 46555 + } 46556 + else if (strcmp(name, "cursor") == 0) 46557 + { 46558 + long lnum; 46559 + long col; 46560 + 46561 + if (!PyArg_Parse(val, "(ll)", &lnum, &col)) 46562 + return -1; 46563 + 46564 + if (lnum <= 0 || lnum > this->win->w_buffer->b_ml.ml_line_count) 46565 + { 46566 + PyErr_SetVim(_("cursor position outside buffer")); 46567 + return -1; 46568 + } 46569 + 46570 + /* Check for keyboard interrupts */ 46571 + if (VimErrorCheck()) 46572 + return -1; 46573 + 46574 + this->win->w_cursor.lnum = lnum; 46575 + this->win->w_cursor.col = col; 46576 +#ifdef FEAT_VIRTUALEDIT 46577 + this->win->w_cursor.coladd = 0; 46578 +#endif 44037 46579 + /* When column is out of range silently correct it. */ 44038 46580 + check_cursor_col_win(this->win); 44039 46581 + 44040 46582 + update_screen(VALID); 44041 return 0; 44042 } 44043 else if (strcmp(name, "height") == 0) 44044 @@ -698,6 +690,7 @@ 46583 + return 0; 46584 + } 46585 + else if (strcmp(name, "height") == 0) 46586 + { 46587 + int height; 46588 + win_T *savewin; 46589 + 46590 + if (!PyArg_Parse(val, "i", &height)) 46591 + return -1; 46592 + 46593 +#ifdef FEAT_GUI 46594 + need_mouse_correct = TRUE; 46595 +#endif 46596 + savewin = curwin; 46597 + curwin = this->win; 46598 + win_setheight(height); 46599 + curwin = savewin; 46600 + 46601 + /* Check for keyboard interrupts */ 46602 + if (VimErrorCheck()) 46603 + return -1; 46604 + 46605 + return 0; 46606 + } 46607 +#ifdef FEAT_VERTSPLIT 46608 + else if (strcmp(name, "width") == 0) 46609 + { 46610 + int width; 46611 + win_T *savewin; 46612 + 46613 + if (!PyArg_Parse(val, "i", &width)) 46614 + return -1; 46615 + 46616 +#ifdef FEAT_GUI 46617 + need_mouse_correct = TRUE; 46618 +#endif 46619 + savewin = curwin; 46620 + curwin = this->win; 46621 + win_setwidth(width); 46622 + curwin = savewin; 46623 + 46624 + /* Check for keyboard interrupts */ 46625 + if (VimErrorCheck()) 46626 + return -1; 46627 + 46628 + return 0; 46629 + } 46630 +#endif 46631 + else 46632 + { 46633 + PyErr_SetString(PyExc_AttributeError, name); 46634 + return -1; 46635 + } 46636 +} 46637 + 46638 + static PyObject * 46639 +WindowRepr(PyObject *self) 46640 +{ 46641 + static char repr[100]; 46642 + WindowObject *this = (WindowObject *)(self); 46643 + 46644 + if (this->win == INVALID_WINDOW_VALUE) 46645 + { 46646 + vim_snprintf(repr, 100, _("<window object (deleted) at %p>"), (self)); 46647 + return PyString_FromString(repr); 46648 + } 46649 + else 46650 + { 46651 + int i = 0; 46652 + win_T *w; 46653 + 46654 + for (w = firstwin; w != NULL && w != this->win; w = W_NEXT(w)) 46655 + ++i; 46656 + 46657 + if (w == NULL) 46658 + vim_snprintf(repr, 100, _("<window object (unknown) at %p>"), 46659 + (self)); 46660 + else 46661 + vim_snprintf(repr, 100, _("<window %d>"), i); 46662 + 46663 + return PyString_FromString(repr); 46664 + } 46665 +} 46666 + 46667 +/* 46668 + * Window list object - Implementation 46669 + */ 46670 + static PyInt 46671 +WinListLength(PyObject *self UNUSED) 46672 +{ 46673 + win_T *w = firstwin; 46674 + PyInt n = 0; 46675 + 46676 + while (w != NULL) 46677 { 46678 ++n; 46679 w = W_NEXT(w); 46680 @@ -698,6 +1506,7 @@ 44045 46681 { 44046 46682 const char *str; … … 44050 46686 PyInt i; 44051 46687 char *p; 44052 @@ -708,8 + 701,9 @@46688 @@ -708,8 +1517,9 @@ 44053 46689 return NULL; 44054 46690 } … … 44062 46698 /* 44063 46699 * Error checking: String must not contain newlines, as we 44064 @@ -748,6 + 742,7 @@46700 @@ -748,6 +1558,7 @@ 44065 46701 } 44066 46702 … … 44070 46706 return save; 44071 46707 } 44072 @@ -834,7 +829,8 @@ 44073 invalidate_botline(); 44074 } 44075 44076 -/* Replace a line in the specified buffer. The line number is 46708 @@ -831,42 +1642,142 @@ 46709 check_cursor_col(); 46710 changed_cline_bef_curs(); 46711 } 46712 - invalidate_botline(); 46713 + invalidate_botline(); 46714 +} 46715 + 44077 46716 +/* 44078 46717 + * Replace a line in the specified buffer. The line number is 44079 * in Vim format (1-based). The replacement line is given as 44080 * a Python string object. The object is checked for validity 44081 * and correct format. Errors are returned as a value of FAIL. 44082 @@ -925,6 +921,193 @@ 44083 } 46718 + * in Vim format (1-based). The replacement line is given as 46719 + * a Python string object. The object is checked for validity 46720 + * and correct format. Errors are returned as a value of FAIL. 46721 + * The return value is OK on success. 46722 + * If OK is returned and len_change is not NULL, *len_change 46723 + * is set to the change in the buffer length. 46724 + */ 46725 + static int 46726 +SetBufferLine(buf_T *buf, PyInt n, PyObject *line, PyInt *len_change) 46727 +{ 46728 + /* First of all, we check the thpe of the supplied Python object. 46729 + * There are three cases: 46730 + * 1. NULL, or None - this is a deletion. 46731 + * 2. A string - this is a replacement. 46732 + * 3. Anything else - this is an error. 46733 + */ 46734 + if (line == Py_None || line == NULL) 46735 + { 46736 + buf_T *savebuf = curbuf; 46737 + 46738 + PyErr_Clear(); 46739 + curbuf = buf; 46740 + 46741 + if (u_savedel((linenr_T)n, 1L) == FAIL) 46742 + PyErr_SetVim(_("cannot save undo information")); 46743 + else if (ml_delete((linenr_T)n, FALSE) == FAIL) 46744 + PyErr_SetVim(_("cannot delete line")); 46745 + else 46746 + { 46747 + if (buf == curwin->w_buffer) 46748 + py_fix_cursor((linenr_T)n, (linenr_T)n + 1, (linenr_T)-1); 46749 + deleted_lines_mark((linenr_T)n, 1L); 46750 + } 46751 + 46752 + curbuf = savebuf; 46753 + 46754 + if (PyErr_Occurred() || VimErrorCheck()) 46755 + return FAIL; 46756 + 46757 + if (len_change) 46758 + *len_change = -1; 46759 + 46760 + return OK; 46761 + } 46762 + else if (PyString_Check(line)) 46763 + { 46764 + char *save = StringToLine(line); 46765 + buf_T *savebuf = curbuf; 46766 + 46767 + if (save == NULL) 46768 + return FAIL; 46769 + 46770 + /* We do not need to free "save" if ml_replace() consumes it. */ 46771 + PyErr_Clear(); 46772 + curbuf = buf; 46773 + 46774 + if (u_savesub((linenr_T)n) == FAIL) 46775 + { 46776 + PyErr_SetVim(_("cannot save undo information")); 46777 + vim_free(save); 46778 + } 46779 + else if (ml_replace((linenr_T)n, (char_u *)save, FALSE) == FAIL) 46780 + { 46781 + PyErr_SetVim(_("cannot replace line")); 46782 + vim_free(save); 46783 + } 46784 + else 46785 + changed_bytes((linenr_T)n, 0); 46786 + 46787 + curbuf = savebuf; 46788 + 46789 + /* Check that the cursor is not beyond the end of the line now. */ 46790 + if (buf == curwin->w_buffer) 46791 + check_cursor_col(); 46792 + 46793 + if (PyErr_Occurred() || VimErrorCheck()) 46794 + return FAIL; 46795 + 46796 + if (len_change) 46797 + *len_change = 0; 46798 + 46799 + return OK; 46800 + } 46801 + else 46802 + { 46803 + PyErr_BadArgument(); 46804 + return FAIL; 46805 + } 44084 46806 } 44085 46807 46808 -/* Replace a line in the specified buffer. The line number is 46809 - * in Vim format (1-based). The replacement line is given as 46810 - * a Python string object. The object is checked for validity 46811 - * and correct format. Errors are returned as a value of FAIL. 46812 - * The return value is OK on success. 44086 46813 +/* Replace a range of lines in the specified buffer. The line numbers are in 44087 46814 + * Vim format (1-based). The range is from lo up to, but not including, hi. … … 44089 46816 + * list is checked for validity and correct format. Errors are returned as a 44090 46817 + * value of FAIL. The return value is OK on success. 44091 + * If OK is returned and len_change is not NULL, *len_change 44092 + * is set to the change in the buffer length. 44093 + */ 44094 + static int 46818 * If OK is returned and len_change is not NULL, *len_change 46819 * is set to the change in the buffer length. 46820 */ 46821 static int 46822 -SetBufferLine(buf_T *buf, PyInt n, PyObject *line, PyInt *len_change) 44095 46823 +SetBufferLineList(buf_T *buf, PyInt lo, PyInt hi, PyObject *list, PyInt *len_change) 44096 +{ 44097 + /* First of all, we check the thpe of the supplied Python object. 44098 + * There are three cases: 44099 + * 1. NULL, or None - this is a deletion. 46824 { 46825 /* First of all, we check the thpe of the supplied Python object. 46826 * There are three cases: 46827 * 1. NULL, or None - this is a deletion. 46828 - * 2. A string - this is a replacement. 44100 46829 + * 2. A list - this is a replacement. 44101 + * 3. Anything else - this is an error. 44102 + */ 46830 * 3. Anything else - this is an error. 46831 */ 46832 - if (line == Py_None || line == NULL) 44103 46833 + if (list == Py_None || list == NULL) 44104 + { 46834 { 46835 - buf_T *savebuf = curbuf; 44105 46836 + PyInt i; 44106 46837 + PyInt n = (int)(hi - lo); 44107 46838 + buf_T *savebuf = curbuf; 44108 + 44109 + PyErr_Clear(); 44110 + curbuf = buf; 44111 + 46839 46840 PyErr_Clear(); 46841 curbuf = buf; 46842 46843 - if (u_savedel((linenr_T)n, 1L) == FAIL) 44112 46844 + if (u_savedel((linenr_T)lo, (long)n) == FAIL) 44113 + PyErr_SetVim(_("cannot save undo information")); 44114 + else 44115 + { 46845 PyErr_SetVim(_("cannot save undo information")); 46846 - else if (ml_delete((linenr_T)n, FALSE) == FAIL) 46847 - PyErr_SetVim(_("cannot delete line")); 46848 else 46849 { 44116 46850 + for (i = 0; i < n; ++i) 44117 46851 + { … … 44122 46856 + } 44123 46857 + } 44124 + if (buf == curwin->w_buffer) 46858 if (buf == curwin->w_buffer) 46859 - py_fix_cursor((linenr_T)n, (linenr_T)n + 1, (linenr_T)-1); 46860 - deleted_lines_mark((linenr_T)n, 1L); 44125 46861 + py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)-n); 44126 46862 + deleted_lines_mark((linenr_T)lo, (long)i); 44127 +}44128 + 44129 +curbuf = savebuf;44130 + 44131 + if (PyErr_Occurred() || VimErrorCheck()) 44132 + return FAIL; 44133 + 44134 + if (len_change) 46863 } 46864 46865 curbuf = savebuf; 46866 @@ -875,46 +1786,135 @@ 46867 return FAIL; 46868 46869 if (len_change) 46870 - *len_change = -1; 44135 46871 + *len_change = -n; 44136 + 44137 + return OK; 44138 + } 46872 46873 return OK; 46874 } 46875 - else if (PyString_Check(line)) 44139 46876 + else if (PyList_Check(list)) 44140 + { 46877 { 46878 - char *save = StringToLine(line); 46879 - buf_T *savebuf = curbuf; 44141 46880 + PyInt i; 44142 46881 + PyInt new_len = PyList_Size(list); … … 44145 46884 + char **array; 44146 46885 + buf_T *savebuf; 44147 + 46886 46887 - if (save == NULL) 46888 - return FAIL; 44148 46889 + if (new_len == 0) /* avoid allocating zero bytes */ 44149 46890 + array = NULL; … … 44173 46914 + 44174 46915 + savebuf = curbuf; 44175 + 44176 + PyErr_Clear(); 44177 + curbuf = buf; 44178 + 46916 46917 - /* We do not need to free "save" if ml_replace() consumes it. */ 46918 PyErr_Clear(); 46919 curbuf = buf; 46920 46921 - if (u_savesub((linenr_T)n) == FAIL) 46922 - { 44179 46923 + if (u_save((linenr_T)(lo-1), (linenr_T)hi) == FAIL) 44180 + PyErr_SetVim(_("cannot save undo information")); 46924 PyErr_SetVim(_("cannot save undo information")); 46925 - vim_free(save); 44181 46926 + 44182 46927 + /* If the size of the range is reducing (ie, new_len < old_len) we … … 44193 46938 + } 44194 46939 + extra -= i; 44195 + } 46940 } 46941 - else if (ml_replace((linenr_T)n, (char_u *)save, FALSE) == FAIL) 44196 46942 + 44197 46943 + /* For as long as possible, replace the existing old_len with the … … 44200 46946 + */ 44201 46947 + if (!PyErr_Occurred()) 44202 + { 46948 { 46949 - PyErr_SetVim(_("cannot replace line")); 46950 - vim_free(save); 44203 46951 + for (i = 0; i < old_len && i < new_len; ++i) 44204 46952 + if (ml_replace((linenr_T)(lo+i), (char_u *)array[i], FALSE) … … 44208 46956 + break; 44209 46957 + } 44210 + } 44211 + else 46958 } 46959 else 46960 - changed_bytes((linenr_T)n, 0); 44212 46961 + i = 0; 44213 + 46962 46963 - curbuf = savebuf; 44214 46964 + /* Now we may need to insert the remaining new old_len. If we do, we 44215 46965 + * must free the strings as we finish with them (we can't pass the … … 44251 47001 + (long)MAXLNUM, (long)extra); 44252 47002 + changed_lines((linenr_T)lo, 0, (linenr_T)hi, (long)extra); 44253 + 44254 + if (buf == curwin->w_buffer) 47003 47004 - /* Check that the cursor is not beyond the end of the line now. */ 47005 if (buf == curwin->w_buffer) 47006 - check_cursor_col(); 44255 47007 + py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)extra); 44256 47008 + 44257 47009 + curbuf = savebuf; 44258 + 44259 + if (PyErr_Occurred() || VimErrorCheck()) 44260 + return FAIL; 44261 + 44262 + if (len_change) 47010 47011 if (PyErr_Occurred() || VimErrorCheck()) 47012 return FAIL; 47013 47014 if (len_change) 47015 - *len_change = 0; 44263 47016 + *len_change = new_len - old_len; 44264 + 44265 + return OK; 44266 + } 44267 + else 44268 + { 44269 + PyErr_BadArgument(); 44270 + return FAIL; 44271 + } 44272 +} 44273 47017 47018 return OK; 47019 } 47020 @@ -925,7 +1925,6 @@ 47021 } 47022 } 47023 47024 - 44274 47025 /* Insert a number of lines into the specified buffer after the specifed line. 44275 47026 * The line number is in Vim format (1-based). The lines to be inserted are 44276 @@ -1130,6 +1313,40 @@ 47027 * given as a Python list of string objects or as a single string. The lines 47028 @@ -1130,6 +2129,40 @@ 44277 47029 return 0; 44278 47030 } … … 44315 47067 static PyObject * 44316 47068 RBAppend(BufferObject *self, PyObject *args, PyInt start, PyInt end, PyInt *new_end) 44317 @@ -1267,6 + 1484,9 @@47069 @@ -1267,6 +2300,9 @@ 44318 47070 {"append", BufferAppend, 1, "Append data to Vim buffer" }, 44319 47071 {"mark", BufferMark, 1, "Return (row,col) representing position of named mark" }, … … 44325 47077 }; 44326 47078 47079 @@ -1347,3 +2383,270 @@ 47080 { NULL, NULL, 0, NULL } 47081 }; 47082 47083 + static void 47084 +set_ref_in_py(const int copyID) 47085 +{ 47086 + pylinkedlist_T *cur; 47087 + dict_T *dd; 47088 + list_T *ll; 47089 + 47090 + if (lastdict != NULL) 47091 + for(cur = lastdict ; cur != NULL ; cur = cur->pll_prev) 47092 + { 47093 + dd = ((DictionaryObject *) (cur->pll_obj))->dict; 47094 + if (dd->dv_copyID != copyID) 47095 + { 47096 + dd->dv_copyID = copyID; 47097 + set_ref_in_ht(&dd->dv_hashtab, copyID); 47098 + } 47099 + } 47100 + 47101 + if (lastlist != NULL) 47102 + for(cur = lastlist ; cur != NULL ; cur = cur->pll_prev) 47103 + { 47104 + ll = ((ListObject *) (cur->pll_obj))->list; 47105 + if (ll->lv_copyID != copyID) 47106 + { 47107 + ll->lv_copyID = copyID; 47108 + set_ref_in_list(ll, copyID); 47109 + } 47110 + } 47111 +} 47112 + 47113 + static int 47114 +set_string_copy(char_u *str, typval_T *tv) 47115 +{ 47116 + tv->vval.v_string = vim_strsave(str); 47117 + if (tv->vval.v_string == NULL) 47118 + { 47119 + PyErr_NoMemory(); 47120 + return -1; 47121 + } 47122 + return 0; 47123 +} 47124 + 47125 +#ifdef FEAT_EVAL 47126 +typedef int (*pytotvfunc)(PyObject *, typval_T *, PyObject *); 47127 + 47128 + static int 47129 +convert_dl(PyObject *obj, typval_T *tv, 47130 + pytotvfunc py_to_tv, PyObject *lookupDict) 47131 +{ 47132 + PyObject *capsule; 47133 + char hexBuf[sizeof(void *) * 2 + 3]; 47134 + 47135 + sprintf(hexBuf, "%p", obj); 47136 + 47137 +# ifdef PY_USE_CAPSULE 47138 + capsule = PyDict_GetItemString(lookupDict, hexBuf); 47139 +# else 47140 + capsule = (PyObject *)PyDict_GetItemString(lookupDict, hexBuf); 47141 +# endif 47142 + if (capsule == NULL) 47143 + { 47144 +# ifdef PY_USE_CAPSULE 47145 + capsule = PyCapsule_New(tv, NULL, NULL); 47146 +# else 47147 + capsule = PyCObject_FromVoidPtr(tv, NULL); 47148 +# endif 47149 + PyDict_SetItemString(lookupDict, hexBuf, capsule); 47150 + Py_DECREF(capsule); 47151 + if (py_to_tv(obj, tv, lookupDict) == -1) 47152 + { 47153 + tv->v_type = VAR_UNKNOWN; 47154 + return -1; 47155 + } 47156 + /* As we are not using copy_tv which increments reference count we must 47157 + * do it ourself. */ 47158 + switch(tv->v_type) 47159 + { 47160 + case VAR_DICT: ++tv->vval.v_dict->dv_refcount; break; 47161 + case VAR_LIST: ++tv->vval.v_list->lv_refcount; break; 47162 + } 47163 + } 47164 + else 47165 + { 47166 + typval_T *v; 47167 + 47168 +# ifdef PY_USE_CAPSULE 47169 + v = PyCapsule_GetPointer(capsule, NULL); 47170 +# else 47171 + v = PyCObject_AsVoidPtr(capsule); 47172 +# endif 47173 + copy_tv(v, tv); 47174 + } 47175 + return 0; 47176 +} 47177 + 47178 + static int 47179 +ConvertFromPyObject(PyObject *obj, typval_T *tv) 47180 +{ 47181 + PyObject *lookup_dict; 47182 + int r; 47183 + 47184 + lookup_dict = PyDict_New(); 47185 + r = _ConvertFromPyObject(obj, tv, lookup_dict); 47186 + Py_DECREF(lookup_dict); 47187 + return r; 47188 +} 47189 + 47190 + static int 47191 +_ConvertFromPyObject(PyObject *obj, typval_T *tv, PyObject *lookupDict) 47192 +{ 47193 + if (obj->ob_type == &DictionaryType) 47194 + { 47195 + tv->v_type = VAR_DICT; 47196 + tv->vval.v_dict = (((DictionaryObject *)(obj))->dict); 47197 + ++tv->vval.v_dict->dv_refcount; 47198 + } 47199 + else if (obj->ob_type == &ListType) 47200 + { 47201 + tv->v_type = VAR_LIST; 47202 + tv->vval.v_list = (((ListObject *)(obj))->list); 47203 + ++tv->vval.v_list->lv_refcount; 47204 + } 47205 + else if (obj->ob_type == &FunctionType) 47206 + { 47207 + if (set_string_copy(((FunctionObject *) (obj))->name, tv) == -1) 47208 + return -1; 47209 + 47210 + tv->v_type = VAR_FUNC; 47211 + func_ref(tv->vval.v_string); 47212 + } 47213 +#if PY_MAJOR_VERSION >= 3 47214 + else if (PyBytes_Check(obj)) 47215 + { 47216 + char_u *result = (char_u *) PyBytes_AsString(obj); 47217 + 47218 + if (result == NULL) 47219 + return -1; 47220 + 47221 + if (set_string_copy(result, tv) == -1) 47222 + return -1; 47223 + 47224 + tv->v_type = VAR_STRING; 47225 + } 47226 + else if (PyUnicode_Check(obj)) 47227 + { 47228 + PyObject *bytes; 47229 + char_u *result; 47230 + 47231 + bytes = PyString_AsBytes(obj); 47232 + if (bytes == NULL) 47233 + return -1; 47234 + 47235 + result = (char_u *) PyBytes_AsString(bytes); 47236 + if (result == NULL) 47237 + return -1; 47238 + 47239 + if (set_string_copy(result, tv) == -1) 47240 + { 47241 + Py_XDECREF(bytes); 47242 + return -1; 47243 + } 47244 + Py_XDECREF(bytes); 47245 + 47246 + tv->v_type = VAR_STRING; 47247 + } 47248 +#else 47249 + else if (PyUnicode_Check(obj)) 47250 + { 47251 + PyObject *bytes; 47252 + char_u *result; 47253 + 47254 + bytes = PyUnicode_AsEncodedString(obj, (char *)ENC_OPT, NULL); 47255 + if (bytes == NULL) 47256 + return -1; 47257 + 47258 + result=(char_u *) PyString_AsString(bytes); 47259 + if (result == NULL) 47260 + return -1; 47261 + 47262 + if (set_string_copy(result, tv) == -1) 47263 + { 47264 + Py_XDECREF(bytes); 47265 + return -1; 47266 + } 47267 + Py_XDECREF(bytes); 47268 + 47269 + tv->v_type = VAR_STRING; 47270 + } 47271 + else if (PyString_Check(obj)) 47272 + { 47273 + char_u *result = (char_u *) PyString_AsString(obj); 47274 + 47275 + if (result == NULL) 47276 + return -1; 47277 + 47278 + if (set_string_copy(result, tv) == -1) 47279 + return -1; 47280 + 47281 + tv->v_type = VAR_STRING; 47282 + } 47283 + else if (PyInt_Check(obj)) 47284 + { 47285 + tv->v_type = VAR_NUMBER; 47286 + tv->vval.v_number = (varnumber_T) PyInt_AsLong(obj); 47287 + } 47288 +#endif 47289 + else if (PyLong_Check(obj)) 47290 + { 47291 + tv->v_type = VAR_NUMBER; 47292 + tv->vval.v_number = (varnumber_T) PyLong_AsLong(obj); 47293 + } 47294 + else if (PyDict_Check(obj)) 47295 + return convert_dl(obj, tv, pydict_to_tv, lookupDict); 47296 +#ifdef FEAT_FLOAT 47297 + else if (PyFloat_Check(obj)) 47298 + { 47299 + tv->v_type = VAR_FLOAT; 47300 + tv->vval.v_float = (float_T) PyFloat_AsDouble(obj); 47301 + } 47302 +#endif 47303 + else if (PyIter_Check(obj)) 47304 + return convert_dl(obj, tv, pyiter_to_tv, lookupDict); 47305 + else if (PySequence_Check(obj)) 47306 + return convert_dl(obj, tv, pyseq_to_tv, lookupDict); 47307 + else if (PyMapping_Check(obj)) 47308 + return convert_dl(obj, tv, pymap_to_tv, lookupDict); 47309 + else 47310 + { 47311 + PyErr_SetString(PyExc_TypeError, _("unable to convert to vim structure")); 47312 + return -1; 47313 + } 47314 + return 0; 47315 +} 47316 + 47317 + static PyObject * 47318 +ConvertToPyObject(typval_T *tv) 47319 +{ 47320 + if (tv == NULL) 47321 + { 47322 + PyErr_SetVim(_("NULL reference passed")); 47323 + return NULL; 47324 + } 47325 + switch (tv->v_type) 47326 + { 47327 + case VAR_STRING: 47328 + return PyBytes_FromString((char *) tv->vval.v_string); 47329 + case VAR_NUMBER: 47330 + return PyLong_FromLong((long) tv->vval.v_number); 47331 +#ifdef FEAT_FLOAT 47332 + case VAR_FLOAT: 47333 + return PyFloat_FromDouble((double) tv->vval.v_float); 47334 +#endif 47335 + case VAR_LIST: 47336 + return ListNew(tv->vval.v_list); 47337 + case VAR_DICT: 47338 + return DictionaryNew(tv->vval.v_dict); 47339 + case VAR_FUNC: 47340 + return FunctionNew(tv->vval.v_string); 47341 + case VAR_UNKNOWN: 47342 + Py_INCREF(Py_None); 47343 + return Py_None; 47344 + default: 47345 + PyErr_SetVim(_("internal error: invalid value type")); 47346 + return NULL; 47347 + } 47348 +} 47349 +#endif 44327 47350 diff -Naur vim73.orig/src/if_python.c vim73/src/if_python.c 44328 --- vim73.orig/src/if_python.c 2012-06-03 23:09:52.924006631 +0000 44329 +++ vim73/src/if_python.c 2012-06-03 23:09:54.636052191 +0000 44330 @@ -56,6 +56,10 @@ 47351 --- vim73.orig/src/if_python.c 2010-08-13 13:59:41.000000000 +0000 47352 +++ vim73/src/if_python.c 2012-07-20 20:31:17.824311481 +0000 47353 @@ -1,4 +1,4 @@ 47354 -/* vi:set ts=8 sts=4 sw=4: 47355 +/* vi:set ts=8 sts=4 sw=4 noet: 47356 * 47357 * VIM - Vi IMproved by Bram Moolenaar 47358 * 47359 @@ -56,6 +56,12 @@ 44331 47360 44332 47361 static void init_structs(void); 44333 47362 47363 +#define PyBytes_FromString PyString_FromString 47364 + 44334 47365 +/* No-op conversion functions, use with care! */ 44335 47366 +#define PyString_AsBytes(obj) (obj) … … 44339 47370 /* Use this to be able to generate prototypes without python being used. */ 44340 47371 # define PyObject Py_ssize_t 44341 @@ -102,7 +106,7 @@ 47372 @@ -65,6 +71,10 @@ 47373 # define PySequenceMethods Py_ssize_t 47374 #endif 47375 47376 +#if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000 47377 +# define PY_USE_CAPSULE 47378 +#endif 47379 + 47380 #if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000 47381 # define PyInt Py_ssize_t 47382 # define PyInquiry lenfunc 47383 @@ -102,7 +112,7 @@ 44342 47384 # include <dlfcn.h> 44343 47385 # define FARPROC void* … … 44348 47390 # else 44349 47391 # define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL) 44350 @@ -110,7 +1 14,7 @@47392 @@ -110,7 +120,7 @@ 44351 47393 # define close_dll dlclose 44352 47394 # define symbol_from_dll dlsym … … 44357 47399 # define symbol_from_dll GetProcAddress 44358 47400 # endif 44359 @@ -129,6 +133,7 @@ 47401 @@ -118,17 +128,21 @@ 47402 /* This makes if_python.c compile without warnings against Python 2.5 47403 * on Win32 and Win64. */ 47404 # undef PyRun_SimpleString 47405 +# undef PyRun_String 47406 # undef PyArg_Parse 47407 # undef PyArg_ParseTuple 47408 # undef Py_BuildValue 47409 # undef Py_InitModule4 47410 # undef Py_InitModule4_64 47411 +# undef PyObject_CallMethod 47412 47413 /* 47414 * Wrapper defines 44360 47415 */ 44361 47416 # define PyArg_Parse dll_PyArg_Parse 44362 47417 # define PyArg_ParseTuple dll_PyArg_ParseTuple 44363 47418 +# define PyMem_Free dll_PyMem_Free 47419 +# define PyMem_Malloc dll_PyMem_Malloc 44364 47420 # define PyDict_SetItemString dll_PyDict_SetItemString 44365 47421 # define PyErr_BadArgument dll_PyErr_BadArgument 44366 47422 # define PyErr_Clear dll_PyErr_Clear 44367 @@ -165,9 +170,11 @@ 47423 @@ -145,35 +159,67 @@ 47424 # endif 47425 # define PyInt_AsLong dll_PyInt_AsLong 47426 # define PyInt_FromLong dll_PyInt_FromLong 47427 +# define PyLong_AsLong dll_PyLong_AsLong 47428 +# define PyLong_FromLong dll_PyLong_FromLong 47429 # define PyInt_Type (*dll_PyInt_Type) 47430 +# define PyLong_Type (*dll_PyLong_Type) 47431 # define PyList_GetItem dll_PyList_GetItem 47432 # define PyList_Append dll_PyList_Append 47433 # define PyList_New dll_PyList_New 47434 # define PyList_SetItem dll_PyList_SetItem 47435 # define PyList_Size dll_PyList_Size 47436 # define PyList_Type (*dll_PyList_Type) 47437 +# define PySequence_Check dll_PySequence_Check 47438 +# define PySequence_Size dll_PySequence_Size 47439 +# define PySequence_GetItem dll_PySequence_GetItem 47440 +# define PyTuple_Size dll_PyTuple_Size 47441 +# define PyTuple_GetItem dll_PyTuple_GetItem 47442 +# define PyTuple_Type (*dll_PyTuple_Type) 47443 # define PyImport_ImportModule dll_PyImport_ImportModule 47444 # define PyDict_New dll_PyDict_New 47445 # define PyDict_GetItemString dll_PyDict_GetItemString 47446 +# define PyDict_Next dll_PyDict_Next 47447 +# ifdef PyMapping_Items 47448 +# define PY_NO_MAPPING_ITEMS 47449 +# else 47450 +# define PyMapping_Items dll_PyMapping_Items 47451 +# endif 47452 +# define PyObject_CallMethod dll_PyObject_CallMethod 47453 +# define PyMapping_Check dll_PyMapping_Check 47454 +# define PyIter_Next dll_PyIter_Next 47455 # define PyModule_GetDict dll_PyModule_GetDict 47456 # define PyRun_SimpleString dll_PyRun_SimpleString 47457 +# define PyRun_String dll_PyRun_String 47458 # define PyString_AsString dll_PyString_AsString 47459 # define PyString_FromString dll_PyString_FromString 47460 # define PyString_FromStringAndSize dll_PyString_FromStringAndSize 47461 # define PyString_Size dll_PyString_Size 47462 # define PyString_Type (*dll_PyString_Type) 47463 +# define PyUnicode_Type (*dll_PyUnicode_Type) 47464 +# undef PyUnicode_AsEncodedString 47465 +# define PyUnicode_AsEncodedString py_PyUnicode_AsEncodedString 47466 +# define PyFloat_AsDouble dll_PyFloat_AsDouble 47467 +# define PyFloat_FromDouble dll_PyFloat_FromDouble 47468 +# define PyFloat_Type (*dll_PyFloat_Type) 47469 +# define PyImport_AddModule (*dll_PyImport_AddModule) 44368 47470 # define PySys_SetObject dll_PySys_SetObject 44369 47471 # define PySys_SetArgv dll_PySys_SetArgv … … 44377 47479 # define Py_Finalize dll_Py_Finalize 44378 47480 # define Py_IsInitialized dll_Py_IsInitialized 44379 @@ -187,6 +194,7 @@ 47481 # define _PyObject_New dll__PyObject_New 47482 +# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000 47483 +# define _PyObject_NextNotImplemented (*dll__PyObject_NextNotImplemented) 47484 +# endif 47485 # define _Py_NoneStruct (*dll__Py_NoneStruct) 47486 # define PyObject_Init dll__PyObject_Init 47487 +# define PyObject_GetIter dll_PyObject_GetIter 47488 # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000 47489 # define PyType_IsSubtype dll_PyType_IsSubtype 47490 # endif 47491 @@ -181,12 +227,21 @@ 47492 # define PyObject_Malloc dll_PyObject_Malloc 47493 # define PyObject_Free dll_PyObject_Free 47494 # endif 47495 +# ifdef PY_USE_CAPSULE 47496 +# define PyCapsule_New dll_PyCapsule_New 47497 +# define PyCapsule_GetPointer dll_PyCapsule_GetPointer 47498 +# else 47499 +# define PyCObject_FromVoidPtr dll_PyCObject_FromVoidPtr 47500 +# define PyCObject_AsVoidPtr dll_PyCObject_AsVoidPtr 47501 +# endif 47502 47503 /* 47504 * Pointers for dynamic link 44380 47505 */ 44381 47506 static int(*dll_PyArg_Parse)(PyObject *, char *, ...); 44382 47507 static int(*dll_PyArg_ParseTuple)(PyObject *, char *, ...); 44383 47508 +static int(*dll_PyMem_Free)(void *); 47509 +static void* (*dll_PyMem_Malloc)(size_t); 44384 47510 static int(*dll_PyDict_SetItemString)(PyObject *dp, char *key, PyObject *item); 44385 47511 static int(*dll_PyErr_BadArgument)(void); 44386 47512 static void(*dll_PyErr_Clear)(void); 44387 @@ -223,9 +231,11 @@ 47513 @@ -200,37 +255,66 @@ 47514 # ifdef PY_CAN_RECURSE 47515 static PyGILState_STATE (*dll_PyGILState_Ensure)(void); 47516 static void (*dll_PyGILState_Release)(PyGILState_STATE); 47517 -#endif 47518 +# endif 47519 static long(*dll_PyInt_AsLong)(PyObject *); 47520 static PyObject*(*dll_PyInt_FromLong)(long); 47521 +static long(*dll_PyLong_AsLong)(PyObject *); 47522 +static PyObject*(*dll_PyLong_FromLong)(long); 47523 static PyTypeObject* dll_PyInt_Type; 47524 +static PyTypeObject* dll_PyLong_Type; 47525 static PyObject*(*dll_PyList_GetItem)(PyObject *, PyInt); 47526 static PyObject*(*dll_PyList_Append)(PyObject *, PyObject *); 47527 static PyObject*(*dll_PyList_New)(PyInt size); 47528 static int(*dll_PyList_SetItem)(PyObject *, PyInt, PyObject *); 47529 static PyInt(*dll_PyList_Size)(PyObject *); 47530 static PyTypeObject* dll_PyList_Type; 47531 +static int (*dll_PySequence_Check)(PyObject *); 47532 +static PyInt(*dll_PySequence_Size)(PyObject *); 47533 +static PyObject*(*dll_PySequence_GetItem)(PyObject *, PyInt); 47534 +static PyInt(*dll_PyTuple_Size)(PyObject *); 47535 +static PyObject*(*dll_PyTuple_GetItem)(PyObject *, PyInt); 47536 +static PyTypeObject* dll_PyTuple_Type; 47537 static PyObject*(*dll_PyImport_ImportModule)(const char *); 47538 static PyObject*(*dll_PyDict_New)(void); 47539 static PyObject*(*dll_PyDict_GetItemString)(PyObject *, const char *); 47540 +static int (*dll_PyDict_Next)(PyObject *, Py_ssize_t *, PyObject **, PyObject **); 47541 +# ifndef PY_NO_MAPPING_ITEMS 47542 +static PyObject* (*dll_PyMapping_Items)(PyObject *); 47543 +# endif 47544 +static PyObject* (*dll_PyObject_CallMethod)(PyObject *, char *, PyObject *); 47545 +static int (*dll_PyMapping_Check)(PyObject *); 47546 +static PyObject* (*dll_PyIter_Next)(PyObject *); 47547 static PyObject*(*dll_PyModule_GetDict)(PyObject *); 47548 static int(*dll_PyRun_SimpleString)(char *); 47549 +static PyObject *(*dll_PyRun_String)(char *, int, PyObject *, PyObject *); 47550 static char*(*dll_PyString_AsString)(PyObject *); 47551 static PyObject*(*dll_PyString_FromString)(const char *); 47552 static PyObject*(*dll_PyString_FromStringAndSize)(const char *, PyInt); 47553 static PyInt(*dll_PyString_Size)(PyObject *); 47554 static PyTypeObject* dll_PyString_Type; 47555 +static PyTypeObject* dll_PyUnicode_Type; 47556 +static PyObject *(*py_PyUnicode_AsEncodedString)(PyObject *, char *, char *); 47557 +static double(*dll_PyFloat_AsDouble)(PyObject *); 47558 +static PyObject*(*dll_PyFloat_FromDouble)(double); 47559 +static PyTypeObject* dll_PyFloat_Type; 44388 47560 static int(*dll_PySys_SetObject)(char *, PyObject *); 44389 47561 static int(*dll_PySys_SetArgv)(int, char **); … … 44393 47565 static PyObject*(*dll_Py_FindMethod)(struct PyMethodDef[], PyObject *, char *); 44394 47566 static PyObject*(*dll_Py_InitModule4)(char *, struct PyMethodDef *, char *, PyObject *, int); 47567 +static PyObject*(*dll_PyImport_AddModule)(char *); 44395 47568 +static void(*dll_Py_SetPythonHome)(char *home); 44396 47569 static void(*dll_Py_Initialize)(void); 44397 47570 static void(*dll_Py_Finalize)(void); 44398 47571 static int(*dll_Py_IsInitialized)(void); 44399 @@ -267,6 +277,7 @@ 47572 static PyObject*(*dll__PyObject_New)(PyTypeObject *, PyObject *); 47573 static PyObject*(*dll__PyObject_Init)(PyObject *, PyTypeObject *); 47574 +static PyObject* (*dll_PyObject_GetIter)(PyObject *); 47575 +# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000 47576 +static iternextfunc dll__PyObject_NextNotImplemented; 47577 +# endif 47578 static PyObject* dll__Py_NoneStruct; 47579 # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000 47580 static int (*dll_PyType_IsSubtype)(PyTypeObject *, PyTypeObject *); 47581 @@ -239,6 +323,13 @@ 47582 static void* (*dll_PyObject_Malloc)(size_t); 47583 static void (*dll_PyObject_Free)(void*); 47584 # endif 47585 +# ifdef PY_USE_CAPSULE 47586 +static PyObject* (*dll_PyCapsule_New)(void *, char *, PyCapsule_Destructor); 47587 +static void* (*dll_PyCapsule_GetPointer)(PyObject *, char *); 47588 +# else 47589 +static PyObject* (*dll_PyCObject_FromVoidPtr)(void *cobj, void (*destr)(void *)); 47590 +static void* (*dll_PyCObject_AsVoidPtr)(PyObject *); 47591 +# endif 47592 47593 static HINSTANCE hinstPython = 0; /* Instance of python.dll */ 47594 47595 @@ -267,6 +358,8 @@ 44400 47596 { 44401 47597 {"PyArg_Parse", (PYTHON_PROC*)&dll_PyArg_Parse}, 44402 47598 {"PyArg_ParseTuple", (PYTHON_PROC*)&dll_PyArg_ParseTuple}, 44403 47599 + {"PyMem_Free", (PYTHON_PROC*)&dll_PyMem_Free}, 47600 + {"PyMem_Malloc", (PYTHON_PROC*)&dll_PyMem_Malloc}, 44404 47601 {"PyDict_SetItemString", (PYTHON_PROC*)&dll_PyDict_SetItemString}, 44405 47602 {"PyErr_BadArgument", (PYTHON_PROC*)&dll_PyErr_BadArgument}, 44406 47603 {"PyErr_Clear", (PYTHON_PROC*)&dll_PyErr_Clear}, 44407 @@ -303,6 +314,7 @@ 47604 @@ -283,38 +376,67 @@ 47605 # endif 47606 {"PyInt_AsLong", (PYTHON_PROC*)&dll_PyInt_AsLong}, 47607 {"PyInt_FromLong", (PYTHON_PROC*)&dll_PyInt_FromLong}, 47608 + {"PyLong_AsLong", (PYTHON_PROC*)&dll_PyLong_AsLong}, 47609 + {"PyLong_FromLong", (PYTHON_PROC*)&dll_PyLong_FromLong}, 47610 {"PyInt_Type", (PYTHON_PROC*)&dll_PyInt_Type}, 47611 + {"PyLong_Type", (PYTHON_PROC*)&dll_PyLong_Type}, 47612 {"PyList_GetItem", (PYTHON_PROC*)&dll_PyList_GetItem}, 47613 {"PyList_Append", (PYTHON_PROC*)&dll_PyList_Append}, 47614 {"PyList_New", (PYTHON_PROC*)&dll_PyList_New}, 47615 {"PyList_SetItem", (PYTHON_PROC*)&dll_PyList_SetItem}, 47616 {"PyList_Size", (PYTHON_PROC*)&dll_PyList_Size}, 47617 {"PyList_Type", (PYTHON_PROC*)&dll_PyList_Type}, 47618 + {"PySequence_GetItem", (PYTHON_PROC*)&dll_PySequence_GetItem}, 47619 + {"PySequence_Size", (PYTHON_PROC*)&dll_PySequence_Size}, 47620 + {"PySequence_Check", (PYTHON_PROC*)&dll_PySequence_Check}, 47621 + {"PyTuple_GetItem", (PYTHON_PROC*)&dll_PyTuple_GetItem}, 47622 + {"PyTuple_Size", (PYTHON_PROC*)&dll_PyTuple_Size}, 47623 + {"PyTuple_Type", (PYTHON_PROC*)&dll_PyTuple_Type}, 47624 {"PyImport_ImportModule", (PYTHON_PROC*)&dll_PyImport_ImportModule}, 47625 {"PyDict_GetItemString", (PYTHON_PROC*)&dll_PyDict_GetItemString}, 47626 + {"PyDict_Next", (PYTHON_PROC*)&dll_PyDict_Next}, 47627 {"PyDict_New", (PYTHON_PROC*)&dll_PyDict_New}, 47628 +# ifndef PY_NO_MAPPING_ITEMS 47629 + {"PyMapping_Items", (PYTHON_PROC*)&dll_PyMapping_Items}, 47630 +# endif 47631 + {"PyObject_CallMethod", (PYTHON_PROC*)&dll_PyObject_CallMethod}, 47632 + {"PyMapping_Check", (PYTHON_PROC*)&dll_PyMapping_Check}, 47633 + {"PyIter_Next", (PYTHON_PROC*)&dll_PyIter_Next}, 47634 {"PyModule_GetDict", (PYTHON_PROC*)&dll_PyModule_GetDict}, 47635 {"PyRun_SimpleString", (PYTHON_PROC*)&dll_PyRun_SimpleString}, 47636 + {"PyRun_String", (PYTHON_PROC*)&dll_PyRun_String}, 47637 {"PyString_AsString", (PYTHON_PROC*)&dll_PyString_AsString}, 47638 {"PyString_FromString", (PYTHON_PROC*)&dll_PyString_FromString}, 47639 {"PyString_FromStringAndSize", (PYTHON_PROC*)&dll_PyString_FromStringAndSize}, 47640 {"PyString_Size", (PYTHON_PROC*)&dll_PyString_Size}, 47641 {"PyString_Type", (PYTHON_PROC*)&dll_PyString_Type}, 47642 + {"PyUnicode_Type", (PYTHON_PROC*)&dll_PyUnicode_Type}, 47643 + {"PyFloat_Type", (PYTHON_PROC*)&dll_PyFloat_Type}, 47644 + {"PyFloat_AsDouble", (PYTHON_PROC*)&dll_PyFloat_AsDouble}, 47645 + {"PyFloat_FromDouble", (PYTHON_PROC*)&dll_PyFloat_FromDouble}, 47646 + {"PyImport_AddModule", (PYTHON_PROC*)&dll_PyImport_AddModule}, 44408 47647 {"PySys_SetObject", (PYTHON_PROC*)&dll_PySys_SetObject}, 44409 47648 {"PySys_SetArgv", (PYTHON_PROC*)&dll_PySys_SetArgv}, … … 44412 47651 {"Py_BuildValue", (PYTHON_PROC*)&dll_Py_BuildValue}, 44413 47652 {"Py_FindMethod", (PYTHON_PROC*)&dll_Py_FindMethod}, 44414 # if (PY_VERSION_HEX >= 0x02050000) && SIZEOF_SIZE_T != SIZEOF_INT 44415 @@ -310,6 +322,7 @@ 47653 -# if (PY_VERSION_HEX >= 0x02050000) && SIZEOF_SIZE_T != SIZEOF_INT 47654 +# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000 \ 47655 + && SIZEOF_SIZE_T != SIZEOF_INT 47656 {"Py_InitModule4_64", (PYTHON_PROC*)&dll_Py_InitModule4}, 44416 47657 # else 44417 47658 {"Py_InitModule4", (PYTHON_PROC*)&dll_Py_InitModule4}, … … 44421 47662 {"Py_Finalize", (PYTHON_PROC*)&dll_Py_Finalize}, 44422 47663 {"Py_IsInitialized", (PYTHON_PROC*)&dll_Py_IsInitialized}, 44423 @@ -349,13 +362,14 @@ 47664 {"_PyObject_New", (PYTHON_PROC*)&dll__PyObject_New}, 47665 {"PyObject_Init", (PYTHON_PROC*)&dll__PyObject_Init}, 47666 + {"PyObject_GetIter", (PYTHON_PROC*)&dll_PyObject_GetIter}, 47667 +# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000 47668 + {"_PyObject_NextNotImplemented", (PYTHON_PROC*)&dll__PyObject_NextNotImplemented}, 47669 +# endif 47670 {"_Py_NoneStruct", (PYTHON_PROC*)&dll__Py_NoneStruct}, 47671 # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000 47672 {"PyType_IsSubtype", (PYTHON_PROC*)&dll_PyType_IsSubtype}, 47673 @@ -323,6 +445,13 @@ 47674 {"PyObject_Malloc", (PYTHON_PROC*)&dll_PyObject_Malloc}, 47675 {"PyObject_Free", (PYTHON_PROC*)&dll_PyObject_Free}, 47676 # endif 47677 +# ifdef PY_USE_CAPSULE 47678 + {"PyCapsule_New", (PYTHON_PROC*)&dll_PyCapsule_New}, 47679 + {"PyCapsule_GetPointer", (PYTHON_PROC*)&dll_PyCapsule_GetPointer}, 47680 +# else 47681 + {"PyCObject_FromVoidPtr", (PYTHON_PROC*)&dll_PyCObject_FromVoidPtr}, 47682 + {"PyCObject_AsVoidPtr", (PYTHON_PROC*)&dll_PyCObject_AsVoidPtr}, 47683 +# endif 47684 {"", NULL}, 47685 }; 47686 47687 @@ -348,14 +477,16 @@ 47688 python_runtime_link_init(char *libname, int verbose) 44424 47689 { 44425 47690 int i; 47691 + void *ucs_as_encoded_string; 44426 47692 44427 47693 -#if !defined(PY_NO_RTLD_GLOBAL) && defined(UNIX) && defined(FEAT_PYTHON3) … … 44438 47704 } 44439 47705 #endif 44440 @@ -543,6 +557,10 @@ 47706 @@ -382,6 +513,25 @@ 47707 return FAIL; 47708 } 47709 } 47710 + 47711 + /* Load unicode functions separately as only the ucs2 or the ucs4 functions 47712 + * will be present in the library. */ 47713 + ucs_as_encoded_string = symbol_from_dll(hinstPython, 47714 + "PyUnicodeUCS2_AsEncodedString"); 47715 + if (ucs_as_encoded_string == NULL) 47716 + ucs_as_encoded_string = symbol_from_dll(hinstPython, 47717 + "PyUnicodeUCS4_AsEncodedString"); 47718 + if (ucs_as_encoded_string != NULL) 47719 + py_PyUnicode_AsEncodedString = ucs_as_encoded_string; 47720 + else 47721 + { 47722 + close_dll(hinstPython); 47723 + hinstPython = 0; 47724 + if (verbose) 47725 + EMSG2(_(e_loadfunc), "PyUnicode_UCSX_*"); 47726 + return FAIL; 47727 + } 47728 + 47729 return OK; 47730 } 47731 47732 @@ -420,10 +570,25 @@ 47733 47734 static PyObject *BufferNew (buf_T *); 47735 static PyObject *WindowNew(win_T *); 47736 +static PyObject *DictionaryNew(dict_T *); 47737 static PyObject *LineToString(const char *); 47738 47739 static PyTypeObject RangeType; 47740 47741 +static int initialised = 0; 47742 +#define PYINITIALISED initialised 47743 + 47744 +/* Add conversion from PyInt? */ 47745 +#define DICTKEY_GET(err) \ 47746 + if (!PyString_Check(keyObject)) \ 47747 + { \ 47748 + PyErr_SetString(PyExc_TypeError, _("only string keys are allowed")); \ 47749 + return err; \ 47750 + } \ 47751 + key = (char_u *) PyString_AsString(keyObject); 47752 +#define DICTKEY_UNREF 47753 +#define DICTKEY_DECL 47754 + 47755 /* 47756 * Include the code shared with if_python3.c 47757 */ 47758 @@ -437,6 +602,8 @@ 47759 static PyInt RangeStart; 47760 static PyInt RangeEnd; 47761 47762 +static PyObject *globals; 47763 + 47764 static void PythonIO_Flush(void); 47765 static int PythonIO_Init(void); 47766 static int PythonMod_Init(void); 47767 @@ -452,8 +619,6 @@ 47768 * 1. Python interpreter main program. 47769 */ 47770 47771 -static int initialised = 0; 47772 - 47773 #if PYTHON_API_VERSION < 1007 /* Python 1.4 */ 47774 typedef PyObject PyThreadState; 47775 #endif 47776 @@ -543,6 +708,10 @@ 44441 47777 } 44442 47778 #endif … … 44449 47785 44450 47786 #if !defined(MACOS) || defined(MACOS_X_UNIX) 44451 @@ -773,7 +791,7 @@ 47787 @@ -563,6 +732,8 @@ 47788 if (PythonMod_Init()) 47789 goto fail; 47790 47791 + globals = PyModule_GetDict(PyImport_AddModule("__main__")); 47792 + 47793 /* Remove the element from sys.path that was added because of our 47794 * argv[0] value in PythonMod_Init(). Previously we used an empty 47795 * string, but dependinding on the OS we then get an empty entry or 47796 @@ -591,7 +762,7 @@ 47797 * External interface 47798 */ 47799 static void 47800 -DoPythonCommand(exarg_T *eap, const char *cmd) 47801 +DoPythonCommand(exarg_T *eap, const char *cmd, typval_T *rettv) 47802 { 47803 #ifndef PY_CAN_RECURSE 47804 static int recursive = 0; 47805 @@ -621,8 +792,16 @@ 47806 if (Python_Init()) 47807 goto theend; 47808 47809 - RangeStart = eap->line1; 47810 - RangeEnd = eap->line2; 47811 + if (rettv == NULL) 47812 + { 47813 + RangeStart = eap->line1; 47814 + RangeEnd = eap->line2; 47815 + } 47816 + else 47817 + { 47818 + RangeStart = (PyInt) curwin->w_cursor.lnum; 47819 + RangeEnd = RangeStart; 47820 + } 47821 Python_Release_Vim(); /* leave vim */ 47822 47823 #if defined(HAVE_LOCALE_H) || defined(X_LOCALE) 47824 @@ -640,7 +819,23 @@ 47825 47826 Python_RestoreThread(); /* enter python */ 47827 47828 - PyRun_SimpleString((char *)(cmd)); 47829 + if (rettv == NULL) 47830 + PyRun_SimpleString((char *)(cmd)); 47831 + else 47832 + { 47833 + PyObject *r; 47834 + 47835 + r = PyRun_String((char *)(cmd), Py_eval_input, globals, globals); 47836 + if (r == NULL) 47837 + EMSG(_("E858: Eval did not return a valid python object")); 47838 + else 47839 + { 47840 + if (ConvertFromPyObject(r, rettv) == -1) 47841 + EMSG(_("E859: Failed to convert returned python object to vim value")); 47842 + Py_DECREF(r); 47843 + } 47844 + PyErr_Clear(); 47845 + } 47846 47847 Python_SaveThread(); /* leave python */ 47848 47849 @@ -662,7 +857,7 @@ 47850 #ifndef PY_CAN_RECURSE 47851 --recursive; 47852 #endif 47853 - return; /* keeps lint happy */ 47854 + return; 47855 } 47856 47857 /* 47858 @@ -677,9 +872,9 @@ 47859 if (!eap->skip) 47860 { 47861 if (script == NULL) 47862 - DoPythonCommand(eap, (char *)eap->arg); 47863 + DoPythonCommand(eap, (char *)eap->arg, NULL); 47864 else 47865 - DoPythonCommand(eap, (char *)script); 47866 + DoPythonCommand(eap, (char *)script, NULL); 47867 } 47868 vim_free(script); 47869 } 47870 @@ -725,7 +920,7 @@ 47871 *p++ = '\0'; 47872 47873 /* Execute the file */ 47874 - DoPythonCommand(eap, buffer); 47875 + DoPythonCommand(eap, buffer, NULL); 47876 } 47877 47878 /****************************************************** 47879 @@ -747,14 +942,16 @@ 47880 static int 47881 OutputSetattr(PyObject *self, char *name, PyObject *val) 47882 { 47883 - if (val == NULL) { 47884 + if (val == NULL) 47885 + { 47886 PyErr_SetString(PyExc_AttributeError, _("can't delete OutputObject attributes")); 47887 return -1; 47888 } 47889 47890 if (strcmp(name, "softspace") == 0) 47891 { 47892 - if (!PyInt_Check(val)) { 47893 + if (!PyInt_Check(val)) 47894 + { 47895 PyErr_SetString(PyExc_TypeError, _("softspace must be an integer")); 47896 return -1; 47897 } 47898 @@ -773,7 +970,7 @@ 44452 47899 PythonIO_Init(void) 44453 47900 { … … 44458 47905 return PythonIO_Init_io(); 44459 47906 } 44460 @@ -823,44 +841,6 @@ 47907 @@ -782,6 +979,9 @@ 47908 * 3. Implementation of the Vim module for Python 47909 */ 47910 47911 +static PyObject *ConvertToPyObject(typval_T *); 47912 +static int ConvertFromPyObject(PyObject *, typval_T *); 47913 + 47914 /* Window type - Implementation functions 47915 * -------------------------------------- 47916 */ 47917 @@ -823,44 +1023,6 @@ 44461 47918 static PyObject *CurrentGetattr(PyObject *, char *); 44462 47919 static int CurrentSetattr(PyObject *, char *, PyObject *); … … 44503 47960 (PyInquiry) BufferLength, /* sq_length, len(x) */ 44504 47961 (binaryfunc) 0, /* BufferConcat, */ /* sq_concat, x+y */ 44505 @@ -1028,7 +1 008,7 @@47962 @@ -1028,7 +1190,7 @@ 44506 47963 static PyInt 44507 47964 BufferAssSlice(PyObject *self, PyInt lo, PyInt hi, PyObject *val) … … 44512 47969 NULL); 44513 47970 } 44514 @@ -1078,7 +1 058,7 @@47971 @@ -1078,7 +1240,7 @@ 44515 47972 static PyInt 44516 47973 RangeAssSlice(PyObject *self, PyInt lo, PyInt hi, PyObject *val) … … 44521 47978 ((RangeObject *)(self))->end, 44522 47979 &((RangeObject *)(self))->end); 44523 @@ -1395,12 +1 375,12 @@47980 @@ -1395,12 +1557,12 @@ 44524 47981 static char *(argv[2]) = {"/must>not&exist/foo", NULL}; 44525 47982 … … 44540 47997 /* Set sys.argv[] to avoid a crash in warn(). */ 44541 47998 PySys_SetArgv(1, argv); 44542 @@ -1425,194 +1 405,6 @@47999 @@ -1425,194 +1587,6 @@ 44543 48000 * 4. Utility functions for handling the interface between Vim and Python. 44544 48001 */ … … 44735 48192 * All internal newlines are replaced by null characters. 44736 48193 * 48194 @@ -1649,6 +1623,172 @@ 48195 return result; 48196 } 48197 48198 +static void DictionaryDestructor(PyObject *); 48199 +static PyObject *DictionaryGetattr(PyObject *, char*); 48200 + 48201 +static PyMappingMethods DictionaryAsMapping = { 48202 + (PyInquiry) DictionaryLength, 48203 + (binaryfunc) DictionaryItem, 48204 + (objobjargproc) DictionaryAssItem, 48205 +}; 48206 + 48207 +static PyTypeObject DictionaryType = { 48208 + PyObject_HEAD_INIT(0) 48209 + 0, 48210 + "vimdictionary", 48211 + sizeof(DictionaryObject), 48212 + 0, 48213 + 48214 + (destructor) DictionaryDestructor, 48215 + (printfunc) 0, 48216 + (getattrfunc) DictionaryGetattr, 48217 + (setattrfunc) 0, 48218 + (cmpfunc) 0, 48219 + (reprfunc) 0, 48220 + 48221 + 0, /* as number */ 48222 + 0, /* as sequence */ 48223 + &DictionaryAsMapping, /* as mapping */ 48224 + 48225 + (hashfunc) 0, 48226 + (ternaryfunc) 0, 48227 + (reprfunc) 0, 48228 +}; 48229 + 48230 + static void 48231 +DictionaryDestructor(PyObject *self) 48232 +{ 48233 + DictionaryObject *this = ((DictionaryObject *) (self)); 48234 + 48235 + pyll_remove(&this->ref, &lastdict); 48236 + dict_unref(this->dict); 48237 + 48238 + Py_DECREF(self); 48239 +} 48240 + 48241 + static PyObject * 48242 +DictionaryGetattr(PyObject *self, char *name) 48243 +{ 48244 + return Py_FindMethod(DictionaryMethods, self, name); 48245 +} 48246 + 48247 +static void ListDestructor(PyObject *); 48248 +static PyObject *ListGetattr(PyObject *, char *); 48249 + 48250 +static PySequenceMethods ListAsSeq = { 48251 + (PyInquiry) ListLength, 48252 + (binaryfunc) 0, 48253 + (PyIntArgFunc) 0, 48254 + (PyIntArgFunc) ListItem, 48255 + (PyIntIntArgFunc) ListSlice, 48256 + (PyIntObjArgProc) ListAssItem, 48257 + (PyIntIntObjArgProc) ListAssSlice, 48258 + (objobjproc) 0, 48259 +#if PY_MAJOR_VERSION >= 2 48260 + (binaryfunc) ListConcatInPlace, 48261 + 0, 48262 +#endif 48263 +}; 48264 + 48265 +static PyTypeObject ListType = { 48266 + PyObject_HEAD_INIT(0) 48267 + 0, 48268 + "vimlist", 48269 + sizeof(ListObject), 48270 + 0, 48271 + 48272 + (destructor) ListDestructor, 48273 + (printfunc) 0, 48274 + (getattrfunc) ListGetattr, 48275 + (setattrfunc) 0, 48276 + (cmpfunc) 0, 48277 + (reprfunc) 0, 48278 + 48279 + 0, /* as number */ 48280 + &ListAsSeq, /* as sequence */ 48281 + 0, /* as mapping */ 48282 + 48283 + (hashfunc) 0, 48284 + (ternaryfunc) 0, 48285 + (reprfunc) 0, 48286 +}; 48287 + 48288 + static void 48289 +ListDestructor(PyObject *self) 48290 +{ 48291 + ListObject *this = ((ListObject *) (self)); 48292 + 48293 + pyll_remove(&this->ref, &lastlist); 48294 + list_unref(this->list); 48295 + 48296 + Py_DECREF(self); 48297 +} 48298 + 48299 + static PyObject * 48300 +ListGetattr(PyObject *self, char *name) 48301 +{ 48302 + return Py_FindMethod(ListMethods, self, name); 48303 +} 48304 + 48305 +static void FunctionDestructor(PyObject *); 48306 +static PyObject *FunctionGetattr(PyObject *, char *); 48307 + 48308 +static PyTypeObject FunctionType = { 48309 + PyObject_HEAD_INIT(0) 48310 + 0, 48311 + "vimfunction", 48312 + sizeof(FunctionObject), 48313 + 0, 48314 + 48315 + (destructor) FunctionDestructor, 48316 + (printfunc) 0, 48317 + (getattrfunc) FunctionGetattr, 48318 + (setattrfunc) 0, 48319 + (cmpfunc) 0, 48320 + (reprfunc) 0, 48321 + 48322 + 0, /* as number */ 48323 + 0, /* as sequence */ 48324 + 0, /* as mapping */ 48325 + 48326 + (hashfunc) 0, 48327 + (ternaryfunc) FunctionCall, 48328 + (reprfunc) 0, 48329 +}; 48330 + 48331 + static void 48332 +FunctionDestructor(PyObject *self) 48333 +{ 48334 + FunctionObject *this = (FunctionObject *) (self); 48335 + 48336 + func_unref(this->name); 48337 + PyMem_Del(this->name); 48338 + 48339 + Py_DECREF(self); 48340 +} 48341 + 48342 + static PyObject * 48343 +FunctionGetattr(PyObject *self, char *name) 48344 +{ 48345 + FunctionObject *this = (FunctionObject *)(self); 48346 + 48347 + if (strcmp(name, "name") == 0) 48348 + return PyString_FromString((char *)(this->name)); 48349 + else 48350 + return Py_FindMethod(FunctionMethods, self, name); 48351 +} 48352 + 48353 + void 48354 +do_pyeval (char_u *str, typval_T *rettv) 48355 +{ 48356 + DoPythonCommand(NULL, (char *) str, rettv); 48357 + switch(rettv->v_type) 48358 + { 48359 + case VAR_DICT: ++rettv->vval.v_dict->dv_refcount; break; 48360 + case VAR_LIST: ++rettv->vval.v_list->lv_refcount; break; 48361 + case VAR_FUNC: func_ref(rettv->vval.v_string); break; 48362 + } 48363 +} 48364 48365 /* Don't generate a prototype for the next function, it generates an error on 48366 * newer Python versions. */ 48367 @@ -1661,6 +1801,12 @@ 48368 } 48369 #endif /* Python 1.4 */ 48370 48371 + void 48372 +set_ref_in_python (int copyID) 48373 +{ 48374 + set_ref_in_py(copyID); 48375 +} 48376 + 48377 static void 48378 init_structs(void) 48379 { 44737 48380 diff -Naur vim73.orig/src/if_python3.c vim73/src/if_python3.c 44738 --- vim73.orig/src/if_python3.c 201 2-06-03 23:09:52.940007057+000044739 +++ vim73/src/if_python3.c 2012-0 6-03 23:09:55.312070180+000048381 --- vim73.orig/src/if_python3.c 2010-08-13 13:59:40.000000000 +0000 48382 +++ vim73/src/if_python3.c 2012-07-20 20:31:17.787644787 +0000 44740 48383 @@ -22,8 +22,8 @@ 44741 48384 * Adaptations to support both python3.x and python2.x … … 44749 48392 #include "vim.h" 44750 48393 44751 @@ -68,19 +68, 28@@48394 @@ -68,19 +68,31 @@ 44752 48395 44753 48396 static void init_structs(void); … … 44760 48403 +#endif 44761 48404 + 48405 +/* Python 3 does not support CObjects, always use Capsules */ 48406 +#define PY_USE_CAPSULE 48407 + 44762 48408 #define PyInt Py_ssize_t 44763 48409 #define PyString_Check(obj) PyUnicode_Check(obj) 44764 48410 -#define PyString_AsString(obj) _PyUnicode_AsString(obj) 44765 48411 -#define PyString_Size(obj) PyUnicode_GET_SIZE(obj) 44766 +#define PyString_AsBytes(obj) PyUnicode_AsEncodedString(obj, (char *)ENC_OPT, CODEC_ERROR_HANDLER) ;48412 +#define PyString_AsBytes(obj) PyUnicode_AsEncodedString(obj, (char *)ENC_OPT, CODEC_ERROR_HANDLER) 44767 48413 +#define PyString_FreeBytes(obj) Py_XDECREF(bytes) 44768 48414 +#define PyString_AsString(obj) PyBytes_AsString(obj) … … 44782 48428 # else 44783 48429 # define load_dll(n) dlopen((n), RTLD_LAZY|RTLD_GLOBAL) 44784 @@ -88,7 + 97,7 @@48430 @@ -88,7 +100,7 @@ 44785 48431 # define close_dll dlclose 44786 48432 # define symbol_from_dll dlsym … … 44791 48437 # define symbol_from_dll GetProcAddress 44792 48438 # endif 44793 @@ -99,6 +1 08,7@@48439 @@ -99,6 +111,8 @@ 44794 48440 # define PyArg_Parse py3_PyArg_Parse 44795 48441 # undef PyArg_ParseTuple 44796 48442 # define PyArg_ParseTuple py3_PyArg_ParseTuple 44797 48443 +# define PyMem_Free py3_PyMem_Free 48444 +# define PyMem_Malloc py3_PyMem_Malloc 44798 48445 # define PyDict_SetItemString py3_PyDict_SetItemString 44799 48446 # define PyErr_BadArgument py3_PyErr_BadArgument 44800 48447 # define PyErr_Clear py3_PyErr_Clear 44801 @@ -132,6 +142,7 @@ 48448 @@ -118,29 +132,54 @@ 48449 # define PyList_New py3_PyList_New 48450 # define PyList_SetItem py3_PyList_SetItem 48451 # define PyList_Size py3_PyList_Size 48452 +# define PySequence_Check py3_PySequence_Check 48453 +# define PySequence_Size py3_PySequence_Size 48454 +# define PySequence_GetItem py3_PySequence_GetItem 48455 +# define PyTuple_Size py3_PyTuple_Size 48456 +# define PyTuple_GetItem py3_PyTuple_GetItem 48457 # define PySlice_GetIndicesEx py3_PySlice_GetIndicesEx 48458 # define PyImport_ImportModule py3_PyImport_ImportModule 48459 +# define PyImport_AddModule py3_PyImport_AddModule 48460 # define PyObject_Init py3__PyObject_Init 48461 # define PyDict_New py3_PyDict_New 48462 # define PyDict_GetItemString py3_PyDict_GetItemString 48463 +# define PyDict_Next py3_PyDict_Next 48464 +# define PyMapping_Check py3_PyMapping_Check 48465 +# define PyMapping_Items py3_PyMapping_Items 48466 +# define PyIter_Next py3_PyIter_Next 48467 +# define PyObject_GetIter py3_PyObject_GetIter 48468 # define PyModule_GetDict py3_PyModule_GetDict 48469 #undef PyRun_SimpleString 48470 # define PyRun_SimpleString py3_PyRun_SimpleString 48471 +#undef PyRun_String 48472 +# define PyRun_String py3_PyRun_String 48473 # define PySys_SetObject py3_PySys_SetObject 48474 # define PySys_SetArgv py3_PySys_SetArgv 48475 # define PyType_Type (*py3_PyType_Type) 44802 48476 # define PyType_Ready py3_PyType_Ready 44803 48477 #undef Py_BuildValue … … 44807 48481 # define Py_Finalize py3_Py_Finalize 44808 48482 # define Py_IsInitialized py3_Py_IsInitialized 44809 @@ -139,8 +150,13 @@ 48483 # define _Py_NoneStruct (*py3__Py_NoneStruct) 48484 +# define _PyObject_NextNotImplemented (*py3__PyObject_NextNotImplemented) 44810 48485 # define PyModule_AddObject py3_PyModule_AddObject 44811 48486 # define PyImport_AppendInittab py3_PyImport_AppendInittab … … 44815 48490 +# undef PyBytes_AsString 44816 48491 +# define PyBytes_AsString py3_PyBytes_AsString 48492 +# undef PyBytes_FromString 48493 +# define PyBytes_FromString py3_PyBytes_FromString 48494 +# define PyFloat_FromDouble py3_PyFloat_FromDouble 48495 +# define PyFloat_AsDouble py3_PyFloat_AsDouble 44817 48496 # define PyObject_GenericGetAttr py3_PyObject_GenericGetAttr 44818 48497 # define PySlice_Type (*py3_PySlice_Type) 48498 +# define PyFloat_Type (*py3_PyFloat_Type) 44819 48499 +# define PyErr_NewException py3_PyErr_NewException 44820 48500 # ifdef Py_DEBUG 44821 48501 # define _Py_NegativeRefcount py3__Py_NegativeRefcount 44822 48502 # define _Py_RefTotal (*py3__Py_RefTotal) 44823 @@ -156,8 +1 72,8@@48503 @@ -156,8 +195,11 @@ 44824 48504 # define PyModule_Create2 py3_PyModule_Create2 44825 48505 # undef PyUnicode_FromString … … 44829 48509 +# undef PyUnicode_Decode 44830 48510 +# define PyUnicode_Decode py3_PyUnicode_Decode 48511 +# define PyType_IsSubtype py3_PyType_IsSubtype 48512 +# define PyCapsule_New py3_PyCapsule_New 48513 +# define PyCapsule_GetPointer py3_PyCapsule_GetPointer 44831 48514 44832 48515 # ifdef Py_DEBUG 44833 48516 # undef PyObject_NEW 44834 @@ -170,6 + 186,7 @@48517 @@ -170,6 +212,7 @@ 44835 48518 * Pointers for dynamic link 44836 48519 */ … … 44840 48523 static PyObject* (*py3_PyList_New)(Py_ssize_t size); 44841 48524 static PyGILState_STATE (*py3_PyGILState_Ensure)(void); 44842 @@ -177, 7 +194,7@@48525 @@ -177,27 +220,40 @@ 44843 48526 static int (*py3_PySys_SetObject)(char *, PyObject *); 44844 48527 static PyObject* (*py3_PyList_Append)(PyObject *, PyObject *); 44845 48528 static Py_ssize_t (*py3_PyList_Size)(PyObject *); 44846 48529 -static int (*py3_PySlice_GetIndicesEx)(PySliceObject *r, Py_ssize_t length, 48530 +static int (*py3_PySequence_Check)(PyObject *); 48531 +static Py_ssize_t (*py3_PySequence_Size)(PyObject *); 48532 +static PyObject* (*py3_PySequence_GetItem)(PyObject *, Py_ssize_t); 48533 +static Py_ssize_t (*py3_PyTuple_Size)(PyObject *); 48534 +static PyObject* (*py3_PyTuple_GetItem)(PyObject *, Py_ssize_t); 48535 +static int (*py3_PyMapping_Check)(PyObject *); 48536 +static PyObject* (*py3_PyMapping_Items)(PyObject *); 44847 48537 +static int (*py3_PySlice_GetIndicesEx)(PyObject *r, Py_ssize_t length, 44848 48538 Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength); 44849 48539 static PyObject* (*py3_PyErr_NoMemory)(void); 44850 48540 static void (*py3_Py_Finalize)(void); 44851 @@ -197,7 +214,8 @@ 48541 static void (*py3_PyErr_SetString)(PyObject *, const char *); 48542 static int (*py3_PyRun_SimpleString)(char *); 48543 +static PyObject* (*py3_PyRun_String)(char *, int, PyObject *, PyObject *); 48544 static PyObject* (*py3_PyList_GetItem)(PyObject *, Py_ssize_t); 48545 static PyObject* (*py3_PyImport_ImportModule)(const char *); 48546 +static PyObject* (*py3_PyImport_AddModule)(const char *); 48547 static int (*py3_PyErr_BadArgument)(void); 48548 static PyTypeObject* py3_PyType_Type; 48549 static PyObject* (*py3_PyErr_Occurred)(void); 48550 static PyObject* (*py3_PyModule_GetDict)(PyObject *); 48551 static int (*py3_PyList_SetItem)(PyObject *, Py_ssize_t, PyObject *); 48552 static PyObject* (*py3_PyDict_GetItemString)(PyObject *, const char *); 48553 +static int (*py3_PyDict_Next)(PyObject *, Py_ssize_t *, PyObject **, PyObject **); 48554 static PyObject* (*py3_PyLong_FromLong)(long); 48555 static PyObject* (*py3_PyDict_New)(void); 48556 +static PyObject* (*py3_PyIter_Next)(PyObject *); 48557 +static PyObject* (*py3_PyObject_GetIter)(PyObject *); 48558 static PyObject* (*py3_Py_BuildValue)(char *, ...); 44852 48559 static int (*py3_PyType_Ready)(PyTypeObject *type); 44853 48560 static int (*py3_PyDict_SetItemString)(PyObject *dp, char *key, PyObject *item); … … 44859 48566 static void (*py3_PyErr_SetNone)(PyObject *); 44860 48567 static void (*py3_PyEval_InitThreads)(void); 44861 @@ -205, 6 +223,7@@48568 @@ -205,18 +261,30 @@ 44862 48569 static PyThreadState*(*py3_PyEval_SaveThread)(void); 44863 48570 static int (*py3_PyArg_Parse)(PyObject *, char *, ...); 44864 48571 static int (*py3_PyArg_ParseTuple)(PyObject *, char *, ...); 44865 48572 +static int (*py3_PyMem_Free)(void *); 48573 +static void* (*py3_PyMem_Malloc)(size_t); 44866 48574 static int (*py3_Py_IsInitialized)(void); 44867 48575 static void (*py3_PyErr_Clear)(void); 44868 48576 static PyObject*(*py3__PyObject_Init)(PyObject *, PyTypeObject *); 44869 @@ -212,11 +231,14 @@ 48577 +static iternextfunc py3__PyObject_NextNotImplemented; 48578 static PyObject* py3__Py_NoneStruct; 44870 48579 static int (*py3_PyModule_AddObject)(PyObject *m, const char *name, PyObject *o); 44871 48580 static int (*py3_PyImport_AppendInittab)(const char *name, PyObject* (*initfunc)(void)); … … 44873 48582 +static PyObject* (*py3_PyUnicode_AsEncodedString)(PyObject *unicode, const char* encoding, const char* errors); 44874 48583 +static char* (*py3_PyBytes_AsString)(PyObject *bytes); 48584 +static PyObject* (*py3_PyBytes_FromString)(char *str); 48585 +static PyObject* (*py3_PyFloat_FromDouble)(double num); 48586 +static double (*py3_PyFloat_AsDouble)(PyObject *); 44875 48587 static PyObject* (*py3_PyObject_GenericGetAttr)(PyObject *obj, PyObject *name); 44876 48588 static PyObject* (*py3_PyModule_Create2)(struct PyModuleDef* module, int module_api_version); … … 44878 48590 static PyObject* (*py3_PyType_GenericNew)(PyTypeObject *type, PyObject *args, PyObject *kwds); 44879 48591 static PyTypeObject* py3_PySlice_Type; 48592 +static PyTypeObject* py3_PyFloat_Type; 44880 48593 +static PyObject* (*py3_PyErr_NewException)(char *name, PyObject *base, PyObject *dict); 48594 +static PyObject* (*py3_PyCapsule_New)(void *, char *, PyCapsule_Destructor); 48595 +static void* (*py3_PyCapsule_GetPointer)(PyObject *, char *); 44881 48596 # ifdef Py_DEBUG 44882 48597 static void (*py3__Py_NegativeRefcount)(const char *fname, int lineno, PyObject *op); 44883 48598 static Py_ssize_t* py3__Py_RefTotal; 44884 @@ -254,8 +276,10 @@ 48599 @@ -227,6 +295,7 @@ 48600 static void (*py3_PyObject_Free)(void*); 48601 static void* (*py3_PyObject_Malloc)(size_t); 48602 # endif 48603 +static int (*py3_PyType_IsSubtype)(PyTypeObject *, PyTypeObject *); 48604 48605 static HINSTANCE hinstPy3 = 0; /* Instance of python.dll */ 48606 48607 @@ -254,27 +323,42 @@ 44885 48608 } py3_funcname_table[] = 44886 48609 { … … 44890 48613 {"PyArg_ParseTuple", (PYTHON_PROC*)&py3_PyArg_ParseTuple}, 44891 48614 + {"PyMem_Free", (PYTHON_PROC*)&py3_PyMem_Free}, 48615 + {"PyMem_Malloc", (PYTHON_PROC*)&py3_PyMem_Malloc}, 44892 48616 {"PyList_New", (PYTHON_PROC*)&py3_PyList_New}, 44893 48617 {"PyGILState_Ensure", (PYTHON_PROC*)&py3_PyGILState_Ensure}, 44894 48618 {"PyGILState_Release", (PYTHON_PROC*)&py3_PyGILState_Release}, 44895 @@ -286,7 +310,6 @@ 48619 {"PySys_SetObject", (PYTHON_PROC*)&py3_PySys_SetObject}, 48620 {"PyList_Append", (PYTHON_PROC*)&py3_PyList_Append}, 48621 {"PyList_Size", (PYTHON_PROC*)&py3_PyList_Size}, 48622 + {"PySequence_Check", (PYTHON_PROC*)&py3_PySequence_Check}, 48623 + {"PySequence_Size", (PYTHON_PROC*)&py3_PySequence_Size}, 48624 + {"PySequence_GetItem", (PYTHON_PROC*)&py3_PySequence_GetItem}, 48625 + {"PyTuple_Size", (PYTHON_PROC*)&py3_PyTuple_Size}, 48626 + {"PyTuple_GetItem", (PYTHON_PROC*)&py3_PyTuple_GetItem}, 48627 {"PySlice_GetIndicesEx", (PYTHON_PROC*)&py3_PySlice_GetIndicesEx}, 48628 {"PyErr_NoMemory", (PYTHON_PROC*)&py3_PyErr_NoMemory}, 48629 {"Py_Finalize", (PYTHON_PROC*)&py3_Py_Finalize}, 48630 {"PyErr_SetString", (PYTHON_PROC*)&py3_PyErr_SetString}, 48631 {"PyRun_SimpleString", (PYTHON_PROC*)&py3_PyRun_SimpleString}, 48632 + {"PyRun_String", (PYTHON_PROC*)&py3_PyRun_String}, 48633 {"PyList_GetItem", (PYTHON_PROC*)&py3_PyList_GetItem}, 48634 {"PyImport_ImportModule", (PYTHON_PROC*)&py3_PyImport_ImportModule}, 48635 + {"PyImport_AddModule", (PYTHON_PROC*)&py3_PyImport_AddModule}, 48636 {"PyErr_BadArgument", (PYTHON_PROC*)&py3_PyErr_BadArgument}, 48637 {"PyType_Type", (PYTHON_PROC*)&py3_PyType_Type}, 48638 {"PyErr_Occurred", (PYTHON_PROC*)&py3_PyErr_Occurred}, 48639 {"PyModule_GetDict", (PYTHON_PROC*)&py3_PyModule_GetDict}, 48640 {"PyList_SetItem", (PYTHON_PROC*)&py3_PyList_SetItem}, 48641 {"PyDict_GetItemString", (PYTHON_PROC*)&py3_PyDict_GetItemString}, 48642 + {"PyDict_Next", (PYTHON_PROC*)&py3_PyDict_Next}, 48643 + {"PyMapping_Check", (PYTHON_PROC*)&py3_PyMapping_Check}, 48644 + {"PyMapping_Items", (PYTHON_PROC*)&py3_PyMapping_Items}, 48645 + {"PyIter_Next", (PYTHON_PROC*)&py3_PyIter_Next}, 48646 + {"PyObject_GetIter", (PYTHON_PROC*)&py3_PyObject_GetIter}, 48647 {"PyLong_FromLong", (PYTHON_PROC*)&py3_PyLong_FromLong}, 48648 {"PyDict_New", (PYTHON_PROC*)&py3_PyDict_New}, 48649 {"Py_BuildValue", (PYTHON_PROC*)&py3_Py_BuildValue}, 48650 @@ -286,19 +370,25 @@ 44896 48651 {"PyEval_RestoreThread", (PYTHON_PROC*)&py3_PyEval_RestoreThread}, 44897 48652 {"PyEval_SaveThread", (PYTHON_PROC*)&py3_PyEval_SaveThread}, … … 44899 48654 - {"PyArg_ParseTuple", (PYTHON_PROC*)&py3_PyArg_ParseTuple}, 44900 48655 {"Py_IsInitialized", (PYTHON_PROC*)&py3_Py_IsInitialized}, 48656 + {"_PyObject_NextNotImplemented", (PYTHON_PROC*)&py3__PyObject_NextNotImplemented}, 44901 48657 {"_Py_NoneStruct", (PYTHON_PROC*)&py3__Py_NoneStruct}, 44902 48658 {"PyErr_Clear", (PYTHON_PROC*)&py3_PyErr_Clear}, 44903 @@ -294,11 +317,13 @@ 48659 {"PyObject_Init", (PYTHON_PROC*)&py3__PyObject_Init}, 44904 48660 {"PyModule_AddObject", (PYTHON_PROC*)&py3_PyModule_AddObject}, 44905 48661 {"PyImport_AppendInittab", (PYTHON_PROC*)&py3_PyImport_AppendInittab}, 44906 48662 {"_PyUnicode_AsString", (PYTHON_PROC*)&py3__PyUnicode_AsString}, 44907 48663 + {"PyBytes_AsString", (PYTHON_PROC*)&py3_PyBytes_AsString}, 48664 + {"PyBytes_FromString", (PYTHON_PROC*)&py3_PyBytes_FromString}, 48665 + {"PyFloat_FromDouble", (PYTHON_PROC*)&py3_PyFloat_FromDouble}, 48666 + {"PyFloat_AsDouble", (PYTHON_PROC*)&py3_PyFloat_AsDouble}, 44908 48667 {"PyObject_GenericGetAttr", (PYTHON_PROC*)&py3_PyObject_GenericGetAttr}, 44909 48668 {"PyModule_Create2", (PYTHON_PROC*)&py3_PyModule_Create2}, … … 44911 48670 {"PyType_GenericNew", (PYTHON_PROC*)&py3_PyType_GenericNew}, 44912 48671 {"PySlice_Type", (PYTHON_PROC*)&py3_PySlice_Type}, 48672 + {"PyFloat_Type", (PYTHON_PROC*)&py3_PyFloat_Type}, 44913 48673 + {"PyErr_NewException", (PYTHON_PROC*)&py3_PyErr_NewException}, 44914 48674 # ifdef Py_DEBUG 44915 48675 {"_Py_NegativeRefcount", (PYTHON_PROC*)&py3__Py_NegativeRefcount}, 44916 48676 {"_Py_RefTotal", (PYTHON_PROC*)&py3__Py_RefTotal}, 44917 @@ -334,15 +359,16 @@ 48677 @@ -309,6 +399,9 @@ 48678 {"PyObject_Malloc", (PYTHON_PROC*)&py3_PyObject_Malloc}, 48679 {"PyObject_Free", (PYTHON_PROC*)&py3_PyObject_Free}, 48680 # endif 48681 + {"PyType_IsSubtype", (PYTHON_PROC*)&py3_PyType_IsSubtype}, 48682 + {"PyCapsule_New", (PYTHON_PROC*)&py3_PyCapsule_New}, 48683 + {"PyCapsule_GetPointer", (PYTHON_PROC*)&py3_PyCapsule_GetPointer}, 48684 {"", NULL}, 48685 }; 48686 48687 @@ -334,15 +427,16 @@ 44918 48688 py3_runtime_link_init(char *libname, int verbose) 44919 48689 { … … 44935 48705 } 44936 48706 # endif 44937 @@ -374,19 +4 00,24 @@48707 @@ -374,19 +468,24 @@ 44938 48708 /* Load unicode functions separately as only the ucs2 or the ucs4 functions 44939 48709 * will be present in the library. */ … … 44967 48737 else 44968 48738 { 44969 @@ -437, 6 +468,7@@48739 @@ -437,14 +536,45 @@ 44970 48740 static PyObject *BufferNew (buf_T *); 44971 48741 static PyObject *WindowNew(win_T *); … … 44975 48745 static PyTypeObject RangeType; 44976 48746 44977 @@ -539,14 +571,18 @@ 48747 +static int py3initialised = 0; 48748 + 48749 +#define PYINITIALISED py3initialised 48750 + 48751 +/* Add conversion from PyInt? */ 48752 +#define DICTKEY_GET(err) \ 48753 + if (PyBytes_Check(keyObject)) \ 48754 + key = (char_u *) PyBytes_AsString(keyObject); \ 48755 + else if (PyUnicode_Check(keyObject)) \ 48756 + { \ 48757 + bytes = PyString_AsBytes(keyObject); \ 48758 + if (bytes == NULL) \ 48759 + return err; \ 48760 + key = (char_u *) PyBytes_AsString(bytes); \ 48761 + if (key == NULL) \ 48762 + return err; \ 48763 + } \ 48764 + else \ 48765 + { \ 48766 + PyErr_SetString(PyExc_TypeError, _("only string keys are allowed")); \ 48767 + return err; \ 48768 + } 48769 +#define DICTKEY_UNREF \ 48770 + if (bytes != NULL) \ 48771 + Py_XDECREF(bytes); 48772 + 48773 +#define DICTKEY_DECL PyObject *bytes = NULL; 48774 + 48775 /* 48776 * Include the code shared with if_python.c 48777 */ 48778 #include "if_py_both.h" 48779 48780 +#define PY3OBJ_DELETED(obj) (obj->ob_base.ob_refcnt<=0) 48781 + 48782 static void 48783 call_PyObject_Free(void *p) 48784 { 48785 @@ -474,6 +604,8 @@ 48786 static Py_ssize_t RangeStart; 48787 static Py_ssize_t RangeEnd; 48788 48789 +static PyObject *globals; 48790 + 48791 static int PythonIO_Init(void); 48792 static void PythonIO_Fini(void); 48793 PyMODINIT_FUNC Py3Init_vim(void); 48794 @@ -482,8 +614,6 @@ 48795 * 1. Python interpreter main program. 48796 */ 48797 48798 -static int py3initialised = 0; 48799 - 48800 static PyGILState_STATE pygilstate = PyGILState_UNLOCKED; 48801 48802 void 48803 @@ -539,14 +669,18 @@ 44978 48804 44979 48805 init_structs(); … … 44996 48822 #ifdef DYNAMIC_PYTHON3 44997 48823 get_py3_exceptions(); 44998 @@ -560,8 +596,11 @@ 48824 @@ -557,11 +691,16 @@ 48825 48826 PyImport_AppendInittab("vim", Py3Init_vim); 48827 48828 + globals = PyModule_GetDict(PyImport_AddModule("__main__")); 48829 + 44999 48830 /* Remove the element from sys.path that was added because of our 45000 48831 * argv[0] value in Py3Init_vim(). Previously we used an empty … … 45010 48841 // lock is created and acquired in PyEval_InitThreads() and thread 45011 48842 // state is created in Py_Initialize() 45012 @@ -598,6 +637,8 @@ 48843 @@ -590,7 +729,7 @@ 48844 * External interface 48845 */ 48846 static void 48847 -DoPy3Command(exarg_T *eap, const char *cmd) 48848 +DoPy3Command(exarg_T *eap, const char *cmd, typval_T *rettv) 48849 { 48850 #if defined(MACOS) && !defined(MACOS_X_UNIX) 48851 GrafPtr oldPort; 48852 @@ -598,6 +737,8 @@ 45013 48853 #if defined(HAVE_LOCALE_H) || defined(X_LOCALE) 45014 48854 char *saved_locale; … … 45019 48859 #if defined(MACOS) && !defined(MACOS_X_UNIX) 45020 48860 GetPort(&oldPort); 45021 @@ -627,7 +668,14 @@ 48861 @@ -608,8 +749,16 @@ 48862 if (Python3_Init()) 48863 goto theend; 48864 48865 - RangeStart = eap->line1; 48866 - RangeEnd = eap->line2; 48867 + if (rettv == NULL) 48868 + { 48869 + RangeStart = eap->line1; 48870 + RangeEnd = eap->line2; 48871 + } 48872 + else 48873 + { 48874 + RangeStart = (PyInt) curwin->w_cursor.lnum; 48875 + RangeEnd = RangeStart; 48876 + } 48877 Python_Release_Vim(); /* leave vim */ 48878 48879 #if defined(HAVE_LOCALE_H) || defined(X_LOCALE) 48880 @@ -627,7 +776,31 @@ 45022 48881 45023 48882 pygilstate = PyGILState_Ensure(); … … 45030 48889 + cmdbytes = PyUnicode_AsEncodedString(cmdstr, "utf-8", CODEC_ERROR_HANDLER); 45031 48890 + Py_XDECREF(cmdstr); 45032 + PyRun_SimpleString(PyBytes_AsString(cmdbytes)); 48891 + if (rettv == NULL) 48892 + PyRun_SimpleString(PyBytes_AsString(cmdbytes)); 48893 + else 48894 + { 48895 + PyObject *r; 48896 + 48897 + r = PyRun_String(PyBytes_AsString(cmdbytes), Py_eval_input, 48898 + globals, globals); 48899 + if (r == NULL) 48900 + EMSG(_("E860: Eval did not return a valid python 3 object")); 48901 + else 48902 + { 48903 + if (ConvertFromPyObject(r, rettv) == -1) 48904 + EMSG(_("E861: Failed to convert returned python 3 object to vim value")); 48905 + Py_DECREF(r); 48906 + } 48907 + PyErr_Clear(); 48908 + } 45033 48909 + Py_XDECREF(cmdbytes); 45034 48910 45035 48911 PyGILState_Release(pygilstate); 45036 48912 45037 @@ -686,7 +734,10 @@ 48913 @@ -661,9 +834,9 @@ 48914 if (!eap->skip) 48915 { 48916 if (script == NULL) 48917 - DoPy3Command(eap, (char *)eap->arg); 48918 + DoPy3Command(eap, (char *)eap->arg, NULL); 48919 else 48920 - DoPy3Command(eap, (char *)script); 48921 + DoPy3Command(eap, (char *)script, NULL); 48922 } 48923 vim_free(script); 48924 } 48925 @@ -686,7 +859,10 @@ 45038 48926 * different options under Windows, meaning that stdio pointers aren't 45039 48927 * compatible between the two. Yuk. … … 45047 48935 * We need to escape any backslashes or single quotes in the file name, so that 45048 48936 * Python won't mangle the file name. 45049 @@ -709,8 + 760,8 @@48937 @@ -709,8 +885,8 @@ 45050 48938 return; 45051 48939 if (i==0) … … 45058 48946 else 45059 48947 { 45060 @@ -805,8 +856,8 @@ 48948 @@ -721,7 +897,7 @@ 48949 48950 48951 /* Execute the file */ 48952 - DoPy3Command(eap, buffer); 48953 + DoPy3Command(eap, buffer, NULL); 48954 } 48955 48956 /****************************************************** 48957 @@ -751,14 +927,16 @@ 48958 if (PyUnicode_Check(nameobj)) 48959 name = _PyUnicode_AsString(nameobj); 48960 48961 - if (val == NULL) { 48962 + if (val == NULL) 48963 + { 48964 PyErr_SetString(PyExc_AttributeError, _("can't delete OutputObject attributes")); 48965 return -1; 48966 } 48967 48968 if (strcmp(name, "softspace") == 0) 48969 { 48970 - if (!PyLong_Check(val)) { 48971 + if (!PyLong_Check(val)) 48972 + { 48973 PyErr_SetString(PyExc_TypeError, _("softspace must be an integer")); 48974 return -1; 48975 } 48976 @@ -805,8 +983,8 @@ 45061 48977 45062 48978 static Py_ssize_t BufferLength(PyObject *); … … 45069 48985 45070 48986 /* Line range type - Implementation functions 45071 @@ -815,8 + 866,9 @@48987 @@ -815,8 +993,9 @@ 45072 48988 45073 48989 #define RangeType_Check(obj) ((obj)->ob_base.ob_type == &RangeType) … … 45080 48996 /* Current objects type - Implementation functions 45081 48997 * ----------------------------------------------- 45082 @@ -828,7 + 880,7 @@48998 @@ -828,7 +1007,7 @@ 45083 48999 (ssizeargfunc) 0, /* sq_repeat, x*n */ 45084 49000 (ssizeargfunc) BufferItem, /* sq_item, x[i] */ … … 45089 49005 0, /* sq_contains */ 45090 49006 0, /* sq_inplace_concat */ 45091 @@ -838,7 + 890,7 @@49007 @@ -838,7 +1017,7 @@ 45092 49008 PyMappingMethods BufferAsMapping = { 45093 49009 /* mp_length */ (lenfunc)BufferLength, … … 45098 49014 45099 49015 45100 @@ -890,6 + 942,8 @@49016 @@ -890,6 +1069,8 @@ 45101 49017 45102 49018 if (this->buf && this->buf != INVALID_BUFFER_VALUE) … … 45107 49023 45108 49024 static PyObject * 45109 @@ -908,13 + 962,18 @@49025 @@ -908,13 +1089,18 @@ 45110 49026 return Py_BuildValue("s", this->buf->b_ffname); 45111 49027 else if (strcmp(name, "number") == 0) … … 45128 49044 { 45129 49045 static char repr[100]; 45130 @@ -968, 15 +1027,6@@49046 @@ -968,37 +1154,64 @@ 45131 49047 (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count); 45132 49048 } … … 45144 49060 BufferSubscript(PyObject *self, PyObject* idx) 45145 49061 { 45146 @@ -986,19 +1036,45 @@ 45147 } else if (PySlice_Check(idx)) { 49062 - if (PyLong_Check(idx)) { 49063 + if (PyLong_Check(idx)) 49064 + { 49065 long _idx = PyLong_AsLong(idx); 49066 return BufferItem(self,_idx); 49067 - } else if (PySlice_Check(idx)) { 49068 + } else if (PySlice_Check(idx)) 49069 + { 45148 49070 Py_ssize_t start, stop, step, slicelen; 45149 49071 … … 45152 49074 (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count+1, 45153 49075 &start, &stop, 45154 &step, &slicelen) < 0) { 49076 - &step, &slicelen) < 0) { 49077 + &step, &slicelen) < 0) 49078 + { 45155 49079 return NULL; 45156 49080 } 45157 49081 - return BufferSlice(self,start,stop+1); 49082 - } else { 45158 49083 + return BufferSlice(self, start, stop); 45159 } else { 49084 + } 49085 + else 49086 + { 45160 49087 PyErr_SetString(PyExc_IndexError, "Index must be int or slice"); 45161 49088 return NULL; … … 45166 49093 +BufferAsSubscript(PyObject *self, PyObject* idx, PyObject* val) 45167 49094 +{ 45168 + if (PyLong_Check(idx)) { 49095 + if (PyLong_Check(idx)) 49096 + { 45169 49097 + long n = PyLong_AsLong(idx); 45170 49098 + return RBAsItem((BufferObject *)(self), n, val, 1, 45171 49099 + (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count, 45172 49100 + NULL); 45173 + } else if (PySlice_Check(idx)) { 49101 + } else if (PySlice_Check(idx)) 49102 + { 45174 49103 + Py_ssize_t start, stop, step, slicelen; 45175 49104 + … … 45177 49106 + (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count+1, 45178 49107 + &start, &stop, 45179 + &step, &slicelen) < 0) { 49108 + &step, &slicelen) < 0) 49109 + { 45180 49110 + return -1; 45181 49111 + } … … 45183 49113 + (PyInt)((BufferObject *)(self))->buf->b_ml.ml_line_count, 45184 49114 + NULL); 45185 + } else { 49115 + } 49116 + else 49117 + { 45186 49118 + PyErr_SetString(PyExc_IndexError, "Index must be int or slice"); 45187 49119 + return -1; … … 45192 49124 (lenfunc) RangeLength, /* sq_length, len(x) */ 45193 49125 (binaryfunc) 0, /* RangeConcat, sq_concat, x+y */ 45194 @@ -1015,7 +1 091,7 @@49126 @@ -1015,7 +1228,7 @@ 45195 49127 PyMappingMethods RangeAsMapping = { 45196 49128 /* mp_length */ (lenfunc)RangeLength, … … 45201 49133 45202 49134 /* Line range object - Implementation 45203 @@ -1025,6 +1 101,7 @@49135 @@ -1025,6 +1238,7 @@ 45204 49136 RangeDestructor(PyObject *self) 45205 49137 { … … 45209 49141 45210 49142 static PyObject * 45211 @@ -1053, 6 +1130,15@@49143 @@ -1053,28 +1267,70 @@ 45212 49144 &((RangeObject *)(self))->end); 45213 49145 } … … 45225 49157 RangeSubscript(PyObject *self, PyObject* idx) 45226 49158 { 45227 @@ -1062,19 +1148,42 @@ 45228 } else if (PySlice_Check(idx)) { 49159 - if (PyLong_Check(idx)) { 49160 + if (PyLong_Check(idx)) 49161 + { 49162 long _idx = PyLong_AsLong(idx); 49163 return RangeItem(self,_idx); 49164 - } else if (PySlice_Check(idx)) { 49165 + } else if (PySlice_Check(idx)) 49166 + { 45229 49167 Py_ssize_t start, stop, step, slicelen; 45230 49168 … … 45233 49171 ((RangeObject *)(self))->end-((RangeObject *)(self))->start+1, 45234 49172 &start, &stop, 45235 &step, &slicelen) < 0) { 49173 - &step, &slicelen) < 0) { 49174 + &step, &slicelen) < 0) 49175 + { 45236 49176 return NULL; 45237 49177 } 45238 49178 - return RangeSlice(self,start,stop+1); 49179 - } else { 45239 49180 + return RangeSlice(self, start, stop); 45240 } else { 49181 + } 49182 + else 49183 + { 45241 49184 PyErr_SetString(PyExc_IndexError, "Index must be int or slice"); 45242 49185 return NULL; … … 45247 49190 +RangeAsSubscript(PyObject *self, PyObject *idx, PyObject *val) 45248 49191 +{ 45249 + if (PyLong_Check(idx)) { 49192 + if (PyLong_Check(idx)) 49193 + { 45250 49194 + long n = PyLong_AsLong(idx); 45251 49195 + return RangeAsItem(self, n, val); 45252 + } else if (PySlice_Check(idx)) { 49196 + } else if (PySlice_Check(idx)) 49197 + { 45253 49198 + Py_ssize_t start, stop, step, slicelen; 45254 49199 + … … 45256 49201 + ((RangeObject *)(self))->end-((RangeObject *)(self))->start+1, 45257 49202 + &start, &stop, 45258 + &step, &slicelen) < 0) { 49203 + &step, &slicelen) < 0) 49204 + { 45259 49205 + return -1; 45260 49206 + } 45261 49207 + return RangeAsSlice(self, start, stop, val); 45262 + } else { 49208 + } 49209 + else 49210 + { 45263 49211 + PyErr_SetString(PyExc_IndexError, "Index must be int or slice"); 45264 49212 + return -1; … … 45270 49218 */ 45271 49219 45272 @@ -1152,6 +1 261,8 @@49220 @@ -1152,6 +1408,8 @@ 45273 49221 45274 49222 if (this->win && this->win != INVALID_WINDOW_VALUE) … … 45279 49227 45280 49228 static PyObject * 45281 @@ -1343,8 +1454,11 @@ 49229 @@ -1279,6 +1537,147 @@ 49230 } 49231 } 49232 49233 +/* Dictionary object - Definitions 49234 + */ 49235 + 49236 +static PyInt DictionaryLength(PyObject *); 49237 + 49238 +static PyMappingMethods DictionaryAsMapping = { 49239 + /* mp_length */ (lenfunc) DictionaryLength, 49240 + /* mp_subscript */ (binaryfunc) DictionaryItem, 49241 + /* mp_ass_subscript */ (objobjargproc) DictionaryAssItem, 49242 +}; 49243 + 49244 +static PyTypeObject DictionaryType; 49245 + 49246 + static void 49247 +DictionaryDestructor(PyObject *self) 49248 +{ 49249 + DictionaryObject *this = (DictionaryObject *)(self); 49250 + 49251 + pyll_remove(&this->ref, &lastdict); 49252 + dict_unref(this->dict); 49253 + 49254 + Py_TYPE(self)->tp_free((PyObject*)self); 49255 +} 49256 + 49257 +/* List object - Definitions 49258 + */ 49259 + 49260 +static PyInt ListLength(PyObject *); 49261 +static PyObject *ListItem(PyObject *, Py_ssize_t); 49262 + 49263 +static PySequenceMethods ListAsSeq = { 49264 + (lenfunc) ListLength, /* sq_length, len(x) */ 49265 + (binaryfunc) 0, /* RangeConcat, sq_concat, x+y */ 49266 + (ssizeargfunc) 0, /* RangeRepeat, sq_repeat, x*n */ 49267 + (ssizeargfunc) ListItem, /* sq_item, x[i] */ 49268 + (void *) 0, /* was_sq_slice, x[i:j] */ 49269 + (ssizeobjargproc) ListAssItem, /* sq_as_item, x[i]=v */ 49270 + (void *) 0, /* was_sq_ass_slice, x[i:j]=v */ 49271 + 0, /* sq_contains */ 49272 + (binaryfunc) ListConcatInPlace,/* sq_inplace_concat */ 49273 + 0, /* sq_inplace_repeat */ 49274 +}; 49275 + 49276 +static PyObject *ListSubscript(PyObject *, PyObject *); 49277 +static Py_ssize_t ListAsSubscript(PyObject *, PyObject *, PyObject *); 49278 + 49279 +static PyMappingMethods ListAsMapping = { 49280 + /* mp_length */ (lenfunc) ListLength, 49281 + /* mp_subscript */ (binaryfunc) ListSubscript, 49282 + /* mp_ass_subscript */ (objobjargproc) ListAsSubscript, 49283 +}; 49284 + 49285 +static PyTypeObject ListType; 49286 + 49287 + static PyObject * 49288 +ListSubscript(PyObject *self, PyObject* idxObject) 49289 +{ 49290 + if (PyLong_Check(idxObject)) 49291 + { 49292 + long idx = PyLong_AsLong(idxObject); 49293 + return ListItem(self, idx); 49294 + } 49295 + else if (PySlice_Check(idxObject)) 49296 + { 49297 + Py_ssize_t start, stop, step, slicelen; 49298 + 49299 + if (PySlice_GetIndicesEx(idxObject, ListLength(self), &start, &stop, 49300 + &step, &slicelen) < 0) 49301 + return NULL; 49302 + return ListSlice(self, start, stop); 49303 + } 49304 + else 49305 + { 49306 + PyErr_SetString(PyExc_IndexError, "Index must be int or slice"); 49307 + return NULL; 49308 + } 49309 +} 49310 + 49311 + static Py_ssize_t 49312 +ListAsSubscript(PyObject *self, PyObject *idxObject, PyObject *obj) 49313 +{ 49314 + if (PyLong_Check(idxObject)) 49315 + { 49316 + long idx = PyLong_AsLong(idxObject); 49317 + return ListAssItem(self, idx, obj); 49318 + } 49319 + else if (PySlice_Check(idxObject)) 49320 + { 49321 + Py_ssize_t start, stop, step, slicelen; 49322 + 49323 + if (PySlice_GetIndicesEx(idxObject, ListLength(self), &start, &stop, 49324 + &step, &slicelen) < 0) 49325 + return -1; 49326 + return ListAssSlice(self, start, stop, obj); 49327 + } 49328 + else 49329 + { 49330 + PyErr_SetString(PyExc_IndexError, "Index must be int or slice"); 49331 + return -1; 49332 + } 49333 +} 49334 + 49335 + static void 49336 +ListDestructor(PyObject *self) 49337 +{ 49338 + ListObject *this = (ListObject *)(self); 49339 + 49340 + pyll_remove(&this->ref, &lastlist); 49341 + list_unref(this->list); 49342 + 49343 + Py_TYPE(self)->tp_free((PyObject*)self); 49344 +} 49345 + 49346 +/* Function object - Definitions 49347 + */ 49348 + 49349 + static void 49350 +FunctionDestructor(PyObject *self) 49351 +{ 49352 + FunctionObject *this = (FunctionObject *) (self); 49353 + 49354 + func_unref(this->name); 49355 + PyMem_Del(this->name); 49356 + 49357 + Py_TYPE(self)->tp_free((PyObject*)self); 49358 +} 49359 + 49360 + static PyObject * 49361 +FunctionGetattro(PyObject *self, PyObject *nameobj) 49362 +{ 49363 + FunctionObject *this = (FunctionObject *)(self); 49364 + char *name = ""; 49365 + if (PyUnicode_Check(nameobj)) 49366 + name = _PyUnicode_AsString(nameobj); 49367 + 49368 + if (strcmp(name, "name") == 0) 49369 + return PyUnicode_FromString((char *)(this->name)); 49370 + 49371 + return PyObject_GenericGetAttr(self, nameobj); 49372 +} 49373 + 49374 /* External interface 49375 */ 49376 49377 @@ -1338,13 +1737,19 @@ 49378 PyType_Ready(&BufListType); 49379 PyType_Ready(&WinListType); 49380 PyType_Ready(&CurrentType); 49381 + PyType_Ready(&DictionaryType); 49382 + PyType_Ready(&ListType); 49383 + PyType_Ready(&FunctionType); 49384 49385 /* Set sys.argv[] to avoid a crash in warn(). */ 45282 49386 PySys_SetArgv(1, argv); 45283 49387 … … 45292 49396 PyModule_AddObject(mod, "error", VimError); 45293 49397 Py_INCREF((PyObject *)(void *)&TheBufferList); 45294 @@ -1397, 7 +1511,7@@49398 @@ -1397,12 +1802,30 @@ 45295 49399 } 45296 49400 *p = '\0'; … … 45301 49405 vim_free(tmp); 45302 49406 return result; 49407 } 49408 49409 + void 49410 +do_py3eval (char_u *str, typval_T *rettv) 49411 +{ 49412 + DoPy3Command(NULL, (char *) str, rettv); 49413 + switch(rettv->v_type) 49414 + { 49415 + case VAR_DICT: ++rettv->vval.v_dict->dv_refcount; break; 49416 + case VAR_LIST: ++rettv->vval.v_list->lv_refcount; break; 49417 + case VAR_FUNC: func_ref(rettv->vval.v_string); break; 49418 + } 49419 +} 49420 + 49421 + void 49422 +set_ref_in_python3 (int copyID) 49423 +{ 49424 + set_ref_in_py(copyID); 49425 +} 49426 + 49427 static void 49428 init_structs(void) 49429 { 49430 @@ -1484,6 +1907,35 @@ 49431 CurrentType.tp_flags = Py_TPFLAGS_DEFAULT; 49432 CurrentType.tp_doc = "vim current object"; 49433 49434 + vim_memset(&DictionaryType, 0, sizeof(DictionaryType)); 49435 + DictionaryType.tp_name = "vim.dictionary"; 49436 + DictionaryType.tp_basicsize = sizeof(DictionaryObject); 49437 + DictionaryType.tp_dealloc = DictionaryDestructor; 49438 + DictionaryType.tp_as_mapping = &DictionaryAsMapping; 49439 + DictionaryType.tp_flags = Py_TPFLAGS_DEFAULT; 49440 + DictionaryType.tp_doc = "dictionary pushing modifications to vim structure"; 49441 + DictionaryType.tp_methods = DictionaryMethods; 49442 + 49443 + vim_memset(&ListType, 0, sizeof(ListType)); 49444 + ListType.tp_name = "vim.list"; 49445 + ListType.tp_dealloc = ListDestructor; 49446 + ListType.tp_basicsize = sizeof(ListObject); 49447 + ListType.tp_as_sequence = &ListAsSeq; 49448 + ListType.tp_as_mapping = &ListAsMapping; 49449 + ListType.tp_flags = Py_TPFLAGS_DEFAULT; 49450 + ListType.tp_doc = "list pushing modifications to vim structure"; 49451 + ListType.tp_methods = ListMethods; 49452 + 49453 + vim_memset(&FunctionType, 0, sizeof(FunctionType)); 49454 + FunctionType.tp_name = "vim.list"; 49455 + FunctionType.tp_basicsize = sizeof(FunctionObject); 49456 + FunctionType.tp_getattro = FunctionGetattro; 49457 + FunctionType.tp_dealloc = FunctionDestructor; 49458 + FunctionType.tp_call = FunctionCall; 49459 + FunctionType.tp_flags = Py_TPFLAGS_DEFAULT; 49460 + FunctionType.tp_doc = "object that calls vim function"; 49461 + FunctionType.tp_methods = FunctionMethods; 49462 + 49463 vim_memset(&vimmodule, 0, sizeof(vimmodule)); 49464 vimmodule.m_name = "vim"; 49465 vimmodule.m_doc = vim_module_doc; 45303 49466 diff -Naur vim73.orig/src/if_ruby.c vim73/src/if_ruby.c 45304 --- vim73.orig/src/if_ruby.c 201 2-06-03 23:09:52.948007269+000045305 +++ vim73/src/if_ruby.c 2012-0 6-03 23:09:55.752081889+000049467 --- vim73.orig/src/if_ruby.c 2010-06-30 19:33:12.000000000 +0000 49468 +++ vim73/src/if_ruby.c 2012-07-20 20:31:15.810976706 +0000 45306 49469 @@ -4,12 +4,17 @@ 45307 49470 * … … 45696 49859 45697 49860 diff -Naur vim73.orig/src/if_sniff.c vim73/src/if_sniff.c 45698 --- vim73.orig/src/if_sniff.c 201 2-06-03 23:09:52.924006631+000045699 +++ vim73/src/if_sniff.c 2012-0 6-03 23:09:53.508022172 +000049861 --- vim73.orig/src/if_sniff.c 2010-05-15 11:04:06.000000000 +0000 49862 +++ vim73/src/if_sniff.c 2012-07-20 20:31:08.870971712 +0000 45700 49863 @@ -9,7 +9,6 @@ 45701 49864 … … 45707 49870 # include <assert.h> 45708 49871 diff -Naur vim73.orig/src/if_tcl.c vim73/src/if_tcl.c 45709 --- vim73.orig/src/if_tcl.c 201 2-06-03 23:09:52.920006524+000045710 +++ vim73/src/if_tcl.c 2012-0 6-03 23:09:55.492074972+000049872 --- vim73.orig/src/if_tcl.c 2010-08-08 13:07:25.000000000 +0000 49873 +++ vim73/src/if_tcl.c 2012-07-20 20:31:14.990976118 +0000 45711 49874 @@ -74,18 +74,18 @@ 45712 49875 #endif … … 45935 50098 line = (char *)Tcl_GetVar(tclinfo.interp, var_line, 0); 45936 50099 if (line) 50100 diff -Naur vim73.orig/src/if_xcmdsrv.c vim73/src/if_xcmdsrv.c 50101 --- vim73.orig/src/if_xcmdsrv.c 2010-05-15 11:04:08.000000000 +0000 50102 +++ vim73/src/if_xcmdsrv.c 2012-07-20 20:31:17.997644938 +0000 50103 @@ -572,61 +572,55 @@ 50104 { 50105 time_t start; 50106 time_t now; 50107 - time_t lastChk = 0; 50108 XEvent event; 50109 - XPropertyEvent *e = (XPropertyEvent *)&event; 50110 -# define SEND_MSEC_POLL 50 50111 + 50112 +#define UI_MSEC_DELAY 50 50113 +#define SEND_MSEC_POLL 500 50114 +#ifndef HAVE_SELECT 50115 + struct pollfd fds; 50116 + 50117 + fds.fd = ConnectionNumber(dpy); 50118 + fds.events = POLLIN; 50119 +#else 50120 + fd_set fds; 50121 + struct timeval tv; 50122 + 50123 + tv.tv_sec = 0; 50124 + tv.tv_usec = SEND_MSEC_POLL * 1000; 50125 + FD_ZERO(&fds); 50126 + FD_SET(ConnectionNumber(dpy), &fds); 50127 +#endif 50128 50129 time(&start); 50130 - while (endCond(endData) == 0) 50131 + while (TRUE) 50132 { 50133 + while (XCheckWindowEvent(dpy, commWindow, PropertyChangeMask, &event)) 50134 + serverEventProc(dpy, &event); 50135 + 50136 + if (endCond(endData) != 0) 50137 + break; 50138 + if (!WindowValid(dpy, w)) 50139 + break; 50140 time(&now); 50141 if (seconds >= 0 && (now - start) >= seconds) 50142 break; 50143 - if (now != lastChk) 50144 - { 50145 - lastChk = now; 50146 - if (!WindowValid(dpy, w)) 50147 - break; 50148 - /* 50149 - * Sometimes the PropertyChange event doesn't come. 50150 - * This can be seen in eg: vim -c 'echo remote_expr("gvim", "3+2")' 50151 - */ 50152 - serverEventProc(dpy, NULL); 50153 - } 50154 + 50155 + /* Just look out for the answer without calling back into Vim */ 50156 if (localLoop) 50157 { 50158 - /* Just look out for the answer without calling back into Vim */ 50159 #ifndef HAVE_SELECT 50160 - struct pollfd fds; 50161 - 50162 - fds.fd = ConnectionNumber(dpy); 50163 - fds.events = POLLIN; 50164 if (poll(&fds, 1, SEND_MSEC_POLL) < 0) 50165 break; 50166 #else 50167 - fd_set fds; 50168 - struct timeval tv; 50169 - 50170 - tv.tv_sec = 0; 50171 - tv.tv_usec = SEND_MSEC_POLL * 1000; 50172 - FD_ZERO(&fds); 50173 - FD_SET(ConnectionNumber(dpy), &fds); 50174 - if (select(ConnectionNumber(dpy) + 1, &fds, NULL, NULL, &tv) < 0) 50175 + if (select(FD_SETSIZE, &fds, NULL, NULL, &tv) < 0) 50176 break; 50177 #endif 50178 - while (XEventsQueued(dpy, QueuedAfterReading) > 0) 50179 - { 50180 - XNextEvent(dpy, &event); 50181 - if (event.type == PropertyNotify && e->window == commWindow) 50182 - serverEventProc(dpy, &event); 50183 - } 50184 } 50185 else 50186 { 50187 if (got_int) 50188 break; 50189 - ui_delay((long)SEND_MSEC_POLL, TRUE); 50190 + ui_delay((long)UI_MSEC_DELAY, TRUE); 50191 ui_breakcheck(); 50192 } 50193 } 50194 @@ -655,7 +649,6 @@ 50195 if (SendInit(dpy) < 0) 50196 return NULL; 50197 } 50198 - ga_init2(&ga, 1, 100); 50199 50200 /* 50201 * Read the registry property. 50202 @@ -1198,9 +1191,8 @@ 50203 if ((*p == 'c' || *p == 'k') && (p[1] == 0)) 50204 { 50205 Window resWindow; 50206 - char_u *name, *script, *serial, *end, *res; 50207 + char_u *name, *script, *serial, *end; 50208 Bool asKeys = *p == 'k'; 50209 - garray_T reply; 50210 char_u *enc; 50211 50212 /* 50213 @@ -1256,50 +1248,52 @@ 50214 if (script == NULL || name == NULL) 50215 continue; 50216 50217 - /* 50218 - * Initialize the result property, so that we're ready at any 50219 - * time if we need to return an error. 50220 - */ 50221 - if (resWindow != None) 50222 - { 50223 - ga_init2(&reply, 1, 100); 50224 + if (serverName != NULL && STRICMP(name, serverName) == 0) 50225 + { 50226 + script = serverConvert(enc, script, &tofree); 50227 + if (asKeys) 50228 + server_to_input_buf(script); 50229 + else 50230 + { 50231 + char_u *res; 50232 + 50233 + res = eval_client_expr_to_string(script); 50234 + if (resWindow != None) 50235 + { 50236 + garray_T reply; 50237 + 50238 + /* Initialize the result property. */ 50239 + ga_init2(&reply, 1, 100); 50240 #ifdef FEAT_MBYTE 50241 - ga_grow(&reply, 50 + STRLEN(p_enc)); 50242 - sprintf(reply.ga_data, "%cr%c-E %s%c-s %s%c-r ", 50243 + ga_grow(&reply, 50 + STRLEN(p_enc)); 50244 + sprintf(reply.ga_data, "%cr%c-E %s%c-s %s%c-r ", 50245 0, 0, p_enc, 0, serial, 0); 50246 - reply.ga_len = 14 + STRLEN(p_enc) + STRLEN(serial); 50247 + reply.ga_len = 14 + STRLEN(p_enc) + STRLEN(serial); 50248 #else 50249 - ga_grow(&reply, 50); 50250 - sprintf(reply.ga_data, "%cr%c-s %s%c-r ", 0, 0, serial, 0); 50251 - reply.ga_len = 10 + STRLEN(serial); 50252 + ga_grow(&reply, 50); 50253 + sprintf(reply.ga_data, "%cr%c-s %s%c-r ", 50254 + 0, 0, serial, 0); 50255 + reply.ga_len = 10 + STRLEN(serial); 50256 #endif 50257 - } 50258 - res = NULL; 50259 - if (serverName != NULL && STRICMP(name, serverName) == 0) 50260 - { 50261 - script = serverConvert(enc, script, &tofree); 50262 - if (asKeys) 50263 - server_to_input_buf(script); 50264 - else 50265 - res = eval_client_expr_to_string(script); 50266 - vim_free(tofree); 50267 - } 50268 - if (resWindow != None) 50269 - { 50270 - if (res != NULL) 50271 - ga_concat(&reply, res); 50272 - else if (asKeys == 0) 50273 - { 50274 - ga_concat(&reply, (char_u *)_(e_invexprmsg)); 50275 - ga_append(&reply, 0); 50276 - ga_concat(&reply, (char_u *)"-c 1"); 50277 - } 50278 - ga_append(&reply, NUL); 50279 - (void)AppendPropCarefully(dpy, resWindow, commProperty, 50280 - reply.ga_data, reply.ga_len); 50281 - ga_clear(&reply); 50282 - } 50283 - vim_free(res); 50284 + 50285 + /* Evaluate the expression and return the result. */ 50286 + if (res != NULL) 50287 + ga_concat(&reply, res); 50288 + else 50289 + { 50290 + ga_concat(&reply, (char_u *)_(e_invexprmsg)); 50291 + ga_append(&reply, 0); 50292 + ga_concat(&reply, (char_u *)"-c 1"); 50293 + } 50294 + ga_append(&reply, NUL); 50295 + (void)AppendPropCarefully(dpy, resWindow, commProperty, 50296 + reply.ga_data, reply.ga_len); 50297 + ga_clear(&reply); 50298 + } 50299 + vim_free(res); 50300 + } 50301 + vim_free(tofree); 50302 + } 50303 } 50304 else if (*p == 'r' && p[1] == 0) 50305 { 45937 50306 diff -Naur vim73.orig/src/integration.c vim73/src/integration.c 45938 --- vim73.orig/src/integration.c 201 2-06-03 23:09:52.952007375+000045939 +++ vim73/src/integration.c 2012-0 6-03 23:09:53.532022810 +000050307 --- vim73.orig/src/integration.c 2010-08-08 13:09:21.000000000 +0000 50308 +++ vim73/src/integration.c 2012-07-20 20:31:08.974305120 +0000 45940 50309 @@ -33,7 +33,6 @@ 45941 50310 #include <sys/un.h> … … 45947 50316 #include <sys/param.h> 45948 50317 diff -Naur vim73.orig/src/keymap.h vim73/src/keymap.h 45949 --- vim73.orig/src/keymap.h 201 2-06-03 23:09:52.948007269+000045950 +++ vim73/src/keymap.h 2012-0 6-03 23:09:55.220067733+000050318 --- vim73.orig/src/keymap.h 2010-07-25 13:14:04.000000000 +0000 50319 +++ vim73/src/keymap.h 2012-07-20 20:31:14.177642201 +0000 45951 50320 @@ -92,13 +92,13 @@ 45952 50321 */ … … 45985 50354 #define K_TEAROFF TERMCAP2KEY(KS_TEAROFF, KE_FILLER) 45986 50355 diff -Naur vim73.orig/src/link.sh vim73/src/link.sh 45987 --- vim73.orig/src/link.sh 201 2-06-03 23:09:52.924006631+000045988 +++ vim73/src/link.sh 2012-0 6-03 23:09:53.304016743+000050356 --- vim73.orig/src/link.sh 2010-07-21 19:43:29.000000000 +0000 50357 +++ vim73/src/link.sh 2012-07-20 20:31:08.227637914 +0000 45989 50358 @@ -5,7 +5,7 @@ 45990 50359 # libraries when they exist, but this doesn't mean they are needed for Vim. … … 46031 50400 # 46032 50401 diff -Naur vim73.orig/src/macros.h vim73/src/macros.h 46033 --- vim73.orig/src/macros.h 2012-06-03 23:09:52.952007375 +0000 46034 +++ vim73/src/macros.h 2012-06-03 23:09:53.080010781 +0000 46035 @@ -285,3 +285,17 @@ 50402 --- vim73.orig/src/macros.h 2010-07-17 19:41:21.000000000 +0000 50403 +++ vim73/src/macros.h 2012-07-20 20:31:18.307645159 +0000 50404 @@ -259,6 +259,8 @@ 50405 * PTR2CHAR(): get character from pointer. 50406 */ 50407 #ifdef FEAT_MBYTE 50408 +/* Get the length of the character p points to */ 50409 +# define MB_PTR2LEN(p) (has_mbyte ? (*mb_ptr2len)(p) : 1) 50410 /* Advance multi-byte pointer, skip over composing chars. */ 50411 # define mb_ptr_adv(p) p += has_mbyte ? (*mb_ptr2len)(p) : 1 50412 /* Advance multi-byte pointer, do not skip over composing chars. */ 50413 @@ -272,6 +274,7 @@ 50414 # define MB_CHARLEN(p) (has_mbyte ? mb_charlen(p) : (int)STRLEN(p)) 50415 # define PTR2CHAR(p) (has_mbyte ? mb_ptr2char(p) : (int)*(p)) 50416 #else 50417 +# define MB_PTR2LEN(p) 1 50418 # define mb_ptr_adv(p) ++p 50419 # define mb_cptr_adv(p) ++p 50420 # define mb_ptr_back(s, p) --p 50421 @@ -285,3 +288,17 @@ 46036 50422 #else 46037 50423 # define DO_AUTOCHDIR … … 46052 50438 +#endif 46053 50439 diff -Naur vim73.orig/src/main.c vim73/src/main.c 46054 --- vim73.orig/src/main.c 201 2-06-03 23:09:52.920006524+000046055 +++ vim73/src/main.c 2012-0 6-03 23:09:55.792082954 +000050440 --- vim73.orig/src/main.c 2010-08-08 13:09:55.000000000 +0000 50441 +++ vim73/src/main.c 2012-07-20 20:31:15.920976784 +0000 46056 50442 @@ -7,10 +7,6 @@ 46057 50443 * See README.txt for an overview of the Vim source code. … … 46453 50839 * When FEAT_FKMAP is defined, also compile the Farsi source code. 46454 50840 diff -Naur vim73.orig/src/mark.c vim73/src/mark.c 46455 --- vim73.orig/src/mark.c 2012-06-03 23:09:52.932006845 +0000 46456 +++ vim73/src/mark.c 2012-06-03 23:09:53.736028239 +0000 46457 @@ -1750,7 +1750,10 @@ 50841 --- vim73.orig/src/mark.c 2010-08-13 09:14:35.000000000 +0000 50842 +++ vim73/src/mark.c 2012-07-20 20:31:17.910978208 +0000 50843 @@ -98,6 +98,19 @@ 50844 return OK; 50845 } 50846 50847 +#ifdef FEAT_VISUAL 50848 + if (c == '<') 50849 + { 50850 + curbuf->b_visual.vi_start = *pos; 50851 + return OK; 50852 + } 50853 + if (c == '>') 50854 + { 50855 + curbuf->b_visual.vi_end = *pos; 50856 + return OK; 50857 + } 50858 +#endif 50859 + 50860 #ifndef EBCDIC 50861 if (c > 'z') /* some islower() and isupper() cannot handle 50862 characters above 127 */ 50863 @@ -1750,7 +1763,10 @@ 46458 50864 { 46459 50865 if (line[1] != NUL) … … 46468 50874 case '"': curbuf->b_last_cursor = pos; break; 46469 50875 diff -Naur vim73.orig/src/mbyte.c vim73/src/mbyte.c 46470 --- vim73.orig/src/mbyte.c 201 2-06-03 23:09:52.940007057+000046471 +++ vim73/src/mbyte.c 2012-0 6-03 23:09:55.956087319+000050876 --- vim73.orig/src/mbyte.c 2010-07-18 13:05:44.000000000 +0000 50877 +++ vim73/src/mbyte.c 2012-07-20 20:31:16.520977215 +0000 46472 50878 @@ -132,6 +132,7 @@ 46473 50879 static int dbcs_char2cells __ARGS((int c)); … … 46922 51328 if (input_style & XIMPreeditArea) 46923 51329 diff -Naur vim73.orig/src/memfile.c vim73/src/memfile.c 46924 --- vim73.orig/src/memfile.c 201 2-06-03 23:09:52.940007057+000046925 +++ vim73/src/memfile.c 2012-0 6-03 23:09:54.088037608+000051330 --- vim73.orig/src/memfile.c 2010-06-21 02:59:57.000000000 +0000 51331 +++ vim73/src/memfile.c 2012-07-20 20:31:10.797639769 +0000 46926 51332 @@ -32,10 +32,6 @@ 46927 51333 * file is opened. … … 47334 51740 diff -Naur vim73.orig/src/memfile_test.c vim73/src/memfile_test.c 47335 51741 --- vim73.orig/src/memfile_test.c 1970-01-01 00:00:00.000000000 +0000 47336 +++ vim73/src/memfile_test.c 2012-0 6-03 23:09:53.800029943+000051742 +++ vim73/src/memfile_test.c 2012-07-20 20:31:09.837639076 +0000 47337 51743 @@ -0,0 +1,145 @@ 47338 51744 +/* vi:set ts=8 sts=4 sw=4: … … 47482 51888 +} 47483 51889 diff -Naur vim73.orig/src/memline.c vim73/src/memline.c 47484 --- vim73.orig/src/memline.c 201 2-06-03 23:09:52.940007057+000047485 +++ vim73/src/memline.c 2012-0 6-03 23:09:54.908059430+000051890 --- vim73.orig/src/memline.c 2010-08-08 13:11:46.000000000 +0000 51891 +++ vim73/src/memline.c 2012-07-20 20:31:13.220974846 +0000 47486 51892 @@ -42,10 +42,6 @@ 47487 51893 * mf_get(). … … 47769 52175 if (process_still_running && choice >= 4) 47770 52176 diff -Naur vim73.orig/src/menu.c vim73/src/menu.c 47771 --- vim73.orig/src/menu.c 201 2-06-03 23:09:52.940007057+000047772 +++ vim73/src/menu.c 2012-0 6-03 23:09:53.876031965+000052177 --- vim73.orig/src/menu.c 2010-07-14 14:49:01.000000000 +0000 52178 +++ vim73/src/menu.c 2012-07-20 20:31:10.130972621 +0000 47773 52179 @@ -1394,7 +1394,8 @@ 47774 52180 int idx; … … 47816 52222 { 47817 52223 diff -Naur vim73.orig/src/message.c vim73/src/message.c 47818 --- vim73.orig/src/message.c 201 2-06-03 23:09:52.956007482+000047819 +++ vim73/src/message.c 2012-0 6-03 23:09:55.664079548+000052224 --- vim73.orig/src/message.c 2010-08-04 18:10:02.000000000 +0000 52225 +++ vim73/src/message.c 2012-07-20 20:31:15.594309884 +0000 47820 52226 @@ -39,7 +39,6 @@ 47821 52227 static void msg_screen_putchar __ARGS((int c, int attr)); … … 48408 52814 case 2: return VIM_NO; 48409 52815 diff -Naur vim73.orig/src/misc1.c vim73/src/misc1.c 48410 --- vim73.orig/src/misc1.c 201 2-06-03 23:09:52.944007163+000048411 +++ vim73/src/misc1.c 2012-0 6-03 23:09:55.940086894+000052816 --- vim73.orig/src/misc1.c 2010-08-15 11:24:05.000000000 +0000 52817 +++ vim73/src/misc1.c 2012-07-20 20:31:17.904311537 +0000 48412 52818 @@ -363,7 +363,7 @@ 48413 52819 … … 48428 52834 todo -= (int)curbuf->b_p_ts; 48429 52835 ++ind_len; 48430 @@ -1561,6 +1561,9 @@ 52836 @@ -423,27 +423,36 @@ 52837 { 52838 colnr_T col; 52839 pos_T pos; 52840 - regmmatch_T regmatch; 52841 + 52842 + regmatch_T regmatch; 52843 + int lead_len = 0; /* length of comment leader */ 52844 52845 if (lnum > curbuf->b_ml.ml_line_count) 52846 return -1; 52847 pos.lnum = 0; 52848 + 52849 +#ifdef FEAT_COMMENTS 52850 + /* In format_lines() (i.e. not insert mode), fo+=q is needed too... */ 52851 + if ((State & INSERT) || has_format_option(FO_Q_COMS)) 52852 + lead_len = get_leader_len(ml_get(lnum), NULL, FALSE, TRUE); 52853 +#endif 52854 regmatch.regprog = vim_regcomp(curbuf->b_p_flp, RE_MAGIC); 52855 if (regmatch.regprog != NULL) 52856 { 52857 - regmatch.rmm_ic = FALSE; 52858 - regmatch.rmm_maxcol = 0; 52859 - if (vim_regexec_multi(®match, curwin, curbuf, lnum, 52860 - (colnr_T)0, NULL)) 52861 + regmatch.rm_ic = FALSE; 52862 + 52863 + /* vim_regexec() expects a pointer to a line. This lets us 52864 + * start matching for the flp beyond any comment leader... */ 52865 + if (vim_regexec(®match, ml_get(lnum) + lead_len, (colnr_T)0)) 52866 { 52867 - pos.lnum = regmatch.endpos[0].lnum + lnum; 52868 - pos.col = regmatch.endpos[0].col; 52869 + pos.lnum = lnum; 52870 + pos.col = (colnr_T)(*regmatch.endp - ml_get(lnum)); 52871 #ifdef FEAT_VIRTUALEDIT 52872 pos.coladd = 0; 52873 #endif 52874 } 52875 - vim_free(regmatch.regprog); 52876 } 52877 + vim_free(regmatch.regprog); 52878 52879 if (pos.lnum == 0 || *ml_get_pos(&pos) == NUL) 52880 return -1; 52881 @@ -502,14 +511,18 @@ 52882 * OPENLINE_DO_COM format comments 52883 * OPENLINE_KEEPTRAIL keep trailing spaces 52884 * OPENLINE_MARKFIX adjust mark positions after the line break 52885 + * OPENLINE_COM_LIST format comments with list or 2nd line indent 52886 + * 52887 + * "second_line_indent": indent for after ^^D in Insert mode or if flag 52888 + * OPENLINE_COM_LIST 52889 * 52890 * Return TRUE for success, FALSE for failure 52891 */ 52892 int 52893 -open_line(dir, flags, old_indent) 52894 +open_line(dir, flags, second_line_indent) 52895 int dir; /* FORWARD or BACKWARD */ 52896 int flags; 52897 - int old_indent; /* indent for after ^^D in Insert mode */ 52898 + int second_line_indent; 52899 { 52900 char_u *saved_line; /* copy of the original line */ 52901 char_u *next_line = NULL; /* copy of the next line */ 52902 @@ -650,8 +663,8 @@ 52903 * count white space on current line 52904 */ 52905 newindent = get_indent_str(saved_line, (int)curbuf->b_p_ts); 52906 - if (newindent == 0) 52907 - newindent = old_indent; /* for ^^D command in insert mode */ 52908 + if (newindent == 0 && !(flags & OPENLINE_COM_LIST)) 52909 + newindent = second_line_indent; /* for ^^D command in insert mode */ 52910 52911 #ifdef FEAT_SMARTINDENT 52912 /* 52913 @@ -671,7 +684,7 @@ 52914 ptr = saved_line; 52915 # ifdef FEAT_COMMENTS 52916 if (flags & OPENLINE_DO_COM) 52917 - lead_len = get_leader_len(ptr, NULL, FALSE); 52918 + lead_len = get_leader_len(ptr, NULL, FALSE, TRUE); 52919 else 52920 lead_len = 0; 52921 # endif 52922 @@ -693,7 +706,7 @@ 52923 } 52924 # ifdef FEAT_COMMENTS 52925 if (flags & OPENLINE_DO_COM) 52926 - lead_len = get_leader_len(ptr, NULL, FALSE); 52927 + lead_len = get_leader_len(ptr, NULL, FALSE, TRUE); 52928 else 52929 lead_len = 0; 52930 if (lead_len > 0) 52931 @@ -836,7 +849,7 @@ 52932 */ 52933 end_comment_pending = NUL; 52934 if (flags & OPENLINE_DO_COM) 52935 - lead_len = get_leader_len(saved_line, &lead_flags, dir == BACKWARD); 52936 + lead_len = get_leader_len(saved_line, &lead_flags, dir == BACKWARD, TRUE); 52937 else 52938 lead_len = 0; 52939 if (lead_len > 0) 52940 @@ -1007,9 +1020,9 @@ 52941 } 52942 if (lead_len) 52943 { 52944 - /* allocate buffer (may concatenate p_exta later) */ 52945 - leader = alloc(lead_len + lead_repl_len + extra_space + 52946 - extra_len + 1); 52947 + /* allocate buffer (may concatenate p_extra later) */ 52948 + leader = alloc(lead_len + lead_repl_len + extra_space + extra_len 52949 + + (second_line_indent > 0 ? second_line_indent : 0) + 1); 52950 allocated = leader; /* remember to free it later */ 52951 52952 if (leader == NULL) 52953 @@ -1304,6 +1317,21 @@ 52954 /* concatenate leader and p_extra, if there is a leader */ 52955 if (lead_len) 52956 { 52957 + if (flags & OPENLINE_COM_LIST && second_line_indent > 0) 52958 + { 52959 + int i; 52960 + int padding = second_line_indent 52961 + - (newindent + (int)STRLEN(leader)); 52962 + 52963 + /* Here whitespace is inserted after the comment char. 52964 + * Below, set_indent(newindent, SIN_INSERT) will insert the 52965 + * whitespace needed before the comment char. */ 52966 + for (i = 0; i < padding; i++) 52967 + { 52968 + STRCAT(leader, " "); 52969 + newcol++; 52970 + } 52971 + } 52972 STRCAT(leader, p_extra); 52973 p_extra = leader; 52974 did_ai = TRUE; /* So truncating blanks works with comments */ 52975 @@ -1548,28 +1576,35 @@ 52976 * When "flags" is not NULL, it is set to point to the flags of the recognized 52977 * comment leader. 52978 * "backward" must be true for the "O" command. 52979 + * If "include_space" is set, include trailing whitespace while calculating the 52980 + * length. 52981 */ 52982 int 52983 -get_leader_len(line, flags, backward) 52984 +get_leader_len(line, flags, backward, include_space) 52985 char_u *line; 52986 char_u **flags; 52987 int backward; 52988 + int include_space; 52989 { 52990 int i, j; 52991 + int result; 52992 int got_com = FALSE; 52993 int found_one; 48431 52994 char_u part_buf[COM_MAX_LEN]; /* buffer for one option part */ 48432 52995 char_u *string; /* pointer to comment string */ … … 48436 52999 + char_u *saved_flags = NULL; 48437 53000 48438 i = 0; 53001 - i = 0; 53002 + result = i = 0; 48439 53003 while (vim_iswhite(line[i])) /* leading white space is ignored */ 48440 @@ -1569,7 +1572,7 @@ 53004 ++i; 53005 48441 53006 /* 48442 53007 * Repeat to match several nested comment strings. … … 48447 53012 /* 48448 53013 * scan through the 'comments' option for a match 48449 @@ -1577, 82 +1580,104@@53014 @@ -1577,29 +1612,161 @@ 48450 53015 found_one = FALSE; 48451 53016 for (list = curbuf->b_p_com; *list; ) … … 48489 53054 continue; 48490 53055 48491 - /*48492 - * Line contents and string must match.48493 53056 + /* Line contents and string must match. 48494 * When string starts with white space, must have some white space 48495 * (but the amount does not need to match, there might be a mix of 48496 - * TABs and spaces). 48497 - */ 53057 + * When string starts with white space, must have some white space 53058 + * (but the amount does not need to match, there might be a mix of 48498 53059 + * TABs and spaces). */ 48499 if (vim_iswhite(string[0])) 48500 { 48501 if (i == 0 || !vim_iswhite(line[i - 1])) 48502 - continue; 53060 + if (vim_iswhite(string[0])) 53061 + { 53062 + if (i == 0 || !vim_iswhite(line[i - 1])) 48503 53063 + continue; /* missing shite space */ 48504 while (vim_iswhite(string[0])) 48505 ++string; 48506 } 48507 for (j = 0; string[j] != NUL && string[j] == line[i + j]; ++j) 48508 ; 48509 if (string[j] != NUL) 48510 - continue; 53064 + while (vim_iswhite(string[0])) 53065 + ++string; 53066 + } 53067 + for (j = 0; string[j] != NUL && string[j] == line[i + j]; ++j) 53068 + ; 53069 + if (string[j] != NUL) 48511 53070 + continue; /* string doesn't match */ 48512 48513 - /* 48514 - * When 'b' flag used, there must be white space or an 48515 - * end-of-line after the string in the line. 48516 - */ 53071 + 48517 53072 + /* When 'b' flag used, there must be white space or an 48518 53073 + * end-of-line after the string in the line. */ 48519 if (vim_strchr(part_buf, COM_BLANK) != NULL 48520 && !vim_iswhite(line[i + j]) && line[i + j] != NUL) 48521 continue; 48522 48523 - /* 48524 - * We have found a match, stop searching. 48525 - */ 48526 - i += j; 48527 - got_com = TRUE; 53074 + if (vim_strchr(part_buf, COM_BLANK) != NULL 53075 + && !vim_iswhite(line[i + j]) && line[i + j] != NUL) 53076 + continue; 53077 + 48528 53078 + /* We have found a match, stop searching unless this is a middle 48529 53079 + * comment. The middle comment can be a substring of the end … … 48547 53097 + if (middle_match_len == 0) 48548 53098 + i += j; 48549 found_one = TRUE; 48550 break; 48551 } 48552 48553 - /* 48554 - * No match found, stop scanning. 48555 - */ 53099 + found_one = TRUE; 53100 + break; 53101 + } 53102 + 48556 53103 + if (middle_match_len != 0) 48557 53104 + { … … 48565 53112 + 48566 53113 + /* No match found, stop scanning. */ 48567 if (!found_one) 53114 + if (!found_one) 53115 + break; 53116 + 53117 + result = i; 53118 + 53119 + /* Include any trailing white space. */ 53120 + while (vim_iswhite(line[i])) 53121 + ++i; 53122 + 53123 + if (include_space) 53124 + result = i; 53125 + 53126 + /* If this comment doesn't nest, stop here. */ 53127 + got_com = TRUE; 53128 + if (vim_strchr(part_buf, COM_NEST) == NULL) 53129 + break; 53130 + } 53131 + return result; 53132 +} 53133 + 53134 +/* 53135 + * Return the offset at which the last comment in line starts. If there is no 53136 + * comment in the whole line, -1 is returned. 53137 + * 53138 + * When "flags" is not null, it is set to point to the flags describing the 53139 + * recognized comment leader. 53140 + */ 53141 + int 53142 +get_last_leader_offset(line, flags) 53143 + char_u *line; 53144 + char_u **flags; 53145 +{ 53146 + int result = -1; 53147 + int i, j; 53148 + int lower_check_bound = 0; 53149 + char_u *string; 53150 + char_u *com_leader; 53151 + char_u *com_flags; 53152 + char_u *list; 53153 + int found_one; 53154 + char_u part_buf[COM_MAX_LEN]; /* buffer for one option part */ 53155 + 53156 + /* 53157 + * Repeat to match several nested comment strings. 53158 + */ 53159 + i = (int)STRLEN(line); 53160 + while (--i >= lower_check_bound) 53161 + { 53162 + /* 53163 + * scan through the 'comments' option for a match 53164 + */ 53165 + found_one = FALSE; 53166 + for (list = curbuf->b_p_com; *list; ) 53167 + { 53168 + char_u *flags_save = list; 53169 + 53170 + /* 53171 + * Get one option part into part_buf[]. Advance list to next one. 53172 + * put string at start of string. 53173 + */ 53174 + (void)copy_option_part(&list, part_buf, COM_MAX_LEN, ","); 53175 + string = vim_strchr(part_buf, ':'); 53176 + if (string == NULL) /* If everything is fine, this cannot actually 53177 + * happen. */ 53178 + { 53179 + continue; 53180 + } 53181 + *string++ = NUL; /* Isolate flags from string. */ 53182 + com_leader = string; 53183 + 53184 /* 53185 * Line contents and string must match. 53186 * When string starts with white space, must have some white space 53187 @@ -1614,7 +1781,7 @@ 53188 ++string; 53189 } 53190 for (j = 0; string[j] != NUL && string[j] == line[i + j]; ++j) 53191 - ; 53192 + /* do nothing */; 53193 if (string[j] != NUL) 53194 continue; 53195 53196 @@ -1623,37 +1790,77 @@ 53197 * end-of-line after the string in the line. 53198 */ 53199 if (vim_strchr(part_buf, COM_BLANK) != NULL 53200 - && !vim_iswhite(line[i + j]) && line[i + j] != NUL) 53201 + && !vim_iswhite(line[i + j]) && line[i + j] != NUL) 53202 + { 53203 continue; 53204 + } 53205 53206 /* 53207 * We have found a match, stop searching. 53208 */ 53209 - i += j; 53210 - got_com = TRUE; 53211 found_one = TRUE; 53212 + 53213 + if (flags) 53214 + *flags = flags_save; 53215 + com_flags = flags_save; 53216 + 48568 53217 break; 53218 } 53219 53220 - /* 53221 - * No match found, stop scanning. 53222 - */ 53223 - if (!found_one) 53224 - break; 53225 + if (found_one) 53226 + { 53227 + char_u part_buf2[COM_MAX_LEN]; /* buffer for one option part */ 53228 + int len1, len2, off; 48569 53229 48570 53230 - /* 48571 53231 - * Include any trailing white space. 48572 53232 - */ 48573 + /* Include any trailing white space. */ 48574 while (vim_iswhite(line[i])) 48575 ++i; 53233 - while (vim_iswhite(line[i])) 53234 - ++i; 53235 + result = i; 53236 + /* 53237 + * If this comment nests, continue searching. 53238 + */ 53239 + if (vim_strchr(part_buf, COM_NEST) != NULL) 53240 + continue; 48576 53241 48577 53242 - /* 48578 53243 - * If this comment doesn't nest, stop here. 48579 53244 - */ 48580 + /* If this comment doesn't nest, stop here. */ 48581 + got_com = TRUE; 48582 if (vim_strchr(part_buf, COM_NEST) == NULL) 48583 break; 53245 - if (vim_strchr(part_buf, COM_NEST) == NULL) 53246 - break; 53247 + lower_check_bound = i; 53248 + 53249 + /* Let's verify whether the comment leader found is a substring 53250 + * of other comment leaders. If it is, let's adjust the 53251 + * lower_check_bound so that we make sure that we have determined 53252 + * the comment leader correctly. 53253 + */ 53254 + 53255 + while (vim_iswhite(*com_leader)) 53256 + ++com_leader; 53257 + len1 = (int)STRLEN(com_leader); 53258 + 53259 + for (list = curbuf->b_p_com; *list; ) 53260 + { 53261 + char_u *flags_save = list; 53262 + 53263 + (void)copy_option_part(&list, part_buf2, COM_MAX_LEN, ","); 53264 + if (flags_save == com_flags) 53265 + continue; 53266 + string = vim_strchr(part_buf2, ':'); 53267 + ++string; 53268 + while (vim_iswhite(*string)) 53269 + ++string; 53270 + len2 = (int)STRLEN(string); 53271 + if (len2 == 0) 53272 + continue; 53273 + 53274 + /* Now we have to verify whether string ends with a substring 53275 + * beginning the com_leader. */ 53276 + for (off = (len2 > i ? i : len2); off > 0 && off + len1 > len2;) 53277 + { 53278 + --off; 53279 + if (!STRNCMP(string + off, com_leader, len2 - off)) 53280 + { 53281 + if (i - off < lower_check_bound) 53282 + lower_check_bound = i - off; 53283 + } 53284 + } 53285 + } 53286 + } 48584 53287 } 48585 + 48586 return (got_com ? i : 0);53288 - return (got_com ? i : 0); 53289 + return result; 48587 53290 } 48588 53291 #endif 48589 @@ -1907,7 +1932,7 @@ 53292 53293 @@ -1907,7 +2114,7 @@ 48590 53294 int c; 48591 53295 { … … 48596 53300 48597 53301 n = (*mb_char2bytes)(c, buf); 48598 @@ -2919,7 + 2944,7 @@53302 @@ -2919,7 +3126,7 @@ 48599 53303 buf_T *buf; 48600 53304 int ff; /* also reset 'fileformat' */ … … 48605 53309 buf->b_changed = 0; 48606 53310 ml_setflags(buf); 48607 @@ -3080,8 +3 105,9 @@53311 @@ -3080,8 +3287,9 @@ 48608 53312 int 48609 53313 get_keystroke() … … 48617 53321 int n; 48618 53322 int save_mapped_ctrl_c = mapped_ctrl_c; 48619 @@ -3093,12 +3 119,29 @@53323 @@ -3093,12 +3301,29 @@ 48620 53324 cursor_on(); 48621 53325 out_flush(); … … 48629 53333 + else if (maxlen < 10) 48630 53334 + { 48631 + /* Need some more space. This mig thhappen when receiving a long53335 + /* Need some more space. This might happen when receiving a long 48632 53336 + * escape sequence. */ 48633 53337 + buflen += 100; … … 48652 53356 { 48653 53357 /* Replace zero and CSI by a special key code. */ 48654 @@ -3110,14 +3 153,23 @@53358 @@ -3110,14 +3335,23 @@ 48655 53359 ++waited; /* keep track of the waiting time */ 48656 53360 … … 48680 53384 48681 53385 /* Handle modifier and/or special key code. */ 48682 @@ -3169,7 +3 221,7 @@53386 @@ -3169,7 +3403,7 @@ 48683 53387 { 48684 53388 if (MB_BYTE2LEN(n) > len) … … 48689 53393 } 48690 53394 #endif 48691 @@ -3179,6 +3 231,7 @@53395 @@ -3179,6 +3413,7 @@ 48692 53396 #endif 48693 53397 break; … … 48697 53401 mapped_ctrl_c = save_mapped_ctrl_c; 48698 53402 return n; 48699 @@ -3323,19 +3 376,23 @@53403 @@ -3323,19 +3558,23 @@ 48700 53404 if (pn == 1) 48701 53405 { … … 48726 53430 { 48727 53431 set_keep_msg(msg_buf, 0); 48728 @@ -3492,7 +3 549,7 @@53432 @@ -3492,7 +3731,7 @@ 48729 53433 if (enc_utf8 && var != NULL) 48730 53434 { … … 48735 53439 /* Convert from active codepage to UTF-8. Other conversions are 48736 53440 * not done, because they would fail for non-ASCII characters. */ 48737 @@ -3859,11 + 3916,13 @@53441 @@ -3859,11 +4098,13 @@ 48738 53442 * Vim's version of getenv(). 48739 53443 * Special handling of $HOME, $VIM and $VIMRUNTIME. … … 48750 53454 char_u *p; 48751 53455 char_u *pend; 48752 @@ -3885,7 + 3944,7 @@53456 @@ -3885,7 +4126,7 @@ 48753 53457 if (enc_utf8) 48754 53458 { … … 48759 53463 /* Convert from active codepage to UTF-8. Other conversions are 48760 53464 * not done, because they would fail for non-ASCII characters. */ 48761 @@ -3929,7 + 3988,7 @@53465 @@ -3929,7 +4170,7 @@ 48762 53466 if (enc_utf8) 48763 53467 { … … 48768 53472 /* Convert from active codepage to UTF-8. Other conversions 48769 53473 * are not done, because they would fail for non-ASCII 48770 @@ -3937,7 + 3996,7 @@53474 @@ -3937,7 +4178,7 @@ 48771 53475 acp_to_enc(p, (int)STRLEN(p), &pp, &len); 48772 53476 if (pp != NULL) … … 48777 53481 p = pp; 48778 53482 *mustfree = TRUE; 48779 @@ -4074,17 +4 133,6 @@53483 @@ -4074,17 +4315,6 @@ 48780 53484 { 48781 53485 vim_setenv((char_u *)"VIMRUNTIME", p); … … 48795 53499 else 48796 53500 { 48797 @@ -4162,6 +4 210,22 @@53501 @@ -4162,6 +4392,22 @@ 48798 53502 putenv((char *)envbuf); 48799 53503 } … … 48818 53522 48819 53523 #if defined(FEAT_CMDL_COMPL) || defined(PROTO) 48820 @@ -4549,25 +4613,21 @@ 53524 @@ -4220,7 +4466,7 @@ 53525 { 53526 size_t dirlen = 0, envlen = 0; 53527 size_t len; 53528 - char_u *homedir_env; 53529 + char_u *homedir_env, *homedir_env_orig; 53530 char_u *p; 53531 53532 if (src == NULL) 53533 @@ -4246,13 +4492,31 @@ 53534 dirlen = STRLEN(homedir); 53535 53536 #ifdef VMS 53537 - homedir_env = mch_getenv((char_u *)"SYS$LOGIN"); 53538 + homedir_env_orig = homedir_env = mch_getenv((char_u *)"SYS$LOGIN"); 53539 #else 53540 - homedir_env = mch_getenv((char_u *)"HOME"); 53541 + homedir_env_orig = homedir_env = mch_getenv((char_u *)"HOME"); 53542 #endif 53543 - 53544 + /* Empty is the same as not set. */ 53545 if (homedir_env != NULL && *homedir_env == NUL) 53546 homedir_env = NULL; 53547 + 53548 +#if defined(FEAT_MODIFY_FNAME) || defined(WIN3264) 53549 + if (homedir_env != NULL && vim_strchr(homedir_env, '~') != NULL) 53550 + { 53551 + int usedlen = 0; 53552 + int flen; 53553 + char_u *fbuf = NULL; 53554 + 53555 + flen = (int)STRLEN(homedir_env); 53556 + (void)modify_fname((char_u *)":p", &usedlen, 53557 + &homedir_env, &fbuf, &flen); 53558 + flen = (int)STRLEN(homedir_env); 53559 + if (flen > 0 && vim_ispathsep(homedir_env[flen - 1])) 53560 + /* Remove the trailing / that is added to a directory. */ 53561 + homedir_env[flen - 1] = NUL; 53562 + } 53563 +#endif 53564 + 53565 if (homedir_env != NULL) 53566 envlen = STRLEN(homedir_env); 53567 53568 @@ -4306,6 +4570,9 @@ 53569 /* if (dstlen == 0) out of space, what to do??? */ 53570 53571 *dst = NUL; 53572 + 53573 + if (homedir_env != homedir_env_orig) 53574 + vim_free(homedir_env); 53575 } 53576 53577 /* 53578 @@ -4549,25 +4816,21 @@ 48821 53579 vim_ispathsep(c) 48822 53580 int c; … … 48852 53610 48853 53611 #if defined(FEAT_SEARCHPATH) || defined(PROTO) 48854 @@ -4907,11 +4967,12 @@ 53612 @@ -4752,8 +5015,8 @@ 53613 char_u * 53614 FullName_save(fname, force) 53615 char_u *fname; 53616 - int force; /* force expansion, even when it already looks 53617 - like a full path name */ 53618 + int force; /* force expansion, even when it already looks 53619 + * like a full path name */ 53620 { 53621 char_u *buf; 53622 char_u *new_fname = NULL; 53623 @@ -4907,11 +5170,12 @@ 48855 53624 static int cin_islinecomment __ARGS((char_u *)); 48856 53625 static int cin_isterminated __ARGS((char_u *, int, int)); … … 48866 53635 static int cin_isbreak __ARGS((char_u *)); 48867 53636 static int cin_is_cpp_baseclass __ARGS((colnr_T *col)); 48868 @@ -4923,6 + 4984,7 @@53637 @@ -4923,6 +5187,7 @@ 48869 53638 static int corr_ind_maxparen __ARGS((int ind_maxparen, pos_T *startpos)); 48870 53639 static int find_last_paren __ARGS((char_u *l, int start, int end)); … … 48874 53643 static int ind_hash_comment = 0; /* # starts a comment */ 48875 53644 48876 @@ -4968,7 +5 030,7 @@53645 @@ -4968,7 +5233,7 @@ 48877 53646 } 48878 53647 … … 48883 53652 */ 48884 53653 static int 48885 @@ -5101,6 +5 163,9 @@53654 @@ -5101,6 +5366,9 @@ 48886 53655 if (STRNCMP(s, "typedef", 7) == 0 && !vim_isIDc(s[7])) 48887 53656 s = cin_skipcomment(s + 7); … … 48893 53662 return TRUE; 48894 53663 48895 @@ -5185,6 +5 250,50 @@53664 @@ -5185,6 +5453,50 @@ 48896 53665 return (*(s = cin_skipcomment(s + i)) == ':' && s[1] != ':'); 48897 53666 } … … 48944 53713 * Return a pointer to the first non-empty non-comment character after a ':'. 48945 53714 * Return NULL if not found. 48946 @@ -5383,8 +5 492,7 @@53715 @@ -5383,8 +5695,7 @@ 48947 53716 cin_ispreproc(s) 48948 53717 char_u *s; … … 48954 53723 return FALSE; 48955 53724 } 48956 @@ -5444,8 +5 552,11 @@53725 @@ -5444,8 +5755,11 @@ 48957 53726 } 48958 53727 … … 48967 53736 * both apply in order to determine initializations). 48968 53737 */ 48969 @@ -5455,21 +5 566,35 @@53738 @@ -5455,21 +5769,35 @@ 48970 53739 int incl_open; /* include '{' at the end as terminator */ 48971 53740 int incl_comma; /* recognize a trailing comma */ … … 49006 53775 if (*s) 49007 53776 s++; 49008 @@ -5485,21 +5 610,41 @@53777 @@ -5485,21 +5813,41 @@ 49009 53778 * "sp" points to a string with the line. When looking at other lines it must 49010 53779 * be restored to the line. When it's NULL fetch lines here. … … 49049 53818 { 49050 53819 if (cin_iscomment(s)) /* ignore comments */ 49051 @@ -5525,18 +5 670,38 @@53820 @@ -5525,18 +5873,38 @@ 49052 53821 retval = TRUE; 49053 53822 goto done; … … 49092 53861 49093 53862 done: 49094 @@ -5607,6 +5 772,52 @@53863 @@ -5607,6 +5975,52 @@ 49095 53864 } 49096 53865 … … 49145 53914 * do 49146 53915 * nothing; 49147 @@ -5754,7 + 5965,9 @@53916 @@ -5754,7 +6168,9 @@ 49148 53917 continue; 49149 53918 } … … 49156 53925 if (s[1] == ':') 49157 53926 { 49158 @@ -5958,7 +6 171,7 @@53927 @@ -5958,7 +6374,7 @@ 49159 53928 49160 53929 /* … … 49165 53934 static pos_T * 49166 53935 find_match_paren(ind_maxparen, ind_maxcomment) /* XXX */ 49167 @@ -6008,7 +6 221,7 @@53936 @@ -6008,7 +6424,7 @@ 49168 53937 49169 53938 /* … … 49174 53943 static int 49175 53944 find_last_paren(l, start, end) 49176 @@ -6021,7 +6 234,7 @@53945 @@ -6021,7 +6437,7 @@ 49177 53946 49178 53947 curwin->w_cursor.col = 0; /* default is start of line */ … … 49183 53952 i = (int)(cin_skipcomment(l + i) - l); /* ignore parens in comments */ 49184 53953 i = (int)(skip_string(l + i) - l); /* ignore parens in quotes */ 49185 @@ -6222,6 +6 435,17 @@53954 @@ -6222,6 +6638,17 @@ 49186 53955 */ 49187 53956 int ind_keep_case_label = 0; … … 49201 53970 int amount; 49202 53971 int scope_amount; 49203 @@ -6262,8 +6486,10 @@ 53972 @@ -6257,19 +6684,23 @@ 53973 int whilelevel; 53974 linenr_T lnum; 53975 char_u *options; 53976 + char_u *digits; 53977 int fraction = 0; /* init for GCC */ 53978 int divider; 49204 53979 int n; 49205 53980 int iscase; … … 49212 53987 for (options = curbuf->b_p_cino; *options; ) 49213 53988 { 49214 @@ -6335,6 +6561,8 @@ 53989 l = options++; 53990 if (*options == '-') 53991 ++options; 53992 + digits = options; /* remember where the digits start */ 53993 n = getdigits(&options); 53994 divider = 0; 53995 if (*options == '.') /* ".5s" means a fraction */ 53996 @@ -6286,7 +6717,7 @@ 53997 } 53998 if (*options == 's') /* "2s" means two times 'shiftwidth' */ 53999 { 54000 - if (n == 0 && fraction == 0) 54001 + if (options == digits) 54002 n = curbuf->b_p_sw; /* just "s" is one 'shiftwidth' */ 54003 else 54004 { 54005 @@ -6335,6 +6766,8 @@ 49215 54006 case 'J': ind_js = n; break; 49216 54007 case 'l': ind_keep_case_label = n; break; … … 49221 54012 if (*options == ',') 49222 54013 ++options; 49223 @@ -6424,6 +6 652,8 @@54014 @@ -6424,6 +6857,8 @@ 49224 54015 /* find how indented the line beginning the comment is */ 49225 54016 getvcol(curwin, trypos, &col, NULL, NULL); … … 49230 54021 p = curbuf->b_p_com; 49231 54022 while (*p != NUL) 49232 @@ -6636,6 + 6866,33 @@54023 @@ -6636,6 +7071,33 @@ 49233 54024 if (amount == -1) 49234 54025 { … … 49264 54055 amount = skip_label(our_paren_pos.lnum, &look, ind_maxcomment); 49265 54056 look = skipwhite(look); 49266 @@ -6660,7 + 6917,7 @@54057 @@ -6660,7 +7122,7 @@ 49267 54058 curwin->w_cursor.lnum = save_lnum; 49268 54059 look = ml_get(our_paren_pos.lnum) + look_col; … … 49273 54064 && ignore_paren_col == 0)) 49274 54065 { 49275 @@ -6731,7 + 6988,8 @@54066 @@ -6731,7 +7193,8 @@ 49276 54067 { 49277 54068 /* Line up with the start of the matching paren line. */ … … 49283 54074 { 49284 54075 if (cur_amount != MAXCOL) 49285 @@ -6764,11 +7 022,15 @@54076 @@ -6764,11 +7227,15 @@ 49286 54077 { 49287 54078 curwin->w_cursor.lnum = our_paren_pos.lnum; … … 49302 54093 /* 49303 54094 * For a line starting with ')' use the minimum of the two 49304 @@ -6838,7 +7 100,7 @@54095 @@ -6838,7 +7305,7 @@ 49305 54096 * ldfd) { 49306 54097 * } … … 49311 54102 amount = get_indent(); 49312 54103 else 49313 @@ -6901,11 +7 163,24 @@54104 @@ -6901,11 +7368,24 @@ 49314 54105 if (start_brace == BRACE_IN_COL0) /* '{' is in column 0 */ 49315 54106 { … … 49336 54127 { 49337 54128 /* Compensate for adding ind_open_extra later. */ 49338 @@ -7014,7 +7 289,8 @@54129 @@ -7014,7 +7494,8 @@ 49339 54130 * (it's a variable declaration). 49340 54131 */ … … 49346 54137 /* if the line is terminated with another ',' 49347 54138 * it is a continued variable initialization. 49348 @@ -7076,12 +7 352,59 @@54139 @@ -7076,12 +7557,59 @@ 49349 54140 else 49350 54141 amount += ind_continuation; … … 49411 54202 break; 49412 54203 } 49413 @@ -7466,17 +7 789,25 @@54204 @@ -7466,17 +7994,25 @@ 49414 54205 49415 54206 /* … … 49444 54235 49445 54236 /* 49446 @@ -7757,8 +8 088,8 @@54237 @@ -7757,8 +8293,8 @@ 49447 54238 * If we're at the end of a block, skip to the start of 49448 54239 * that block. … … 49455 54246 != NULL) /* XXX */ 49456 54247 { 49457 @@ -7820,7 +8 151,9 @@54248 @@ -7820,7 +8356,9 @@ 49458 54249 && vim_strchr(theline, '}') == NULL 49459 54250 && !cin_ends_in(theline, (char_u *)":", NULL) … … 49466 54257 { 49467 54258 amount = ind_func_type; 49468 @@ -7926,7 +8 259,8 @@54259 @@ -7926,7 +8464,8 @@ 49469 54260 * If the line looks like a function declaration, and we're 49470 54261 * not in a comment, put it the left margin. … … 49476 54267 l = ml_get_curline(); 49477 54268 49478 @@ -7947,11 +8 281,35 @@54269 @@ -7947,11 +8486,35 @@ 49479 54270 break; 49480 54271 … … 49513 54304 amount = ind_param; 49514 54305 break; 49515 @@ -8856,11 +9 214,15 @@54306 @@ -8856,11 +9419,15 @@ 49516 54307 } 49517 54308 … … 49530 54321 vim_free(buf); 49531 54322 return 0; 49532 @@ -8928,7 +9 290,10 @@54323 @@ -8928,7 +9495,10 @@ 49533 54324 * all entries found with "matchname". */ 49534 54325 if ((p[0] != '.' || starts_with_dot) … … 49542 54333 #ifdef WIN3264 49543 54334 STRCPY(s, p); 49544 @@ -9096,6 +9 461,7 @@54335 @@ -9096,6 +9666,7 @@ 49545 54336 49546 54337 /* … … 49550 54341 */ 49551 54342 p = buf; 49552 @@ -9115,7 +9 481,12 @@54343 @@ -9115,7 +9686,12 @@ 49553 54344 s = p + 1; 49554 54345 } … … 49564 54355 #ifdef FEAT_MBYTE 49565 54356 if (has_mbyte) 49566 @@ -9132,7 +9 503,7 @@54357 @@ -9132,7 +9708,7 @@ 49567 54358 e = p; 49568 54359 *e = NUL; … … 49573 54364 * component. */ 49574 54365 for (p = buf + wildoff; p < s; ++p) 49575 @@ -9161,12 +9 532,19 @@54366 @@ -9161,12 +9737,19 @@ 49576 54367 #ifdef CASE_INSENSITIVE_FILENAME 49577 54368 regmatch.rm_ic = TRUE; /* Behave like Terminal.app */ … … 49595 54386 vim_free(buf); 49596 54387 return 0; 49597 @@ -9196,7 +9 574,10 @@54388 @@ -9196,7 +9779,10 @@ 49598 54389 if (dp == NULL) 49599 54390 break; … … 49607 54398 STRCPY(s, dp->d_name); 49608 54399 len = STRLEN(buf); 49609 @@ -9317,7 +9 698,8 @@54400 @@ -9317,7 +9903,8 @@ 49610 54401 continue; /* it's different when it's shorter */ 49611 54402 … … 49617 54408 } 49618 54409 49619 @@ -9642,7 +10 024,7 @@54410 @@ -9642,7 +10229,7 @@ 49620 54411 if (paths == NULL) 49621 54412 return 0; … … 49627 54418 return 0; 49628 54419 diff -Naur vim73.orig/src/misc2.c vim73/src/misc2.c 49629 --- vim73.orig/src/misc2.c 201 2-06-03 23:09:52.948007269+000049630 +++ vim73/src/misc2.c 2012-0 6-03 23:09:55.524075823+000054420 --- vim73.orig/src/misc2.c 2010-08-13 09:14:35.000000000 +0000 54421 +++ vim73/src/misc2.c 2012-07-20 20:31:17.620978002 +0000 49631 54422 @@ -200,7 +200,6 @@ 49632 54423 } … … 49722 54513 #endif 49723 54514 } 49724 @@ -1003,8 +1012,12 @@ 54515 @@ -806,6 +815,7 @@ 54516 #else 54517 # define KEEP_ROOM (2 * 8192L) 54518 #endif 54519 +#define KEEP_ROOM_KB (KEEP_ROOM / 1024L) 54520 54521 /* 54522 * Note: if unsigned is 16 bits we can only allocate up to 64K with alloc(). 54523 @@ -931,7 +941,7 @@ 54524 allocated = 0; 54525 # endif 54526 /* 3. check for available memory: call mch_avail_mem() */ 54527 - if (mch_avail_mem(TRUE) < KEEP_ROOM && !releasing) 54528 + if (mch_avail_mem(TRUE) < KEEP_ROOM_KB && !releasing) 54529 { 54530 free((char *)p); /* System is low... no go! */ 54531 p = NULL; 54532 @@ -1003,8 +1013,12 @@ 49725 54533 { 49726 54534 /* Don't hide this message */ … … 49736 54544 } 49737 54545 49738 @@ -1160,7 +117 3,7 @@54546 @@ -1160,7 +1174,7 @@ 49739 54547 for (buf = firstbuf; buf != NULL; ) 49740 54548 { … … 49745 54553 buf = nextbuf; /* didn't work, try next one */ 49746 54554 else 49747 @@ -1223,7 +123 6,7 @@54555 @@ -1223,7 +1237,7 @@ 49748 54556 #endif 49749 54557 … … 49754 54562 char_u * 49755 54563 vim_strsave(string) 49756 @@ -1239,6 +125 2,12 @@54564 @@ -1239,6 +1253,12 @@ 49757 54565 return p; 49758 54566 } … … 49767 54575 vim_strnsave(string, len) 49768 54576 char_u *string; 49769 @@ -1540,7 +15 59,7 @@54577 @@ -1540,7 +1560,7 @@ 49770 54578 if (enc_utf8) 49771 54579 { … … 49776 54584 49777 54585 c = utf_ptr2char(p); 49778 @@ -1549,21 +156 8,21 @@54586 @@ -1549,21 +1569,21 @@ 49779 54587 /* Reallocate string when byte count changes. This is rare, 49780 54588 * thus it's OK to do another malloc()/free(). */ … … 49803 54611 else if (has_mbyte && (l = (*mb_ptr2len)(p)) > 1) 49804 54612 p += l; /* skip multi-byte character */ 49805 @@ -1642,6 +166 1,28 @@54613 @@ -1642,6 +1662,28 @@ 49806 54614 } 49807 54615 … … 49832 54640 * "sep_chars". 49833 54641 * The part is copied into "buf[maxlen]". 49834 @@ -2023,24 +206 4,22 @@54642 @@ -2023,24 +2065,22 @@ 49835 54643 garray_T *gap; 49836 54644 int n; … … 49864 54672 } 49865 54673 return OK; 49866 @@ -2109,6 +214 8,25 @@54674 @@ -2109,6 +2149,25 @@ 49867 54675 } 49868 54676 } … … 49890 54698 * functions that use lookup tables for various things, generally to do with 49891 54699 * special key codes. 49892 @@ -2356,10 +241 4,21 @@54700 @@ -2356,10 +2415,21 @@ 49893 54701 {'<', (char_u *)"lt"}, 49894 54702 … … 49912 54720 {K_LEFTMOUSE_NM, (char_u *)"LeftMouseNM"}, 49913 54721 {K_LEFTDRAG, (char_u *)"LeftDrag"}, 49914 @@ -2698,6 +276 7,7 @@54722 @@ -2698,6 +2768,7 @@ 49915 54723 int bit; 49916 54724 int key; … … 49920 54728 src = *srcp; 49921 54729 if (src[0] != '<') 49922 @@ -2710,26 +278 0,32 @@54730 @@ -2710,26 +2781,32 @@ 49923 54731 if (*bp == '-') 49924 54732 { … … 49964 54772 modifiers = 0x0; 49965 54773 for (bp = src + 1; bp < last_dash; bp++) 49966 @@ -2748,16 +282 4,32 @@54774 @@ -2748,16 +2825,32 @@ 49967 54775 */ 49968 54776 if (bp >= last_dash) … … 50005 54813 50006 54814 /* 50007 @@ -3131,17 +322 3,31 @@54815 @@ -3131,17 +3224,31 @@ 50008 54816 retval = mch_call_shell(cmd, opt); 50009 54817 else … … 50040 54848 #ifdef FEAT_GUI 50041 54849 --hold_gui_events; 50042 @@ -3191,7 +329 7,7 @@54850 @@ -3191,7 +3298,7 @@ 50043 54851 #if defined(FEAT_MBYTE) || defined(PROTO) 50044 54852 /* … … 50049 54857 */ 50050 54858 int 50051 @@ -3199,7 +330 5,7 @@54859 @@ -3199,7 +3306,7 @@ 50052 54860 char_u *b; 50053 54861 char_u *p; … … 50058 54866 } 50059 54867 #endif 50060 @@ -4210,6 +431 6,8 @@54868 @@ -4210,6 +4317,8 @@ 50061 54869 static int ff_path_in_stoplist __ARGS((char_u *, int, char_u **)); 50062 54870 #endif … … 50067 54875 /* 50068 54876 * if someone likes findfirst/findnext, here are the functions 50069 @@ -4506,6 +461 4,11 @@54877 @@ -4506,6 +4615,11 @@ 50070 54878 len = 0; 50071 54879 while (*wc_part != NUL) … … 50079 54887 { 50080 54888 ff_expand_buffer[len++] = *wc_part++; 50081 @@ -4551,6 +466 4,12 @@54889 @@ -4551,6 +4665,12 @@ 50082 54890 } 50083 54891 … … 50092 54900 add_pathsep(ff_expand_buffer); 50093 54901 STRCAT(ff_expand_buffer, search_ctx->ffsc_fix_path); 50094 @@ -4597,9 +471 6,8 @@54902 @@ -4597,9 +4717,8 @@ 50095 54903 { 50096 54904 if (r_ptr[0] == '\\' && r_ptr[1] == ';') … … 50104 54912 r_ptr++; 50105 54913 } 50106 @@ -4858,10 +497 6,13 @@54914 @@ -4858,10 +4977,13 @@ 50107 54915 stackp->ffs_filearray_size = 0; 50108 54916 } … … 50119 54927 stackp->ffs_filearray_cur = 0; 50120 54928 stackp->ffs_stage = 0; 50121 @@ -6443,3 +656 4,23 @@54929 @@ -6443,3 +6565,23 @@ 50122 54930 #endif 50123 54931 … … 50144 54952 +#endif 50145 54953 diff -Naur vim73.orig/src/move.c vim73/src/move.c 50146 --- vim73.orig/src/move.c 201 2-06-03 23:09:52.920006524+000050147 +++ vim73/src/move.c 2012-0 6-03 23:09:55.652079228+000054954 --- vim73.orig/src/move.c 2010-08-08 13:12:31.000000000 +0000 54955 +++ vim73/src/move.c 2012-07-20 20:31:15.540976512 +0000 50148 54956 @@ -362,7 +362,7 @@ 50149 54957 #endif … … 50235 55043 diff -Naur vim73.orig/src/msvc2010.bat vim73/src/msvc2010.bat 50236 55044 --- vim73.orig/src/msvc2010.bat 1970-01-01 00:00:00.000000000 +0000 50237 +++ vim73/src/msvc2010.bat 2012-0 6-03 23:09:54.252041972+000055045 +++ vim73/src/msvc2010.bat 2012-07-20 20:31:11.317640143 +0000 50238 55046 @@ -0,0 +1,7 @@ 50239 55047 +@echo off … … 50245 55053 +call "%VS100COMNTOOLS%%vsvars32.bat" 50246 55054 diff -Naur vim73.orig/src/netbeans.c vim73/src/netbeans.c 50247 --- vim73.orig/src/netbeans.c 201 2-06-03 23:09:52.948007269+000050248 +++ vim73/src/netbeans.c 2012-0 6-03 23:09:55.748081783+000055055 --- vim73.orig/src/netbeans.c 2010-08-09 20:48:09.000000000 +0000 55056 +++ vim73/src/netbeans.c 2012-07-20 20:31:15.804310035 +0000 50249 55057 @@ -14,12 +14,15 @@ 50250 55058 * which are *between* characters, whereas vim uses line number … … 50901 55709 50902 55710 diff -Naur vim73.orig/src/normal.c vim73/src/normal.c 50903 --- vim73.orig/src/normal.c 201 2-06-03 23:09:52.948007269+000050904 +++ vim73/src/normal.c 2012-0 6-03 23:09:55.900085828+000055711 --- vim73.orig/src/normal.c 2010-07-31 13:25:19.000000000 +0000 55712 +++ vim73/src/normal.c 2012-07-20 20:31:18.050978309 +0000 50905 55713 @@ -20,15 +20,18 @@ 50906 55714 */ … … 51012 55820 # ifdef FEAT_VIRTUALEDIT 51013 55821 int include_line_break = FALSE; 55822 @@ -1419,7 +1451,7 @@ 55823 * This could call do_pending_operator() recursively, but that's OK 55824 * because gui_yank will be TRUE for the nested call. 55825 */ 55826 - if (clip_star.available 55827 + if ((clip_star.available || clip_plus.available) 55828 && oap->op_type != OP_NOP 55829 && !gui_yank 55830 # ifdef FEAT_VISUAL 51014 55831 @@ -1517,22 +1549,31 @@ 51015 55832 #ifdef FEAT_VISUAL … … 51134 55951 } 51135 55952 } 55953 @@ -1910,7 +1968,7 @@ 55954 beep_flush(); 55955 else 55956 { 55957 - (void)do_join(oap->line_count, oap->op_type == OP_JOIN, TRUE); 55958 + (void)do_join(oap->line_count, oap->op_type == OP_JOIN, TRUE, TRUE); 55959 auto_format(FALSE, TRUE); 55960 } 55961 break; 51136 55962 @@ -1920,7 +1978,10 @@ 51137 55963 VIsual_reselect = FALSE; /* don't reselect now */ … … 51223 56049 #else 51224 56050 EMSG(_("E775: Eval feature not available")); 56051 @@ -4342,7 +4426,7 @@ 56052 break; 56053 } 56054 #ifdef FEAT_COMMENTS 56055 - if (get_leader_len(ml_get_curline(), NULL, FALSE) > 0) 56056 + if (get_leader_len(ml_get_curline(), NULL, FALSE, TRUE) > 0) 56057 { 56058 /* Ignore this line, continue at start of next line. */ 56059 ++curwin->w_cursor.lnum; 51225 56060 @@ -4501,6 +4585,7 @@ 51226 56061 } … … 51347 56182 } 51348 56183 } 51349 @@ -8524,7 +8643,7 @@ 56184 @@ -8274,10 +8393,12 @@ 56185 56186 #ifdef FEAT_WINDOWS 56187 case 't': 56188 - goto_tabpage((int)cap->count0); 56189 + if (!checkclearop(oap)) 56190 + goto_tabpage((int)cap->count0); 56191 break; 56192 case 'T': 56193 - goto_tabpage(-(int)cap->count1); 56194 + if (!checkclearop(oap)) 56195 + goto_tabpage(-(int)cap->count1); 56196 break; 56197 #endif 56198 56199 @@ -8524,7 +8645,7 @@ 51350 56200 else 51351 56201 curwin->w_curswant = 0; … … 51356 56206 } 51357 56207 51358 @@ -8736,7 +885 5,7 @@56208 @@ -8736,7 +8857,7 @@ 51359 56209 { 51360 56210 --pp->col; … … 51365 56215 } 51366 56216 else if (pp->lnum > 1) 51367 @@ -9261,7 +9380,7 @@ 56217 @@ -9205,7 +9326,7 @@ 56218 { 56219 prep_redo(cap->oap->regname, cap->count0, 56220 NUL, cap->cmdchar, NUL, NUL, cap->nchar); 56221 - (void)do_join(cap->count0, cap->nchar == NUL, TRUE); 56222 + (void)do_join(cap->count0, cap->nchar == NUL, TRUE, TRUE); 56223 } 56224 } 56225 } 56226 @@ -9261,7 +9382,7 @@ 51368 56227 # ifdef FEAT_CLIPBOARD 51369 56228 adjust_clip_reg(®name); … … 51375 56234 # endif 51376 56235 diff -Naur vim73.orig/src/ops.c vim73/src/ops.c 51377 --- vim73.orig/src/ops.c 2012-06-03 23:09:52.940007057 +0000 51378 +++ vim73/src/ops.c 2012-06-03 23:09:55.844084339 +0000 51379 @@ -1584,9 +1584,11 @@ 56236 --- vim73.orig/src/ops.c 2010-08-01 12:16:08.000000000 +0000 56237 +++ vim73/src/ops.c 2012-07-20 20:31:18.057644980 +0000 56238 @@ -112,6 +112,9 @@ 56239 # endif 56240 #endif 56241 static void dis_msg __ARGS((char_u *p, int skip_esc)); 56242 +#if defined(FEAT_COMMENTS) || defined(PROTO) 56243 +static char_u *skip_comment __ARGS((char_u *line, int process, int include_space, int *is_comment)); 56244 +#endif 56245 #ifdef FEAT_VISUAL 56246 static void block_prep __ARGS((oparg_T *oap, struct block_def *, linenr_T, int)); 56247 #endif 56248 @@ -959,8 +962,14 @@ 56249 * selection too. */ 56250 if (name == '*' && clip_star.available) 56251 { 56252 - if (clip_isautosel()) 56253 - clip_update_selection(); 56254 + if (clip_isautosel_star()) 56255 + clip_update_selection(&clip_star); 56256 + may_get_selection(name); 56257 + } 56258 + if (name == '+' && clip_plus.available) 56259 + { 56260 + if (clip_isautosel_plus()) 56261 + clip_update_selection(&clip_plus); 56262 may_get_selection(name); 56263 } 56264 #endif 56265 @@ -1584,9 +1593,11 @@ 51380 56266 adjust_clip_reg(rp) 51381 56267 int *rp; … … 51392 56278 *rp = 0; 51393 56279 if (!clip_plus.available && *rp == '+') 51394 @@ -1646,9 +16 48,12 @@56280 @@ -1646,9 +1657,12 @@ 51395 56281 && !oap->block_mode 51396 56282 #endif … … 51406 56292 if (*ptr == NUL && inindent(0)) 51407 56293 oap->motion_type = MLINE; 51408 @@ -1715,9 +172 0,14 @@56294 @@ -1715,9 +1729,14 @@ 51409 56295 did_yank = TRUE; 51410 56296 } … … 51417 56303 + if (( 51418 56304 +#ifdef FEAT_CLIPBOARD 51419 + 51420 + 56305 + ((clip_unnamed & CLIP_UNNAMED) && oap->regname == '*') || 56306 + ((clip_unnamed & CLIP_UNNAMED_PLUS) && oap->regname == '+') || 51421 56307 +#endif 51422 56308 + oap->regname == 0) && oap->motion_type != MLINE … … 51424 56310 { 51425 56311 oap->regname = '-'; 51426 @@ -1918,38 +19 28,66 @@56312 @@ -1918,38 +1937,66 @@ 51427 56313 curwin->w_cursor.coladd = 0; 51428 56314 } … … 51495 56381 + } 51496 56382 + if (curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count) 51497 + (void)do_join(2, FALSE, FALSE );56383 + (void)do_join(2, FALSE, FALSE, FALSE); 51498 56384 } 51499 56385 } 51500 56386 51501 @@ -2569,7 +26 07,8 @@56387 @@ -2569,7 +2616,8 @@ 51502 56388 firstline = ml_get(oap->start.lnum) + bd.textcol; 51503 56389 if (oap->op_type == OP_APPEND) … … 51509 56395 ins_text = vim_strnsave(firstline, (int)ins_len); 51510 56396 if (ins_text != NULL) 51511 @@ -2842,6 +28 81,9 @@56397 @@ -2842,6 +2890,9 @@ 51512 56398 char_u *p; 51513 56399 char_u *pnew; … … 51519 56405 /* check for read-only register */ 51520 56406 if (oap->regname != 0 && !valid_yank_reg(oap->regname, TRUE)) 51521 @@ -3000,6 +30 42,8 @@56407 @@ -3000,6 +3051,8 @@ 51522 56408 } 51523 56409 #endif … … 51528 56414 #ifdef FEAT_VIRTUALEDIT 51529 56415 || is_oneChar 51530 @@ -3008,8 +30 52,6 @@56416 @@ -3008,8 +3061,6 @@ 51531 56417 bd.textlen = 0; 51532 56418 else … … 51537 56423 } 51538 56424 bd.textstart = p + startcol; 51539 @@ -3115,7 +31 57,8 @@56425 @@ -3115,7 +3166,8 @@ 51540 56426 */ 51541 56427 if (clip_star.available … … 51547 56433 if (curr != &(y_regs[STAR_REGISTER])) 51548 56434 /* Copy the text from register 0 to the clipboard register. */ 51549 @@ -3123,6 +31 66,9 @@56435 @@ -3123,6 +3175,9 @@ 51550 56436 51551 56437 clip_own_selection(&clip_star); … … 51557 56443 51558 56444 # ifdef FEAT_X11 51559 @@ -3130,12 +31 76,18@@56445 @@ -3130,12 +3185,19 @@ 51560 56446 * If we were yanking to the '+' register, send result to selection. 51561 56447 * Also copy to the '*' register, in case auto-select is off. … … 51575 56461 clip_gen_set_selection(&clip_plus); 51576 56462 - if (!clip_isautosel()) 51577 + if (!clip_isautosel() && !did_star && curr == &(y_regs[PLUS_REGISTER])) 56463 + if (!clip_isautosel_star() && !did_star 56464 + && curr == &(y_regs[PLUS_REGISTER])) 51578 56465 { 51579 56466 copy_yank_reg(&(y_regs[STAR_REGISTER])); 51580 56467 clip_own_selection(&clip_star); 51581 @@ -3293,8 +33 45,8 @@56468 @@ -3293,8 +3355,8 @@ 51582 56469 if (regname == '=') 51583 56470 { … … 51590 56477 { 51591 56478 y_size = 0; 51592 @@ -3310,7 +33 62,7 @@56479 @@ -3310,7 +3372,7 @@ 51593 56480 if (y_array != NULL) 51594 56481 *ptr = NUL; … … 51599 56486 { 51600 56487 y_type = MLINE; 51601 @@ -3979,7 +40 31,12 @@56488 @@ -3979,7 +4041,12 @@ 51602 56489 for (i = -1; i < NUM_REGISTERS && !got_int; ++i) 51603 56490 { … … 51613 56500 51614 56501 #ifdef FEAT_CLIPBOARD 51615 @@ -4153,9 +4210,10 @@ 56502 @@ -4140,22 +4207,101 @@ 56503 ui_breakcheck(); 56504 } 56505 56506 +#if defined(FEAT_COMMENTS) || defined(PROTO) 56507 +/* 56508 + * If "process" is TRUE and the line begins with a comment leader (possibly 56509 + * after some white space), return a pointer to the text after it. Put a boolean 56510 + * value indicating whether the line ends with an unclosed comment in 56511 + * "is_comment". 56512 + * line - line to be processed, 56513 + * process - if FALSE, will only check whether the line ends with an unclosed 56514 + * comment, 56515 + * include_space - whether to also skip space following the comment leader, 56516 + * is_comment - will indicate whether the current line ends with an unclosed 56517 + * comment. 56518 + */ 56519 + static char_u * 56520 +skip_comment(line, process, include_space, is_comment) 56521 + char_u *line; 56522 + int process; 56523 + int include_space; 56524 + int *is_comment; 56525 +{ 56526 + char_u *comment_flags = NULL; 56527 + int lead_len; 56528 + int leader_offset = get_last_leader_offset(line, &comment_flags); 56529 + 56530 + *is_comment = FALSE; 56531 + if (leader_offset != -1) 56532 + { 56533 + /* Let's check whether the line ends with an unclosed comment. 56534 + * If the last comment leader has COM_END in flags, there's no comment. 56535 + */ 56536 + while (*comment_flags) 56537 + { 56538 + if (*comment_flags == COM_END 56539 + || *comment_flags == ':') 56540 + break; 56541 + ++comment_flags; 56542 + } 56543 + if (*comment_flags != COM_END) 56544 + *is_comment = TRUE; 56545 + } 56546 + 56547 + if (process == FALSE) 56548 + return line; 56549 + 56550 + lead_len = get_leader_len(line, &comment_flags, FALSE, include_space); 56551 + 56552 + if (lead_len == 0) 56553 + return line; 56554 + 56555 + /* Find: 56556 + * - COM_END, 56557 + * - colon, 56558 + * whichever comes first. 56559 + */ 56560 + while (*comment_flags) 56561 + { 56562 + if (*comment_flags == COM_END 56563 + || *comment_flags == ':') 56564 + { 56565 + break; 56566 + } 56567 + ++comment_flags; 56568 + } 56569 + 56570 + /* If we found a colon, it means that we are not processing a line 56571 + * starting with a closing part of a three-part comment. That's good, 56572 + * because we don't want to remove those as this would be annoying. 56573 + */ 56574 + if (*comment_flags == ':' || *comment_flags == NUL) 56575 + line += lead_len; 56576 + 56577 + return line; 56578 +} 56579 +#endif 56580 + 56581 /* 56582 * Join 'count' lines (minimal 2) at cursor position. 56583 * When "save_undo" is TRUE save lines for undo first. 56584 + * Set "use_formatoptions" to FALSE when e.g. processing 56585 + * backspace and comment leaders should not be removed. 56586 * 56587 * return FAIL for failure, OK otherwise 56588 */ 56589 int 56590 -do_join(count, insert_space, save_undo) 56591 +do_join(count, insert_space, save_undo, use_formatoptions) 56592 long count; 56593 int insert_space; 51616 56594 int save_undo; 56595 + int use_formatoptions UNUSED; 51617 56596 { 51618 56597 char_u *curr = NULL; … … 51625 56604 int endcurr2 = NUL; 51626 56605 int currsize = 0; /* size of the current line */ 51627 @@ -4181,7 +4239,7 @@ 56606 @@ -4163,6 +4309,13 @@ 56607 linenr_T t; 56608 colnr_T col = 0; 56609 int ret = OK; 56610 +#if defined(FEAT_COMMENTS) || defined(PROTO) 56611 + int *comments = NULL; 56612 + int remove_comments = (use_formatoptions == TRUE) 56613 + && has_format_option(FO_REMOVE_COMS); 56614 + int prev_was_comment; 56615 +#endif 56616 + 56617 56618 if (save_undo && u_save((linenr_T)(curwin->w_cursor.lnum - 1), 56619 (linenr_T)(curwin->w_cursor.lnum + count)) == FAIL) 56620 @@ -4174,6 +4327,17 @@ 56621 spaces = lalloc_clear((long_u)count, TRUE); 56622 if (spaces == NULL) 56623 return FAIL; 56624 +#if defined(FEAT_COMMENTS) || defined(PROTO) 56625 + if (remove_comments) 56626 + { 56627 + comments = (int *)lalloc_clear((long_u)count * sizeof(int), TRUE); 56628 + if (comments == NULL) 56629 + { 56630 + vim_free(spaces); 56631 + return FAIL; 56632 + } 56633 + } 56634 +#endif 56635 56636 /* 56637 * Don't move anything, just compute the final line length 56638 @@ -4181,7 +4345,26 @@ 51628 56639 */ 51629 56640 for (t = 0; t < count; ++t) … … 51631 56642 - curr = ml_get((linenr_T)(curwin->w_cursor.lnum + t)); 51632 56643 + curr = curr_start = ml_get((linenr_T)(curwin->w_cursor.lnum + t)); 56644 +#if defined(FEAT_COMMENTS) || defined(PROTO) 56645 + if (remove_comments) 56646 + { 56647 + /* We don't want to remove the comment leader if the 56648 + * previous line is not a comment. */ 56649 + if (t > 0 && prev_was_comment) 56650 + { 56651 + 56652 + char_u *new_curr = skip_comment(curr, TRUE, insert_space, 56653 + &prev_was_comment); 56654 + comments[t] = (int)(new_curr - curr); 56655 + curr = new_curr; 56656 + } 56657 + else 56658 + curr = skip_comment(curr, FALSE, insert_space, 56659 + &prev_was_comment); 56660 + } 56661 +#endif 56662 + 51633 56663 if (insert_space && t > 0) 51634 56664 { 51635 56665 curr = skipwhite(curr); 51636 @@ -4265,10 +4 323,10@@56666 @@ -4265,10 +4448,14 @@ 51637 56667 copy_spaces(cend, (size_t)(spaces[t])); 51638 56668 } … … 51644 56674 - curr = ml_get((linenr_T)(curwin->w_cursor.lnum + t - 1)); 51645 56675 + curr = curr_start = ml_get((linenr_T)(curwin->w_cursor.lnum + t - 1)); 56676 +#if defined(FEAT_COMMENTS) || defined(PROTO) 56677 + if (remove_comments) 56678 + curr += comments[t - 1]; 56679 +#endif 51646 56680 if (insert_space && t > 1) 51647 56681 curr = skipwhite(curr); 51648 56682 currsize = (int)STRLEN(curr); 51649 @@ -4388,7 +4446,7 @@ 56683 @@ -4306,6 +4493,10 @@ 56684 56685 theend: 56686 vim_free(spaces); 56687 +#if defined(FEAT_COMMENTS) || defined(PROTO) 56688 + if (remove_comments) 56689 + vim_free(comments); 56690 +#endif 56691 return ret; 56692 } 56693 56694 @@ -4388,7 +4579,7 @@ 51650 56695 #endif 51651 56696 … … 51656 56701 void 51657 56702 op_format(oap, keep_cursor) 51658 @@ -5712,7 +5770,9 @@ 56703 @@ -4539,9 +4730,11 @@ 56704 char_u *leader_flags = NULL; /* flags for leader of current line */ 56705 char_u *next_leader_flags; /* flags for leader of next line */ 56706 int do_comments; /* format comments */ 56707 + int do_comments_list = 0; /* format comments with 'n' or '2' */ 56708 #endif 56709 int advance = TRUE; 56710 - int second_indent = -1; 56711 + int second_indent = -1; /* indent for second line (comment 56712 + * aware) */ 56713 int do_second_indent; 56714 int do_number_indent; 56715 int do_trail_white; 56716 @@ -4644,18 +4837,46 @@ 56717 if (first_par_line 56718 && (do_second_indent || do_number_indent) 56719 && prev_is_end_par 56720 - && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count 56721 + && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count) 56722 + { 56723 + if (do_second_indent && !lineempty(curwin->w_cursor.lnum + 1)) 56724 + { 56725 #ifdef FEAT_COMMENTS 56726 - && leader_len == 0 56727 - && next_leader_len == 0 56728 + if (leader_len == 0 && next_leader_len == 0) 56729 + { 56730 + /* no comment found */ 56731 #endif 56732 - ) 56733 - { 56734 - if (do_second_indent 56735 - && !lineempty(curwin->w_cursor.lnum + 1)) 56736 - second_indent = get_indent_lnum(curwin->w_cursor.lnum + 1); 56737 + second_indent = 56738 + get_indent_lnum(curwin->w_cursor.lnum + 1); 56739 +#ifdef FEAT_COMMENTS 56740 + } 56741 + else 56742 + { 56743 + second_indent = next_leader_len; 56744 + do_comments_list = 1; 56745 + } 56746 +#endif 56747 + } 56748 else if (do_number_indent) 56749 - second_indent = get_number_indent(curwin->w_cursor.lnum); 56750 + { 56751 +#ifdef FEAT_COMMENTS 56752 + if (leader_len == 0 && next_leader_len == 0) 56753 + { 56754 + /* no comment found */ 56755 +#endif 56756 + second_indent = 56757 + get_number_indent(curwin->w_cursor.lnum); 56758 +#ifdef FEAT_COMMENTS 56759 + } 56760 + else 56761 + { 56762 + /* get_number_indent() is now "comment aware"... */ 56763 + second_indent = 56764 + get_number_indent(curwin->w_cursor.lnum); 56765 + do_comments_list = 1; 56766 + } 56767 +#endif 56768 + } 56769 } 56770 56771 /* 56772 @@ -4694,6 +4915,8 @@ 56773 insertchar(NUL, INSCHAR_FORMAT 56774 #ifdef FEAT_COMMENTS 56775 + (do_comments ? INSCHAR_DO_COM : 0) 56776 + + (do_comments && do_comments_list 56777 + ? INSCHAR_COM_LIST : 0) 56778 #endif 56779 + (avoid_fex ? INSCHAR_NO_FEX : 0), second_indent); 56780 State = old_State; 56781 @@ -4730,7 +4953,7 @@ 56782 (long)-next_leader_len); 56783 #endif 56784 curwin->w_cursor.lnum--; 56785 - if (do_join(2, TRUE, FALSE) == FAIL) 56786 + if (do_join(2, TRUE, FALSE, FALSE) == FAIL) 56787 { 56788 beep_flush(); 56789 break; 56790 @@ -4786,7 +5009,7 @@ 56791 56792 ptr = ml_get(lnum); 56793 if (do_comments) 56794 - *leader_len = get_leader_len(ptr, leader_flags, FALSE); 56795 + *leader_len = get_leader_len(ptr, leader_flags, FALSE, TRUE); 56796 else 56797 *leader_len = 0; 56798 56799 @@ -5712,7 +5935,9 @@ 51659 56800 } 51660 56801 } … … 51667 56808 clip_yank_selection(type, str, len, cbd) 51668 56809 int type; 51669 @@ -6069,9 +6 129,6 @@56810 @@ -6069,9 +6294,6 @@ 51670 56811 if (yank_type == MBLOCK) 51671 56812 yank_type = MAUTO; … … 51677 56818 51678 56819 # ifdef FEAT_CLIPBOARD 51679 @@ -6092,13 +6 149,14 @@56820 @@ -6092,13 +6314,14 @@ 51680 56821 * is appended. 51681 56822 */ … … 51694 56835 long start; 51695 56836 long i; 51696 @@ -6115,6 +6 173,12 @@56837 @@ -6115,6 +6338,12 @@ 51697 56838 if (y_ptr->y_array == NULL) /* NULL means empty register */ 51698 56839 y_ptr->y_size = 0; … … 51707 56848 * Count the number of lines within the string 51708 56849 */ 51709 @@ -6261,7 +6325,7 @@ 56850 @@ -6236,7 +6465,7 @@ 56851 long chars = 0; 56852 int is_word = 0; 56853 56854 - for (i = 0; line[i] && i < limit; ) 56855 + for (i = 0; i < limit && line[i] != NUL; ) 56856 { 56857 if (is_word) 56858 { 56859 @@ -6261,7 +6490,7 @@ 51710 56860 *wc += words; 51711 56861 … … 51717 56867 chars += eol_size; 51718 56868 diff -Naur vim73.orig/src/option.c vim73/src/option.c 51719 --- vim73.orig/src/option.c 201 2-06-03 23:09:52.952007375+000051720 +++ vim73/src/option.c 2012-0 6-03 23:09:55.676079868+000056869 --- vim73.orig/src/option.c 2010-08-04 18:49:18.000000000 +0000 56870 +++ vim73/src/option.c 2012-07-20 20:31:18.180978402 +0000 51721 56871 @@ -140,9 +140,6 @@ 51722 56872 #define PV_MOD OPT_BUF(BV_MOD) … … 51944 57094 #ifdef FEAT_WILDMENU 51945 57095 (char_u *)&p_wmnu, PV_NONE, 57096 @@ -3145,7 +3154,7 @@ 57097 { 57098 #ifdef HAVE_AVAIL_MEM 57099 /* Use amount of memory available at this moment. */ 57100 - n = (mch_avail_mem(FALSE) >> 11); 57101 + n = (mch_avail_mem(FALSE) >> 1); 57102 #else 57103 # ifdef HAVE_TOTAL_MEM 57104 /* Use amount of memory available to Vim. */ 51946 57105 @@ -3843,6 +3852,8 @@ 51947 57106 # ifndef OS2 /* Always use bourne shell style redirection if we reach this */ … … 52072 57231 check_string_option(&buf->b_p_cinw); 52073 57232 #endif 57233 @@ -6635,7 +6702,7 @@ 57234 { 57235 for (s = *varp; *s;) 57236 { 57237 - while(*s == ',' || *s == ' ') 57238 + while (*s == ',' || *s == ' ') 57239 s++; 57240 if (!*s) 57241 break; 52074 57242 @@ -6999,8 +7066,10 @@ 52075 57243 } … … 52095 57263 { 52096 57264 if (*s == '-' || *s == '+') 52097 @@ -7304, 7 +7376,7@@57265 @@ -7304,8 +7376,9 @@ 52098 57266 static char_u * 52099 57267 check_clipboard_option() 52100 57268 { 52101 57269 - int new_unnamed = FALSE; 57270 - int new_autoselect = FALSE; 52102 57271 + int new_unnamed = 0; 52103 int new_autoselect = FALSE; 57272 + int new_autoselect_star = FALSE; 57273 + int new_autoselect_plus = FALSE; 52104 57274 int new_autoselectml = FALSE; 52105 57275 int new_html = FALSE; 52106 @@ -7316,9 +7388,15 @@ 57276 regprog_T *new_exclude_prog = NULL; 57277 @@ -7316,17 +7389,29 @@ 52107 57278 { 52108 57279 if (STRNCMP(p, "unnamed", 7) == 0 && (p[7] == ',' || p[7] == NUL)) … … 52112 57283 p += 7; 52113 57284 } 52114 + 57285 + else if (STRNCMP(p, "unnamedplus", 11) == 0 52115 57286 + && (p[11] == ',' || p[11] == NUL)) 52116 57287 + { … … 52119 57290 + } 52120 57291 else if (STRNCMP(p, "autoselect", 10) == 0 52121 && (p[10] == ',' || p[10] == NUL)) 57292 - && (p[10] == ',' || p[10] == NUL)) 57293 + && (p[10] == ',' || p[10] == NUL)) 52122 57294 { 52123 @@ -7483,14 +7561,36 @@ 57295 - new_autoselect = TRUE; 57296 + new_autoselect_star = TRUE; 57297 p += 10; 57298 } 57299 + else if (STRNCMP(p, "autoselectplus", 14) == 0 57300 + && (p[14] == ',' || p[14] == NUL)) 57301 + { 57302 + new_autoselect_plus = TRUE; 57303 + p += 14; 57304 + } 57305 else if (STRNCMP(p, "autoselectml", 12) == 0 57306 - && (p[12] == ',' || p[12] == NUL)) 57307 + && (p[12] == ',' || p[12] == NUL)) 57308 { 57309 new_autoselectml = TRUE; 57310 p += 12; 57311 @@ -7355,7 +7440,8 @@ 57312 if (errmsg == NULL) 57313 { 57314 clip_unnamed = new_unnamed; 57315 - clip_autoselect = new_autoselect; 57316 + clip_autoselect_star = new_autoselect_star; 57317 + clip_autoselect_plus = new_autoselect_plus; 57318 clip_autoselectml = new_autoselectml; 57319 clip_html = new_html; 57320 vim_free(clip_exclude_prog); 57321 @@ -7483,14 +7569,36 @@ 52124 57322 compatible_set(); 52125 57323 } … … 52161 57359 /* If 'relativenumber' is set, reset 'number'. */ 52162 57360 if ((int *)varp == &curwin->w_p_nu && curwin->w_p_nu) 52163 @@ -7735,8 +78 35,6 @@57361 @@ -7735,8 +7843,6 @@ 52164 57362 { 52165 57363 if (curwin->w_p_wrap) … … 52170 57368 52171 57369 #ifdef FEAT_WINDOWS 52172 @@ -7763,9 +786 1,9 @@57370 @@ -7763,9 +7869,9 @@ 52173 57371 #ifdef FEAT_BEVAL 52174 57372 else if ((int *)varp == &p_beval) … … 52182 57380 } 52183 57381 #endif 52184 @@ -7798,6 +7 896,10 @@57382 @@ -7798,6 +7904,10 @@ 52185 57383 /* Only de-activate it here, it will be enabled when changing mode. */ 52186 57384 if (p_imdisable) … … 52193 57391 #endif 52194 57392 52195 @@ -7959,31 +806 1,8 @@57393 @@ -7959,31 +8069,8 @@ 52196 57394 curbuf->b_p_imsearch = B_IMODE_USE_INSERT; 52197 57395 # endif … … 52225 57423 52226 57424 /* 52227 @@ -7993,7 +80 72,9 @@57425 @@ -7993,7 +8080,9 @@ 52228 57426 options[opt_idx].flags |= P_WAS_SET; 52229 57427 … … 52236 57434 52237 57435 return NULL; 52238 @@ -8508,8 +85 89,9 @@57436 @@ -8508,8 +8597,9 @@ 52239 57437 options[opt_idx].flags |= P_WAS_SET; 52240 57438 … … 52248 57446 52249 57447 return errmsg; 52250 @@ -8523,8 +86 05,8 @@57448 @@ -8523,8 +8613,8 @@ 52251 57449 long_u flags; 52252 57450 { … … 52259 57457 #ifdef FEAT_WINDOWS 52260 57458 if ((flags & P_RSTAT) || all) /* mark all status lines dirty */ 52261 @@ -8535,7 +86 17,7 @@57459 @@ -8535,7 +8625,7 @@ 52262 57460 changed_window_setting(); 52263 57461 if (flags & P_RBUF) … … 52268 57466 else if (all) 52269 57467 redraw_all_later(NOT_VALID); 52270 @@ -9172,7 +92 54,7 @@57468 @@ -9172,7 +9262,7 @@ 52271 57469 int expand; 52272 57470 { … … 52277 57475 if (fprintf(fd, "%s %s=", cmd, name) < 0) 52278 57476 return FAIL; 52279 @@ -9190,9 +92 72,16 @@57477 @@ -9190,9 +9280,16 @@ 52280 57478 } 52281 57479 else if (expand) … … 52294 57492 else if (put_escstr(fd, *valuep, 2) == FAIL) 52295 57493 return FAIL; 52296 @@ -9645,9 +97 34,6 @@57494 @@ -9645,9 +9742,6 @@ 52297 57495 case PV_MA: return (char_u *)&(curbuf->b_p_ma); 52298 57496 case PV_MOD: return (char_u *)&(curbuf->b_changed); … … 52304 57502 #ifdef FEAT_TEXTOBJ 52305 57503 case PV_QE: return (char_u *)&(curbuf->b_p_qe); 52306 @@ -9756,6 +98 42,9 @@57504 @@ -9756,6 +9850,9 @@ 52307 57505 #ifdef FEAT_SCROLLBIND 52308 57506 to->wo_scb = from->wo_scb; … … 52314 57512 to->wo_spell = from->wo_spell; 52315 57513 #endif 52316 @@ -9995,9 +100 84,6 @@57514 @@ -9995,9 +10092,6 @@ 52317 57515 /* Don't copy 'filetype', it must be detected */ 52318 57516 buf->b_p_ft = empty_option; … … 52324 57522 #if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT) 52325 57523 buf->b_p_cinw = vim_strsave(p_cinw); 52326 @@ -10011,7 +10 097,7 @@57524 @@ -10011,7 +10105,7 @@ 52327 57525 buf->b_p_smc = p_smc; 52328 57526 #endif … … 52333 57531 buf->b_s.b_p_spf = vim_strsave(p_spf); 52334 57532 buf->b_s.b_p_spl = vim_strsave(p_spl); 52335 @@ -10877,7 +109 63,8 @@57533 @@ -10877,7 +10971,8 @@ 52336 57534 shortmess(x) 52337 57535 int x; … … 52343 57541 && vim_strchr((char_u *)SHM_A, x) != NULL)); 52344 57542 } 52345 @@ -11284,16 +1137 1,19 @@57543 @@ -11284,16 +11379,19 @@ 52346 57544 * from when editing started (save_file_ff() called). 52347 57545 * Also when 'endofline' was changed and 'binary' is set, or when 'bomb' was … … 52367 57565 return FALSE; 52368 57566 diff -Naur vim73.orig/src/option.h vim73/src/option.h 52369 --- vim73.orig/src/option.h 201 2-06-03 23:09:52.920006524+000052370 +++ vim73/src/option.h 2012-0 6-03 23:09:55.460074120+000057567 --- vim73.orig/src/option.h 2010-07-25 14:15:02.000000000 +0000 57568 +++ vim73/src/option.h 2012-07-20 20:31:18.070978324 +0000 52371 57569 @@ -33,7 +33,7 @@ 52372 57570 # ifdef EBCDIC … … 52378 57576 # endif 52379 57577 # endif 52380 @@ -169,10 +169,12 @@ 57578 @@ -104,10 +104,11 @@ 57579 #define FO_ONE_LETTER '1' 57580 #define FO_WHITE_PAR 'w' /* trailing white space continues paragr. */ 57581 #define FO_AUTO 'a' /* automatic formatting */ 57582 +#define FO_REMOVE_COMS 'j' /* remove comment leaders when joining lines */ 57583 57584 #define DFLT_FO_VI "vt" 57585 #define DFLT_FO_VIM "tcq" 57586 -#define FO_ALL "tcroq2vlb1mMBn,aw" /* for do_set() */ 57587 +#define FO_ALL "tcroq2vlb1mMBn,awj" /* for do_set() */ 57588 57589 /* characters for the p_cpo option: */ 57590 #define CPO_ALTREAD 'a' /* ":read" sets alternate file name */ 57591 @@ -169,10 +170,12 @@ 52381 57592 #define CPO_SUBPERCENT '/' /* % in :s string uses previous one */ 52382 57593 #define CPO_BACKSL '\\' /* \ is not special in [] */ … … 52393 57604 /* characters for p_ww option: */ 52394 57605 #define WW_ALL "bshl<>[],~" 52395 @@ -391,6 +393,7 @@ 57606 @@ -226,6 +229,7 @@ 57607 #define GO_MENUS 'm' /* use menu bar */ 57608 #define GO_NOSYSMENU 'M' /* don't source system menu */ 57609 #define GO_POINTER 'p' /* pointer enter/leave callbacks */ 57610 +#define GO_ASELPLUS 'P' /* autoselectPlus */ 57611 #define GO_RIGHT 'r' /* use right scrollbar */ 57612 #define GO_VRIGHT 'R' /* right scrollbar with vert split */ 57613 #define GO_TEAROFF 't' /* add tear-off menu items */ 57614 @@ -391,6 +395,7 @@ 52396 57615 EXTERN char_u *p_cpo; /* 'cpoptions' */ 52397 57616 #ifdef FEAT_CSCOPE … … 52401 57620 EXTERN char_u *p_csqf; /* 'cscopequickfix' */ 52402 57621 # define CSQF_CMDS "sgdctefi" 52403 @@ -709,6 +71 2,7 @@57622 @@ -709,6 +714,7 @@ 52404 57623 #endif 52405 57624 EXTERN char_u *p_shq; /* 'shellquote' */ … … 52409 57628 #ifdef AMIGA 52410 57629 EXTERN long p_st; /* 'shelltype' */ 52411 @@ -816,7 +82 0,7 @@57630 @@ -816,7 +822,7 @@ 52412 57631 EXTERN char_u *p_ttym; /* 'ttymouse' */ 52413 57632 EXTERN unsigned ttym_flags; … … 52418 57637 # define TTYM_XTERM 0x01 52419 57638 # define TTYM_XTERM2 0x02 52420 @@ -824,6 +8 28,7 @@57639 @@ -824,6 +830,7 @@ 52421 57640 # define TTYM_NETTERM 0x08 52422 57641 # define TTYM_JSBTERM 0x10 … … 52426 57645 EXTERN char_u *p_udir; /* 'undodir' */ 52427 57646 EXTERN long p_ul; /* 'undolevels' */ 52428 @@ -854,7 +8 59,11 @@57647 @@ -854,7 +861,11 @@ 52429 57648 # define VE_ONEMORE 8 52430 57649 #endif … … 52439 57658 #ifdef FEAT_CMDL_COMPL 52440 57659 EXTERN char_u *p_wop; /* 'wildoptions' */ 52441 @@ -872,6 +88 1,7 @@57660 @@ -872,6 +883,7 @@ 52442 57661 EXTERN char_u *p_ww; /* 'whichwrap' */ 52443 57662 EXTERN long p_wc; /* 'wildchar' */ … … 52447 57666 #ifdef FEAT_WILDMENU 52448 57667 EXTERN int p_wmnu; /* 'wildmenu' */ 52449 @@ -979,9 +9 89,6 @@57668 @@ -979,9 +991,6 @@ 52450 57669 , BV_MOD 52451 57670 , BV_MPS … … 52458 57677 #endif 52459 57678 diff -Naur vim73.orig/src/os_amiga.c vim73/src/os_amiga.c 52460 --- vim73.orig/src/os_amiga.c 2012-06-03 23:09:52.920006524 +0000 52461 +++ vim73/src/os_amiga.c 2012-06-03 23:09:54.876058577 +0000 57679 --- vim73.orig/src/os_amiga.c 2010-05-15 11:04:08.000000000 +0000 57680 +++ vim73/src/os_amiga.c 2012-07-20 20:31:17.630978008 +0000 57681 @@ -191,16 +191,16 @@ 57682 } 57683 57684 /* 57685 - * Return amount of memory still available. 57686 + * Return amount of memory still available in Kbyte. 57687 */ 57688 long_u 57689 mch_avail_mem(special) 57690 int special; 57691 { 57692 #ifdef __amigaos4__ 57693 - return (long_u)AvailMem(MEMF_ANY); 57694 + return (long_u)AvailMem(MEMF_ANY) >> 10; 57695 #else 57696 - return (long_u)AvailMem(special ? (long)MEMF_CHIP : (long)MEMF_ANY); 57697 + return (long_u)(AvailMem(special ? (long)MEMF_CHIP : (long)MEMF_ANY)) >> 10; 57698 #endif 57699 } 57700 52462 57701 @@ -1022,7 +1022,7 @@ 52463 57702 … … 52470 57709 id = (struct InfoData *)(((long)id_a + 3L) & ~3L); 52471 57710 diff -Naur vim73.orig/src/os_mac_conv.c vim73/src/os_mac_conv.c 52472 --- vim73.orig/src/os_mac_conv.c 201 2-06-03 23:09:52.932006845+000052473 +++ vim73/src/os_mac_conv.c 2012-0 6-03 23:09:54.876058577+000057711 --- vim73.orig/src/os_mac_conv.c 2010-07-14 11:50:20.000000000 +0000 57712 +++ vim73/src/os_mac_conv.c 2012-07-20 20:31:13.047641389 +0000 52474 57713 @@ -14,6 +14,8 @@ 52475 57714 */ … … 52491 57730 * there is an incomplete byte sequence. Only do up to 6 bytes to avoid 52492 57731 diff -Naur vim73.orig/src/os_macosx.m vim73/src/os_macosx.m 52493 --- vim73.orig/src/os_macosx.m 201 2-06-03 23:09:52.948007269+000052494 +++ vim73/src/os_macosx.m 2012-0 6-03 23:09:54.356044740 +000057732 --- vim73.orig/src/os_macosx.m 2010-08-15 10:56:50.000000000 +0000 57733 +++ vim73/src/os_macosx.m 2012-07-20 20:31:11.617640360 +0000 52495 57734 @@ -15,6 +15,11 @@ 52496 57735 Error: MACOS 9 is no longer supported in Vim 7 … … 52560 57799 int len = [string lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; 52561 57800 diff -Naur vim73.orig/src/os_msdos.c vim73/src/os_msdos.c 52562 --- vim73.orig/src/os_msdos.c 201 2-06-03 23:09:52.952007375+000052563 +++ vim73/src/os_msdos.c 2012-0 6-03 23:09:54.320043782+000057801 --- vim73.orig/src/os_msdos.c 2010-05-15 11:04:07.000000000 +0000 57802 +++ vim73/src/os_msdos.c 2012-07-20 20:31:17.634311344 +0000 52564 57803 @@ -21,7 +21,6 @@ 52565 57804 * Some functions are also used for Win16 (MS-Windows 3.1). … … 52570 57809 52571 57810 #include <conio.h> 57811 @@ -551,15 +550,15 @@ 57812 #endif 57813 57814 /* 57815 - * Return amount of memory currently available. 57816 + * Return amount of memory currently available in Kbyte. 57817 */ 57818 long_u 57819 mch_avail_mem(int special) 57820 { 57821 #ifdef DJGPP 57822 - return _go32_dpmi_remaining_virtual_memory(); 57823 + return _go32_dpmi_remaining_virtual_memory() >> 10; 57824 #else 57825 - return coreleft(); 57826 + return coreleft() >> 10; 57827 #endif 57828 } 57829 52572 57830 @@ -2233,7 +2232,7 @@ 52573 57831 void … … 52595 57853 /* Did we get anything? */ 52596 57854 diff -Naur vim73.orig/src/os_mswin.c vim73/src/os_mswin.c 52597 --- vim73.orig/src/os_mswin.c 201 2-06-03 23:09:52.952007375+000052598 +++ vim73/src/os_mswin.c 2012-0 6-03 23:09:54.944060388+000057855 --- vim73.orig/src/os_mswin.c 2010-07-27 19:39:05.000000000 +0000 57856 +++ vim73/src/os_mswin.c 2012-07-20 20:31:13.320974919 +0000 52599 57857 @@ -22,7 +22,6 @@ 52600 57858 # endif … … 53019 58277 53020 58278 diff -Naur vim73.orig/src/os_qnx.c vim73/src/os_qnx.c 53021 --- vim73.orig/src/os_qnx.c 201 2-06-03 23:09:52.948007269+000053022 +++ vim73/src/os_qnx.c 2012-0 6-03 23:09:54.784056130+000058279 --- vim73.orig/src/os_qnx.c 2010-05-24 09:42:44.000000000 +0000 58280 +++ vim73/src/os_qnx.c 2012-07-20 20:31:12.814307887 +0000 53023 58281 @@ -24,10 +24,10 @@ 53024 58282 #if defined(FEAT_GUI_PHOTON) … … 53185 58443 #endif 53186 58444 diff -Naur vim73.orig/src/os_riscos.c vim73/src/os_riscos.c 53187 --- vim73.orig/src/os_riscos.c 201 2-06-03 23:09:52.940007057+000058445 --- vim73.orig/src/os_riscos.c 2010-05-15 11:04:08.000000000 +0000 53188 58446 +++ vim73/src/os_riscos.c 1970-01-01 00:00:00.000000000 +0000 53189 58447 @@ -1,1292 +0,0 @@ … … 54481 59739 -} 54482 59740 diff -Naur vim73.orig/src/os_riscos.h vim73/src/os_riscos.h 54483 --- vim73.orig/src/os_riscos.h 201 2-06-03 23:09:52.940007057+000059741 --- vim73.orig/src/os_riscos.h 2010-05-23 12:16:06.000000000 +0000 54484 59742 +++ vim73/src/os_riscos.h 1970-01-01 00:00:00.000000000 +0000 54485 59743 @@ -1,166 +0,0 @@ … … 54651 59909 -#define mch_setenv(name, val, x) setenv(name, val, x) 54652 59910 diff -Naur vim73.orig/src/os_unix.c vim73/src/os_unix.c 54653 --- vim73.orig/src/os_unix.c 201 2-06-03 23:09:52.940007057+000054654 +++ vim73/src/os_unix.c 2012-0 6-03 23:09:55.740081571+000059911 --- vim73.orig/src/os_unix.c 2010-08-08 13:14:04.000000000 +0000 59912 +++ vim73/src/os_unix.c 2012-07-20 20:31:15.784310019 +0000 54655 59913 @@ -154,6 +154,13 @@ 54656 59914 … … 55265 60523 return FALSE; 55266 60524 diff -Naur vim73.orig/src/os_unix.h vim73/src/os_unix.h 55267 --- vim73.orig/src/os_unix.h 201 2-06-03 23:09:52.920006524+000055268 +++ vim73/src/os_unix.h 2012-0 6-03 23:09:53.744028453+000060525 --- vim73.orig/src/os_unix.h 2010-05-23 12:16:14.000000000 +0000 60526 +++ vim73/src/os_unix.h 2012-07-20 20:31:09.687638968 +0000 55269 60527 @@ -184,10 +184,6 @@ 55270 60528 … … 55279 60537 #endif 55280 60538 diff -Naur vim73.orig/src/os_win16.c vim73/src/os_win16.c 55281 --- vim73.orig/src/os_win16.c 201 2-06-03 23:09:52.920006524+000055282 +++ vim73/src/os_win16.c 2012-0 6-03 23:09:54.876058577+000060539 --- vim73.orig/src/os_win16.c 2010-06-26 04:03:31.000000000 +0000 60540 +++ vim73/src/os_win16.c 2012-07-20 20:31:17.634311344 +0000 55283 60541 @@ -20,13 +20,11 @@ 55284 60542 # pragma warn -obs … … 55307 60565 { 55308 60566 PostQuitMessage(msg.wParam); 60567 @@ -381,13 +379,13 @@ 60568 60569 60570 /* 60571 - * How much memory is available? 60572 + * How much memory is available in Kbyte? 60573 */ 60574 long_u 60575 mch_avail_mem( 60576 int special) 60577 { 60578 - return GetFreeSpace(0); 60579 + return GetFreeSpace(0) >> 10; 60580 } 60581 60582 55309 60583 diff -Naur vim73.orig/src/os_win32.c vim73/src/os_win32.c 55310 --- vim73.orig/src/os_win32.c 201 2-06-03 23:09:52.956007482+000055311 +++ vim73/src/os_win32.c 2012-0 6-03 23:09:55.524075823+000060584 --- vim73.orig/src/os_win32.c 2010-07-14 14:49:36.000000000 +0000 60585 +++ vim73/src/os_win32.c 2012-07-20 20:31:18.294311815 +0000 55312 60586 @@ -20,7 +20,6 @@ 55313 60587 * Roger Knobbe <rogerk@wonderware.com> did the initial port of Vim 3.0. … … 55341 60615 /* Win32 Console handles for input and output */ 55342 60616 static HANDLE g_hConIn = INVALID_HANDLE_VALUE; 55343 @@ -206, 42 +212,96@@60617 @@ -206,55 +212,109 @@ 55344 60618 static int suppress_winsize = 1; /* don't fiddle with console */ 55345 60619 #endif … … 55419 60693 + int l = (int)STRLEN(p); 55420 60694 + int n; 55421 + 60695 60696 - did_set_PATH = TRUE; 55422 60697 + while (*p != NUL) 55423 60698 + { … … 55431 60706 + p += n; 55432 60707 + l -= n; 55433 +}55434 +}55435 + 60708 } 60709 } 60710 55436 60711 +/* 55437 60712 + * Load library "name". … … 55442 60717 + HINSTANCE dll = NULL; 55443 60718 + char old_dir[MAXPATHL]; 55444 55445 - did_set_PATH = TRUE; 60719 + 55446 60720 + if (exe_path == NULL) 55447 60721 + get_exe_name(); … … 55454 60728 + dll = LoadLibrary(name); 55455 60729 + mch_chdir(old_dir); 55456 60730 + } 55457 60731 + return dll; 55458 55459 60732 +} 60733 + 55460 60734 #if defined(DYNAMIC_GETTEXT) || defined(PROTO) 55461 @@ -254,7 +314,7 @@ 60735 # ifndef GETTEXT_DLL 60736 # define GETTEXT_DLL "libintl.dll" 60737 # endif 60738 -/* Dummy funcitons */ 60739 +/* Dummy functions */ 60740 static char *null_libintl_gettext(const char *); 60741 static char *null_libintl_textdomain(const char *); 55462 60742 static char *null_libintl_bindtextdomain(const char *, const char *); 55463 60743 static char *null_libintl_bind_textdomain_codeset(const char *, const char *); … … 55541 60821 } 55542 60822 } 60823 @@ -1342,7 +1409,7 @@ 60824 60825 60826 /* 60827 - * mch_inchar(): low-level input funcion. 60828 + * mch_inchar(): low-level input function. 60829 * Get one or more characters from the keyboard or the mouse. 60830 * If time == 0, do not wait for characters. 60831 * If time == n, wait a short time for characters. 55543 60832 @@ -1615,6 +1682,35 @@ 55544 60833 return TRUE; … … 55872 61161 + ret = PeekNamedPipe(g_hChildStd_OUT_Rd, /* pipe to query */ 55873 61162 + NULL, /* optional buffer */ 55874 + 0, /* buffe size */61163 + 0, /* buffer size */ 55875 61164 + NULL, /* number of read bytes */ 55876 61165 + &availableBytes, /* available bytes total */ … … 55879 61168 + repeatCount = 0; 55880 61169 + /* We got real data in the pipe, read it */ 55881 + while (ret != 0 && availableBytes > 0 && availableBytes > 0)61170 + while (ret != 0 && availableBytes > 0) 55882 61171 + { 55883 61172 + repeatCount++; … … 56059 61348 + NULL, /* Thread security attributes */ 56060 61349 + 56061 + // this command can be litig eous, handle inheritence was61350 + // this command can be litigious, handle inheritance was 56062 61351 + // deactivated for pending temp file, but, if we deactivate 56063 61352 + // it, the pipes don't work for some reason. … … 56532 61821 ) 56533 61822 { 61823 @@ -4273,18 +4992,34 @@ 61824 61825 61826 /* 61827 - * How much memory is available? 61828 + * How much memory is available in Kbyte? 61829 * Return sum of available physical and page file memory. 61830 */ 61831 /*ARGSUSED*/ 61832 long_u 61833 mch_avail_mem(int special) 61834 { 61835 - MEMORYSTATUS ms; 61836 +#ifdef MEMORYSTATUSEX 61837 + PlatformId(); 61838 + if (g_PlatformId == VER_PLATFORM_WIN32_NT) 61839 + { 61840 + MEMORYSTATUSEX ms; 61841 + 61842 + /* Need to use GlobalMemoryStatusEx() when there is more memory than 61843 + * what fits in 32 bits. But it's not always available. */ 61844 + ms.dwLength = sizeof(MEMORYSTATUSEX); 61845 + GlobalMemoryStatusEx(&ms); 61846 + return (long_u)((ms.ullAvailPhys + ms.ullAvailPageFile) >> 10); 61847 + } 61848 + else 61849 +#endif 61850 + { 61851 + MEMORYSTATUS ms; 61852 61853 - ms.dwLength = sizeof(MEMORYSTATUS); 61854 - GlobalMemoryStatus(&ms); 61855 - return (long_u) (ms.dwAvailPhys + ms.dwAvailPageFile); 61856 + ms.dwLength = sizeof(MEMORYSTATUS); 61857 + GlobalMemoryStatus(&ms); 61858 + return (long_u)((ms.dwAvailPhys + ms.dwAvailPageFile) >> 10); 61859 + } 61860 } 61861 61862 #ifdef FEAT_MBYTE 56534 61863 diff -Naur vim73.orig/src/os_win32.h vim73/src/os_win32.h 56535 --- vim73.orig/src/os_win32.h 201 2-06-03 23:09:52.940007057+000056536 +++ vim73/src/os_win32.h 2012-0 6-03 23:09:54.588050913+000061864 --- vim73.orig/src/os_win32.h 2010-05-31 19:50:24.000000000 +0000 61865 +++ vim73/src/os_win32.h 2012-07-20 20:31:12.314307528 +0000 56537 61866 @@ -191,5 +191,19 @@ 56538 61867 #ifdef __BORLANDC__ … … 56557 61886 #endif 56558 61887 diff -Naur vim73.orig/src/popupmnu.c vim73/src/popupmnu.c 56559 --- vim73.orig/src/popupmnu.c 201 2-06-03 23:09:52.948007269+000056560 +++ vim73/src/popupmnu.c 2012-0 6-03 23:09:53.272015892 +000061888 --- vim73.orig/src/popupmnu.c 2010-08-08 13:14:58.000000000 +0000 61889 +++ vim73/src/popupmnu.c 2012-07-20 20:31:08.150971192 +0000 56561 61890 @@ -558,8 +558,11 @@ 56562 61891 win_T *curwin_save = curwin; … … 56573 61902 56574 61903 diff -Naur vim73.orig/src/proto/buffer.pro vim73/src/proto/buffer.pro 56575 --- vim73.orig/src/proto/buffer.pro 201 2-06-03 23:09:52.948007269+000056576 +++ vim73/src/proto/buffer.pro 2012-0 6-03 23:09:55.472074438+000061904 --- vim73.orig/src/proto/buffer.pro 2010-08-15 12:30:19.000000000 +0000 61905 +++ vim73/src/proto/buffer.pro 2012-07-20 20:31:18.014311616 +0000 56577 61906 @@ -1,7 +1,7 @@ 56578 61907 /* buffer.c */ … … 56584 61913 void buf_freeall __ARGS((buf_T *buf, int flags)); 56585 61914 void goto_buffer __ARGS((exarg_T *eap, int start, int dir, int count)); 61915 @@ -60,6 +60,7 @@ 61916 int buf_findsign_id __ARGS((buf_T *buf, linenr_T lnum)); 61917 int buf_findsigntype_id __ARGS((buf_T *buf, linenr_T lnum, int typenr)); 61918 int buf_signcount __ARGS((buf_T *buf, linenr_T lnum)); 61919 +void buf_delete_signs __ARGS((buf_T *buf)); 61920 void buf_delete_all_signs __ARGS((void)); 61921 void sign_list_placed __ARGS((buf_T *rbuf)); 61922 void sign_mark_adjust __ARGS((linenr_T line1, linenr_T line2, long amount, long amount_after)); 56586 61923 diff -Naur vim73.orig/src/proto/edit.pro vim73/src/proto/edit.pro 56587 --- vim73.orig/src/proto/edit.pro 201 2-06-03 23:09:52.944007163+000056588 +++ vim73/src/proto/edit.pro 2012-0 6-03 23:09:55.816083593+000061924 --- vim73.orig/src/proto/edit.pro 2010-08-15 12:30:22.000000000 +0000 61925 +++ vim73/src/proto/edit.pro 2012-07-20 20:31:16.054310214 +0000 56589 61926 @@ -39,4 +39,5 @@ 56590 61927 int hkmap __ARGS((int c)); … … 56594 61931 /* vim: set ft=c : */ 56595 61932 diff -Naur vim73.orig/src/proto/eval.pro vim73/src/proto/eval.pro 56596 --- vim73.orig/src/proto/eval.pro 201 2-06-03 23:09:52.944007163+000056597 +++ vim73/src/proto/eval.pro 2012-0 6-03 23:09:54.748055172+000061933 --- vim73.orig/src/proto/eval.pro 2010-08-15 12:30:23.000000000 +0000 61934 +++ vim73/src/proto/eval.pro 2012-07-20 20:31:18.257645124 +0000 56598 61935 @@ -23,6 +23,7 @@ 56599 61936 list_T *eval_spell_expr __ARGS((char_u *badword, char_u *expr)); … … 56604 61941 long call_func_retnr __ARGS((char_u *func, int argc, char_u **argv, int safe)); 56605 61942 void *call_func_retlist __ARGS((char_u *func, int argc, char_u **argv, int safe)); 56606 @@ -52,6 +53,7 @@ 61943 @@ -45,13 +46,23 @@ 61944 list_T *list_alloc __ARGS((void)); 61945 void list_unref __ARGS((list_T *l)); 61946 void list_free __ARGS((list_T *l, int recurse)); 61947 +listitem_T *listitem_alloc __ARGS((void)); 61948 +void listitem_remove __ARGS((list_T *l, listitem_T *item)); 61949 dictitem_T *dict_lookup __ARGS((hashitem_T *hi)); 61950 +listitem_T *list_find __ARGS((list_T *l, long n)); 61951 char_u *list_find_str __ARGS((list_T *l, long idx)); 61952 +void list_append __ARGS((list_T *l, listitem_T *item)); 61953 int list_append_tv __ARGS((list_T *l, typval_T *tv)); 61954 int list_append_dict __ARGS((list_T *list, dict_T *dict)); 56607 61955 int list_append_string __ARGS((list_T *l, char_u *str, int len)); 61956 +int list_insert_tv __ARGS((list_T *l, typval_T *tv, listitem_T *item)); 61957 +void list_remove __ARGS((list_T *l, listitem_T *item, listitem_T *item2)); 56608 61958 int garbage_collect __ARGS((void)); 61959 +void set_ref_in_ht __ARGS((hashtab_T *ht, int copyID)); 61960 +void set_ref_in_list __ARGS((list_T *l, int copyID)); 61961 +void set_ref_in_item __ARGS((typval_T *tv, int copyID)); 56609 61962 dict_T *dict_alloc __ARGS((void)); 56610 61963 +void dict_unref __ARGS((dict_T *d)); … … 56612 61965 void dictitem_free __ARGS((dictitem_T *item)); 56613 61966 int dict_add __ARGS((dict_T *d, dictitem_T *item)); 61967 @@ -62,6 +73,7 @@ 61968 long get_dict_number __ARGS((dict_T *d, char_u *key)); 61969 char_u *get_function_name __ARGS((expand_T *xp, int idx)); 61970 char_u *get_expr_name __ARGS((expand_T *xp, int idx)); 61971 +int func_call __ARGS((char_u *name, typval_T *args, dict_T *selfdict, typval_T *rettv)); 61972 long do_searchpair __ARGS((char_u *spat, char_u *mpat, char_u *epat, int dir, char_u *skip, int flags, pos_T *match_pos, linenr_T lnum_stop, long time_limit)); 61973 void set_vim_var_nr __ARGS((int idx, long val)); 61974 long get_vim_var_nr __ARGS((int idx)); 61975 @@ -81,7 +93,7 @@ 61976 char_u *get_tv_string_chk __ARGS((typval_T *varp)); 61977 char_u *get_var_value __ARGS((char_u *name)); 61978 void new_script_vars __ARGS((scid_T id)); 61979 -void init_var_dict __ARGS((dict_T *dict, dictitem_T *dict_var)); 61980 +void init_var_dict __ARGS((dict_T *dict, dictitem_T *dict_var, int scope)); 61981 void vars_clear __ARGS((hashtab_T *ht)); 61982 void copy_tv __ARGS((typval_T *from, typval_T *to)); 61983 void ex_echo __ARGS((exarg_T *eap)); 61984 @@ -92,6 +104,8 @@ 61985 void func_dump_profile __ARGS((FILE *fd)); 61986 char_u *get_user_func_name __ARGS((expand_T *xp, int idx)); 61987 void ex_delfunction __ARGS((exarg_T *eap)); 61988 +void func_unref __ARGS((char_u *name)); 61989 +void func_ref __ARGS((char_u *name)); 61990 void ex_return __ARGS((exarg_T *eap)); 61991 int do_return __ARGS((exarg_T *eap, int reanimate, int is_cmd, void *rettv)); 61992 void discard_pending_return __ARGS((void *rettv)); 56614 61993 diff -Naur vim73.orig/src/proto/ex_cmds.pro vim73/src/proto/ex_cmds.pro 56615 --- vim73.orig/src/proto/ex_cmds.pro 201 2-06-03 23:09:52.944007163+000056616 +++ vim73/src/proto/ex_cmds.pro 2012-0 6-03 23:09:55.780082635 +000061994 --- vim73.orig/src/proto/ex_cmds.pro 2010-08-15 12:30:24.000000000 +0000 61995 +++ vim73/src/proto/ex_cmds.pro 2012-07-20 20:31:15.897643435 +0000 56617 61996 @@ -23,6 +23,7 @@ 56618 61997 void ex_update __ARGS((exarg_T *eap)); … … 56624 62003 int not_writing __ARGS((void)); 56625 62004 diff -Naur vim73.orig/src/proto/ex_cmds2.pro vim73/src/proto/ex_cmds2.pro 56626 --- vim73.orig/src/proto/ex_cmds2.pro 2012-06-03 23:09:52.944007163 +0000 56627 +++ vim73/src/proto/ex_cmds2.pro 2012-06-03 23:09:54.204040695 +0000 62005 --- vim73.orig/src/proto/ex_cmds2.pro 2010-08-15 12:30:25.000000000 +0000 62006 +++ vim73/src/proto/ex_cmds2.pro 2012-07-20 20:31:17.374311158 +0000 62007 @@ -42,7 +42,7 @@ 62008 int check_fname __ARGS((void)); 62009 int buf_write_all __ARGS((buf_T *buf, int forceit)); 62010 int get_arglist __ARGS((garray_T *gap, char_u *str)); 62011 -int get_arglist_exp __ARGS((char_u *str, int *fcountp, char_u ***fnamesp)); 62012 +int get_arglist_exp __ARGS((char_u *str, int *fcountp, char_u ***fnamesp, int wig)); 62013 void set_arglist __ARGS((char_u *str)); 62014 void check_arg_idx __ARGS((win_T *win)); 62015 void ex_args __ARGS((exarg_T *eap)); 56628 62016 @@ -83,5 +83,7 @@ 56629 62017 char_u *get_mess_lang __ARGS((void)); … … 56635 62023 /* vim: set ft=c : */ 56636 62024 diff -Naur vim73.orig/src/proto/ex_docmd.pro vim73/src/proto/ex_docmd.pro 56637 --- vim73.orig/src/proto/ex_docmd.pro 201 2-06-03 23:09:52.944007163+000056638 +++ vim73/src/proto/ex_docmd.pro 2012-0 6-03 23:09:55.316070287+000062025 --- vim73.orig/src/proto/ex_docmd.pro 2010-08-15 12:30:26.000000000 +0000 62026 +++ vim73/src/proto/ex_docmd.pro 2012-07-20 20:31:14.470975744 +0000 56639 62027 @@ -1,7 +1,7 @@ 56640 62028 /* ex_docmd.c */ … … 56647 62035 int checkforcmd __ARGS((char_u **pp, char *cmd, int len)); 56648 62036 diff -Naur vim73.orig/src/proto/ex_getln.pro vim73/src/proto/ex_getln.pro 56649 --- vim73.orig/src/proto/ex_getln.pro 201 2-06-03 23:09:52.944007163+000056650 +++ vim73/src/proto/ex_getln.pro 2012-0 6-03 23:09:54.204040695+000062037 --- vim73.orig/src/proto/ex_getln.pro 2010-08-15 12:30:27.000000000 +0000 62038 +++ vim73/src/proto/ex_getln.pro 2012-07-20 20:31:11.154306693 +0000 56651 62039 @@ -31,7 +31,7 @@ 56652 62040 char_u *addstar __ARGS((char_u *fname, int len, int context)); … … 56659 62047 int get_histtype __ARGS((char_u *name)); 56660 62048 diff -Naur vim73.orig/src/proto/fileio.pro vim73/src/proto/fileio.pro 56661 --- vim73.orig/src/proto/fileio.pro 201 2-06-03 23:09:52.944007163+000056662 +++ vim73/src/proto/fileio.pro 2012-0 6-03 23:09:55.536076142+000062049 --- vim73.orig/src/proto/fileio.pro 2010-08-15 12:30:28.000000000 +0000 62050 +++ vim73/src/proto/fileio.pro 2012-07-20 20:31:15.164309576 +0000 56663 62051 @@ -35,6 +35,7 @@ 56664 62052 void do_autocmd __ARGS((char_u *arg, int forceit)); … … 56685 62073 /* vim: set ft=c : */ 56686 62074 diff -Naur vim73.orig/src/proto/getchar.pro vim73/src/proto/getchar.pro 56687 --- vim73.orig/src/proto/getchar.pro 201 2-06-03 23:09:52.944007163+000056688 +++ vim73/src/proto/getchar.pro 2012-0 6-03 23:09:55.352071245+000062075 --- vim73.orig/src/proto/getchar.pro 2010-08-15 12:30:29.000000000 +0000 62076 +++ vim73/src/proto/getchar.pro 2012-07-20 20:31:14.557642473 +0000 56689 62077 @@ -4,8 +4,9 @@ 56690 62078 char_u *get_inserted __ARGS((void)); … … 56716 62104 /* vim: set ft=c : */ 56717 62105 diff -Naur vim73.orig/src/proto/gui_athena.pro vim73/src/proto/gui_athena.pro 56718 --- vim73.orig/src/proto/gui_athena.pro 201 2-06-03 23:09:52.944007163+000056719 +++ vim73/src/proto/gui_athena.pro 2012-0 6-03 23:09:53.620025153+000062106 --- vim73.orig/src/proto/gui_athena.pro 2010-08-15 12:31:06.000000000 +0000 62107 +++ vim73/src/proto/gui_athena.pro 2012-07-20 20:31:09.297638687 +0000 56720 62108 @@ -27,5 +27,5 @@ 56721 62109 void gui_mch_set_scrollbar_colors __ARGS((scrollbar_T *sb)); … … 56726 62114 /* vim: set ft=c : */ 56727 62115 diff -Naur vim73.orig/src/proto/gui_gtk.pro vim73/src/proto/gui_gtk.pro 56728 --- vim73.orig/src/proto/gui_gtk.pro 201 2-06-03 23:09:52.944007163+000056729 +++ vim73/src/proto/gui_gtk.pro 2012-0 6-03 23:09:53.620025153+000062116 --- vim73.orig/src/proto/gui_gtk.pro 2010-08-15 12:31:03.000000000 +0000 62117 +++ vim73/src/proto/gui_gtk.pro 2012-07-20 20:31:09.297638687 +0000 56730 62118 @@ -13,7 +13,7 @@ 56731 62119 void gui_mch_destroy_scrollbar __ARGS((scrollbar_T *sb)); … … 56738 62126 void gui_mch_find_dialog __ARGS((exarg_T *eap)); 56739 62127 diff -Naur vim73.orig/src/proto/gui_gtk_x11.pro vim73/src/proto/gui_gtk_x11.pro 56740 --- vim73.orig/src/proto/gui_gtk_x11.pro 201 2-06-03 23:09:52.944007163+000056741 +++ vim73/src/proto/gui_gtk_x11.pro 2012-0 6-03 23:09:55.860084763+000062128 --- vim73.orig/src/proto/gui_gtk_x11.pro 2010-08-15 12:31:07.000000000 +0000 62129 +++ vim73/src/proto/gui_gtk_x11.pro 2012-07-20 20:31:16.160976957 +0000 56742 62130 @@ -4,6 +4,7 @@ 56743 62131 void gui_mch_set_blinking __ARGS((long waittime, long on, long off)); … … 56757 62145 void gui_mch_settitle __ARGS((char_u *title, char_u *icon)); 56758 62146 diff -Naur vim73.orig/src/proto/gui_mac.pro vim73/src/proto/gui_mac.pro 56759 --- vim73.orig/src/proto/gui_mac.pro 201 2-06-03 23:09:52.944007163+000056760 +++ vim73/src/proto/gui_mac.pro 2012-0 6-03 23:09:53.620025153+000062147 --- vim73.orig/src/proto/gui_mac.pro 2010-08-14 19:40:45.000000000 +0000 62148 +++ vim73/src/proto/gui_mac.pro 2012-07-20 20:31:09.297638687 +0000 56761 62149 @@ -81,7 +81,7 @@ 56762 62150 int gui_mch_get_mouse_y __ARGS((void)); … … 56769 62157 void gui_mch_show_tabline __ARGS((int showit)); 56770 62158 diff -Naur vim73.orig/src/proto/gui_motif.pro vim73/src/proto/gui_motif.pro 56771 --- vim73.orig/src/proto/gui_motif.pro 201 2-06-03 23:09:52.944007163+000056772 +++ vim73/src/proto/gui_motif.pro 2012-0 6-03 23:09:53.620025153+000062159 --- vim73.orig/src/proto/gui_motif.pro 2010-08-15 12:31:04.000000000 +0000 62160 +++ vim73/src/proto/gui_motif.pro 2012-07-20 20:31:09.297638687 +0000 56773 62161 @@ -29,7 +29,7 @@ 56774 62162 void gui_mch_set_scrollbar_colors __ARGS((scrollbar_T *sb)); … … 56781 62169 void gui_mch_show_toolbar __ARGS((int showit)); 56782 62170 diff -Naur vim73.orig/src/proto/gui_photon.pro vim73/src/proto/gui_photon.pro 56783 --- vim73.orig/src/proto/gui_photon.pro 201 2-06-03 23:09:52.944007163+000056784 +++ vim73/src/proto/gui_photon.pro 2012-0 6-03 23:09:53.620025153+000062171 --- vim73.orig/src/proto/gui_photon.pro 2010-08-15 12:31:10.000000000 +0000 62172 +++ vim73/src/proto/gui_photon.pro 2012-07-20 20:31:09.297638687 +0000 56785 62173 @@ -8,7 +8,7 @@ 56786 62174 void gui_mch_update __ARGS((void)); … … 56793 62181 void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height, int direction)); 56794 62182 diff -Naur vim73.orig/src/proto/gui_riscos.pro vim73/src/proto/gui_riscos.pro 56795 --- vim73.orig/src/proto/gui_riscos.pro 201 2-06-03 23:09:52.944007163+000062183 --- vim73.orig/src/proto/gui_riscos.pro 2010-05-15 11:04:08.000000000 +0000 56796 62184 +++ vim73/src/proto/gui_riscos.pro 1970-01-01 00:00:00.000000000 +0000 56797 62185 @@ -1,66 +0,0 @@ … … 56863 62251 -/* vim: set ft=c : */ 56864 62252 diff -Naur vim73.orig/src/proto/gui_w16.pro vim73/src/proto/gui_w16.pro 56865 --- vim73.orig/src/proto/gui_w16.pro 201 2-06-03 23:09:52.944007163+000056866 +++ vim73/src/proto/gui_w16.pro 2012-0 6-03 23:09:53.620025153 +000062253 --- vim73.orig/src/proto/gui_w16.pro 2010-08-15 12:31:09.000000000 +0000 62254 +++ vim73/src/proto/gui_w16.pro 2012-07-20 20:31:09.300972023 +0000 56867 62255 @@ -74,6 +74,6 @@ 56868 62256 void gui_mch_add_menu_item __ARGS((vimmenu_T *menu, int idx)); … … 56874 62262 /* vim: set ft=c : */ 56875 62263 diff -Naur vim73.orig/src/proto/gui_w32.pro vim73/src/proto/gui_w32.pro 56876 --- vim73.orig/src/proto/gui_w32.pro 201 2-06-03 23:09:52.944007163+000056877 +++ vim73/src/proto/gui_w32.pro 2012-0 6-03 23:09:53.620025153 +000062264 --- vim73.orig/src/proto/gui_w32.pro 2010-08-15 12:31:09.000000000 +0000 62265 +++ vim73/src/proto/gui_w32.pro 2012-07-20 20:31:09.300972023 +0000 56878 62266 @@ -81,7 +81,7 @@ 56879 62267 void gui_mch_add_menu_item __ARGS((vimmenu_T *menu, int idx)); … … 56886 62274 void *gui_mch_register_sign __ARGS((char_u *signfile)); 56887 62275 diff -Naur vim73.orig/src/proto/if_lua.pro vim73/src/proto/if_lua.pro 56888 --- vim73.orig/src/proto/if_lua.pro 201 2-06-03 23:09:52.948007269+000056889 +++ vim73/src/proto/if_lua.pro 2012-0 6-03 23:09:55.704080614+000062276 --- vim73.orig/src/proto/if_lua.pro 2010-07-22 19:29:02.000000000 +0000 62277 +++ vim73/src/proto/if_lua.pro 2012-07-20 20:31:15.690976620 +0000 56890 62278 @@ -6,4 +6,6 @@ 56891 62279 void ex_luafile __ARGS((exarg_T *eap)); … … 56896 62284 /* vim: set ft=c : */ 56897 62285 diff -Naur vim73.orig/src/proto/if_mzsch.pro vim73/src/proto/if_mzsch.pro 56898 --- vim73.orig/src/proto/if_mzsch.pro 201 2-06-03 23:09:52.944007163+000056899 +++ vim73/src/proto/if_mzsch.pro 2012-0 6-03 23:09:55.416072949+000062286 --- vim73.orig/src/proto/if_mzsch.pro 2010-05-15 11:04:08.000000000 +0000 62287 +++ vim73/src/proto/if_mzsch.pro 2012-07-20 20:31:14.807642652 +0000 56900 62288 @@ -14,6 +14,7 @@ 56901 62289 void mzvim_reset_timer __ARGS((void)); … … 56907 62295 +int vim_main2 __ARGS((int argc, char **argv)); 56908 62296 /* vim: set ft=c : */ 62297 diff -Naur vim73.orig/src/proto/if_python.pro vim73/src/proto/if_python.pro 62298 --- vim73.orig/src/proto/if_python.pro 2010-08-15 12:30:35.000000000 +0000 62299 +++ vim73/src/proto/if_python.pro 2012-07-20 20:31:17.334311130 +0000 62300 @@ -6,4 +6,6 @@ 62301 void ex_pyfile __ARGS((exarg_T *eap)); 62302 void python_buffer_free __ARGS((buf_T *buf)); 62303 void python_window_free __ARGS((win_T *win)); 62304 +void do_pyeval __ARGS((char_u *str, typval_T *rettv)); 62305 +void set_ref_in_python __ARGS((int copyID)); 62306 /* vim: set ft=c : */ 62307 diff -Naur vim73.orig/src/proto/if_python3.pro vim73/src/proto/if_python3.pro 62308 --- vim73.orig/src/proto/if_python3.pro 2010-08-15 12:30:36.000000000 +0000 62309 +++ vim73/src/proto/if_python3.pro 2012-07-20 20:31:17.337644466 +0000 62310 @@ -6,4 +6,6 @@ 62311 void ex_py3file __ARGS((exarg_T *eap)); 62312 void python3_buffer_free __ARGS((buf_T *buf)); 62313 void python3_window_free __ARGS((win_T *win)); 62314 +void do_py3eval __ARGS((char_u *str, typval_T *rettv)); 62315 +void set_ref_in_python3 __ARGS((int copyID)); 62316 /* vim: set ft=c : */ 56909 62317 diff -Naur vim73.orig/src/proto/mbyte.pro vim73/src/proto/mbyte.pro 56910 --- vim73.orig/src/proto/mbyte.pro 201 2-06-03 23:09:52.944007163+000056911 +++ vim73/src/proto/mbyte.pro 2012-0 6-03 23:09:54.572050488+000062318 --- vim73.orig/src/proto/mbyte.pro 2010-08-15 12:30:44.000000000 +0000 62319 +++ vim73/src/proto/mbyte.pro 2012-07-20 20:31:12.267640827 +0000 56912 62320 @@ -2,6 +2,7 @@ 56913 62321 int enc_canon_props __ARGS((char_u *name)); … … 56928 62336 int mb_charlen_len __ARGS((char_u *str, int len)); 56929 62337 diff -Naur vim73.orig/src/proto/message.pro vim73/src/proto/message.pro 56930 --- vim73.orig/src/proto/message.pro 201 2-06-03 23:09:52.944007163+000056931 +++ vim73/src/proto/message.pro 2012-0 6-03 23:09:55.664079548+000062338 --- vim73.orig/src/proto/message.pro 2010-08-15 12:30:41.000000000 +0000 62339 +++ vim73/src/proto/message.pro 2012-07-20 20:31:15.597643219 +0000 56932 62340 @@ -4,7 +4,7 @@ 56933 62341 int msg_attr __ARGS((char_u *s, int attr)); … … 56964 62372 int vim_dialog_yesno __ARGS((int type, char_u *title, char_u *message, int dflt)); 56965 62373 int vim_dialog_yesnocancel __ARGS((int type, char_u *title, char_u *message, int dflt)); 62374 diff -Naur vim73.orig/src/proto/misc1.pro vim73/src/proto/misc1.pro 62375 --- vim73.orig/src/proto/misc1.pro 2010-08-15 12:30:42.000000000 +0000 62376 +++ vim73/src/proto/misc1.pro 2012-07-20 20:31:16.614310614 +0000 62377 @@ -6,7 +6,8 @@ 62378 int set_indent __ARGS((int size, int flags)); 62379 int get_number_indent __ARGS((linenr_T lnum)); 62380 int open_line __ARGS((int dir, int flags, int old_indent)); 62381 -int get_leader_len __ARGS((char_u *line, char_u **flags, int backward)); 62382 +int get_leader_len __ARGS((char_u *line, char_u **flags, int backward, int do_skip_space)); 62383 +int get_last_leader_offset __ARGS((char_u *line, char_u **flags)); 62384 int plines __ARGS((linenr_T lnum)); 62385 int plines_win __ARGS((win_T *wp, linenr_T lnum, int winheight)); 62386 int plines_nofill __ARGS((linenr_T lnum)); 56966 62387 diff -Naur vim73.orig/src/proto/misc2.pro vim73/src/proto/misc2.pro 56967 --- vim73.orig/src/proto/misc2.pro 201 2-06-03 23:09:52.944007163+000056968 +++ vim73/src/proto/misc2.pro 2012-0 6-03 23:09:55.148065818+000062388 --- vim73.orig/src/proto/misc2.pro 2010-08-15 12:30:42.000000000 +0000 62389 +++ vim73/src/proto/misc2.pro 2012-07-20 20:31:13.947642036 +0000 56969 62390 @@ -14,6 +14,7 @@ 56970 62391 linenr_T get_cursor_rel_lnum __ARGS((win_T *wp, linenr_T lnum)); … … 56997 62418 +int has_non_ascii __ARGS((char_u *s)); 56998 62419 /* vim: set ft=c : */ 62420 diff -Naur vim73.orig/src/proto/ops.pro vim73/src/proto/ops.pro 62421 --- vim73.orig/src/proto/ops.pro 2010-08-15 12:30:45.000000000 +0000 62422 +++ vim73/src/proto/ops.pro 2012-07-20 20:31:16.614310614 +0000 62423 @@ -36,7 +36,7 @@ 62424 int preprocs_left __ARGS((void)); 62425 int get_register_name __ARGS((int num)); 62426 void ex_display __ARGS((exarg_T *eap)); 62427 -int do_join __ARGS((long count, int insert_space, int save_undo)); 62428 +int do_join __ARGS((long count, int insert_space, int save_undo, int use_formatoptions)); 62429 void op_format __ARGS((oparg_T *oap, int keep_cursor)); 62430 void op_formatexpr __ARGS((oparg_T *oap)); 62431 int fex_format __ARGS((linenr_T lnum, long count, int c)); 56999 62432 diff -Naur vim73.orig/src/proto/option.pro vim73/src/proto/option.pro 57000 --- vim73.orig/src/proto/option.pro 201 2-06-03 23:09:52.944007163+000057001 +++ vim73/src/proto/option.pro 2012-0 6-03 23:09:53.628025365+000062433 --- vim73.orig/src/proto/option.pro 2010-08-15 12:30:46.000000000 +0000 62434 +++ vim73/src/proto/option.pro 2012-07-20 20:31:09.320972037 +0000 57002 62435 @@ -54,6 +54,6 @@ 57003 62436 int option_was_set __ARGS((char_u *name)); … … 57009 62442 /* vim: set ft=c : */ 57010 62443 diff -Naur vim73.orig/src/proto/os_riscos.pro vim73/src/proto/os_riscos.pro 57011 --- vim73.orig/src/proto/os_riscos.pro 201 2-06-03 23:09:52.944007163+000062444 --- vim73.orig/src/proto/os_riscos.pro 2010-08-15 12:31:16.000000000 +0000 57012 62445 +++ vim73/src/proto/os_riscos.pro 1970-01-01 00:00:00.000000000 +0000 57013 62446 @@ -1,49 +0,0 @@ … … 57062 62495 -/* vim: set ft=c : */ 57063 62496 diff -Naur vim73.orig/src/proto/os_win32.pro vim73/src/proto/os_win32.pro 57064 --- vim73.orig/src/proto/os_win32.pro 201 2-06-03 23:09:52.944007163+000057065 +++ vim73/src/proto/os_win32.pro 2012-0 6-03 23:09:54.016035691+000062497 --- vim73.orig/src/proto/os_win32.pro 2010-08-15 12:31:14.000000000 +0000 62498 +++ vim73/src/proto/os_win32.pro 2012-07-20 20:31:10.627639646 +0000 57066 62499 @@ -1,4 +1,5 @@ 57067 62500 /* os_win32.c */ … … 57081 62514 int mch_nodetype __ARGS((char_u *name)); 57082 62515 diff -Naur vim73.orig/src/proto/term.pro vim73/src/proto/term.pro 57083 --- vim73.orig/src/proto/term.pro 201 2-06-03 23:09:52.944007163+000057084 +++ vim73/src/proto/term.pro 2012-0 6-03 23:09:55.364071565+000062516 --- vim73.orig/src/proto/term.pro 2010-08-15 12:30:56.000000000 +0000 62517 +++ vim73/src/proto/term.pro 2012-07-20 20:31:14.587642496 +0000 57085 62518 @@ -50,7 +50,7 @@ 57086 62519 char_u *get_termcode __ARGS((int i)); … … 57092 62525 int find_term_bykeys __ARGS((char_u *src)); 57093 62526 void show_termcodes __ARGS((void)); 62527 diff -Naur vim73.orig/src/proto/ui.pro vim73/src/proto/ui.pro 62528 --- vim73.orig/src/proto/ui.pro 2010-08-15 12:30:57.000000000 +0000 62529 +++ vim73/src/proto/ui.pro 2012-07-20 20:31:18.070978324 +0000 62530 @@ -11,17 +11,17 @@ 62531 void ui_new_shellsize __ARGS((void)); 62532 void ui_breakcheck __ARGS((void)); 62533 void clip_init __ARGS((int can_use)); 62534 -void clip_update_selection __ARGS((void)); 62535 +void clip_update_selection __ARGS((VimClipboard *clip)); 62536 void clip_own_selection __ARGS((VimClipboard *cbd)); 62537 void clip_lose_selection __ARGS((VimClipboard *cbd)); 62538 -void clip_copy_selection __ARGS((void)); 62539 void clip_auto_select __ARGS((void)); 62540 -int clip_isautosel __ARGS((void)); 62541 +int clip_isautosel_star __ARGS((void)); 62542 +int clip_isautosel_plus __ARGS((void)); 62543 void clip_modeless __ARGS((int button, int is_click, int is_drag)); 62544 void clip_start_selection __ARGS((int col, int row, int repeated_click)); 62545 void clip_process_selection __ARGS((int button, int col, int row, int_u repeated_click)); 62546 void clip_may_redraw_selection __ARGS((int row, int col, int len)); 62547 -void clip_clear_selection __ARGS((void)); 62548 +void clip_clear_selection __ARGS((VimClipboard *cbd)); 62549 void clip_may_clear_selection __ARGS((int row1, int row2)); 62550 void clip_scroll_selection __ARGS((int rows)); 62551 void clip_copy_modeless_selection __ARGS((int both)); 57094 62552 diff -Naur vim73.orig/src/proto/window.pro vim73/src/proto/window.pro 57095 --- vim73.orig/src/proto/window.pro 201 2-06-03 23:09:52.944007163+000057096 +++ vim73/src/proto/window.pro 2012-0 6-03 23:09:55.484074758+000062553 --- vim73.orig/src/proto/window.pro 2010-08-15 12:30:59.000000000 +0000 62554 +++ vim73/src/proto/window.pro 2012-07-20 20:31:18.337645181 +0000 57097 62555 @@ -1,13 +1,14 @@ 57098 62556 /* window.c */ … … 57111 62569 void win_close_othertab __ARGS((win_T *win, int free_buf, tabpage_T *tp)); 57112 62570 void win_free_all __ARGS((void)); 62571 @@ -26,7 +27,7 @@ 62572 tabpage_T *find_tabpage __ARGS((int n)); 62573 int tabpage_index __ARGS((tabpage_T *ftp)); 62574 void goto_tabpage __ARGS((int n)); 62575 -void goto_tabpage_tp __ARGS((tabpage_T *tp)); 62576 +void goto_tabpage_tp __ARGS((tabpage_T *tp, int trigger_autocmds)); 62577 void goto_tabpage_win __ARGS((tabpage_T *tp, win_T *wp)); 62578 void tabpage_move __ARGS((int nr)); 62579 void win_goto __ARGS((win_T *wp)); 62580 @@ -50,6 +51,8 @@ 62581 void win_setminheight __ARGS((void)); 62582 void win_drag_status_line __ARGS((win_T *dragwin, int offset)); 62583 void win_drag_vsep_line __ARGS((win_T *dragwin, int offset)); 62584 +void win_new_height __ARGS((win_T *wp, int height)); 62585 +void win_new_width __ARGS((win_T *wp, int width)); 62586 void win_comp_scroll __ARGS((win_T *wp)); 62587 void command_height __ARGS((void)); 62588 void last_status __ARGS((int morewin)); 57113 62589 diff -Naur vim73.orig/src/proto.h vim73/src/proto.h 57114 --- vim73.orig/src/proto.h 201 2-06-03 23:09:52.940007057+000057115 +++ vim73/src/proto.h 2012-0 6-03 23:09:54.096037821+000062590 --- vim73.orig/src/proto.h 2010-07-17 15:28:51.000000000 +0000 62591 +++ vim73/src/proto.h 2012-07-20 20:31:10.807639777 +0000 57116 62592 @@ -62,9 +62,6 @@ 57117 62593 # ifdef __BEOS__ … … 57135 62611 # endif 57136 62612 diff -Naur vim73.orig/src/pty.c vim73/src/pty.c 57137 --- vim73.orig/src/pty.c 201 2-06-03 23:09:52.952007375+000057138 +++ vim73/src/pty.c 2012-0 6-03 23:09:55.244068371+000062613 --- vim73.orig/src/pty.c 2010-07-24 18:23:01.000000000 +0000 62614 +++ vim73/src/pty.c 2012-07-20 20:31:14.287642279 +0000 57139 62615 @@ -14,6 +14,10 @@ 57140 62616 * It has been modified to work better with Vim. … … 57188 62664 close(f); 57189 62665 diff -Naur vim73.orig/src/quickfix.c vim73/src/quickfix.c 57190 --- vim73.orig/src/quickfix.c 201 2-06-03 23:09:52.940007057+000057191 +++ vim73/src/quickfix.c 2012-0 6-03 23:09:55.964087533+000062666 --- vim73.orig/src/quickfix.c 2010-08-09 20:12:14.000000000 +0000 62667 +++ vim73/src/quickfix.c 2012-07-20 20:31:17.374311158 +0000 57192 62668 @@ -126,12 +126,14 @@ 57193 62669 static win_T *qf_find_win __ARGS((qf_info_T *qi)); … … 57591 63067 } 57592 63068 if (au_name != NULL) 63069 @@ -3122,7 +3189,7 @@ 63070 ; 63071 63072 /* parse the list of arguments */ 63073 - if (get_arglist_exp(p, &fcount, &fnames) == FAIL) 63074 + if (get_arglist_exp(p, &fcount, &fnames, TRUE) == FAIL) 63075 goto theend; 63076 if (fcount == 0) 63077 { 57593 63078 @@ -3130,6 +3197,11 @@ 57594 63079 goto theend; … … 57955 63440 qf_jump(qi, 0, 0, FALSE); 57956 63441 diff -Naur vim73.orig/src/regexp.c vim73/src/regexp.c 57957 --- vim73.orig/src/regexp.c 201 2-06-03 23:09:52.956007482+000057958 +++ vim73/src/regexp.c 2012-0 6-03 23:09:54.512048891+000063442 --- vim73.orig/src/regexp.c 2010-07-12 20:41:48.000000000 +0000 63443 +++ vim73/src/regexp.c 2012-07-20 20:31:12.114307384 +0000 57959 63444 @@ -666,8 +666,12 @@ 57960 63445 static void regc __ARGS((int b)); … … 58343 63828 can_f_submatch = FALSE; 58344 63829 diff -Naur vim73.orig/src/screen.c vim73/src/screen.c 58345 --- vim73.orig/src/screen.c 2012-06-03 23:09:52.948007269 +0000 58346 +++ vim73/src/screen.c 2012-06-03 23:09:55.944087000 +0000 58347 @@ -764,9 +764,13 @@ 63830 --- vim73.orig/src/screen.c 2010-08-13 13:21:27.000000000 +0000 63831 +++ vim73/src/screen.c 2012-07-20 20:31:18.064311652 +0000 63832 @@ -89,6 +89,9 @@ 63833 63834 #include "vim.h" 63835 63836 +#define MB_FILLER_CHAR '<' /* character used when a double-width character 63837 + * doesn't fit. */ 63838 + 63839 /* 63840 * The attributes that are actually active for writing to the screen. 63841 */ 63842 @@ -516,8 +519,10 @@ 63843 # endif 63844 # ifdef FEAT_CLIPBOARD 63845 /* When Visual area changed, may have to update selection. */ 63846 - if (clip_star.available && clip_isautosel()) 63847 - clip_update_selection(); 63848 + if (clip_star.available && clip_isautosel_star()) 63849 + clip_update_selection(&clip_star); 63850 + if (clip_plus.available && clip_isautosel_plus()) 63851 + clip_update_selection(&clip_plus); 63852 # endif 63853 #ifdef FEAT_GUI 63854 /* Remove the cursor before starting to do anything, because 63855 @@ -764,9 +769,13 @@ 58348 63856 doit = TRUE; 58349 63857 } … … 58362 63870 58363 63871 /* update all windows that need updating */ 58364 @@ -1633,11 +1637,11 @@ 63872 @@ -807,8 +816,10 @@ 63873 63874 #ifdef FEAT_CLIPBOARD 63875 /* When Visual area changed, may have to update selection. */ 63876 - if (clip_star.available && clip_isautosel()) 63877 - clip_update_selection(); 63878 + if (clip_star.available && clip_isautosel_star()) 63879 + clip_update_selection(&clip_star); 63880 + if (clip_plus.available && clip_isautosel_plus()) 63881 + clip_update_selection(&clip_plus); 63882 #endif 63883 63884 win_update(wp); 63885 @@ -1633,11 +1644,11 @@ 58365 63886 * When at start of changed lines: May scroll following lines 58366 63887 * up or down to minimize redrawing. … … 58376 63897 int old_rows = 0; 58377 63898 int new_rows = 0; 58378 @@ -1864,12 +18 68,12 @@63899 @@ -1864,12 +1875,12 @@ 58379 63900 if (row > wp->w_height) /* past end of screen */ 58380 63901 { … … 58391 63912 ++idx; 58392 63913 #ifdef FEAT_FOLDING 58393 @@ -1986,7 +199 0,7 @@63914 @@ -1986,7 +1997,7 @@ 58394 63915 } 58395 63916 #endif … … 58400 63921 58401 63922 /* make sure the rest of the screen is blank */ 58402 @@ -2001,7 +20 05,7 @@63923 @@ -2001,7 +2012,7 @@ 58403 63924 wp->w_old_botfill = wp->w_botfill; 58404 63925 #endif … … 58409 63930 /* 58410 63931 * There is a trick with w_botline. If we invalidate it on each 58411 @@ -2317,7 +232 1,7 @@63932 @@ -2317,7 +2328,7 @@ 58412 63933 num = (long)lnum; 58413 63934 else … … 58418 63939 sprintf((char *)buf, "%*ld ", w, num); 58419 63940 #ifdef FEAT_RIGHTLEFT 58420 @@ -2531,7 +25 35,9 @@63941 @@ -2531,7 +2542,9 @@ 58421 63942 /* Visual block mode: highlight the chars part of the block */ 58422 63943 if (wp->w_old_cursor_fcol + txtcol < (colnr_T)W_WIDTH(wp)) … … 58429 63950 else 58430 63951 len = W_WIDTH(wp) - txtcol; 58431 @@ -3405,9 +3411,9 @@ 63952 @@ -2991,7 +3004,10 @@ 63953 area_highlighting = TRUE; 63954 attr = hl_attr(HLF_V); 63955 #if defined(FEAT_CLIPBOARD) && defined(FEAT_X11) 63956 - if (clip_star.available && !clip_star.owned && clip_isautosel()) 63957 + if ((clip_star.available && !clip_star.owned 63958 + && clip_isautosel_star()) 63959 + || (clip_plus.available && !clip_plus.owned 63960 + && clip_isautosel_plus())) 63961 attr = hl_attr(HLF_VNC); 63962 #endif 63963 } 63964 @@ -3222,8 +3238,7 @@ 63965 /* no bad word found at line start, don't check until end of a 63966 * word */ 63967 spell_hlf = HLF_COUNT; 63968 - word_end = (int)(spell_to_word_end(ptr, wp) 63969 - - line + 1); 63970 + word_end = (int)(spell_to_word_end(ptr, wp) - line + 1); 63971 } 63972 else 63973 { 63974 @@ -3405,9 +3420,9 @@ 58432 63975 # endif 58433 63976 ) … … 58441 63984 58442 63985 /* Draw two cells with the sign value or blank. */ 58443 @@ -3475,8 +34 81,7 @@63986 @@ -3475,8 +3490,7 @@ 58444 63987 num = (long)lnum; 58445 63988 else … … 58451 63994 sprintf((char *)extra, "%*ld ", 58452 63995 number_width(wp), num); 58453 @@ -3496,9 +35 01,11 @@63996 @@ -3496,9 +3510,11 @@ 58454 63997 char_attr = hl_attr(HLF_N); 58455 63998 #ifdef FEAT_SYN_HL … … 58465 64008 } 58466 64009 } 58467 @@ -3559,7 +35 66,7 @@64010 @@ -3559,7 +3575,7 @@ 58468 64011 } 58469 64012 … … 58474 64017 #ifdef FEAT_DIFF 58475 64018 && filler_todo <= 0 58476 @@ -4253,7 +4260,7 @@ 64019 @@ -4010,7 +4026,7 @@ 64020 if (n_skip > 0 && mb_l > 1 && n_extra == 0) 64021 { 64022 n_extra = 1; 64023 - c_extra = '<'; 64024 + c_extra = MB_FILLER_CHAR; 64025 c = ' '; 64026 if (area_attr == 0 && search_attr == 0) 64027 { 64028 @@ -4253,7 +4269,7 @@ 58477 64029 { 58478 64030 /* tab amount depends on current column */ … … 58483 64035 mb_utf8 = FALSE; /* don't draw as UTF-8 */ 58484 64036 #endif 58485 @@ -5366,6 +5373,12 @@ 64037 @@ -4570,6 +4586,15 @@ 64038 c = lcs_prec; 64039 lcs_prec_todo = NUL; 64040 #ifdef FEAT_MBYTE 64041 + if (has_mbyte && (*mb_char2cells)(mb_c) > 1) 64042 + { 64043 + /* Double-width character being overwritten by the "precedes" 64044 + * character, need to fill up half the character. */ 64045 + c_extra = MB_FILLER_CHAR; 64046 + n_extra = 1; 64047 + n_attr = 2; 64048 + extra_attr = hl_attr(HLF_AT); 64049 + } 64050 mb_c = c; 64051 if (enc_utf8 && (*mb_char2len)(c) > 1) 64052 { 64053 @@ -5366,6 +5391,12 @@ 58486 64054 # define CHAR_CELLS 1 58487 64055 #endif … … 58496 64064 clip_may_clear_selection(row, row); 58497 64065 # endif 58498 @@ -6436,6 +64 49,8 @@64066 @@ -6436,6 +6467,8 @@ 58499 64067 struct stl_hlrec hltab[STL_MAX_ITEM]; 58500 64068 struct stl_hlrec tabtab[STL_MAX_ITEM]; … … 58505 64073 /* setup environment for the task at hand */ 58506 64074 if (wp == NULL) 58507 @@ -6514,16 +65 29,31 @@64075 @@ -6514,16 +6547,31 @@ 58508 64076 if (maxwidth <= 0) 58509 64077 return; … … 58540 64108 { 58541 64109 #ifdef FEAT_MBYTE 58542 @@ -6591,16 +66 21,17 @@64110 @@ -6591,16 +6639,17 @@ 58543 64111 int row, col; 58544 64112 int attr; … … 58565 64133 } 58566 64134 58567 @@ -7827,15 +78 58,15 @@64135 @@ -7827,15 +7876,15 @@ 58568 64136 58569 64137 /* … … 58585 64153 } 58586 64154 58587 @@ -7850,8 +78 81,8 @@64155 @@ -7850,8 +7899,8 @@ 58588 64156 * final size of the shell is needed. 58589 64157 */ … … 58596 64164 int new_row, old_row; 58597 64165 #ifdef FEAT_GUI 58598 @@ -8047,7 +80 78,7 @@64166 @@ -8047,7 +8096,7 @@ 58599 64167 * (used when resizing the window at the "--more--" prompt or when 58600 64168 * executing an external command, for the GUI). … … 58605 64173 (void)vim_memset(new_ScreenLines + new_row * Columns, 58606 64174 ' ', (size_t)Columns * sizeof(schar_T)); 58607 @@ -8137,7 +81 68,7 @@64175 @@ -8137,7 +8186,7 @@ 58608 64176 screen_Columns = Columns; 58609 64177 … … 58614 64182 58615 64183 #ifdef FEAT_GUI 64184 @@ -9018,7 +9067,7 @@ 64185 || (wp != NULL && wp->w_width != Columns) 64186 # endif 64187 ) 64188 - clip_clear_selection(); 64189 + clip_clear_selection(&clip_star); 64190 else 64191 clip_scroll_selection(-line_count); 64192 #endif 64193 @@ -9239,7 +9288,7 @@ 64194 || (wp != NULL && wp->w_width != Columns) 64195 # endif 64196 ) 64197 - clip_clear_selection(); 64198 + clip_clear_selection(&clip_star); 64199 else 64200 clip_scroll_selection(line_count); 64201 #endif 58616 64202 diff -Naur vim73.orig/src/search.c vim73/src/search.c 58617 --- vim73.orig/src/search.c 201 2-06-03 23:09:52.956007482+000058618 +++ vim73/src/search.c 2012-0 6-03 23:09:55.336070819+000064203 --- vim73.orig/src/search.c 2010-07-14 14:49:41.000000000 +0000 64204 +++ vim73/src/search.c 2012-07-20 20:31:18.304311823 +0000 58619 64205 @@ -1161,12 +1161,20 @@ 58620 64206 { … … 58643 64229 58644 64230 if (pat != NULL && *pat != NUL) /* look for (new) offset */ 58645 @@ -1538, 6 +1546,7@@64231 @@ -1538,8 +1546,9 @@ 58646 64232 int col; 58647 64233 char_u *p; … … 58649 64235 + int stop = TRUE; 58650 64236 #ifdef FEAT_MBYTE 58651 static char_u bytes[MB_MAXBYTES]; 64237 - static char_u bytes[MB_MAXBYTES]; 64238 + static char_u bytes[MB_MAXBYTES + 1]; 58652 64239 static int bytelen = 1; /* >1 for multi-byte char */ 64240 #endif 64241 58653 64242 @@ -1572,6 +1581,12 @@ 58654 64243 t_cmd = last_t_cmd; … … 58783 64372 #ifdef FEAT_INS_EXPAND 58784 64373 /* when CONT_SOL is set compare "ptr" with the beginning of the line 64374 @@ -4892,7 +4901,7 @@ 64375 #ifdef FEAT_COMMENTS 64376 if ((*line != '#' || 64377 STRNCMP(skipwhite(line + 1), "define", 6) != 0) 64378 - && get_leader_len(line, NULL, FALSE)) 64379 + && get_leader_len(line, NULL, FALSE, TRUE)) 64380 matched = FALSE; 64381 64382 /* 58785 64383 @@ -5075,9 +5084,7 @@ 58786 64384 if (win_split(0, 0) == FAIL) … … 58794 64392 if (depth == -1) 58795 64393 { 64394 @@ -5134,7 +5141,7 @@ 64395 && !(compl_cont_status & CONT_SOL) 64396 #endif 64397 && *startp != NUL 64398 - && *(p = startp + 1) != NUL) 64399 + && *(p = startp + MB_PTR2LEN(startp)) != NUL) 64400 goto search_line; 64401 } 64402 line_breakcheck(); 58796 64403 @@ -5222,11 +5229,6 @@ 58797 64404 vim_free(regmatch.regprog); … … 58807 64414 static void 58808 64415 diff -Naur vim73.orig/src/spell.c vim73/src/spell.c 58809 --- vim73.orig/src/spell.c 201 2-06-03 23:09:52.924006631+000058810 +++ vim73/src/spell.c 2012-0 6-03 23:09:55.960087426+000064416 --- vim73.orig/src/spell.c 2010-08-01 13:43:01.000000000 +0000 64417 +++ vim73/src/spell.c 2012-07-20 20:31:17.387644502 +0000 58811 64418 @@ -303,10 +303,6 @@ 58812 64419 * few bytes as possible, see offset2bytes()) … … 59135 64742 return n; 59136 64743 } 64744 @@ -8531,7 +8553,7 @@ 64745 } 64746 64747 /* Expand all the remaining arguments (e.g., $VIMRUNTIME). */ 64748 - if (get_arglist_exp(arg, &fcount, &fnames) == OK) 64749 + if (get_arglist_exp(arg, &fcount, &fnames, FALSE) == OK) 64750 { 64751 mkspell(fcount, fnames, ascii, eap->forceit, FALSE); 64752 FreeWild(fcount, fnames); 59137 64753 @@ -8548,7 +8570,7 @@ 59138 64754 spellinfo_T *spin; … … 59556 65172 } 59557 65173 diff -Naur vim73.orig/src/structs.h vim73/src/structs.h 59558 --- vim73.orig/src/structs.h 201 2-06-03 23:09:52.924006631+000059559 +++ vim73/src/structs.h 2012-0 6-03 23:09:55.316070287+000065174 --- vim73.orig/src/structs.h 2010-08-07 14:59:27.000000000 +0000 65175 +++ vim73/src/structs.h 2012-07-20 20:31:18.260978460 +0000 59560 65176 @@ -378,6 +378,35 @@ 59561 65177 typedef long blocknr_T; … … 59659 65275 int m_noremap; /* if non-zero no re-mapping for m_str */ 59660 65276 char m_silent; /* <silent> used, don't echo commands */ 59661 @@ -1506,9 +1530,6 @@ 65277 @@ -1082,6 +1106,11 @@ 65278 #define VAR_DICT 5 /* "v_dict" is used */ 65279 #define VAR_FLOAT 6 /* "v_float" is used */ 65280 65281 +/* Values for "dv_scope". */ 65282 +#define VAR_SCOPE 1 /* a:, v:, s:, etc. scope dictionaries */ 65283 +#define VAR_DEF_SCOPE 2 /* l:, g: scope dictionaries: here funcrefs are not 65284 + allowed to mask existing functions */ 65285 + 65286 /* Values for "v_lock". */ 65287 #define VAR_LOCKED 1 /* locked with lock(), can use unlock() */ 65288 #define VAR_FIXED 2 /* locked forever */ 65289 @@ -1157,6 +1186,7 @@ 65290 int dv_copyID; /* ID used by deepcopy() */ 65291 dict_T *dv_copydict; /* copied dict used by deepcopy() */ 65292 char dv_lock; /* zero, VAR_LOCKED, VAR_FIXED */ 65293 + char dv_scope; /* zero, VAR_SCOPE, VAR_DEF_SCOPE */ 65294 dict_T *dv_used_next; /* next dict in used dicts list */ 65295 dict_T *dv_used_prev; /* previous dict in used dicts list */ 65296 }; 65297 @@ -1177,6 +1207,10 @@ 65298 typedef struct qf_info_S qf_info_T; 65299 #endif 65300 65301 +/* 65302 + * These are items normally related to a buffer. But when using ":ownsyntax" 65303 + * a window may have its own instance. 65304 + */ 65305 typedef struct { 65306 #ifdef FEAT_SYN_HL 65307 hashtab_T b_keywtab; /* syntax keywords hash table */ 65308 @@ -1266,6 +1300,10 @@ 65309 int b_nwindows; /* nr of windows open on this buffer */ 65310 65311 int b_flags; /* various BF_ flags */ 65312 +#ifdef FEAT_AUTOCMD 65313 + int b_closing; /* buffer is being closed, don't let 65314 + autocommands close it too. */ 65315 +#endif 65316 65317 /* 65318 * b_ffname has the full path of the file (NULL for no name). 65319 @@ -1506,9 +1544,6 @@ 59662 65320 int b_p_ml_nobin; /* b_p_ml saved for binary mode */ 59663 65321 int b_p_ma; /* 'modifiable' */ … … 59669 65327 #ifdef FEAT_TEXTOBJ 59670 65328 char_u *b_p_qe; /* 'quoteescape' */ 59671 @@ -1563,6 +15 84,9 @@65329 @@ -1563,6 +1598,9 @@ 59672 65330 59673 65331 /* end of buffer options */ … … 59679 65337 int b_start_ffc; /* first char of 'ff' when edit started */ 59680 65338 #ifdef FEAT_MBYTE 59681 @@ -1822, 7 +1846,7 @@65339 @@ -1822,13 +1860,17 @@ 59682 65340 often, keep it the first item!) */ 59683 65341 … … 59688 65346 59689 65347 #ifdef FEAT_WINDOWS 59690 @@ -2339,11 +2363,6 @@ 65348 win_T *w_prev; /* link to previous window */ 65349 win_T *w_next; /* link to next window */ 65350 #endif 65351 +#ifdef FEAT_AUTOCMD 65352 + int w_closing; /* window is being closed, don't let 65353 + autocommands close it too. */ 65354 +#endif 65355 65356 frame_T *w_frame; /* frame containing this window */ 65357 65358 @@ -2339,11 +2381,6 @@ 59691 65359 MenuHandle menu_handle; 59692 65360 MenuHandle submenu_handle; … … 59701 65369 PtWidget_t *submenu_id; 59702 65370 diff -Naur vim73.orig/src/syntax.c vim73/src/syntax.c 59703 --- vim73.orig/src/syntax.c 201 2-06-03 23:09:52.948007269+000059704 +++ vim73/src/syntax.c 2012-0 6-03 23:09:55.912086149+000065371 --- vim73.orig/src/syntax.c 2010-08-08 13:17:03.000000000 +0000 65372 +++ vim73/src/syntax.c 2012-07-20 20:31:18.317645167 +0000 59705 65373 @@ -68,6 +68,8 @@ 59706 65374 … … 60014 65682 + CENT("Pmenu ctermbg=Magenta ctermfg=Black", 60015 65683 + "Pmenu ctermbg=Magenta ctermfg=Black guibg=Magenta"), 60016 + CENT("PmenuSel ctermbg= DarkGrey ctermfg=Black",60017 + "PmenuSel ctermbg= DarkGrey ctermfg=Blackguibg=DarkGrey"),65684 + CENT("PmenuSel ctermbg=Black ctermfg=DarkGrey", 65685 + "PmenuSel ctermbg=Black ctermfg=DarkGrey guibg=DarkGrey"), 60018 65686 #endif 60019 65687 CENT("Title term=bold ctermfg=LightMagenta", … … 60067 65735 ui_delay(cnt == 99 ? 40L : (long)cnt * 50L, FALSE); 60068 65736 diff -Naur vim73.orig/src/tag.c vim73/src/tag.c 60069 --- vim73.orig/src/tag.c 201 2-06-03 23:09:52.940007057+000060070 +++ vim73/src/tag.c 2012-0 6-03 23:09:55.200067199+000065737 --- vim73.orig/src/tag.c 2010-08-10 07:25:22.000000000 +0000 65738 +++ vim73/src/tag.c 2012-07-20 20:31:14.130975501 +0000 60071 65739 @@ -11,10 +11,6 @@ 60072 65740 * Code to handle tags and the tag stack … … 60835 66503 /* 60836 66504 diff -Naur vim73.orig/src/term.c vim73/src/term.c 60837 --- vim73.orig/src/term.c 201 2-06-03 23:09:52.952007375+000060838 +++ vim73/src/term.c 2012-0 6-03 23:09:55.364071565+000066505 --- vim73.orig/src/term.c 2010-07-25 13:30:31.000000000 +0000 66506 +++ vim73/src/term.c 2012-07-20 20:31:14.584309160 +0000 60839 66507 @@ -52,7 +52,7 @@ 60840 66508 … … 61206 66874 return -1; 61207 66875 diff -Naur vim73.orig/src/termlib.c vim73/src/termlib.c 61208 --- vim73.orig/src/termlib.c 201 2-06-03 23:09:52.924006631+000061209 +++ vim73/src/termlib.c 2012-0 6-03 23:09:54.100037927+000066876 --- vim73.orig/src/termlib.c 2010-05-15 11:04:10.000000000 +0000 66877 +++ vim73/src/termlib.c 2012-07-20 20:31:10.824306455 +0000 61210 66878 @@ -13,7 +13,7 @@ 61211 66879 #include "vim.h" … … 61218 66886 61219 66887 diff -Naur vim73.orig/src/testdir/Make_amiga.mak vim73/src/testdir/Make_amiga.mak 61220 --- vim73.orig/src/testdir/Make_amiga.mak 201 2-06-03 23:09:52.928006738+000061221 +++ vim73/src/testdir/Make_amiga.mak 2012-0 6-03 23:09:55.708080720+000061222 @@ -13,6 +13, 7@@66888 --- vim73.orig/src/testdir/Make_amiga.mak 2010-08-04 14:34:34.000000000 +0000 66889 +++ vim73/src/testdir/Make_amiga.mak 2012-07-20 20:31:17.337644466 +0000 66890 @@ -13,6 +13,8 @@ 61223 66891 # test25 uses symbolic link 61224 66892 # test27 can't edit file with "*" 61225 66893 # test52 only for Win32 61226 66894 +# test85 no Lua interface 66895 +# test86, 87 no Python interface 61227 66896 61228 66897 SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ 61229 66898 test7.out test8.out test9.out \ 61230 @@ -27,7 +2 8,9 @@66899 @@ -27,7 +29,9 @@ 61231 66900 test56.out test57.out test58.out test59.out test60.out \ 61232 66901 test61.out test62.out test63.out test64.out test65.out \ … … 61239 66908 .SUFFIXES: .in .out 61240 66909 61241 @@ -120,3 +12 3,14 @@66910 @@ -120,3 +124,14 @@ 61242 66911 test71.out: test71.in 61243 66912 test72.out: test72.in … … 61255 66924 +test84.out: test84.in 61256 66925 diff -Naur vim73.orig/src/testdir/Make_dos.mak vim73/src/testdir/Make_dos.mak 61257 --- vim73.orig/src/testdir/Make_dos.mak 201 2-06-03 23:09:52.928006738+000061258 +++ vim73/src/testdir/Make_dos.mak 2012-0 6-03 23:09:55.732081359+000066926 --- vim73.orig/src/testdir/Make_dos.mak 2010-08-13 16:27:19.000000000 +0000 66927 +++ vim73/src/testdir/Make_dos.mak 2012-07-20 20:31:17.337644466 +0000 61259 66928 @@ -27,7 +27,10 @@ 61260 66929 test30.out test31.out test32.out test33.out test34.out \ … … 61265 66934 + test74.out test75.out test76.out test77.out test78.out \ 61266 66935 + test79.out test80.out test81.out test82.out test83.out \ 61267 + test84.out test85.out 66936 + test84.out test85.out test86.out test87.out 61268 66937 61269 66938 SCRIPTS32 = test50.out test70.out … … 61280 66949 -del *.out 61281 66950 diff -Naur vim73.orig/src/testdir/Make_ming.mak vim73/src/testdir/Make_ming.mak 61282 --- vim73.orig/src/testdir/Make_ming.mak 201 2-06-03 23:09:52.928006738+000061283 +++ vim73/src/testdir/Make_ming.mak 2012-0 6-03 23:09:55.732081359+000066951 --- vim73.orig/src/testdir/Make_ming.mak 2010-08-04 14:34:47.000000000 +0000 66952 +++ vim73/src/testdir/Make_ming.mak 2012-07-20 20:31:17.337644466 +0000 61284 66953 @@ -47,7 +47,10 @@ 61285 66954 test30.out test31.out test32.out test33.out test34.out \ … … 61290 66959 + test74.out test75.out test76.out test77.out test78.out \ 61291 66960 + test79.out test80.out test81.out test82.out test83.out \ 61292 + test84.out test85.out 66961 + test84.out test85.out test86.out test87.out 61293 66962 61294 66963 SCRIPTS32 = test50.out test70.out … … 61304 66973 -$(DEL) *.out 61305 66974 diff -Naur vim73.orig/src/testdir/Make_os2.mak vim73/src/testdir/Make_os2.mak 61306 --- vim73.orig/src/testdir/Make_os2.mak 201 2-06-03 23:09:52.928006738+000061307 +++ vim73/src/testdir/Make_os2.mak 2012-0 6-03 23:09:55.708080720+000061308 @@ -13,6 +13, 7@@66975 --- vim73.orig/src/testdir/Make_os2.mak 2010-08-04 14:34:55.000000000 +0000 66976 +++ vim73/src/testdir/Make_os2.mak 2012-07-20 20:31:17.337644466 +0000 66977 @@ -13,6 +13,8 @@ 61309 66978 # test25 uses symbolic link 61310 66979 # test27 can't edit file with "*" in file name 61311 66980 # test52 only for Win32 61312 66981 +# test85 no Lua interface 66982 +# test86, 87 no Python interface 61313 66983 61314 66984 SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ 61315 66985 test7.out test8.out test9.out \ 61316 @@ -27,7 +2 8,9 @@66986 @@ -27,7 +29,9 @@ 61317 66987 test56.out test57.out test58.out test59.out test60.out \ 61318 66988 test61.out test62.out test63.out test64.out test65.out \ … … 61326 66996 61327 66997 diff -Naur vim73.orig/src/testdir/Make_vms.mms vim73/src/testdir/Make_vms.mms 61328 --- vim73.orig/src/testdir/Make_vms.mms 201 2-06-03 23:09:52.932006845+000061329 +++ vim73/src/testdir/Make_vms.mms 2012-0 6-03 23:09:55.708080720+000066998 --- vim73.orig/src/testdir/Make_vms.mms 2010-08-04 14:35:46.000000000 +0000 66999 +++ vim73/src/testdir/Make_vms.mms 2012-07-20 20:31:15.700976626 +0000 61330 67000 @@ -4,7 +4,7 @@ 61331 67001 # Authors: Zoltan Arpadffy, <arpadffy@polarhome.com> … … 61357 67027 SCRIPT_GUI = test16.out 61358 67028 diff -Naur vim73.orig/src/testdir/Makefile vim73/src/testdir/Makefile 61359 --- vim73.orig/src/testdir/Makefile 201 2-06-03 23:09:52.932006845+000061360 +++ vim73/src/testdir/Makefile 2012-0 6-03 23:09:55.708080720+000067029 --- vim73.orig/src/testdir/Makefile 2010-08-15 12:56:30.000000000 +0000 67030 +++ vim73/src/testdir/Makefile 2012-07-20 20:31:17.337644466 +0000 61361 67031 @@ -10,6 +10,7 @@ 61362 67032 # This will make testing about 10 times as slow. … … 61375 67045 + test74.out test75.out test76.out test77.out test78.out \ 61376 67046 + test79.out test80.out test81.out test82.out test83.out \ 61377 + test84.out test85.out 67047 + test84.out test85.out test86.out test87.out 61378 67048 61379 67049 SCRIPTS_GUI = test16.out … … 61398 67068 61399 67069 diff -Naur vim73.orig/src/testdir/main.aap vim73/src/testdir/main.aap 61400 --- vim73.orig/src/testdir/main.aap 201 2-06-03 23:09:52.924006631+000061401 +++ vim73/src/testdir/main.aap 2012-0 6-03 23:09:53.184013549+000067070 --- vim73.orig/src/testdir/main.aap 2010-07-30 20:03:23.000000000 +0000 67071 +++ vim73/src/testdir/main.aap 2012-07-20 20:31:07.820970952 +0000 61402 67072 @@ -13,7 +13,7 @@ 61403 67073 test33.out test34.out test35.out test36.out test37.out … … 61410 67080 61411 67081 diff -Naur vim73.orig/src/testdir/test1.in vim73/src/testdir/test1.in 61412 --- vim73.orig/src/testdir/test1.in 201 2-06-03 23:09:52.928006738+000061413 +++ vim73/src/testdir/test1.in 2012-0 6-03 23:09:55.708080720 +000067082 --- vim73.orig/src/testdir/test1.in 2010-08-04 14:06:24.000000000 +0000 67083 +++ vim73/src/testdir/test1.in 2012-07-20 20:31:15.697643290 +0000 61414 67084 @@ -15,6 +15,7 @@ 61415 67085 be set like small.vim above. mbyte.vim is sourced by tests that require the … … 61439 67109 :if 1 | q! | endif 61440 67110 diff -Naur vim73.orig/src/testdir/test10.in vim73/src/testdir/test10.in 61441 --- vim73.orig/src/testdir/test10.in 201 2-06-03 23:09:52.928006738+000061442 +++ vim73/src/testdir/test10.in 2012-0 6-03 23:09:55.964087533+000067111 --- vim73.orig/src/testdir/test10.in 2010-05-15 11:04:10.000000000 +0000 67112 +++ vim73/src/testdir/test10.in 2012-07-20 20:31:16.547643900 +0000 61443 67113 @@ -2,56 +2,113 @@ 61444 67114 … … 61590 67260 end of testfile 61591 67261 diff -Naur vim73.orig/src/testdir/test10.ok vim73/src/testdir/test10.ok 61592 --- vim73.orig/src/testdir/test10.ok 201 2-06-03 23:09:52.928006738+000061593 +++ vim73/src/testdir/test10.ok 2012-0 6-03 23:09:55.964087533+000067262 --- vim73.orig/src/testdir/test10.ok 2010-05-15 11:04:10.000000000 +0000 67263 +++ vim73/src/testdir/test10.ok 2012-07-20 20:31:16.550977236 +0000 61594 67264 @@ -1,23 +1,23 @@ 61595 67265 start of testfile … … 61638 67308 end of testfile 61639 67309 diff -Naur vim73.orig/src/testdir/test19.in vim73/src/testdir/test19.in 61640 --- vim73.orig/src/testdir/test19.in 201 2-06-03 23:09:52.928006738+000061641 +++ vim73/src/testdir/test19.in 2012-0 6-03 23:09:54.700053894+000067310 --- vim73.orig/src/testdir/test19.in 2010-05-15 11:04:10.000000000 +0000 67311 +++ vim73/src/testdir/test19.in 2012-07-20 20:31:12.597641065 +0000 61642 67312 @@ -1,6 +1,7 @@ 61643 67313 Tests for "r<Tab>" with 'smarttab' and 'expandtab' set/not set. … … 61661 67331 61662 67332 diff -Naur vim73.orig/src/testdir/test19.ok vim73/src/testdir/test19.ok 61663 --- vim73.orig/src/testdir/test19.ok 201 2-06-03 23:09:52.928006738+000061664 +++ vim73/src/testdir/test19.ok 2012-0 6-03 23:09:54.696053787+000067333 --- vim73.orig/src/testdir/test19.ok 2010-05-15 11:04:10.000000000 +0000 67334 +++ vim73/src/testdir/test19.ok 2012-07-20 20:31:12.590974393 +0000 61665 67335 @@ -5,3 +5,5 @@ 61666 67336 a cde … … 61669 67339 +{ 61670 67340 + x 67341 diff -Naur vim73.orig/src/testdir/test29.in vim73/src/testdir/test29.in 67342 --- vim73.orig/src/testdir/test29.in 2010-08-01 13:38:24.000000000 +0000 67343 +++ vim73/src/testdir/test29.in 2012-07-20 20:31:16.864310793 +0000 67344 @@ -4,16 +4,17 @@ 67345 and with 'cpoptions' flag 'j' set or not 67346 67347 STARTTEST 67348 +:so small.vim 67349 :set nocompatible viminfo+=nviminfo 67350 :set nojoinspaces 67351 :set cpoptions-=j 67352 /firstline/ 67353 -j"tdGpJjJjJjJjJjJjJjJjJjJjJjJjJjJj05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions+=j 67354 +j"td/^STARTTEST/-1 67355 +PJjJjJjJjJjJjJjJjJjJjJjJjJjJj05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions+=j 67356 j05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions-=j joinspaces 67357 j"tpJjJjJjJjJjJjJjJjJjJjJjJjJjJj05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions+=j 67358 j05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions-=j nojoinspaces compatible 67359 -j"tpJjJjJjJjJjJjJjJjJjJjJjJjJjJj4Jy3l$pjdG:?firstline?+1,$w! test.out 67360 -:qa! 67361 +j"tpJjJjJjJjJjJjJjJjJjJjJjJjJjJj4Jy3l$pjd/STARTTEST/-2 67362 ENDTEST 67363 67364 firstline 67365 @@ -54,3 +55,148 @@ 67366 hjkl iop! 67367 ert 67368 67369 +STARTTEST 67370 +/^{/+1 67371 +:set comments=s1:/*,mb:*,ex:*/,:// 67372 +:set nojoinspaces fo=j 67373 +:set backspace=eol,start 67374 +:.,+3join 67375 +j4J 67376 +:.,+2join 67377 +j3J 67378 +:.,+2join 67379 +j3J 67380 +:.,+2join 67381 +jj3J 67382 +ENDTEST 67383 + 67384 +{ 67385 + 67386 +/* 67387 + * Make sure the previous comment leader is not removed. 67388 + */ 67389 + 67390 +/* 67391 + * Make sure the previous comment leader is not removed. 67392 + */ 67393 + 67394 +// Should the next comment leader be left alone? 67395 +// Yes. 67396 + 67397 +// Should the next comment leader be left alone? 67398 +// Yes. 67399 + 67400 +/* Here the comment leader should be left intact. */ 67401 +// And so should this one. 67402 + 67403 +/* Here the comment leader should be left intact. */ 67404 +// And so should this one. 67405 + 67406 +if (condition) // Remove the next comment leader! 67407 + // OK, I will. 67408 + action(); 67409 + 67410 +if (condition) // Remove the next comment leader! 67411 + // OK, I will. 67412 + action(); 67413 +} 67414 + 67415 +STARTTEST 67416 +/^{/+1 67417 +:set comments=sO:*\ -,mO:*\ \ ,exO:*/ 67418 +:set comments+=s1:/*,mb:*,ex:*/,:// 67419 +:set comments+=s1:>#,mb:#,ex:#<,:< 67420 +:set cpoptions-=j joinspaces fo=j 67421 +:set backspace=eol,start 67422 +:.,+3join 67423 +j4J 67424 +:.,+8join 67425 +j9J 67426 +:.,+2join 67427 +j3J 67428 +:.,+2join 67429 +j3J 67430 +:.,+2join 67431 +jj3J 67432 +j:.,+2join 67433 +jj3J 67434 +j:.,+5join 67435 +j6J 67436 +oSome code! 67437 // Make sure backspacing does not remove this comment leader.0i 67438 +ENDTEST 67439 + 67440 +{ 67441 + 67442 +/* 67443 + * Make sure the previous comment leader is not removed. 67444 + */ 67445 + 67446 +/* 67447 + * Make sure the previous comment leader is not removed. 67448 + */ 67449 + 67450 +/* List: 67451 + * - item1 67452 + * foo bar baz 67453 + * foo bar baz 67454 + * - item2 67455 + * foo bar baz 67456 + * foo bar baz 67457 + */ 67458 + 67459 +/* List: 67460 + * - item1 67461 + * foo bar baz 67462 + * foo bar baz 67463 + * - item2 67464 + * foo bar baz 67465 + * foo bar baz 67466 + */ 67467 + 67468 +// Should the next comment leader be left alone? 67469 +// Yes. 67470 + 67471 +// Should the next comment leader be left alone? 67472 +// Yes. 67473 + 67474 +/* Here the comment leader should be left intact. */ 67475 +// And so should this one. 67476 + 67477 +/* Here the comment leader should be left intact. */ 67478 +// And so should this one. 67479 + 67480 +if (condition) // Remove the next comment leader! 67481 + // OK, I will. 67482 + action(); 67483 + 67484 +if (condition) // Remove the next comment leader! 67485 + // OK, I will. 67486 + action(); 67487 + 67488 +int i = 7 /* foo *// 3 67489 + // comment 67490 + ; 67491 + 67492 +int i = 7 /* foo *// 3 67493 + // comment 67494 + ; 67495 + 67496 +># Note that the last character of the ending comment leader (left angle 67497 + # bracket) is a comment leader itself. Make sure that this comment leader is 67498 + # not removed from the next line #< 67499 +< On this line a new comment is opened which spans 2 lines. This comment should 67500 +< retain its comment leader. 67501 + 67502 +># Note that the last character of the ending comment leader (left angle 67503 + # bracket) is a comment leader itself. Make sure that this comment leader is 67504 + # not removed from the next line #< 67505 +< On this line a new comment is opened which spans 2 lines. This comment should 67506 +< retain its comment leader. 67507 + 67508 +} 67509 + 67510 +STARTTEST 67511 +:g/^STARTTEST/.,/^ENDTEST/d 67512 +:?firstline?+1,$w! test.out 67513 +:qa! 67514 +ENDTEST 67515 diff -Naur vim73.orig/src/testdir/test29.ok vim73/src/testdir/test29.ok 67516 --- vim73.orig/src/testdir/test29.ok 2010-07-10 12:08:18.000000000 +0000 67517 +++ vim73/src/testdir/test29.ok 2012-07-20 20:31:16.867644128 +0000 67518 @@ -47,3 +47,42 @@ 67519 asdfasdf asdf 67520 asdfasdf asdf 67521 zx cvn. as dfg? hjkl iop! ert a 67522 + 67523 + 67524 +{ 67525 +/* Make sure the previous comment leader is not removed. */ 67526 +/* Make sure the previous comment leader is not removed. */ 67527 +// Should the next comment leader be left alone? Yes. 67528 +// Should the next comment leader be left alone? Yes. 67529 +/* Here the comment leader should be left intact. */ // And so should this one. 67530 +/* Here the comment leader should be left intact. */ // And so should this one. 67531 +if (condition) // Remove the next comment leader! OK, I will. 67532 + action(); 67533 +if (condition) // Remove the next comment leader! OK, I will. 67534 + action(); 67535 +} 67536 + 67537 + 67538 +{ 67539 +/* Make sure the previous comment leader is not removed. */ 67540 +/* Make sure the previous comment leader is not removed. */ 67541 +/* List: item1 foo bar baz foo bar baz item2 foo bar baz foo bar baz */ 67542 +/* List: item1 foo bar baz foo bar baz item2 foo bar baz foo bar baz */ 67543 +// Should the next comment leader be left alone? Yes. 67544 +// Should the next comment leader be left alone? Yes. 67545 +/* Here the comment leader should be left intact. */ // And so should this one. 67546 +/* Here the comment leader should be left intact. */ // And so should this one. 67547 +if (condition) // Remove the next comment leader! OK, I will. 67548 + action(); 67549 +if (condition) // Remove the next comment leader! OK, I will. 67550 + action(); 67551 +int i = 7 /* foo *// 3 // comment 67552 + ; 67553 +int i = 7 /* foo *// 3 // comment 67554 + ; 67555 +># Note that the last character of the ending comment leader (left angle bracket) is a comment leader itself. Make sure that this comment leader is not removed from the next line #< < On this line a new comment is opened which spans 2 lines. This comment should retain its comment leader. 67556 +># Note that the last character of the ending comment leader (left angle bracket) is a comment leader itself. Make sure that this comment leader is not removed from the next line #< < On this line a new comment is opened which spans 2 lines. This comment should retain its comment leader. 67557 + 67558 +Some code!// Make sure backspacing does not remove this comment leader. 67559 +} 67560 + 61671 67561 diff -Naur vim73.orig/src/testdir/test3.in vim73/src/testdir/test3.in 61672 --- vim73.orig/src/testdir/test3.in 201 2-06-03 23:09:52.932006845+000061673 +++ vim73/src/testdir/test3.in 2012-0 6-03 23:09:55.716080932+000067562 --- vim73.orig/src/testdir/test3.in 2010-05-15 11:04:10.000000000 +0000 67563 +++ vim73/src/testdir/test3.in 2012-07-20 20:31:16.854310787 +0000 61674 67564 @@ -299,18 +299,25 @@ 61675 67565 … … 61774 67664 61775 67665 STARTTEST 61776 @@ -1246,6 +1316,20 @@ 67666 @@ -907,6 +977,24 @@ 67667 67668 STARTTEST 67669 :set cin 67670 +:set cino=es,n0s 67671 +/main 67672 +=][ 67673 +ENDTEST 67674 + 67675 +main(void) 67676 +{ 67677 + /* Make sure that cino=X0s is not parsed like cino=Xs. */ 67678 + if (cond) 67679 + foo(); 67680 + else 67681 + { 67682 + bar(); 67683 + } 67684 +} 67685 + 67686 +STARTTEST 67687 +:set cin 67688 :set cino= 67689 ]]=][ 67690 ENDTEST 67691 @@ -1246,6 +1334,20 @@ 61777 67692 }; 61778 67693 … … 61795 67710 2kdd]]=][ 61796 67711 ENDTEST 61797 @@ -1315,6 +1 399,626 @@67712 @@ -1315,6 +1417,626 @@ 61798 67713 } 61799 67714 … … 62423 68338 ENDTEST 62424 68339 diff -Naur vim73.orig/src/testdir/test3.ok vim73/src/testdir/test3.ok 62425 --- vim73.orig/src/testdir/test3.ok 201 2-06-03 23:09:52.924006631+000062426 +++ vim73/src/testdir/test3.ok 2012-0 6-03 23:09:55.716080932+000068340 --- vim73.orig/src/testdir/test3.ok 2010-05-15 11:04:10.000000000 +0000 68341 +++ vim73/src/testdir/test3.ok 2012-07-20 20:31:16.854310787 +0000 62427 68342 @@ -299,6 +299,13 @@ 62428 68343 maybe … … 62509 68424 62510 68425 62511 @@ -1127,6 +1197,16 @@ 68426 @@ -870,6 +940,18 @@ 68427 } 68428 68429 68430 +main(void) 68431 +{ 68432 + /* Make sure that cino=X0s is not parsed like cino=Xs. */ 68433 + if (cond) 68434 + foo(); 68435 + else 68436 + { 68437 + bar(); 68438 + } 68439 +} 68440 + 68441 + 68442 { 68443 do 68444 { 68445 @@ -1127,6 +1209,16 @@ 62512 68446 }; 62513 68447 … … 62526 68460 foo() 62527 68461 { 62528 @@ -1183,3 +12 63,532 @@68462 @@ -1183,3 +1275,532 @@ 62529 68463 foo; 62530 68464 } … … 63060 68994 + 63061 68995 diff -Naur vim73.orig/src/testdir/test31.in vim73/src/testdir/test31.in 63062 --- vim73.orig/src/testdir/test31.in 201 2-06-03 23:09:52.928006738+000063063 +++ vim73/src/testdir/test31.in 2012-0 6-03 23:09:55.440073587+000068996 --- vim73.orig/src/testdir/test31.in 2010-05-15 11:04:10.000000000 +0000 68997 +++ vim73/src/testdir/test31.in 2012-07-20 20:31:14.857642689 +0000 63064 68998 @@ -63,6 +63,12 @@ 63065 68999 :" write "testtext 1" … … 63076 69010 63077 69011 diff -Naur vim73.orig/src/testdir/test31.ok vim73/src/testdir/test31.ok 63078 --- vim73.orig/src/testdir/test31.ok 201 2-06-03 23:09:52.928006738+000063079 +++ vim73/src/testdir/test31.ok 2012-0 6-03 23:09:55.440073587+000069012 --- vim73.orig/src/testdir/test31.ok 2010-05-15 11:04:10.000000000 +0000 69013 +++ vim73/src/testdir/test31.ok 2012-07-20 20:31:14.857642689 +0000 63080 69014 @@ -9,3 +9,4 @@ 63081 69015 testtext 1 … … 63083 69017 testtext 1 63084 69018 +testtext 2 2 2 69019 diff -Naur vim73.orig/src/testdir/test34.in vim73/src/testdir/test34.in 69020 --- vim73.orig/src/testdir/test34.in 2010-05-29 13:09:55.000000000 +0000 69021 +++ vim73/src/testdir/test34.in 2012-07-20 20:31:18.260978460 +0000 69022 @@ -1,5 +1,6 @@ 69023 Test for user functions. 69024 Also test an <expr> mapping calling a function. 69025 +Also test that a builtin function cannot be replaced. 69026 69027 STARTTEST 69028 :so small.vim 69029 @@ -58,7 +59,10 @@ 69030 ---*--- 69031 (one 69032 (two 69033 -[(one again:$-5,$w! test.out 69034 +[(one again:call append(line('$'), max([1, 2, 3])) 69035 +:call extend(g:, {'max': function('min')}) 69036 +:call append(line('$'), max([1, 2, 3])) 69037 +:$-7,$w! test.out 69038 :delfunc Table 69039 :delfunc Compute 69040 :delfunc Expr1 63085 69041 diff -Naur vim73.orig/src/testdir/test34.ok vim73/src/testdir/test34.ok 63086 --- vim73.orig/src/testdir/test34.ok 201 2-06-03 23:09:52.928006738+000063087 +++ vim73/src/testdir/test34.ok 2012-0 6-03 23:09:54.864058259+000063088 @@ -1, 5 +1,5@@69042 --- vim73.orig/src/testdir/test34.ok 2010-05-29 13:11:12.000000000 +0000 69043 +++ vim73/src/testdir/test34.ok 2012-07-20 20:31:18.260978460 +0000 69044 @@ -1,6 +1,8 @@ 63089 69045 xxx4asdf fail nop ok 9 333 63090 69046 -XX111XX … … 63093 69049 1. one 63094 69050 2. two 69051 1. one again 69052 +3 69053 +3 63095 69054 diff -Naur vim73.orig/src/testdir/test43.in vim73/src/testdir/test43.in 63096 --- vim73.orig/src/testdir/test43.in 201 2-06-03 23:09:52.928006738+000063097 +++ vim73/src/testdir/test43.in 2012-0 6-03 23:09:55.288069543+000069055 --- vim73.orig/src/testdir/test43.in 2010-05-15 11:04:10.000000000 +0000 69056 +++ vim73/src/testdir/test43.in 2012-07-20 20:31:14.397642358 +0000 63098 69057 @@ -1,6 +1,7 @@ 63099 69058 Tests for regexp with various magic settings. … … 63124 69083 + 63125 69084 diff -Naur vim73.orig/src/testdir/test43.ok vim73/src/testdir/test43.ok 63126 --- vim73.orig/src/testdir/test43.ok 201 2-06-03 23:09:52.932006845+000063127 +++ vim73/src/testdir/test43.ok 2012-0 6-03 23:09:55.132065390+000069085 --- vim73.orig/src/testdir/test43.ok 2010-05-15 11:04:10.000000000 +0000 69086 +++ vim73/src/testdir/test43.ok 2012-07-20 20:31:13.914308679 +0000 63128 69087 @@ -6,3 +6,6 @@ 63129 69088 6 x aa$ x … … 63134 69093 + 63135 69094 diff -Naur vim73.orig/src/testdir/test44.in vim73/src/testdir/test44.in 63136 --- vim73.orig/src/testdir/test44.in 201 2-06-03 23:09:52.928006738+000063137 +++ vim73/src/testdir/test44.in 2012-0 6-03 23:09:54.512048891+000069095 --- vim73.orig/src/testdir/test44.in 2010-05-15 11:04:10.000000000 +0000 69096 +++ vim73/src/testdir/test44.in 2012-07-20 20:31:12.114307384 +0000 63138 69097 @@ -27,6 +27,8 @@ 63139 69098 x/\%U12345678 … … 63158 69117 áºáº xáºáº yÜÿŷáºáºá»³á»·á»¹ zźŌşƶáºáº 63159 69118 diff -Naur vim73.orig/src/testdir/test44.ok vim73/src/testdir/test44.ok 63160 --- vim73.orig/src/testdir/test44.ok 201 2-06-03 23:09:52.924006631+000063161 +++ vim73/src/testdir/test44.ok 2012-0 6-03 23:09:54.512048891+000069119 --- vim73.orig/src/testdir/test44.ok 2010-05-15 11:04:10.000000000 +0000 69120 +++ vim73/src/testdir/test44.ok 2012-07-20 20:31:12.117640720 +0000 63162 69121 @@ -14,6 +14,8 @@ 63163 69122 e y … … 63175 69134 × 63176 69135 diff -Naur vim73.orig/src/testdir/test49.vim vim73/src/testdir/test49.vim 63177 --- vim73.orig/src/testdir/test49.vim 201 2-06-03 23:09:52.928006738+000063178 +++ vim73/src/testdir/test49.vim 2012-0 6-03 23:09:53.108011527+000069136 --- vim73.orig/src/testdir/test49.vim 2010-05-15 11:04:10.000000000 +0000 69137 +++ vim73/src/testdir/test49.vim 2012-07-20 20:31:07.597637458 +0000 63179 69138 @@ -1,6 +1,6 @@ 63180 69139 " Vim script language tests … … 63195 69154 endif 63196 69155 diff -Naur vim73.orig/src/testdir/test55.in vim73/src/testdir/test55.in 63197 --- vim73.orig/src/testdir/test55.in 201 2-06-03 23:09:52.924006631+000063198 +++ vim73/src/testdir/test55.in 2012-0 6-03 23:09:55.840084233+000069156 --- vim73.orig/src/testdir/test55.in 2010-05-15 11:04:10.000000000 +0000 69157 +++ vim73/src/testdir/test55.in 2012-07-20 20:31:16.110976920 +0000 63199 69158 @@ -342,7 +342,36 @@ 63200 69159 :$put =(d == d) … … 63235 69194 :delfunc Test 63236 69195 diff -Naur vim73.orig/src/testdir/test55.ok vim73/src/testdir/test55.ok 63237 --- vim73.orig/src/testdir/test55.ok 201 2-06-03 23:09:52.924006631+000063238 +++ vim73/src/testdir/test55.ok 2012-0 6-03 23:09:55.840084233+000069196 --- vim73.orig/src/testdir/test55.ok 2010-05-15 11:04:10.000000000 +0000 69197 +++ vim73/src/testdir/test55.ok 2012-07-20 20:31:16.110976920 +0000 63239 69198 @@ -109,3 +109,9 @@ 63240 69199 1 … … 63248 69207 +{'a': {'b': 'B'}} 63249 69208 diff -Naur vim73.orig/src/testdir/test57.in vim73/src/testdir/test57.in 63250 --- vim73.orig/src/testdir/test57.in 201 2-06-03 23:09:52.928006738+000063251 +++ vim73/src/testdir/test57.in 2012-0 6-03 23:09:53.168013125+000069209 --- vim73.orig/src/testdir/test57.in 2010-05-15 11:04:10.000000000 +0000 69210 +++ vim73/src/testdir/test57.in 2012-07-20 20:31:07.790970931 +0000 63252 69211 @@ -53,15 +53,19 @@ 63253 69212 t02: numeric … … 63272 69231 b321b 63273 69232 diff -Naur vim73.orig/src/testdir/test57.ok vim73/src/testdir/test57.ok 63274 --- vim73.orig/src/testdir/test57.ok 201 2-06-03 23:09:52.928006738+000063275 +++ vim73/src/testdir/test57.ok 2012-0 6-03 23:09:53.168013125+000069233 --- vim73.orig/src/testdir/test57.ok 2010-05-15 11:04:10.000000000 +0000 69234 +++ vim73/src/testdir/test57.ok 2012-07-20 20:31:07.790970931 +0000 63276 69235 @@ -21,6 +21,10 @@ 63277 69236 a … … 63286 69245 b123 63287 69246 diff -Naur vim73.orig/src/testdir/test61.in vim73/src/testdir/test61.in 63288 --- vim73.orig/src/testdir/test61.in 201 2-06-03 23:09:52.928006738+000063289 +++ vim73/src/testdir/test61.in 2012-0 6-03 23:09:53.052010037+000069247 --- vim73.orig/src/testdir/test61.in 2010-06-27 03:07:58.000000000 +0000 69248 +++ vim73/src/testdir/test61.in 2012-07-20 20:31:07.427637334 +0000 63290 69249 @@ -4,6 +4,10 @@ 63291 69250 Also tests :earlier and :later. … … 63300 69259 x:set ul=100 63301 69260 diff -Naur vim73.orig/src/testdir/test62.in vim73/src/testdir/test62.in 63302 --- vim73.orig/src/testdir/test62.in 201 2-06-03 23:09:52.928006738+000063303 +++ vim73/src/testdir/test62.in 2012-0 6-03 23:09:55.584077418+000063304 @@ -49,6 +49, 49@@69261 --- vim73.orig/src/testdir/test62.in 2010-05-31 19:22:55.000000000 +0000 69262 +++ vim73/src/testdir/test62.in 2012-07-20 20:31:17.930978224 +0000 69263 @@ -49,6 +49,77 @@ 63305 69264 :tabclose 63306 69265 :call append(line('$'), test_status) … … 63349 69308 +:endif 63350 69309 +:" 69310 +:" 69311 +:for i in range(9) | tabnew | endfor 69312 +1gt 69313 +Go=tabpagenr() 69314 69315 69316 +:tabmove 5 69317 +i=tabpagenr() 69318 69319 69320 +:tabmove -2 69321 +i=tabpagenr() 69322 69323 69324 +:tabmove +4 69325 +i=tabpagenr() 69326 69327 69328 +:tabmove 69329 +i=tabpagenr() 69330 69331 69332 +:tabmove -20 69333 +i=tabpagenr() 69334 69335 69336 +:tabmove +20 69337 +i=tabpagenr() 69338 69339 69340 +:3tabmove 69341 +i=tabpagenr() 69342 69343 69344 +:7tabmove 5 69345 +i=tabpagenr() 69346 69347 69348 +:let a='No error caught.' 69349 +:try 69350 +:tabmove foo 69351 +:catch E474 69352 +:let a='E474 caught.' 69353 +:endtry 69354 +i=a 69355 69356 +:" 63351 69357 :" 63352 69358 :/^Results/,$w! test.out 63353 69359 :qa! 63354 69360 diff -Naur vim73.orig/src/testdir/test62.ok vim73/src/testdir/test62.ok 63355 --- vim73.orig/src/testdir/test62.ok 201 2-06-03 23:09:52.928006738+000063356 +++ vim73/src/testdir/test62.ok 2012-0 6-03 23:09:55.512075502+000063357 @@ -5,3 +5, 6 @@69361 --- vim73.orig/src/testdir/test62.ok 2010-05-31 19:22:55.000000000 +0000 69362 +++ vim73/src/testdir/test62.ok 2012-07-20 20:31:17.930978224 +0000 69363 @@ -5,3 +5,16 @@ 63358 69364 this is tab page 4 63359 69365 gettabvar: pass … … 63362 69368 +tab drop 2: pass 63363 69369 +tab drop 3: pass 69370 +1 69371 +6 69372 +4 69373 +8 69374 +10 69375 +1 69376 +10 69377 +4 69378 +6 69379 +E474 caught. 63364 69380 diff -Naur vim73.orig/src/testdir/test65.in vim73/src/testdir/test65.in 63365 --- vim73.orig/src/testdir/test65.in 201 2-06-03 23:09:52.928006738+000063366 +++ vim73/src/testdir/test65.in 2012-0 6-03 23:09:55.036062835+000069381 --- vim73.orig/src/testdir/test65.in 2010-05-15 11:04:10.000000000 +0000 69382 +++ vim73/src/testdir/test65.in 2012-07-20 20:31:13.614308463 +0000 63367 69383 @@ -1,4 +1,4 @@ 63368 69384 -Test for floating point. … … 63396 69412 63397 69413 diff -Naur vim73.orig/src/testdir/test65.ok vim73/src/testdir/test65.ok 63398 --- vim73.orig/src/testdir/test65.ok 201 2-06-03 23:09:52.928006738+000063399 +++ vim73/src/testdir/test65.ok 2012-0 6-03 23:09:55.036062835+000069414 --- vim73.orig/src/testdir/test65.ok 2010-05-15 11:04:10.000000000 +0000 69415 +++ vim73/src/testdir/test65.ok 2012-07-20 20:31:13.614308463 +0000 63400 69416 @@ -54,3 +54,20 @@ 63401 69417 float2nr … … 63420 69436 +0 63421 69437 diff -Naur vim73.orig/src/testdir/test68.in vim73/src/testdir/test68.in 63422 --- vim73.orig/src/testdir/test68.in 201 2-06-03 23:09:52.928006738+000063423 +++ vim73/src/testdir/test68.in 2012-0 6-03 23:09:53.136012273+000063424 @@ -51,6 +51, 17 @@69438 --- vim73.orig/src/testdir/test68.in 2010-05-15 11:04:10.000000000 +0000 69439 +++ vim73/src/testdir/test68.in 2012-07-20 20:31:17.610977994 +0000 69440 @@ -51,6 +51,57 @@ 63425 69441 } 63426 69442 63427 69443 STARTTEST 69444 +/^{/+1 69445 +:set tw=5 fo=tcn comments=:# 69446 +A bjA b 69447 +ENDTEST 69448 + 69449 +{ 69450 + 1 a 69451 +# 1 a 69452 +} 69453 + 69454 +STARTTEST 69455 +/^{/+1 69456 +:set tw=5 fo=qn comments=:# 69457 +gwap 69458 +ENDTEST 69459 + 69460 +{ 69461 +# 1 a b 69462 +} 69463 + 69464 +STARTTEST 69465 +/^{/+1 69466 +:set tw=5 fo=q2 comments=:# 69467 +gwap 69468 +ENDTEST 69469 + 69470 +{ 69471 +# x 69472 +# a b 69473 +} 69474 + 69475 +STARTTEST 63428 69476 +/^{/+2 63429 69477 +:set tw& fo=a … … 63435 69483 + 2bb 63436 69484 +} 69485 + 69486 +STARTTEST 69487 +/^#/ 69488 +:setl tw=12 fo=tqnc comments=:# 69489 +A foobar 69490 +ENDTEST 69491 + 69492 +# 1 xxxxx 63437 69493 + 63438 69494 +STARTTEST … … 63441 69497 ENDTEST 63442 69498 diff -Naur vim73.orig/src/testdir/test68.ok vim73/src/testdir/test68.ok 63443 --- vim73.orig/src/testdir/test68.ok 201 2-06-03 23:09:52.928006738+000063444 +++ vim73/src/testdir/test68.ok 2012-0 6-03 23:09:53.136012273+000063445 @@ -33,3 +33, 6@@69499 --- vim73.orig/src/testdir/test68.ok 2010-05-15 11:04:10.000000000 +0000 69500 +++ vim73/src/testdir/test68.ok 2012-07-20 20:31:17.807644801 +0000 69501 @@ -33,3 +33,30 @@ 63446 69502 #a b 63447 69503 } 63448 69504 63449 69505 + 69506 +{ 69507 + 1 a 69508 + b 69509 +# 1 a 69510 +# b 69511 +} 69512 + 69513 + 69514 +{ 69515 +# 1 a 69516 +# b 69517 +} 69518 + 69519 + 69520 +{ 69521 +# x a 69522 +# b 69523 +} 69524 + 69525 + 63450 69526 +{ 1aa ^^2bb } 63451 69527 + 69528 + 69529 +# 1 xxxxx 69530 +# foobar 69531 + 63452 69532 diff -Naur vim73.orig/src/testdir/test72.in vim73/src/testdir/test72.in 63453 --- vim73.orig/src/testdir/test72.in 201 2-06-03 23:09:52.928006738+000063454 +++ vim73/src/testdir/test72.in 2012-0 6-03 23:09:55.120065072 +000069533 --- vim73.orig/src/testdir/test72.in 2010-08-07 11:26:43.000000000 +0000 69534 +++ vim73/src/testdir/test72.in 2012-07-20 20:31:13.880975322 +0000 63455 69535 @@ -51,6 +51,12 @@ 63456 69536 :e Xtestfile … … 63467 69547 :set undofile cm=zip 63468 69548 diff -Naur vim73.orig/src/testdir/test72.ok vim73/src/testdir/test72.ok 63469 --- vim73.orig/src/testdir/test72.ok 201 2-06-03 23:09:52.924006631+000063470 +++ vim73/src/testdir/test72.ok 2012-0 6-03 23:09:55.120065072 +000069549 --- vim73.orig/src/testdir/test72.ok 2010-05-30 20:39:12.000000000 +0000 69550 +++ vim73/src/testdir/test72.ok 2012-07-20 20:31:13.880975322 +0000 63471 69551 @@ -7,6 +7,16 @@ 63472 69552 eight … … 63488 69568 diff -Naur vim73.orig/src/testdir/test74.in vim73/src/testdir/test74.in 63489 69569 --- vim73.orig/src/testdir/test74.in 1970-01-01 00:00:00.000000000 +0000 63490 +++ vim73/src/testdir/test74.in 2012-0 6-03 23:09:53.184013549+000069570 +++ vim73/src/testdir/test74.in 2012-07-20 20:31:07.824304288 +0000 63491 69571 @@ -0,0 +1,36 @@ 63492 69572 +" Tests for storing global variables in the .viminfo file vim: set ft=vim: … … 63528 69608 diff -Naur vim73.orig/src/testdir/test74.ok vim73/src/testdir/test74.ok 63529 69609 --- vim73.orig/src/testdir/test74.ok 1970-01-01 00:00:00.000000000 +0000 63530 +++ vim73/src/testdir/test74.ok 2012-0 6-03 23:09:53.184013549+000069610 +++ vim73/src/testdir/test74.ok 2012-07-20 20:31:07.824304288 +0000 63531 69611 @@ -0,0 +1,5 @@ 63532 69612 + … … 63537 69617 diff -Naur vim73.orig/src/testdir/test75.in vim73/src/testdir/test75.in 63538 69618 --- vim73.orig/src/testdir/test75.in 1970-01-01 00:00:00.000000000 +0000 63539 +++ vim73/src/testdir/test75.in 2012-0 6-03 23:09:54.628051978+000069619 +++ vim73/src/testdir/test75.in 2012-07-20 20:31:12.414307600 +0000 63540 69620 @@ -0,0 +1,22 @@ 63541 69621 +" Tests for functions. … … 63563 69643 diff -Naur vim73.orig/src/testdir/test75.ok vim73/src/testdir/test75.ok 63564 69644 --- vim73.orig/src/testdir/test75.ok 1970-01-01 00:00:00.000000000 +0000 63565 +++ vim73/src/testdir/test75.ok 2012-0 6-03 23:09:54.628051978+000069645 +++ vim73/src/testdir/test75.ok 2012-07-20 20:31:12.414307600 +0000 63566 69646 @@ -0,0 +1,5 @@ 63567 69647 +is<F4>foo … … 63572 69652 diff -Naur vim73.orig/src/testdir/test76.in vim73/src/testdir/test76.in 63573 69653 --- vim73.orig/src/testdir/test76.in 1970-01-01 00:00:00.000000000 +0000 63574 +++ vim73/src/testdir/test76.in 2012-0 6-03 23:09:53.316017063+000069654 +++ vim73/src/testdir/test76.in 2012-07-20 20:31:08.257637936 +0000 63575 69655 @@ -0,0 +1,46 @@ 63576 69656 +Tests for completefunc/omnifunc. vim: set ft=vim : … … 63622 69702 diff -Naur vim73.orig/src/testdir/test76.ok vim73/src/testdir/test76.ok 63623 69703 --- vim73.orig/src/testdir/test76.ok 1970-01-01 00:00:00.000000000 +0000 63624 +++ vim73/src/testdir/test76.ok 2012-0 6-03 23:09:53.316017063+000069704 +++ vim73/src/testdir/test76.ok 2012-07-20 20:31:08.257637936 +0000 63625 69705 @@ -0,0 +1,4 @@ 63626 69706 ++++ … … 63630 69710 diff -Naur vim73.orig/src/testdir/test77.in vim73/src/testdir/test77.in 63631 69711 --- vim73.orig/src/testdir/test77.in 1970-01-01 00:00:00.000000000 +0000 63632 +++ vim73/src/testdir/test77.in 2012-0 6-03 23:09:55.796083061+000069712 +++ vim73/src/testdir/test77.in 2012-07-20 20:31:15.937643464 +0000 63633 69713 @@ -0,0 +1,29 @@ 63634 69714 +Inserts 2 million lines with consecutive integers starting from 1 … … 63663 69743 diff -Naur vim73.orig/src/testdir/test77.ok vim73/src/testdir/test77.ok 63664 69744 --- vim73.orig/src/testdir/test77.ok 1970-01-01 00:00:00.000000000 +0000 63665 +++ vim73/src/testdir/test77.ok 2012-0 6-03 23:09:53.804030049+000069745 +++ vim73/src/testdir/test77.ok 2012-07-20 20:31:09.844305747 +0000 63666 69746 @@ -0,0 +1 @@ 63667 69747 +3678979763 14888896 Xtest 63668 69748 diff -Naur vim73.orig/src/testdir/test78.in vim73/src/testdir/test78.in 63669 69749 --- vim73.orig/src/testdir/test78.in 1970-01-01 00:00:00.000000000 +0000 63670 +++ vim73/src/testdir/test78.in 2012-0 6-03 23:09:54.456047401+000069750 +++ vim73/src/testdir/test78.in 2012-07-20 20:31:11.964307276 +0000 63671 69751 @@ -0,0 +1,46 @@ 63672 69752 +Inserts 10000 lines with text to fill the swap file with two levels of pointer … … 63718 69798 diff -Naur vim73.orig/src/testdir/test78.ok vim73/src/testdir/test78.ok 63719 69799 --- vim73.orig/src/testdir/test78.ok 1970-01-01 00:00:00.000000000 +0000 63720 +++ vim73/src/testdir/test78.ok 2012-0 6-03 23:09:54.288042929+000069800 +++ vim73/src/testdir/test78.ok 2012-07-20 20:31:11.410973545 +0000 63721 69801 @@ -0,0 +1,3 @@ 63722 69802 +recovery start … … 63725 69805 diff -Naur vim73.orig/src/testdir/test79.in vim73/src/testdir/test79.in 63726 69806 --- vim73.orig/src/testdir/test79.in 1970-01-01 00:00:00.000000000 +0000 63727 +++ vim73/src/testdir/test79.in 2012-0 6-03 23:09:54.348044528+000069807 +++ vim73/src/testdir/test79.in 2012-07-20 20:31:11.550973645 +0000 63728 69808 @@ -0,0 +1,213 @@ 63729 69809 +Test for *sub-replace-special* and *sub-replace-expression* on :substitute. … … 63953 70033 diff -Naur vim73.orig/src/testdir/test79.ok vim73/src/testdir/test79.ok 63954 70034 --- vim73.orig/src/testdir/test79.ok 1970-01-01 00:00:00.000000000 +0000 63955 +++ vim73/src/testdir/test79.ok 2012-0 6-03 23:09:54.348044528+000070035 +++ vim73/src/testdir/test79.ok 2012-07-20 20:31:11.550973645 +0000 63956 70036 @@ -0,0 +1,118 @@ 63957 70037 +Results of test71: … … 64077 70157 diff -Naur vim73.orig/src/testdir/test80.in vim73/src/testdir/test80.in 64078 70158 --- vim73.orig/src/testdir/test80.in 1970-01-01 00:00:00.000000000 +0000 64079 +++ vim73/src/testdir/test80.in 2012-0 6-03 23:09:54.348044528+000070159 +++ vim73/src/testdir/test80.in 2012-07-20 20:31:11.550973645 +0000 64080 70160 @@ -0,0 +1,150 @@ 64081 70161 +Test for *sub-replace-special* and *sub-replace-expression* on substitue(). … … 64242 70322 diff -Naur vim73.orig/src/testdir/test80.ok vim73/src/testdir/test80.ok 64243 70323 --- vim73.orig/src/testdir/test80.ok 1970-01-01 00:00:00.000000000 +0000 64244 +++ vim73/src/testdir/test80.ok 2012-0 6-03 23:09:54.348044528+000070324 +++ vim73/src/testdir/test80.ok 2012-07-20 20:31:11.550973645 +0000 64245 70325 @@ -0,0 +1,101 @@ 64246 70326 +Results of test72: … … 64365 70445 diff -Naur vim73.orig/src/testdir/test81.in vim73/src/testdir/test81.in 64366 70446 --- vim73.orig/src/testdir/test81.in 1970-01-01 00:00:00.000000000 +0000 64367 +++ vim73/src/testdir/test81.in 2012-0 6-03 23:09:54.456047401+000070447 +++ vim73/src/testdir/test81.in 2012-07-20 20:31:11.967640612 +0000 64368 70448 @@ -0,0 +1,22 @@ 64369 70449 +Test for t movement command and 'cpo-;' setting … … 64391 70471 diff -Naur vim73.orig/src/testdir/test81.ok vim73/src/testdir/test81.ok 64392 70472 --- vim73.orig/src/testdir/test81.ok 1970-01-01 00:00:00.000000000 +0000 64393 +++ vim73/src/testdir/test81.ok 2012-0 6-03 23:09:54.476047933+000070473 +++ vim73/src/testdir/test81.ok 2012-07-20 20:31:12.014307312 +0000 64394 70474 @@ -0,0 +1,6 @@ 64395 70475 +aaa two … … 64401 70481 diff -Naur vim73.orig/src/testdir/test82.in vim73/src/testdir/test82.in 64402 70482 --- vim73.orig/src/testdir/test82.in 1970-01-01 00:00:00.000000000 +0000 64403 +++ vim73/src/testdir/test82.in 2012-0 6-03 23:09:54.480048039+000070483 +++ vim73/src/testdir/test82.in 2012-07-20 20:31:12.027640655 +0000 64404 70484 @@ -0,0 +1,93 @@ 64405 70485 +Tests for case-insensitive UTF-8 comparisons (utf_strnicmp() in mbyte.c) … … 64498 70578 diff -Naur vim73.orig/src/testdir/test82.ok vim73/src/testdir/test82.ok 64499 70579 --- vim73.orig/src/testdir/test82.ok 1970-01-01 00:00:00.000000000 +0000 64500 +++ vim73/src/testdir/test82.ok 2012-0 6-03 23:09:54.480048039+000070580 +++ vim73/src/testdir/test82.ok 2012-07-20 20:31:12.027640655 +0000 64501 70581 @@ -0,0 +1,2 @@ 64502 70582 +3732 checks passed … … 64504 70584 diff -Naur vim73.orig/src/testdir/test83-tags2 vim73/src/testdir/test83-tags2 64505 70585 --- vim73.orig/src/testdir/test83-tags2 1970-01-01 00:00:00.000000000 +0000 64506 +++ vim73/src/testdir/test83-tags2 2012-0 6-03 23:09:54.856058047 +000070586 +++ vim73/src/testdir/test83-tags2 2012-07-20 20:31:12.994308017 +0000 64507 70587 @@ -0,0 +1,2 @@ 64508 70588 +!_TAG_FILE_ENCODING cp932 // … … 64510 70590 diff -Naur vim73.orig/src/testdir/test83-tags3 vim73/src/testdir/test83-tags3 64511 70591 --- vim73.orig/src/testdir/test83-tags3 1970-01-01 00:00:00.000000000 +0000 64512 +++ vim73/src/testdir/test83-tags3 2012-0 6-03 23:09:54.856058047 +000070592 +++ vim73/src/testdir/test83-tags3 2012-07-20 20:31:12.994308017 +0000 64513 70593 @@ -0,0 +1,102 @@ 64514 70594 +!_TAG_FILE_SORTED 1 // … … 64616 70696 diff -Naur vim73.orig/src/testdir/test83.in vim73/src/testdir/test83.in 64617 70697 --- vim73.orig/src/testdir/test83.in 1970-01-01 00:00:00.000000000 +0000 64618 +++ vim73/src/testdir/test83.in 2012-0 6-03 23:09:55.088064220 +000070698 +++ vim73/src/testdir/test83.in 2012-07-20 20:31:13.787641920 +0000 64619 70699 @@ -0,0 +1,76 @@ 64620 70700 +Tests for tag search with !_TAG_FILE_ENCODING. … … 64696 70776 diff -Naur vim73.orig/src/testdir/test83.ok vim73/src/testdir/test83.ok 64697 70777 --- vim73.orig/src/testdir/test83.ok 1970-01-01 00:00:00.000000000 +0000 64698 +++ vim73/src/testdir/test83.ok 2012-0 6-03 23:09:54.856058047+000070778 +++ vim73/src/testdir/test83.ok 2012-07-20 20:31:12.997641353 +0000 64699 70779 @@ -0,0 +1,4 @@ 64700 70780 +Results of test83 … … 64704 70784 diff -Naur vim73.orig/src/testdir/test84.in vim73/src/testdir/test84.in 64705 70785 --- vim73.orig/src/testdir/test84.in 1970-01-01 00:00:00.000000000 +0000 64706 +++ vim73/src/testdir/test84.in 2012-0 6-03 23:09:55.680079974+000070786 +++ vim73/src/testdir/test84.in 2012-07-20 20:31:15.634309912 +0000 64707 70787 @@ -0,0 +1,35 @@ 64708 70788 +Tests for curswant not changing when setting an option … … 64743 70823 diff -Naur vim73.orig/src/testdir/test84.ok vim73/src/testdir/test84.ok 64744 70824 --- vim73.orig/src/testdir/test84.ok 1970-01-01 00:00:00.000000000 +0000 64745 +++ vim73/src/testdir/test84.ok 2012-0 6-03 23:09:55.680079974+000070825 +++ vim73/src/testdir/test84.ok 2012-07-20 20:31:15.634309912 +0000 64746 70826 @@ -0,0 +1,3 @@ 64747 70827 +tabstop 7 4 … … 64750 70830 diff -Naur vim73.orig/src/testdir/test85.in vim73/src/testdir/test85.in 64751 70831 --- vim73.orig/src/testdir/test85.in 1970-01-01 00:00:00.000000000 +0000 64752 +++ vim73/src/testdir/test85.in 2012-0 6-03 23:09:55.708080720 +000070832 +++ vim73/src/testdir/test85.in 2012-07-20 20:31:15.697643290 +0000 64753 70833 @@ -0,0 +1,42 @@ 64754 70834 +Test for Lua interface and luaeval() function … … 64796 70876 diff -Naur vim73.orig/src/testdir/test85.ok vim73/src/testdir/test85.ok 64797 70877 --- vim73.orig/src/testdir/test85.ok 1970-01-01 00:00:00.000000000 +0000 64798 +++ vim73/src/testdir/test85.ok 2012-0 6-03 23:09:55.708080720 +000070878 +++ vim73/src/testdir/test85.ok 2012-07-20 20:31:15.697643290 +0000 64799 70879 @@ -0,0 +1,5 @@ 64800 70880 +1 changed line 1 … … 64803 70883 +dictionary with list OK 64804 70884 +circular test OK 70885 diff -Naur vim73.orig/src/testdir/test86.in vim73/src/testdir/test86.in 70886 --- vim73.orig/src/testdir/test86.in 1970-01-01 00:00:00.000000000 +0000 70887 +++ vim73/src/testdir/test86.in 2012-07-20 20:31:17.340977802 +0000 70888 @@ -0,0 +1,211 @@ 70889 +Tests for various python features. vim: set ft=vim : 70890 + 70891 +STARTTEST 70892 +:so small.vim 70893 +:if !has('python') | e! test.ok | wq! test.out | endif 70894 +:py import vim 70895 +:fun Test() 70896 +:let l = [] 70897 +:py l=vim.bindeval('l') 70898 +:py f=vim.bindeval('function("strlen")') 70899 +:" Extending List directly with different types 70900 +:py l.extend([1, "as'd", [1, 2, f, {'a': 1}]]) 70901 +:$put =string(l) 70902 +:$put =string(l[-1]) 70903 +:try 70904 +: $put =string(l[-4]) 70905 +:catch 70906 +: $put =v:exception[:13] 70907 +:endtry 70908 +:" List assignment 70909 +:py l[0]=0 70910 +:$put =string(l) 70911 +:py l[-2]=f 70912 +:$put =string(l) 70913 +:" 70914 +:" Extending Dictionary directly with different types 70915 +:let d = {} 70916 +:py d=vim.bindeval('d') 70917 +:py d['1']='asd' 70918 +:py d['b']=[1, 2, f] 70919 +:py d['-1']={'a': 1} 70920 +:let dkeys = [] 70921 +:py dk=vim.bindeval('dkeys') 70922 +:py dkeys=d.keys() 70923 +:py dkeys.sort() 70924 +:py dk.extend(dkeys) 70925 +:$put =string(dkeys) 70926 +:for [key, val] in sort(items(d)) 70927 +: $put =string(key) . ' : ' . string(val) 70928 +: unlet key val 70929 +:endfor 70930 +:" 70931 +:" removing items with del 70932 +:py del l[2] 70933 +:$put =string(l) 70934 +:let l = range(8) 70935 +:py l=vim.bindeval('l') 70936 +:try 70937 +: py del l[:3] 70938 +: py del l[1:] 70939 +:catch 70940 +: $put =v:exception 70941 +:endtry 70942 +:$put =string(l) 70943 +:" 70944 +:py del d['-1'] 70945 +:$put =string(d) 70946 +:" 70947 +:" removing items out of range: silently skip items that don't exist 70948 +:let l = [0, 1, 2, 3] 70949 +:py l=vim.bindeval('l') 70950 +:" The following two ranges delete nothing as they match empty list: 70951 +:py del l[2:1] 70952 +:$put =string(l) 70953 +:py del l[2:2] 70954 +:$put =string(l) 70955 +:py del l[2:3] 70956 +:$put =string(l) 70957 +:let l = [0, 1, 2, 3] 70958 +:py l=vim.bindeval('l') 70959 +:py del l[2:4] 70960 +:$put =string(l) 70961 +:let l = [0, 1, 2, 3] 70962 +:py l=vim.bindeval('l') 70963 +:py del l[2:5] 70964 +:$put =string(l) 70965 +:let l = [0, 1, 2, 3] 70966 +:py l=vim.bindeval('l') 70967 +:py del l[2:6] 70968 +:$put =string(l) 70969 +:let l = [0, 1, 2, 3] 70970 +:py l=vim.bindeval('l') 70971 +:" The following two ranges delete nothing as they match empty list: 70972 +:py del l[-1:2] 70973 +:$put =string(l) 70974 +:py del l[-2:2] 70975 +:$put =string(l) 70976 +:py del l[-3:2] 70977 +:$put =string(l) 70978 +:let l = [0, 1, 2, 3] 70979 +:py l=vim.bindeval('l') 70980 +:py del l[-4:2] 70981 +:$put =string(l) 70982 +:let l = [0, 1, 2, 3] 70983 +:py l=vim.bindeval('l') 70984 +:py del l[-5:2] 70985 +:$put =string(l) 70986 +:let l = [0, 1, 2, 3] 70987 +:py l=vim.bindeval('l') 70988 +:py del l[-6:2] 70989 +:$put =string(l) 70990 +:" 70991 +:" Slice assignment to a list 70992 +:let l = [0, 1, 2, 3] 70993 +:py l=vim.bindeval('l') 70994 +:py l[0:0]=['a'] 70995 +:$put =string(l) 70996 +:let l = [0, 1, 2, 3] 70997 +:py l=vim.bindeval('l') 70998 +:py l[1:2]=['b'] 70999 +:$put =string(l) 71000 +:let l = [0, 1, 2, 3] 71001 +:py l=vim.bindeval('l') 71002 +:py l[2:4]=['c'] 71003 +:$put =string(l) 71004 +:let l = [0, 1, 2, 3] 71005 +:py l=vim.bindeval('l') 71006 +:py l[4:4]=['d'] 71007 +:$put =string(l) 71008 +:let l = [0, 1, 2, 3] 71009 +:py l=vim.bindeval('l') 71010 +:py l[-1:2]=['e'] 71011 +:$put =string(l) 71012 +:let l = [0, 1, 2, 3] 71013 +:py l=vim.bindeval('l') 71014 +:py l[-10:2]=['f'] 71015 +:$put =string(l) 71016 +:let l = [0, 1, 2, 3] 71017 +:py l=vim.bindeval('l') 71018 +:py l[2:-10]=['g'] 71019 +:$put =string(l) 71020 +:let l = [] 71021 +:py l=vim.bindeval('l') 71022 +:py l[0:0]=['h'] 71023 +:$put =string(l) 71024 +:" 71025 +:" Locked variables 71026 +:let l = [0, 1, 2, 3] 71027 +:py l=vim.bindeval('l') 71028 +:lockvar! l 71029 +:py l[2]='i' 71030 +:$put =string(l) 71031 +:unlockvar! l 71032 +:" 71033 +:" Function calls 71034 +:function New(...) 71035 +:return ['NewStart']+a:000+['NewEnd'] 71036 +:endfunction 71037 +:function DictNew(...) dict 71038 +:return ['DictNewStart']+a:000+['DictNewEnd', self] 71039 +:endfunction 71040 +:let l=[function('New'), function('DictNew')] 71041 +:py l=vim.bindeval('l') 71042 +:py l.extend(list(l[0](1, 2, 3))) 71043 +:$put =string(l) 71044 +:py l.extend(list(l[1](1, 2, 3, self={'a': 'b'}))) 71045 +:$put =string(l) 71046 +:py l.extend([l[0].name]) 71047 +:$put =string(l) 71048 +:try 71049 +: py l[1](1, 2, 3) 71050 +:catch 71051 +: $put =v:exception[:16] 71052 +:endtry 71053 +:delfunction New 71054 +:try 71055 +: py l[0](1, 2, 3) 71056 +:catch 71057 +: $put =v:exception[:16] 71058 +:endtry 71059 +:if has('float') 71060 +: let l=[0.0] 71061 +: py l=vim.bindeval('l') 71062 +: py l.extend([0.0]) 71063 +: $put =string(l) 71064 +:else 71065 +: $put ='[0.0, 0.0]' 71066 +:endif 71067 +:" 71068 +:" pyeval() 71069 +:let l=pyeval('range(3)') 71070 +:$put =string(l) 71071 +:let d=pyeval('{"a": "b", "c": 1, "d": ["e"]}') 71072 +:$put =sort(items(d)) 71073 +:try 71074 +: let undef=pyeval('undefined_name') 71075 +:catch 71076 +: $put =v:exception[:13] 71077 +:endtry 71078 +:try 71079 +: let vim=pyeval('vim') 71080 +:catch 71081 +: $put =v:exception[:13] 71082 +:endtry 71083 +:if has('float') 71084 +: let f=pyeval('0.0') 71085 +: $put =string(f) 71086 +:else 71087 +: $put ='0.0' 71088 +:endif 71089 +:endfun 71090 +:" 71091 +:call Test() 71092 +:" 71093 +:delfunc Test 71094 +:call garbagecollect(1) 71095 +:" 71096 +:/^start:/,$wq! test.out 71097 +ENDTEST 71098 + 71099 +start: 71100 diff -Naur vim73.orig/src/testdir/test86.ok vim73/src/testdir/test86.ok 71101 --- vim73.orig/src/testdir/test86.ok 1970-01-01 00:00:00.000000000 +0000 71102 +++ vim73/src/testdir/test86.ok 2012-07-20 20:31:17.340977802 +0000 71103 @@ -0,0 +1,47 @@ 71104 +start: 71105 +[1, 'as''d', [1, 2, function('strlen'), {'a': 1}]] 71106 +[1, 2, function('strlen'), {'a': 1}] 71107 +Vim(put):E684: 71108 +[0, 'as''d', [1, 2, function('strlen'), {'a': 1}]] 71109 +[0, function('strlen'), [1, 2, function('strlen'), {'a': 1}]] 71110 +['-1', '1', 'b'] 71111 +'-1' : {'a': 1} 71112 +'1' : 'asd' 71113 +'b' : [1, 2, function('strlen')] 71114 +[0, function('strlen')] 71115 +[3] 71116 +{'1': 'asd', 'b': [1, 2, function('strlen')]} 71117 +[0, 1, 2, 3] 71118 +[0, 1, 2, 3] 71119 +[0, 1, 3] 71120 +[0, 1] 71121 +[0, 1] 71122 +[0, 1] 71123 +[0, 1, 2, 3] 71124 +[0, 1, 2, 3] 71125 +[0, 2, 3] 71126 +[2, 3] 71127 +[2, 3] 71128 +[2, 3] 71129 +['a', 0, 1, 2, 3] 71130 +[0, 'b', 2, 3] 71131 +[0, 1, 'c'] 71132 +[0, 1, 2, 3, 'd'] 71133 +[0, 1, 2, 'e', 3] 71134 +['f', 2, 3] 71135 +[0, 1, 'g', 2, 3] 71136 +['h'] 71137 +[0, 1, 2, 3] 71138 +[function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd'] 71139 +[function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}] 71140 +[function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}, 'New'] 71141 +Vim(python):E725: 71142 +Vim(python):E117: 71143 +[0.0, 0.0] 71144 +[0, 1, 2] 71145 +['a', 'b'] 71146 +['c', 1] 71147 +['d', ['e']] 71148 +Vim(let):E858: 71149 +Vim(let):E859: 71150 +0.0 71151 diff -Naur vim73.orig/src/testdir/test87.in vim73/src/testdir/test87.in 71152 --- vim73.orig/src/testdir/test87.in 1970-01-01 00:00:00.000000000 +0000 71153 +++ vim73/src/testdir/test87.in 2012-07-20 20:31:17.340977802 +0000 71154 @@ -0,0 +1,211 @@ 71155 +Tests for various python features. vim: set ft=vim : 71156 + 71157 +STARTTEST 71158 +:so small.vim 71159 +:if !has('python3') | e! test.ok | wq! test.out | endif 71160 +:py3 import vim 71161 +:fun Test() 71162 +:let l = [] 71163 +:py3 l=vim.bindeval('l') 71164 +:py3 f=vim.bindeval('function("strlen")') 71165 +:" Extending List directly with different types 71166 +:py3 l+=[1, "as'd", [1, 2, f, {'a': 1}]] 71167 +:$put =string(l) 71168 +:$put =string(l[-1]) 71169 +:try 71170 +: $put =string(l[-4]) 71171 +:catch 71172 +: $put =v:exception[:13] 71173 +:endtry 71174 +:" List assignment 71175 +:py3 l[0]=0 71176 +:$put =string(l) 71177 +:py3 l[-2]=f 71178 +:$put =string(l) 71179 +:" 71180 +:" Extending Dictionary directly with different types 71181 +:let d = {} 71182 +:py3 d=vim.bindeval('d') 71183 +:py3 d['1']='asd' 71184 +:py3 d['b']=[1, 2, f] 71185 +:py3 d['-1']={'a': 1} 71186 +:let dkeys = [] 71187 +:py3 dk=vim.bindeval('dkeys') 71188 +:py3 dkeys=d.keys() 71189 +:py3 dkeys.sort() 71190 +:py3 dk+=dkeys 71191 +:$put =string(dkeys) 71192 +:for [key, val] in sort(items(d)) 71193 +: $put =string(key) . ' : ' . string(val) 71194 +: unlet key val 71195 +:endfor 71196 +:" 71197 +:" removing items with del 71198 +:py3 del l[2] 71199 +:$put =string(l) 71200 +:let l = range(8) 71201 +:py3 l=vim.bindeval('l') 71202 +:try 71203 +: py3 del l[:3] 71204 +: py3 del l[1:] 71205 +:catch 71206 +: $put =v:exception 71207 +:endtry 71208 +:$put =string(l) 71209 +:" 71210 +:py3 del d['-1'] 71211 +:$put =string(d) 71212 +:" 71213 +:" removing items out of range: silently skip items that don't exist 71214 +:let l = [0, 1, 2, 3] 71215 +:py3 l=vim.bindeval('l') 71216 +:" The following two ranges delete nothing as they match empty list: 71217 +:py3 del l[2:1] 71218 +:$put =string(l) 71219 +:py3 del l[2:2] 71220 +:$put =string(l) 71221 +:py3 del l[2:3] 71222 +:$put =string(l) 71223 +:let l = [0, 1, 2, 3] 71224 +:py3 l=vim.bindeval('l') 71225 +:py3 del l[2:4] 71226 +:$put =string(l) 71227 +:let l = [0, 1, 2, 3] 71228 +:py3 l=vim.bindeval('l') 71229 +:py3 del l[2:5] 71230 +:$put =string(l) 71231 +:let l = [0, 1, 2, 3] 71232 +:py3 l=vim.bindeval('l') 71233 +:py3 del l[2:6] 71234 +:$put =string(l) 71235 +:let l = [0, 1, 2, 3] 71236 +:py3 l=vim.bindeval('l') 71237 +:" The following two ranges delete nothing as they match empty list: 71238 +:py3 del l[-1:2] 71239 +:$put =string(l) 71240 +:py3 del l[-2:2] 71241 +:$put =string(l) 71242 +:py3 del l[-3:2] 71243 +:$put =string(l) 71244 +:let l = [0, 1, 2, 3] 71245 +:py3 l=vim.bindeval('l') 71246 +:py3 del l[-4:2] 71247 +:$put =string(l) 71248 +:let l = [0, 1, 2, 3] 71249 +:py3 l=vim.bindeval('l') 71250 +:py3 del l[-5:2] 71251 +:$put =string(l) 71252 +:let l = [0, 1, 2, 3] 71253 +:py3 l=vim.bindeval('l') 71254 +:py3 del l[-6:2] 71255 +:$put =string(l) 71256 +:" 71257 +:" Slice assignment to a list 71258 +:let l = [0, 1, 2, 3] 71259 +:py3 l=vim.bindeval('l') 71260 +:py3 l[0:0]=['a'] 71261 +:$put =string(l) 71262 +:let l = [0, 1, 2, 3] 71263 +:py3 l=vim.bindeval('l') 71264 +:py3 l[1:2]=['b'] 71265 +:$put =string(l) 71266 +:let l = [0, 1, 2, 3] 71267 +:py3 l=vim.bindeval('l') 71268 +:py3 l[2:4]=['c'] 71269 +:$put =string(l) 71270 +:let l = [0, 1, 2, 3] 71271 +:py3 l=vim.bindeval('l') 71272 +:py3 l[4:4]=['d'] 71273 +:$put =string(l) 71274 +:let l = [0, 1, 2, 3] 71275 +:py3 l=vim.bindeval('l') 71276 +:py3 l[-1:2]=['e'] 71277 +:$put =string(l) 71278 +:let l = [0, 1, 2, 3] 71279 +:py3 l=vim.bindeval('l') 71280 +:py3 l[-10:2]=['f'] 71281 +:$put =string(l) 71282 +:let l = [0, 1, 2, 3] 71283 +:py3 l=vim.bindeval('l') 71284 +:py3 l[2:-10]=['g'] 71285 +:$put =string(l) 71286 +:let l = [] 71287 +:py3 l=vim.bindeval('l') 71288 +:py3 l[0:0]=['h'] 71289 +:$put =string(l) 71290 +:" 71291 +:" Locked variables 71292 +:let l = [0, 1, 2, 3] 71293 +:py3 l=vim.bindeval('l') 71294 +:lockvar! l 71295 +:py3 l[2]='i' 71296 +:$put =string(l) 71297 +:unlockvar! l 71298 +:" 71299 +:" Function calls 71300 +:function New(...) 71301 +:return ['NewStart']+a:000+['NewEnd'] 71302 +:endfunction 71303 +:function DictNew(...) dict 71304 +:return ['DictNewStart']+a:000+['DictNewEnd', self] 71305 +:endfunction 71306 +:let l=[function('New'), function('DictNew')] 71307 +:py3 l=vim.bindeval('l') 71308 +:py3 l.extend(list(l[0](1, 2, 3))) 71309 +:$put =string(l) 71310 +:py3 l.extend(list(l[1](1, 2, 3, self={'a': 'b'}))) 71311 +:$put =string(l) 71312 +:py3 l+=[l[0].name] 71313 +:$put =string(l) 71314 +:try 71315 +: py3 l[1](1, 2, 3) 71316 +:catch 71317 +: $put =v:exception[:13] 71318 +:endtry 71319 +:delfunction New 71320 +:try 71321 +: py3 l[0](1, 2, 3) 71322 +:catch 71323 +: $put =v:exception[:13] 71324 +:endtry 71325 +:if has('float') 71326 +: let l=[0.0] 71327 +: py3 l=vim.bindeval('l') 71328 +: py3 l.extend([0.0]) 71329 +: $put =string(l) 71330 +:else 71331 +: $put ='[0.0, 0.0]' 71332 +:endif 71333 +:" 71334 +:" py3eval() 71335 +:let l=py3eval('[0, 1, 2]') 71336 +:$put =string(l) 71337 +:let d=py3eval('{"a": "b", "c": 1, "d": ["e"]}') 71338 +:$put =sort(items(d)) 71339 +:try 71340 +: let undef=py3eval('undefined_name') 71341 +:catch 71342 +: $put =v:exception[:13] 71343 +:endtry 71344 +:try 71345 +: let vim=py3eval('vim') 71346 +:catch 71347 +: $put =v:exception[:13] 71348 +:endtry 71349 +:if has('float') 71350 +: let f=py3eval('0.0') 71351 +: $put =string(f) 71352 +:else 71353 +: $put ='0.0' 71354 +:endif 71355 +:endfun 71356 +:" 71357 +:call Test() 71358 +:" 71359 +:delfunc Test 71360 +:call garbagecollect(1) 71361 +:" 71362 +:/^start:/,$wq! test.out 71363 +ENDTEST 71364 + 71365 +start: 71366 diff -Naur vim73.orig/src/testdir/test87.ok vim73/src/testdir/test87.ok 71367 --- vim73.orig/src/testdir/test87.ok 1970-01-01 00:00:00.000000000 +0000 71368 +++ vim73/src/testdir/test87.ok 2012-07-20 20:31:17.340977802 +0000 71369 @@ -0,0 +1,47 @@ 71370 +start: 71371 +[1, 'as''d', [1, 2, function('strlen'), {'a': 1}]] 71372 +[1, 2, function('strlen'), {'a': 1}] 71373 +Vim(put):E684: 71374 +[0, 'as''d', [1, 2, function('strlen'), {'a': 1}]] 71375 +[0, function('strlen'), [1, 2, function('strlen'), {'a': 1}]] 71376 +['-1', '1', 'b'] 71377 +'-1' : {'a': 1} 71378 +'1' : 'asd' 71379 +'b' : [1, 2, function('strlen')] 71380 +[0, function('strlen')] 71381 +[3] 71382 +{'1': 'asd', 'b': [1, 2, function('strlen')]} 71383 +[0, 1, 2, 3] 71384 +[0, 1, 2, 3] 71385 +[0, 1, 3] 71386 +[0, 1] 71387 +[0, 1] 71388 +[0, 1] 71389 +[0, 1, 2, 3] 71390 +[0, 1, 2, 3] 71391 +[0, 2, 3] 71392 +[2, 3] 71393 +[2, 3] 71394 +[2, 3] 71395 +['a', 0, 1, 2, 3] 71396 +[0, 'b', 2, 3] 71397 +[0, 1, 'c'] 71398 +[0, 1, 2, 3, 'd'] 71399 +[0, 1, 2, 'e', 3] 71400 +['f', 2, 3] 71401 +[0, 1, 'g', 2, 3] 71402 +['h'] 71403 +[0, 1, 2, 3] 71404 +[function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd'] 71405 +[function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}] 71406 +[function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}, 'New'] 71407 +Vim(py3):E725: 71408 +Vim(py3):E117: 71409 +[0.0, 0.0] 71410 +[0, 1, 2] 71411 +['a', 'b'] 71412 +['c', 1] 71413 +['d', ['e']] 71414 +Vim(let):E860: 71415 +Vim(let):E861: 71416 +0.0 64805 71417 diff -Naur vim73.orig/src/typemap vim73/src/typemap 64806 --- vim73.orig/src/typemap 201 2-06-03 23:09:52.924006631+000064807 +++ vim73/src/typemap 2012-0 6-03 23:09:55.408072735+000071418 --- vim73.orig/src/typemap 2010-05-15 11:04:10.000000000 +0000 71419 +++ vim73/src/typemap 2012-07-20 20:31:14.784309303 +0000 64808 71420 @@ -6,7 +6,7 @@ 64809 71421 T_VIOBJNOMUNGE … … 64816 71428 } 64817 71429 diff -Naur vim73.orig/src/ui.c vim73/src/ui.c 64818 --- vim73.orig/src/ui.c 201 2-06-03 23:09:52.920006524+000064819 +++ vim73/src/ui.c 2012-0 6-03 23:09:55.412072842+000071430 --- vim73.orig/src/ui.c 2010-08-08 13:17:30.000000000 +0000 71431 +++ vim73/src/ui.c 2012-07-20 20:31:18.067644988 +0000 64820 71432 @@ -58,7 +58,7 @@ 64821 71433 #endif … … 64827 71439 * When executing an external program, there may be some typed characters that 64828 71440 * are not consumed by it. Give them back to ui_inchar() and they are stored 64829 @@ -469,7 +469,7 @@ 71441 @@ -381,6 +381,8 @@ 71442 71443 #if defined(FEAT_CLIPBOARD) || defined(PROTO) 71444 71445 +static void clip_copy_selection __ARGS((VimClipboard *clip)); 71446 + 71447 /* 71448 * Selection stuff using Visual mode, for cutting and pasting text to other 71449 * windows. 71450 @@ -423,9 +425,10 @@ 71451 * this is called whenever VIsual mode is ended. 71452 */ 71453 void 71454 -clip_update_selection() 71455 +clip_update_selection(clip) 71456 + VimClipboard *clip; 71457 { 71458 - pos_T start, end; 71459 + pos_T start, end; 71460 71461 /* If visual mode is only due to a redo command ("."), then ignore it */ 71462 if (!redo_VIsual_busy && VIsual_active && (State & NORMAL)) 71463 @@ -444,17 +447,17 @@ 71464 start = curwin->w_cursor; 71465 end = VIsual; 71466 } 71467 - if (!equalpos(clip_star.start, start) 71468 - || !equalpos(clip_star.end, end) 71469 - || clip_star.vmode != VIsual_mode) 71470 - { 71471 - clip_clear_selection(); 71472 - clip_star.start = start; 71473 - clip_star.end = end; 71474 - clip_star.vmode = VIsual_mode; 71475 - clip_free_selection(&clip_star); 71476 - clip_own_selection(&clip_star); 71477 - clip_gen_set_selection(&clip_star); 71478 + if (!equalpos(clip->start, start) 71479 + || !equalpos(clip->end, end) 71480 + || clip->vmode != VIsual_mode) 71481 + { 71482 + clip_clear_selection(clip); 71483 + clip->start = start; 71484 + clip->end = end; 71485 + clip->vmode = VIsual_mode; 71486 + clip_free_selection(clip); 71487 + clip_own_selection(clip); 71488 + clip_gen_set_selection(clip); 71489 } 71490 } 71491 } 71492 @@ -469,13 +472,13 @@ 64830 71493 */ 64831 71494 #ifdef FEAT_X11 … … 64836 71499 { 64837 71500 int was_owned = cbd->owned; 64838 @@ -1609,7 +1609,7 @@ 71501 71502 cbd->owned = (clip_gen_own_selection(cbd) == OK); 71503 - if (!was_owned && cbd == &clip_star) 71504 + if (!was_owned && (cbd == &clip_star || cbd == &clip_plus)) 71505 { 71506 /* May have to show a different kind of highlighting for the 71507 * selected area. There is no specific redraw command for this, 71508 @@ -483,7 +486,8 @@ 71509 if (cbd->owned 71510 && (get_real_state() == VISUAL 71511 || get_real_state() == SELECTMODE) 71512 - && clip_isautosel() 71513 + && (cbd == &clip_star ? clip_isautosel_star() 71514 + : clip_isautosel_plus()) 71515 && hl_attr(HLF_V) != hl_attr(HLF_VNC)) 71516 redraw_curbuf_later(INVERTED_ALL); 71517 } 71518 @@ -502,12 +506,15 @@ 71519 #ifdef FEAT_X11 71520 int was_owned = cbd->owned; 71521 #endif 71522 - int visual_selection = (cbd == &clip_star); 71523 + int visual_selection = FALSE; 71524 + 71525 + if (cbd == &clip_star || cbd == &clip_plus) 71526 + visual_selection = TRUE; 71527 71528 clip_free_selection(cbd); 71529 cbd->owned = FALSE; 71530 if (visual_selection) 71531 - clip_clear_selection(); 71532 + clip_clear_selection(cbd); 71533 clip_gen_lose_selection(cbd); 71534 #ifdef FEAT_X11 71535 if (visual_selection) 71536 @@ -518,7 +525,8 @@ 71537 if (was_owned 71538 && (get_real_state() == VISUAL 71539 || get_real_state() == SELECTMODE) 71540 - && clip_isautosel() 71541 + && (cbd == &clip_star ? 71542 + clip_isautosel_star() : clip_isautosel_plus()) 71543 && hl_attr(HLF_V) != hl_attr(HLF_VNC)) 71544 { 71545 update_curbuf(INVERTED_ALL); 71546 @@ -534,18 +542,18 @@ 71547 #endif 71548 } 71549 71550 - void 71551 -clip_copy_selection() 71552 + static void 71553 +clip_copy_selection(clip) 71554 + VimClipboard *clip; 71555 { 71556 - if (VIsual_active && (State & NORMAL) && clip_star.available) 71557 + if (VIsual_active && (State & NORMAL) && clip->available) 71558 { 71559 - if (clip_isautosel()) 71560 - clip_update_selection(); 71561 - clip_free_selection(&clip_star); 71562 - clip_own_selection(&clip_star); 71563 - if (clip_star.owned) 71564 - clip_get_selection(&clip_star); 71565 - clip_gen_set_selection(&clip_star); 71566 + clip_update_selection(clip); 71567 + clip_free_selection(clip); 71568 + clip_own_selection(clip); 71569 + if (clip->owned) 71570 + clip_get_selection(clip); 71571 + clip_gen_set_selection(clip); 71572 } 71573 } 71574 71575 @@ -555,21 +563,38 @@ 71576 void 71577 clip_auto_select() 71578 { 71579 - if (clip_isautosel()) 71580 - clip_copy_selection(); 71581 + if (clip_isautosel_star()) 71582 + clip_copy_selection(&clip_star); 71583 + if (clip_isautosel_plus()) 71584 + clip_copy_selection(&clip_plus); 71585 } 71586 71587 /* 71588 - * Return TRUE if automatic selection of Visual area is desired. 71589 + * Return TRUE if automatic selection of Visual area is desired for the * 71590 + * register. 71591 */ 71592 int 71593 -clip_isautosel() 71594 +clip_isautosel_star() 71595 { 71596 return ( 71597 #ifdef FEAT_GUI 71598 gui.in_use ? (vim_strchr(p_go, GO_ASEL) != NULL) : 71599 #endif 71600 - clip_autoselect); 71601 + clip_autoselect_star); 71602 +} 71603 + 71604 +/* 71605 + * Return TRUE if automatic selection of Visual area is desired for the + 71606 + * register. 71607 + */ 71608 + int 71609 +clip_isautosel_plus() 71610 +{ 71611 + return ( 71612 +#ifdef FEAT_GUI 71613 + gui.in_use ? (vim_strchr(p_go, GO_ASELPLUS) != NULL) : 71614 +#endif 71615 + clip_autoselect_plus); 71616 } 71617 71618 71619 @@ -657,7 +682,7 @@ 71620 VimClipboard *cb = &clip_star; 71621 71622 if (cb->state == SELECT_DONE) 71623 - clip_clear_selection(); 71624 + clip_clear_selection(cb); 71625 71626 row = check_row(row); 71627 col = check_col(col); 71628 @@ -749,7 +774,7 @@ 71629 printf("Selection ended: (%u,%u) to (%u,%u)\n", cb->start.lnum, 71630 cb->start.col, cb->end.lnum, cb->end.col); 71631 #endif 71632 - if (clip_isautosel() 71633 + if (clip_isautosel_star() 71634 || ( 71635 #ifdef FEAT_GUI 71636 gui.in_use ? (vim_strchr(p_go, GO_ASELML) != NULL) : 71637 @@ -932,16 +957,16 @@ 71638 * Called from outside to clear selected region from the display 71639 */ 71640 void 71641 -clip_clear_selection() 71642 +clip_clear_selection(cbd) 71643 + VimClipboard *cbd; 71644 { 71645 - VimClipboard *cb = &clip_star; 71646 71647 - if (cb->state == SELECT_CLEARED) 71648 + if (cbd->state == SELECT_CLEARED) 71649 return; 71650 71651 - clip_invert_area((int)cb->start.lnum, cb->start.col, (int)cb->end.lnum, 71652 - cb->end.col, CLIP_CLEAR); 71653 - cb->state = SELECT_CLEARED; 71654 + clip_invert_area((int)cbd->start.lnum, cbd->start.col, (int)cbd->end.lnum, 71655 + cbd->end.col, CLIP_CLEAR); 71656 + cbd->state = SELECT_CLEARED; 71657 } 71658 71659 /* 71660 @@ -954,7 +979,7 @@ 71661 if (clip_star.state == SELECT_DONE 71662 && row2 >= clip_star.start.lnum 71663 && row1 <= clip_star.end.lnum) 71664 - clip_clear_selection(); 71665 + clip_clear_selection(&clip_star); 71666 } 71667 71668 /* 71669 @@ -1609,7 +1634,7 @@ 64839 71670 64840 71671 #if defined(FEAT_HANGULIN) || defined(PROTO) … … 64845 71676 int len; 64846 71677 { 64847 @@ -1917,6 +19 17,7 @@71678 @@ -1917,6 +1942,7 @@ 64848 71679 static Atom vim_atom; /* Vim's own special selection format */ 64849 71680 #ifdef FEAT_MBYTE … … 64853 71684 static Atom compound_text_atom; 64854 71685 static Atom text_atom; 64855 @@ -1930,6 +19 31,7 @@71686 @@ -1930,6 +1956,7 @@ 64856 71687 vim_atom = XInternAtom(dpy, VIM_ATOM_NAME, False); 64857 71688 #ifdef FEAT_MBYTE … … 64861 71692 compound_text_atom = XInternAtom(dpy, "COMPOUND_TEXT", False); 64862 71693 text_atom = XInternAtom(dpy, "TEXT", False); 64863 @@ -1944,10 +19 46,9 @@71694 @@ -1944,10 +1971,9 @@ 64864 71695 */ 64865 71696 … … 64873 71704 /* 64874 71705 * Property callback to get a timestamp for XtOwnSelection. 64875 @@ -1985,8 + 1986,17 @@71706 @@ -1985,8 +2011,17 @@ 64876 71707 return; 64877 71708 … … 64893 71724 64894 71725 void 64895 @@ -1997,8 +20 07,6 @@71726 @@ -1997,8 +2032,6 @@ 64896 71727 /*(XtEventHandler)*/clip_x11_timestamp_cb, (XtPointer)NULL); 64897 71728 } … … 64902 71733 clip_x11_request_selection_cb(w, success, sel_atom, type, value, length, 64903 71734 format) 64904 @@ -2010,7 +20 18,7 @@71735 @@ -2010,7 +2043,7 @@ 64905 71736 long_u *length; 64906 71737 int *format; … … 64911 71742 char_u *p; 64912 71743 char **text_list = NULL; 64913 @@ -2030,7 +20 38,6 @@71744 @@ -2030,7 +2063,6 @@ 64914 71745 *(int *)success = FALSE; 64915 71746 return; … … 64919 71750 len = *length; 64920 71751 if (*type == vim_atom) 64921 @@ -2069,7 +2 076,11 @@71752 @@ -2069,7 +2101,11 @@ 64922 71753 } 64923 71754 #endif … … 64932 71763 enc_dbcs != 0 && 64933 71764 #endif 64934 @@ -2123,7 +21 34,7 @@71765 @@ -2123,7 +2159,7 @@ 64935 71766 #else 64936 71767 1 … … 64941 71772 switch (i) 64942 71773 { 64943 @@ -2131,10 +21 42,18 @@71774 @@ -2131,10 +2167,18 @@ 64944 71775 case 0: type = vimenc_atom; break; 64945 71776 #endif … … 64962 71793 XtGetSelectionValue(myShell, cbd->sel_atom, type, 64963 71794 clip_x11_request_selection_cb, (XtPointer)&success, CurrentTime); 64964 @@ -2225,18 +22 44,23 @@71795 @@ -2225,18 +2269,23 @@ 64965 71796 { 64966 71797 Atom *array; … … 64988 71819 /* This used to be: *format = sizeof(Atom) * 8; but that caused 64989 71820 * crashes on 64 bit machines. (Peter Derr) */ 64990 @@ -2248,6 +22 72,7 @@71821 @@ -2248,6 +2297,7 @@ 64991 71822 if ( *target != XA_STRING 64992 71823 #ifdef FEAT_MBYTE … … 64996 71827 && *target != vim_atom 64997 71828 && *target != text_atom 64998 @@ -2277,13 +23 02,16 @@71829 @@ -2277,13 +2327,16 @@ 64999 71830 return False; 65000 71831 } … … 65017 71848 XTextProperty text_prop; 65018 71849 char *string_nt = (char *)alloc((unsigned)*length + 1); 65019 @@ -2336,7 +23 64,7 @@71850 @@ -2336,7 +2389,7 @@ 65020 71851 65021 71852 void … … 65026 71857 { 65027 71858 XtDisownSelection(myShell, cbd->sel_atom, CurrentTime); 65028 @@ -2344,14 +23 72,29 @@71859 @@ -2344,14 +2397,29 @@ 65029 71860 65030 71861 int … … 65063 71894 return OK; 65064 71895 diff -Naur vim73.orig/src/undo.c vim73/src/undo.c 65065 --- vim73.orig/src/undo.c 201 2-06-03 23:09:52.952007375+000065066 +++ vim73/src/undo.c 2012-0 6-03 23:09:55.916086255+000071896 --- vim73.orig/src/undo.c 2010-08-07 10:48:15.000000000 +0000 71897 +++ vim73/src/undo.c 2012-07-20 20:31:16.354310429 +0000 65067 71898 @@ -81,10 +81,6 @@ 65068 71899 #define UH_MAGIC 0x18dade /* value for uh_magic when in use */ … … 65164 71995 #if defined(FEAT_EVAL) || defined(PROTO) 65165 71996 diff -Naur vim73.orig/src/version.c vim73/src/version.c 65166 --- vim73.orig/src/version.c 201 2-06-03 23:09:52.932006845+000065167 +++ vim73/src/version.c 2012-0 6-03 23:09:55.964087533+000071997 --- vim73.orig/src/version.c 2010-08-01 13:45:48.000000000 +0000 71998 +++ vim73/src/version.c 2012-07-20 20:31:18.344311852 +0000 65168 71999 @@ -379,6 +379,11 @@ 65169 72000 # else … … 65190 72021 "+path_extra", 65191 72022 #else 65192 @@ -715,127 +715,1 200 @@72023 @@ -715,127 +715,1340 @@ 65193 72024 static int included_patches[] = 65194 72025 { /* Add new patch number below this line */ … … 65206 72037 -static char *(extra_patches[]) = 65207 72038 -{ /* Add your patch description below this line */ 65208 + 538,72039 + 608, 65209 72040 /**/ 65210 72041 - NULL … … 65316 72147 - MSG_PUTS(_("\nRISC OS version")); 65317 72148 -#endif 72149 + 607, 72150 +/**/ 72151 + 606, 72152 +/**/ 72153 + 605, 72154 +/**/ 72155 + 604, 72156 +/**/ 72157 + 603, 72158 +/**/ 72159 + 602, 72160 +/**/ 72161 + 601, 72162 +/**/ 72163 + 600, 72164 +/**/ 72165 + 599, 72166 +/**/ 72167 + 598, 72168 +/**/ 72169 + 597, 72170 +/**/ 72171 + 596, 72172 +/**/ 72173 + 595, 72174 +/**/ 72175 + 594, 72176 +/**/ 72177 + 593, 72178 +/**/ 72179 + 592, 72180 +/**/ 72181 + 591, 72182 +/**/ 72183 + 590, 72184 +/**/ 72185 + 589, 72186 +/**/ 72187 + 588, 72188 +/**/ 72189 + 587, 72190 +/**/ 72191 + 586, 72192 +/**/ 72193 + 585, 72194 +/**/ 72195 + 584, 72196 +/**/ 72197 + 583, 72198 +/**/ 72199 + 582, 72200 +/**/ 72201 + 581, 72202 +/**/ 72203 + 580, 72204 +/**/ 72205 + 579, 72206 +/**/ 72207 + 578, 72208 +/**/ 72209 + 577, 72210 +/**/ 72211 + 576, 72212 +/**/ 72213 + 575, 72214 +/**/ 72215 + 574, 72216 +/**/ 72217 + 573, 72218 +/**/ 72219 + 572, 72220 +/**/ 72221 + 571, 72222 +/**/ 72223 + 570, 72224 +/**/ 72225 + 569, 72226 +/**/ 72227 + 568, 72228 +/**/ 72229 + 567, 72230 +/**/ 72231 + 566, 72232 +/**/ 72233 + 565, 72234 +/**/ 72235 + 564, 72236 +/**/ 72237 + 563, 72238 +/**/ 72239 + 562, 72240 +/**/ 72241 + 561, 72242 +/**/ 72243 + 560, 72244 +/**/ 72245 + 559, 72246 +/**/ 72247 + 558, 72248 +/**/ 72249 + 557, 72250 +/**/ 72251 + 556, 72252 +/**/ 72253 + 555, 72254 +/**/ 72255 + 554, 72256 +/**/ 72257 + 553, 72258 +/**/ 72259 + 552, 72260 +/**/ 72261 + 551, 72262 +/**/ 72263 + 550, 72264 +/**/ 72265 + 549, 72266 +/**/ 72267 + 548, 72268 +/**/ 72269 + 547, 72270 +/**/ 72271 + 546, 72272 +/**/ 72273 + 545, 72274 +/**/ 72275 + 544, 72276 +/**/ 72277 + 543, 72278 +/**/ 72279 + 542, 72280 +/**/ 72281 + 541, 72282 +/**/ 72283 + 540, 72284 +/**/ 72285 + 539, 72286 +/**/ 72287 + 538, 72288 +/**/ 65318 72289 + 537, 65319 72290 +/**/ … … 66511 73482 MSG_PUTS(_("\nOpenVMS version")); 66512 73483 # ifdef HAVE_PATHDEF 66513 @@ -1262,14 +2 335,11 @@73484 @@ -1262,14 +2475,11 @@ 66514 73485 if (highest_patch()) 66515 73486 { … … 66530 73501 else 66531 73502 sprintf((char *)vers + 3, ".%d", highest_patch()); 66532 diff -Naur vim73.orig/src/version.c.orig vim73/src/version.c.orig66533 --- vim73.orig/src/version.c.orig 1970-01-01 00:00:00.000000000 +000066534 +++ vim73/src/version.c.orig 2012-06-03 23:09:54.144039098 +000066535 @@ -0,0 +1,1691 @@66536 +/* vi:set ts=8 sts=4 sw=4:66537 + *66538 + * VIM - Vi IMproved by Bram Moolenaar66539 + *66540 + * Do ":help uganda" in Vim to read copying and usage conditions.66541 + * Do ":help credits" in Vim to see a list of people who contributed.66542 + * See README.txt for an overview of the Vim source code.66543 + */66544 +66545 +#include "vim.h"66546 +66547 +#ifdef AMIGA66548 +# include <time.h> /* for time() */66549 +#endif66550 +66551 +/*66552 + * Vim originated from Stevie version 3.6 (Fish disk 217) by GRWalter (Fred)66553 + * It has been changed beyond recognition since then.66554 + *66555 + * Differences between version 6.x and 7.x can be found with ":help version7".66556 + * Differences between version 5.x and 6.x can be found with ":help version6".66557 + * Differences between version 4.x and 5.x can be found with ":help version5".66558 + * Differences between version 3.0 and 4.x can be found with ":help version4".66559 + * All the remarks about older versions have been removed, they are not very66560 + * interesting.66561 + */66562 +66563 +#include "version.h"66564 +66565 +char *Version = VIM_VERSION_SHORT;66566 +static char *mediumVersion = VIM_VERSION_MEDIUM;66567 +66568 +#if defined(HAVE_DATE_TIME) || defined(PROTO)66569 +# if (defined(VMS) && defined(VAXC)) || defined(PROTO)66570 +char longVersion[sizeof(VIM_VERSION_LONG_DATE) + sizeof(__DATE__)66571 + + sizeof(__TIME__) + 3];66572 + void66573 +make_version()66574 +{66575 + /*66576 + * Construct the long version string. Necessary because66577 + * VAX C can't catenate strings in the preprocessor.66578 + */66579 + strcpy(longVersion, VIM_VERSION_LONG_DATE);66580 + strcat(longVersion, __DATE__);66581 + strcat(longVersion, " ");66582 + strcat(longVersion, __TIME__);66583 + strcat(longVersion, ")");66584 +}66585 +# else66586 +char *longVersion = VIM_VERSION_LONG_DATE __DATE__ " " __TIME__ ")";66587 +# endif66588 +#else66589 +char *longVersion = VIM_VERSION_LONG;66590 +#endif66591 +66592 +static void version_msg __ARGS((char *s));66593 +66594 +static char *(features[]) =66595 +{66596 +#ifdef AMIGA /* only for Amiga systems */66597 +# ifdef FEAT_ARP66598 + "+ARP",66599 +# else66600 + "-ARP",66601 +# endif66602 +#endif66603 +#ifdef FEAT_ARABIC66604 + "+arabic",66605 +#else66606 + "-arabic",66607 +#endif66608 +#ifdef FEAT_AUTOCMD66609 + "+autocmd",66610 +#else66611 + "-autocmd",66612 +#endif66613 +#ifdef FEAT_BEVAL66614 + "+balloon_eval",66615 +#else66616 + "-balloon_eval",66617 +#endif66618 +#ifdef FEAT_BROWSE66619 + "+browse",66620 +#else66621 + "-browse",66622 +#endif66623 +#ifdef NO_BUILTIN_TCAPS66624 + "-builtin_terms",66625 +#endif66626 +#ifdef SOME_BUILTIN_TCAPS66627 + "+builtin_terms",66628 +#endif66629 +#ifdef ALL_BUILTIN_TCAPS66630 + "++builtin_terms",66631 +#endif66632 +#ifdef FEAT_BYTEOFF66633 + "+byte_offset",66634 +#else66635 + "-byte_offset",66636 +#endif66637 +#ifdef FEAT_CINDENT66638 + "+cindent",66639 +#else66640 + "-cindent",66641 +#endif66642 +#ifdef FEAT_CLIENTSERVER66643 + "+clientserver",66644 +#else66645 + "-clientserver",66646 +#endif66647 +#ifdef FEAT_CLIPBOARD66648 + "+clipboard",66649 +#else66650 + "-clipboard",66651 +#endif66652 +#ifdef FEAT_CMDL_COMPL66653 + "+cmdline_compl",66654 +#else66655 + "-cmdline_compl",66656 +#endif66657 +#ifdef FEAT_CMDHIST66658 + "+cmdline_hist",66659 +#else66660 + "-cmdline_hist",66661 +#endif66662 +#ifdef FEAT_CMDL_INFO66663 + "+cmdline_info",66664 +#else66665 + "-cmdline_info",66666 +#endif66667 +#ifdef FEAT_COMMENTS66668 + "+comments",66669 +#else66670 + "-comments",66671 +#endif66672 +#ifdef FEAT_CONCEAL66673 + "+conceal",66674 +#else66675 + "-conceal",66676 +#endif66677 +#ifdef FEAT_CRYPT66678 + "+cryptv",66679 +#else66680 + "-cryptv",66681 +#endif66682 +#ifdef FEAT_CSCOPE66683 + "+cscope",66684 +#else66685 + "-cscope",66686 +#endif66687 +#ifdef FEAT_CURSORBIND66688 + "+cursorbind",66689 +#else66690 + "-cursorbind",66691 +#endif66692 +#ifdef CURSOR_SHAPE66693 + "+cursorshape",66694 +#else66695 + "-cursorshape",66696 +#endif66697 +#if defined(FEAT_CON_DIALOG) && defined(FEAT_GUI_DIALOG)66698 + "+dialog_con_gui",66699 +#else66700 +# if defined(FEAT_CON_DIALOG)66701 + "+dialog_con",66702 +# else66703 +# if defined(FEAT_GUI_DIALOG)66704 + "+dialog_gui",66705 +# else66706 + "-dialog",66707 +# endif66708 +# endif66709 +#endif66710 +#ifdef FEAT_DIFF66711 + "+diff",66712 +#else66713 + "-diff",66714 +#endif66715 +#ifdef FEAT_DIGRAPHS66716 + "+digraphs",66717 +#else66718 + "-digraphs",66719 +#endif66720 +#ifdef FEAT_DND66721 + "+dnd",66722 +#else66723 + "-dnd",66724 +#endif66725 +#ifdef EBCDIC66726 + "+ebcdic",66727 +#else66728 + "-ebcdic",66729 +#endif66730 +#ifdef FEAT_EMACS_TAGS66731 + "+emacs_tags",66732 +#else66733 + "-emacs_tags",66734 +#endif66735 +#ifdef FEAT_EVAL66736 + "+eval",66737 +#else66738 + "-eval",66739 +#endif66740 +#ifdef FEAT_EX_EXTRA66741 + "+ex_extra",66742 +#else66743 + "-ex_extra",66744 +#endif66745 +#ifdef FEAT_SEARCH_EXTRA66746 + "+extra_search",66747 +#else66748 + "-extra_search",66749 +#endif66750 +#ifdef FEAT_FKMAP66751 + "+farsi",66752 +#else66753 + "-farsi",66754 +#endif66755 +#ifdef FEAT_SEARCHPATH66756 + "+file_in_path",66757 +#else66758 + "-file_in_path",66759 +#endif66760 +#ifdef FEAT_FIND_ID66761 + "+find_in_path",66762 +#else66763 + "-find_in_path",66764 +#endif66765 +#ifdef FEAT_FLOAT66766 + "+float",66767 +#else66768 + "-float",66769 +#endif66770 +#ifdef FEAT_FOLDING66771 + "+folding",66772 +#else66773 + "-folding",66774 +#endif66775 +#ifdef FEAT_FOOTER66776 + "+footer",66777 +#else66778 + "-footer",66779 +#endif66780 + /* only interesting on Unix systems */66781 +#if !defined(USE_SYSTEM) && defined(UNIX)66782 + "+fork()",66783 +#endif66784 +#ifdef FEAT_GETTEXT66785 +# ifdef DYNAMIC_GETTEXT66786 + "+gettext/dyn",66787 +# else66788 + "+gettext",66789 +# endif66790 +#else66791 + "-gettext",66792 +#endif66793 +#ifdef FEAT_HANGULIN66794 + "+hangul_input",66795 +#else66796 + "-hangul_input",66797 +#endif66798 +#if (defined(HAVE_ICONV_H) && defined(USE_ICONV)) || defined(DYNAMIC_ICONV)66799 +# ifdef DYNAMIC_ICONV66800 + "+iconv/dyn",66801 +# else66802 + "+iconv",66803 +# endif66804 +#else66805 + "-iconv",66806 +#endif66807 +#ifdef FEAT_INS_EXPAND66808 + "+insert_expand",66809 +#else66810 + "-insert_expand",66811 +#endif66812 +#ifdef FEAT_JUMPLIST66813 + "+jumplist",66814 +#else66815 + "-jumplist",66816 +#endif66817 +#ifdef FEAT_KEYMAP66818 + "+keymap",66819 +#else66820 + "-keymap",66821 +#endif66822 +#ifdef FEAT_LANGMAP66823 + "+langmap",66824 +#else66825 + "-langmap",66826 +#endif66827 +#ifdef FEAT_LIBCALL66828 + "+libcall",66829 +#else66830 + "-libcall",66831 +#endif66832 +#ifdef FEAT_LINEBREAK66833 + "+linebreak",66834 +#else66835 + "-linebreak",66836 +#endif66837 +#ifdef FEAT_LISP66838 + "+lispindent",66839 +#else66840 + "-lispindent",66841 +#endif66842 +#ifdef FEAT_LISTCMDS66843 + "+listcmds",66844 +#else66845 + "-listcmds",66846 +#endif66847 +#ifdef FEAT_LOCALMAP66848 + "+localmap",66849 +#else66850 + "-localmap",66851 +#endif66852 +#ifdef FEAT_LUA66853 +# ifdef DYNAMIC_LUA66854 + "+lua/dyn",66855 +# else66856 + "+lua",66857 +# endif66858 +#else66859 + "-lua",66860 +#endif66861 +#ifdef FEAT_MENU66862 + "+menu",66863 +#else66864 + "-menu",66865 +#endif66866 +#ifdef FEAT_SESSION66867 + "+mksession",66868 +#else66869 + "-mksession",66870 +#endif66871 +#ifdef FEAT_MODIFY_FNAME66872 + "+modify_fname",66873 +#else66874 + "-modify_fname",66875 +#endif66876 +#ifdef FEAT_MOUSE66877 + "+mouse",66878 +# ifdef FEAT_MOUSESHAPE66879 + "+mouseshape",66880 +# else66881 + "-mouseshape",66882 +# endif66883 +# else66884 + "-mouse",66885 +#endif66886 +#if defined(UNIX) || defined(VMS)66887 +# ifdef FEAT_MOUSE_DEC66888 + "+mouse_dec",66889 +# else66890 + "-mouse_dec",66891 +# endif66892 +# ifdef FEAT_MOUSE_GPM66893 + "+mouse_gpm",66894 +# else66895 + "-mouse_gpm",66896 +# endif66897 +# ifdef FEAT_MOUSE_JSB66898 + "+mouse_jsbterm",66899 +# else66900 + "-mouse_jsbterm",66901 +# endif66902 +# ifdef FEAT_MOUSE_NET66903 + "+mouse_netterm",66904 +# else66905 + "-mouse_netterm",66906 +# endif66907 +# ifdef FEAT_SYSMOUSE66908 + "+mouse_sysmouse",66909 +# else66910 + "-mouse_sysmouse",66911 +# endif66912 +# ifdef FEAT_MOUSE_XTERM66913 + "+mouse_xterm",66914 +# else66915 + "-mouse_xterm",66916 +# endif66917 +#endif66918 +#ifdef __QNX__66919 +# ifdef FEAT_MOUSE_PTERM66920 + "+mouse_pterm",66921 +# else66922 + "-mouse_pterm",66923 +# endif66924 +#endif66925 +#ifdef FEAT_MBYTE_IME66926 +# ifdef DYNAMIC_IME66927 + "+multi_byte_ime/dyn",66928 +# else66929 + "+multi_byte_ime",66930 +# endif66931 +#else66932 +# ifdef FEAT_MBYTE66933 + "+multi_byte",66934 +# else66935 + "-multi_byte",66936 +# endif66937 +#endif66938 +#ifdef FEAT_MULTI_LANG66939 + "+multi_lang",66940 +#else66941 + "-multi_lang",66942 +#endif66943 +#ifdef FEAT_MZSCHEME66944 +# ifdef DYNAMIC_MZSCHEME66945 + "+mzscheme/dyn",66946 +# else66947 + "+mzscheme",66948 +# endif66949 +#else66950 + "-mzscheme",66951 +#endif66952 +#ifdef FEAT_NETBEANS_INTG66953 + "+netbeans_intg",66954 +#else66955 + "-netbeans_intg",66956 +#endif66957 +#ifdef FEAT_GUI_W3266958 +# ifdef FEAT_OLE66959 + "+ole",66960 +# else66961 + "-ole",66962 +# endif66963 +#endif66964 +#ifdef FEAT_PATH_EXTRA66965 + "+path_extra",66966 +#else66967 + "-path_extra",66968 +#endif66969 +#ifdef FEAT_PERL66970 +# ifdef DYNAMIC_PERL66971 + "+perl/dyn",66972 +# else66973 + "+perl",66974 +# endif66975 +#else66976 + "-perl",66977 +#endif66978 +#ifdef FEAT_PERSISTENT_UNDO66979 + "+persistent_undo",66980 +#else66981 + "-persistent_undo",66982 +#endif66983 +#ifdef FEAT_PRINTER66984 +# ifdef FEAT_POSTSCRIPT66985 + "+postscript",66986 +# else66987 + "-postscript",66988 +# endif66989 + "+printer",66990 +#else66991 + "-printer",66992 +#endif66993 +#ifdef FEAT_PROFILE66994 + "+profile",66995 +#else66996 + "-profile",66997 +#endif66998 +#ifdef FEAT_PYTHON66999 +# ifdef DYNAMIC_PYTHON67000 + "+python/dyn",67001 +# else67002 + "+python",67003 +# endif67004 +#else67005 + "-python",67006 +#endif67007 +#ifdef FEAT_PYTHON367008 +# ifdef DYNAMIC_PYTHON367009 + "+python3/dyn",67010 +# else67011 + "+python3",67012 +# endif67013 +#else67014 + "-python3",67015 +#endif67016 +#ifdef FEAT_QUICKFIX67017 + "+quickfix",67018 +#else67019 + "-quickfix",67020 +#endif67021 +#ifdef FEAT_RELTIME67022 + "+reltime",67023 +#else67024 + "-reltime",67025 +#endif67026 +#ifdef FEAT_RIGHTLEFT67027 + "+rightleft",67028 +#else67029 + "-rightleft",67030 +#endif67031 +#ifdef FEAT_RUBY67032 +# ifdef DYNAMIC_RUBY67033 + "+ruby/dyn",67034 +# else67035 + "+ruby",67036 +# endif67037 +#else67038 + "-ruby",67039 +#endif67040 +#ifdef FEAT_SCROLLBIND67041 + "+scrollbind",67042 +#else67043 + "-scrollbind",67044 +#endif67045 +#ifdef FEAT_SIGNS67046 + "+signs",67047 +#else67048 + "-signs",67049 +#endif67050 +#ifdef FEAT_SMARTINDENT67051 + "+smartindent",67052 +#else67053 + "-smartindent",67054 +#endif67055 +#ifdef FEAT_SNIFF67056 + "+sniff",67057 +#else67058 + "-sniff",67059 +#endif67060 +#ifdef STARTUPTIME67061 + "+startuptime",67062 +#else67063 + "-startuptime",67064 +#endif67065 +#ifdef FEAT_STL_OPT67066 + "+statusline",67067 +#else67068 + "-statusline",67069 +#endif67070 +#ifdef FEAT_SUN_WORKSHOP67071 + "+sun_workshop",67072 +#else67073 + "-sun_workshop",67074 +#endif67075 +#ifdef FEAT_SYN_HL67076 + "+syntax",67077 +#else67078 + "-syntax",67079 +#endif67080 + /* only interesting on Unix systems */67081 +#if defined(USE_SYSTEM) && (defined(UNIX) || defined(__EMX__))67082 + "+system()",67083 +#endif67084 +#ifdef FEAT_TAG_BINS67085 + "+tag_binary",67086 +#else67087 + "-tag_binary",67088 +#endif67089 +#ifdef FEAT_TAG_OLDSTATIC67090 + "+tag_old_static",67091 +#else67092 + "-tag_old_static",67093 +#endif67094 +#ifdef FEAT_TAG_ANYWHITE67095 + "+tag_any_white",67096 +#else67097 + "-tag_any_white",67098 +#endif67099 +#ifdef FEAT_TCL67100 +# ifdef DYNAMIC_TCL67101 + "+tcl/dyn",67102 +# else67103 + "+tcl",67104 +# endif67105 +#else67106 + "-tcl",67107 +#endif67108 +#if defined(UNIX) || defined(__EMX__)67109 +/* only Unix (or OS/2 with EMX!) can have terminfo instead of termcap */67110 +# ifdef TERMINFO67111 + "+terminfo",67112 +# else67113 + "-terminfo",67114 +# endif67115 +#else /* unix always includes termcap support */67116 +# ifdef HAVE_TGETENT67117 + "+tgetent",67118 +# else67119 + "-tgetent",67120 +# endif67121 +#endif67122 +#ifdef FEAT_TERMRESPONSE67123 + "+termresponse",67124 +#else67125 + "-termresponse",67126 +#endif67127 +#ifdef FEAT_TEXTOBJ67128 + "+textobjects",67129 +#else67130 + "-textobjects",67131 +#endif67132 +#ifdef FEAT_TITLE67133 + "+title",67134 +#else67135 + "-title",67136 +#endif67137 +#ifdef FEAT_TOOLBAR67138 + "+toolbar",67139 +#else67140 + "-toolbar",67141 +#endif67142 +#ifdef FEAT_USR_CMDS67143 + "+user_commands",67144 +#else67145 + "-user_commands",67146 +#endif67147 +#ifdef FEAT_VERTSPLIT67148 + "+vertsplit",67149 +#else67150 + "-vertsplit",67151 +#endif67152 +#ifdef FEAT_VIRTUALEDIT67153 + "+virtualedit",67154 +#else67155 + "-virtualedit",67156 +#endif67157 +#ifdef FEAT_VISUAL67158 + "+visual",67159 +# ifdef FEAT_VISUALEXTRA67160 + "+visualextra",67161 +# else67162 + "-visualextra",67163 +# endif67164 +#else67165 + "-visual",67166 +#endif67167 +#ifdef FEAT_VIMINFO67168 + "+viminfo",67169 +#else67170 + "-viminfo",67171 +#endif67172 +#ifdef FEAT_VREPLACE67173 + "+vreplace",67174 +#else67175 + "-vreplace",67176 +#endif67177 +#ifdef FEAT_WILDIGN67178 + "+wildignore",67179 +#else67180 + "-wildignore",67181 +#endif67182 +#ifdef FEAT_WILDMENU67183 + "+wildmenu",67184 +#else67185 + "-wildmenu",67186 +#endif67187 +#ifdef FEAT_WINDOWS67188 + "+windows",67189 +#else67190 + "-windows",67191 +#endif67192 +#ifdef FEAT_WRITEBACKUP67193 + "+writebackup",67194 +#else67195 + "-writebackup",67196 +#endif67197 +#if defined(UNIX) || defined(VMS)67198 +# ifdef FEAT_X1167199 + "+X11",67200 +# else67201 + "-X11",67202 +# endif67203 +#endif67204 +#ifdef FEAT_XFONTSET67205 + "+xfontset",67206 +#else67207 + "-xfontset",67208 +#endif67209 +#ifdef FEAT_XIM67210 + "+xim",67211 +#else67212 + "-xim",67213 +#endif67214 +#if defined(UNIX) || defined(VMS)67215 +# ifdef USE_XSMP_INTERACT67216 + "+xsmp_interact",67217 +# else67218 +# ifdef USE_XSMP67219 + "+xsmp",67220 +# else67221 + "-xsmp",67222 +# endif67223 +# endif67224 +# ifdef FEAT_XCLIPBOARD67225 + "+xterm_clipboard",67226 +# else67227 + "-xterm_clipboard",67228 +# endif67229 +#endif67230 +#ifdef FEAT_XTERM_SAVE67231 + "+xterm_save",67232 +#else67233 + "-xterm_save",67234 +#endif67235 +#ifdef WIN326467236 +# ifdef FEAT_XPM_W3267237 + "+xpm_w32",67238 +# else67239 + "-xpm_w32",67240 +# endif67241 +#endif67242 + NULL67243 +};67244 +67245 +static int included_patches[] =67246 +{ /* Add new patch number below this line */67247 +/**/67248 + 190,67249 +/**/67250 + 189,67251 +/**/67252 + 188,67253 +/**/67254 + 187,67255 +/**/67256 + 186,67257 +/**/67258 + 185,67259 +/**/67260 + 184,67261 +/**/67262 + 183,67263 +/**/67264 + 182,67265 +/**/67266 + 181,67267 +/**/67268 + 180,67269 +/**/67270 + 179,67271 +/**/67272 + 178,67273 +/**/67274 + 177,67275 +/**/67276 + 176,67277 +/**/67278 + 175,67279 +/**/67280 + 174,67281 +/**/67282 + 173,67283 +/**/67284 + 172,67285 +/**/67286 + 171,67287 +/**/67288 + 170,67289 +/**/67290 + 169,67291 +/**/67292 + 168,67293 +/**/67294 + 167,67295 +/**/67296 + 166,67297 +/**/67298 + 165,67299 +/**/67300 + 164,67301 +/**/67302 + 163,67303 +/**/67304 + 162,67305 +/**/67306 + 161,67307 +/**/67308 + 160,67309 +/**/67310 + 159,67311 +/**/67312 + 158,67313 +/**/67314 + 157,67315 +/**/67316 + 156,67317 +/**/67318 + 155,67319 +/**/67320 + 154,67321 +/**/67322 + 153,67323 +/**/67324 + 152,67325 +/**/67326 + 151,67327 +/**/67328 + 150,67329 +/**/67330 + 149,67331 +/**/67332 + 148,67333 +/**/67334 + 147,67335 +/**/67336 + 146,67337 +/**/67338 + 145,67339 +/**/67340 + 144,67341 +/**/67342 + 143,67343 +/**/67344 + 142,67345 +/**/67346 + 141,67347 +/**/67348 + 140,67349 +/**/67350 + 139,67351 +/**/67352 + 138,67353 +/**/67354 + 137,67355 +/**/67356 + 136,67357 +/**/67358 + 135,67359 +/**/67360 + 134,67361 +/**/67362 + 133,67363 +/**/67364 + 132,67365 +/**/67366 + 131,67367 +/**/67368 + 130,67369 +/**/67370 + 129,67371 +/**/67372 + 128,67373 +/**/67374 + 127,67375 +/**/67376 + 126,67377 +/**/67378 + 125,67379 +/**/67380 + 124,67381 +/**/67382 + 123,67383 +/**/67384 + 122,67385 +/**/67386 + 121,67387 +/**/67388 + 120,67389 +/**/67390 + 119,67391 +/**/67392 + 118,67393 +/**/67394 + 117,67395 +/**/67396 + 116,67397 +/**/67398 + 115,67399 +/**/67400 + 114,67401 +/**/67402 + 113,67403 +/**/67404 + 112,67405 +/**/67406 + 111,67407 +/**/67408 + 110,67409 +/**/67410 + 109,67411 +/**/67412 + 108,67413 +/**/67414 + 107,67415 +/**/67416 + 106,67417 +/**/67418 + 105,67419 +/**/67420 + 104,67421 +/**/67422 + 103,67423 +/**/67424 + 102,67425 +/**/67426 + 101,67427 +/**/67428 + 100,67429 +/**/67430 + 99,67431 +/**/67432 + 98,67433 +/**/67434 + 97,67435 +/**/67436 + 96,67437 +/**/67438 + 95,67439 +/**/67440 + 94,67441 +/**/67442 + 93,67443 +/**/67444 + 92,67445 +/**/67446 + 91,67447 +/**/67448 + 90,67449 +/**/67450 + 89,67451 +/**/67452 + 88,67453 +/**/67454 + 87,67455 +/**/67456 + 86,67457 +/**/67458 + 85,67459 +/**/67460 + 84,67461 +/**/67462 + 83,67463 +/**/67464 + 82,67465 +/**/67466 + 81,67467 +/**/67468 + 80,67469 +/**/67470 + 79,67471 +/**/67472 + 78,67473 +/**/67474 + 77,67475 +/**/67476 + 76,67477 +/**/67478 + 75,67479 +/**/67480 + 74,67481 +/**/67482 + 73,67483 +/**/67484 + 72,67485 +/**/67486 + 71,67487 +/**/67488 + 70,67489 +/**/67490 + 69,67491 +/**/67492 + 68,67493 +/**/67494 + 67,67495 +/**/67496 + 66,67497 +/**/67498 + 65,67499 +/**/67500 + 64,67501 +/**/67502 + 63,67503 +/**/67504 + 62,67505 +/**/67506 + 61,67507 +/**/67508 + 60,67509 +/**/67510 + 59,67511 +/**/67512 + 58,67513 +/**/67514 + 57,67515 +/**/67516 + 56,67517 +/**/67518 + 55,67519 +/**/67520 + 54,67521 +/**/67522 + 53,67523 +/**/67524 + 52,67525 +/**/67526 + 51,67527 +/**/67528 + 50,67529 +/**/67530 + 49,67531 +/**/67532 + 48,67533 +/**/67534 + 47,67535 +/**/67536 + 46,67537 +/**/67538 + 45,67539 +/**/67540 + 44,67541 +/**/67542 + 43,67543 +/**/67544 + 42,67545 +/**/67546 + 41,67547 +/**/67548 + 40,67549 +/**/67550 + 39,67551 +/**/67552 + 38,67553 +/**/67554 + 37,67555 +/**/67556 + 36,67557 +/**/67558 + 35,67559 +/**/67560 + 34,67561 +/**/67562 + 33,67563 +/**/67564 + 32,67565 +/**/67566 + 31,67567 +/**/67568 + 30,67569 +/**/67570 + 29,67571 +/**/67572 + 28,67573 +/**/67574 + 27,67575 +/**/67576 + 26,67577 +/**/67578 + 25,67579 +/**/67580 + 24,67581 +/**/67582 + 23,67583 +/**/67584 + 22,67585 +/**/67586 + 21,67587 +/**/67588 + 20,67589 +/**/67590 + 19,67591 +/**/67592 + 18,67593 +/**/67594 + 17,67595 +/**/67596 + 16,67597 +/**/67598 + 15,67599 +/**/67600 + 14,67601 +/**/67602 + 13,67603 +/**/67604 + 12,67605 +/**/67606 + 11,67607 +/**/67608 + 10,67609 +/**/67610 + 9,67611 +/**/67612 + 8,67613 +/**/67614 + 7,67615 +/**/67616 + 6,67617 +/**/67618 + 5,67619 +/**/67620 + 4,67621 +/**/67622 + 3,67623 +/**/67624 + 2,67625 +/**/67626 + 1,67627 +/**/67628 + 067629 +};67630 +67631 +/*67632 + * Place to put a short description when adding a feature with a patch.67633 + * Keep it short, e.g.,: "relative numbers", "persistent undo".67634 + * Also add a comment marker to separate the lines.67635 + * See the official Vim patches for the diff format: It must use a context of67636 + * one line only. Create it by hand or use "diff -C2" and edit the patch.67637 + */67638 +static char *(extra_patches[]) =67639 +{ /* Add your patch description below this line */67640 +/**/67641 + NULL67642 +};67643 +67644 + int67645 +highest_patch()67646 +{67647 + int i;67648 + int h = 0;67649 +67650 + for (i = 0; included_patches[i] != 0; ++i)67651 + if (included_patches[i] > h)67652 + h = included_patches[i];67653 + return h;67654 +}67655 +67656 +#if defined(FEAT_EVAL) || defined(PROTO)67657 +/*67658 + * Return TRUE if patch "n" has been included.67659 + */67660 + int67661 +has_patch(n)67662 + int n;67663 +{67664 + int i;67665 +67666 + for (i = 0; included_patches[i] != 0; ++i)67667 + if (included_patches[i] == n)67668 + return TRUE;67669 + return FALSE;67670 +}67671 +#endif67672 +67673 + void67674 +ex_version(eap)67675 + exarg_T *eap;67676 +{67677 + /*67678 + * Ignore a ":version 9.99" command.67679 + */67680 + if (*eap->arg == NUL)67681 + {67682 + msg_putchar('\n');67683 + list_version();67684 + }67685 +}67686 +67687 + void67688 +list_version()67689 +{67690 + int i;67691 + int first;67692 + char *s = "";67693 +67694 + /*67695 + * When adding features here, don't forget to update the list of67696 + * internal variables in eval.c!67697 + */67698 + MSG(longVersion);67699 +#ifdef WIN326467700 +# ifdef FEAT_GUI_W3267701 +# if defined(_MSC_VER) && (_MSC_VER <= 1010)67702 + /* Only MS VC 4.1 and earlier can do Win32s */67703 + MSG_PUTS(_("\nMS-Windows 16/32-bit GUI version"));67704 +# else67705 +# ifdef _WIN6467706 + MSG_PUTS(_("\nMS-Windows 64-bit GUI version"));67707 +# else67708 + MSG_PUTS(_("\nMS-Windows 32-bit GUI version"));67709 +# endif67710 +# endif67711 + if (gui_is_win32s())67712 + MSG_PUTS(_(" in Win32s mode"));67713 +# ifdef FEAT_OLE67714 + MSG_PUTS(_(" with OLE support"));67715 +# endif67716 +# else67717 +# ifdef _WIN6467718 + MSG_PUTS(_("\nMS-Windows 64-bit console version"));67719 +# else67720 + MSG_PUTS(_("\nMS-Windows 32-bit console version"));67721 +# endif67722 +# endif67723 +#endif67724 +#ifdef WIN1667725 + MSG_PUTS(_("\nMS-Windows 16-bit version"));67726 +#endif67727 +#ifdef MSDOS67728 +# ifdef DJGPP67729 + MSG_PUTS(_("\n32-bit MS-DOS version"));67730 +# else67731 + MSG_PUTS(_("\n16-bit MS-DOS version"));67732 +# endif67733 +#endif67734 +#ifdef MACOS67735 +# ifdef MACOS_X67736 +# ifdef MACOS_X_UNIX67737 + MSG_PUTS(_("\nMacOS X (unix) version"));67738 +# else67739 + MSG_PUTS(_("\nMacOS X version"));67740 +# endif67741 +#else67742 + MSG_PUTS(_("\nMacOS version"));67743 +# endif67744 +#endif67745 +67746 +#ifdef VMS67747 + MSG_PUTS(_("\nOpenVMS version"));67748 +# ifdef HAVE_PATHDEF67749 + if (*compiled_arch != NUL)67750 + {67751 + MSG_PUTS(" - ");67752 + MSG_PUTS(compiled_arch);67753 + }67754 +# endif67755 +67756 +#endif67757 +67758 + /* Print the list of patch numbers if there is at least one. */67759 + /* Print a range when patches are consecutive: "1-10, 12, 15-40, 42-45" */67760 + if (included_patches[0] != 0)67761 + {67762 + MSG_PUTS(_("\nIncluded patches: "));67763 + first = -1;67764 + /* find last one */67765 + for (i = 0; included_patches[i] != 0; ++i)67766 + ;67767 + while (--i >= 0)67768 + {67769 + if (first < 0)67770 + first = included_patches[i];67771 + if (i == 0 || included_patches[i - 1] != included_patches[i] + 1)67772 + {67773 + MSG_PUTS(s);67774 + s = ", ";67775 + msg_outnum((long)first);67776 + if (first != included_patches[i])67777 + {67778 + MSG_PUTS("-");67779 + msg_outnum((long)included_patches[i]);67780 + }67781 + first = -1;67782 + }67783 + }67784 + }67785 +67786 + /* Print the list of extra patch descriptions if there is at least one. */67787 + if (extra_patches[0] != NULL)67788 + {67789 + MSG_PUTS(_("\nExtra patches: "));67790 + s = "";67791 + for (i = 0; extra_patches[i] != NULL; ++i)67792 + {67793 + MSG_PUTS(s);67794 + s = ", ";67795 + MSG_PUTS(extra_patches[i]);67796 + }67797 + }67798 +67799 +#ifdef MODIFIED_BY67800 + MSG_PUTS("\n");67801 + MSG_PUTS(_("Modified by "));67802 + MSG_PUTS(MODIFIED_BY);67803 +#endif67804 +67805 +#ifdef HAVE_PATHDEF67806 + if (*compiled_user != NUL || *compiled_sys != NUL)67807 + {67808 + MSG_PUTS(_("\nCompiled "));67809 + if (*compiled_user != NUL)67810 + {67811 + MSG_PUTS(_("by "));67812 + MSG_PUTS(compiled_user);67813 + }67814 + if (*compiled_sys != NUL)67815 + {67816 + MSG_PUTS("@");67817 + MSG_PUTS(compiled_sys);67818 + }67819 + }67820 +#endif67821 +67822 +#ifdef FEAT_HUGE67823 + MSG_PUTS(_("\nHuge version "));67824 +#else67825 +# ifdef FEAT_BIG67826 + MSG_PUTS(_("\nBig version "));67827 +# else67828 +# ifdef FEAT_NORMAL67829 + MSG_PUTS(_("\nNormal version "));67830 +# else67831 +# ifdef FEAT_SMALL67832 + MSG_PUTS(_("\nSmall version "));67833 +# else67834 + MSG_PUTS(_("\nTiny version "));67835 +# endif67836 +# endif67837 +# endif67838 +#endif67839 +#ifndef FEAT_GUI67840 + MSG_PUTS(_("without GUI."));67841 +#else67842 +# ifdef FEAT_GUI_GTK67843 +# ifdef FEAT_GUI_GNOME67844 + MSG_PUTS(_("with GTK2-GNOME GUI."));67845 +# else67846 + MSG_PUTS(_("with GTK2 GUI."));67847 +# endif67848 +# else67849 +# ifdef FEAT_GUI_MOTIF67850 + MSG_PUTS(_("with X11-Motif GUI."));67851 +# else67852 +# ifdef FEAT_GUI_ATHENA67853 +# ifdef FEAT_GUI_NEXTAW67854 + MSG_PUTS(_("with X11-neXtaw GUI."));67855 +# else67856 + MSG_PUTS(_("with X11-Athena GUI."));67857 +# endif67858 +# else67859 +# ifdef FEAT_GUI_PHOTON67860 + MSG_PUTS(_("with Photon GUI."));67861 +# else67862 +# if defined(MSWIN)67863 + MSG_PUTS(_("with GUI."));67864 +# else67865 +# if defined(TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON67866 + MSG_PUTS(_("with Carbon GUI."));67867 +# else67868 +# if defined(TARGET_API_MAC_OSX) && TARGET_API_MAC_OSX67869 + MSG_PUTS(_("with Cocoa GUI."));67870 +# else67871 +# if defined(MACOS)67872 + MSG_PUTS(_("with (classic) GUI."));67873 +# endif67874 +# endif67875 +# endif67876 +# endif67877 +# endif67878 +# endif67879 +# endif67880 +# endif67881 +#endif67882 + version_msg(_(" Features included (+) or not (-):\n"));67883 +67884 + /* print all the features */67885 + for (i = 0; features[i] != NULL; ++i)67886 + {67887 + version_msg(features[i]);67888 + if (msg_col > 0)67889 + version_msg(" ");67890 + }67891 +67892 + version_msg("\n");67893 +#ifdef SYS_VIMRC_FILE67894 + version_msg(_(" system vimrc file: \""));67895 + version_msg(SYS_VIMRC_FILE);67896 + version_msg("\"\n");67897 +#endif67898 +#ifdef USR_VIMRC_FILE67899 + version_msg(_(" user vimrc file: \""));67900 + version_msg(USR_VIMRC_FILE);67901 + version_msg("\"\n");67902 +#endif67903 +#ifdef USR_VIMRC_FILE267904 + version_msg(_(" 2nd user vimrc file: \""));67905 + version_msg(USR_VIMRC_FILE2);67906 + version_msg("\"\n");67907 +#endif67908 +#ifdef USR_VIMRC_FILE367909 + version_msg(_(" 3rd user vimrc file: \""));67910 + version_msg(USR_VIMRC_FILE3);67911 + version_msg("\"\n");67912 +#endif67913 +#ifdef USR_EXRC_FILE67914 + version_msg(_(" user exrc file: \""));67915 + version_msg(USR_EXRC_FILE);67916 + version_msg("\"\n");67917 +#endif67918 +#ifdef USR_EXRC_FILE267919 + version_msg(_(" 2nd user exrc file: \""));67920 + version_msg(USR_EXRC_FILE2);67921 + version_msg("\"\n");67922 +#endif67923 +#ifdef FEAT_GUI67924 +# ifdef SYS_GVIMRC_FILE67925 + version_msg(_(" system gvimrc file: \""));67926 + version_msg(SYS_GVIMRC_FILE);67927 + version_msg("\"\n");67928 +# endif67929 + version_msg(_(" user gvimrc file: \""));67930 + version_msg(USR_GVIMRC_FILE);67931 + version_msg("\"\n");67932 +# ifdef USR_GVIMRC_FILE267933 + version_msg(_("2nd user gvimrc file: \""));67934 + version_msg(USR_GVIMRC_FILE2);67935 + version_msg("\"\n");67936 +# endif67937 +# ifdef USR_GVIMRC_FILE367938 + version_msg(_("3rd user gvimrc file: \""));67939 + version_msg(USR_GVIMRC_FILE3);67940 + version_msg("\"\n");67941 +# endif67942 +#endif67943 +#ifdef FEAT_GUI67944 +# ifdef SYS_MENU_FILE67945 + version_msg(_(" system menu file: \""));67946 + version_msg(SYS_MENU_FILE);67947 + version_msg("\"\n");67948 +# endif67949 +#endif67950 +#ifdef HAVE_PATHDEF67951 + if (*default_vim_dir != NUL)67952 + {67953 + version_msg(_(" fall-back for $VIM: \""));67954 + version_msg((char *)default_vim_dir);67955 + version_msg("\"\n");67956 + }67957 + if (*default_vimruntime_dir != NUL)67958 + {67959 + version_msg(_(" f-b for $VIMRUNTIME: \""));67960 + version_msg((char *)default_vimruntime_dir);67961 + version_msg("\"\n");67962 + }67963 + version_msg(_("Compilation: "));67964 + version_msg((char *)all_cflags);67965 + version_msg("\n");67966 +#ifdef VMS67967 + if (*compiler_version != NUL)67968 + {67969 + version_msg(_("Compiler: "));67970 + version_msg((char *)compiler_version);67971 + version_msg("\n");67972 + }67973 +#endif67974 + version_msg(_("Linking: "));67975 + version_msg((char *)all_lflags);67976 +#endif67977 +#ifdef DEBUG67978 + version_msg("\n");67979 + version_msg(_(" DEBUG BUILD"));67980 +#endif67981 +}67982 +67983 +/*67984 + * Output a string for the version message. If it's going to wrap, output a67985 + * newline, unless the message is too long to fit on the screen anyway.67986 + */67987 + static void67988 +version_msg(s)67989 + char *s;67990 +{67991 + int len = (int)STRLEN(s);67992 +67993 + if (!got_int && len < (int)Columns && msg_col + len >= (int)Columns67994 + && *s != '\n')67995 + msg_putchar('\n');67996 + if (!got_int)67997 + MSG_PUTS(s);67998 +}67999 +68000 +static void do_intro_line __ARGS((int row, char_u *mesg, int add_version, int attr));68001 +68002 +/*68003 + * Give an introductory message about Vim.68004 + * Only used when starting Vim on an empty file, without a file name.68005 + * Or with the ":intro" command (for Sven :-).68006 + */68007 + void68008 +intro_message(colon)68009 + int colon; /* TRUE for ":intro" */68010 +{68011 + int i;68012 + int row;68013 + int blanklines;68014 + int sponsor;68015 + char *p;68016 + static char *(lines[]) =68017 + {68018 + N_("VIM - Vi IMproved"),68019 + "",68020 + N_("version "),68021 + N_("by Bram Moolenaar et al."),68022 +#ifdef MODIFIED_BY68023 + " ",68024 +#endif68025 + N_("Vim is open source and freely distributable"),68026 + "",68027 + N_("Help poor children in Uganda!"),68028 + N_("type :help iccf<Enter> for information "),68029 + "",68030 + N_("type :q<Enter> to exit "),68031 + N_("type :help<Enter> or <F1> for on-line help"),68032 + N_("type :help version7<Enter> for version info"),68033 + NULL,68034 + "",68035 + N_("Running in Vi compatible mode"),68036 + N_("type :set nocp<Enter> for Vim defaults"),68037 + N_("type :help cp-default<Enter> for info on this"),68038 + };68039 +#ifdef FEAT_GUI68040 + static char *(gui_lines[]) =68041 + {68042 + NULL,68043 + NULL,68044 + NULL,68045 + NULL,68046 +#ifdef MODIFIED_BY68047 + NULL,68048 +#endif68049 + NULL,68050 + NULL,68051 + NULL,68052 + N_("menu Help->Orphans for information "),68053 + NULL,68054 + N_("Running modeless, typed text is inserted"),68055 + N_("menu Edit->Global Settings->Toggle Insert Mode "),68056 + N_(" for two modes "),68057 + NULL,68058 + NULL,68059 + NULL,68060 + N_("menu Edit->Global Settings->Toggle Vi Compatible"),68061 + N_(" for Vim defaults "),68062 + };68063 +#endif68064 +68065 + /* blanklines = screen height - # message lines */68066 + blanklines = (int)Rows - ((sizeof(lines) / sizeof(char *)) - 1);68067 + if (!p_cp)68068 + blanklines += 4; /* add 4 for not showing "Vi compatible" message */68069 +#if defined(WIN3264) && !defined(FEAT_GUI_W32)68070 + if (mch_windows95())68071 + blanklines -= 3; /* subtract 3 for showing "Windows 95" message */68072 +#endif68073 +68074 +#ifdef FEAT_WINDOWS68075 + /* Don't overwrite a statusline. Depends on 'cmdheight'. */68076 + if (p_ls > 1)68077 + blanklines -= Rows - topframe->fr_height;68078 +#endif68079 + if (blanklines < 0)68080 + blanklines = 0;68081 +68082 + /* Show the sponsor and register message one out of four times, the Uganda68083 + * message two out of four times. */68084 + sponsor = (int)time(NULL);68085 + sponsor = ((sponsor & 2) == 0) - ((sponsor & 4) == 0);68086 +68087 + /* start displaying the message lines after half of the blank lines */68088 + row = blanklines / 2;68089 + if ((row >= 2 && Columns >= 50) || colon)68090 + {68091 + for (i = 0; i < (int)(sizeof(lines) / sizeof(char *)); ++i)68092 + {68093 + p = lines[i];68094 +#ifdef FEAT_GUI68095 + if (p_im && gui.in_use && gui_lines[i] != NULL)68096 + p = gui_lines[i];68097 +#endif68098 + if (p == NULL)68099 + {68100 + if (!p_cp)68101 + break;68102 + continue;68103 + }68104 + if (sponsor != 0)68105 + {68106 + if (strstr(p, "children") != NULL)68107 + p = sponsor < 068108 + ? N_("Sponsor Vim development!")68109 + : N_("Become a registered Vim user!");68110 + else if (strstr(p, "iccf") != NULL)68111 + p = sponsor < 068112 + ? N_("type :help sponsor<Enter> for information ")68113 + : N_("type :help register<Enter> for information ");68114 + else if (strstr(p, "Orphans") != NULL)68115 + p = N_("menu Help->Sponsor/Register for information ");68116 + }68117 + if (*p != NUL)68118 + do_intro_line(row, (char_u *)_(p), i == 2, 0);68119 + ++row;68120 + }68121 +#if defined(WIN3264) && !defined(FEAT_GUI_W32)68122 + if (mch_windows95())68123 + {68124 + do_intro_line(++row,68125 + (char_u *)_("WARNING: Windows 95/98/ME detected"),68126 + FALSE, hl_attr(HLF_E));68127 + do_intro_line(++row,68128 + (char_u *)_("type :help windows95<Enter> for info on this"),68129 + FALSE, 0);68130 + }68131 +#endif68132 + }68133 +68134 + /* Make the wait-return message appear just below the text. */68135 + if (colon)68136 + msg_row = row;68137 +}68138 +68139 + static void68140 +do_intro_line(row, mesg, add_version, attr)68141 + int row;68142 + char_u *mesg;68143 + int add_version;68144 + int attr;68145 +{68146 + char_u vers[20];68147 + int col;68148 + char_u *p;68149 + int l;68150 + int clen;68151 +#ifdef MODIFIED_BY68152 +# define MODBY_LEN 15068153 + char_u modby[MODBY_LEN];68154 +68155 + if (*mesg == ' ')68156 + {68157 + vim_strncpy(modby, (char_u *)_("Modified by "), MODBY_LEN - 1);68158 + l = STRLEN(modby);68159 + vim_strncpy(modby + l, (char_u *)MODIFIED_BY, MODBY_LEN - l - 1);68160 + mesg = modby;68161 + }68162 +#endif68163 +68164 + /* Center the message horizontally. */68165 + col = vim_strsize(mesg);68166 + if (add_version)68167 + {68168 + STRCPY(vers, mediumVersion);68169 + if (highest_patch())68170 + {68171 + /* Check for 9.9x or 9.9xx, alpha/beta version */68172 + if (isalpha((int)vers[3]))68173 + {68174 + if (isalpha((int)vers[4]))68175 + sprintf((char *)vers + 5, ".%d%s", highest_patch(),68176 + mediumVersion + 5);68177 + else68178 + sprintf((char *)vers + 4, ".%d%s", highest_patch(),68179 + mediumVersion + 4);68180 + }68181 + else68182 + sprintf((char *)vers + 3, ".%d", highest_patch());68183 + }68184 + col += (int)STRLEN(vers);68185 + }68186 + col = (Columns - col) / 2;68187 + if (col < 0)68188 + col = 0;68189 +68190 + /* Split up in parts to highlight <> items differently. */68191 + for (p = mesg; *p != NUL; p += l)68192 + {68193 + clen = 0;68194 + for (l = 0; p[l] != NUL68195 + && (l == 0 || (p[l] != '<' && p[l - 1] != '>')); ++l)68196 + {68197 +#ifdef FEAT_MBYTE68198 + if (has_mbyte)68199 + {68200 + clen += ptr2cells(p + l);68201 + l += (*mb_ptr2len)(p + l) - 1;68202 + }68203 + else68204 +#endif68205 + clen += byte2cells(p[l]);68206 + }68207 + screen_puts_len(p, l, row, col, *p == '<' ? hl_attr(HLF_8) : attr);68208 + col += clen;68209 + }68210 +68211 + /* Add the version number to the version line. */68212 + if (add_version)68213 + screen_puts(vers, row, col, 0);68214 +}68215 +68216 +/*68217 + * ":intro": clear screen, display intro screen and wait for return.68218 + */68219 + void68220 +ex_intro(eap)68221 + exarg_T *eap UNUSED;68222 +{68223 + screenclear();68224 + intro_message(TRUE);68225 + wait_return(TRUE);68226 +}68227 73503 diff -Naur vim73.orig/src/vim.h vim73/src/vim.h 68228 --- vim73.orig/src/vim.h 201 2-06-03 23:09:52.940007057+000068229 +++ vim73/src/vim.h 2012-0 6-03 23:09:55.952087212+000073504 --- vim73.orig/src/vim.h 2010-07-29 18:46:39.000000000 +0000 73505 +++ vim73/src/vim.h 2012-07-20 20:31:18.167645059 +0000 68230 73506 @@ -27,6 +27,11 @@ 68231 73507 # endif … … 68327 73603 * is used when executing commands and EW_SILENT for interactive expanding. */ 68328 73604 68329 @@ -1269,6 +1280,7 @@ 73605 @@ -1061,12 +1072,14 @@ 73606 #define INSCHAR_DO_COM 2 /* format comments */ 73607 #define INSCHAR_CTRLV 4 /* char typed just after CTRL-V */ 73608 #define INSCHAR_NO_FEX 8 /* don't use 'formatexpr' */ 73609 +#define INSCHAR_COM_LIST 16 /* format comments with list/2nd line indent */ 73610 73611 /* flags for open_line() */ 73612 #define OPENLINE_DELSPACES 1 /* delete spaces after cursor */ 73613 #define OPENLINE_DO_COM 2 /* format comments */ 73614 #define OPENLINE_KEEPTRAIL 4 /* keep trailing spaces */ 73615 #define OPENLINE_MARKFIX 8 /* fix mark positions */ 73616 +#define OPENLINE_COM_LIST 16 /* format comments with list/2nd line indent */ 73617 73618 /* 73619 * There are four history tables: 73620 @@ -1228,6 +1241,7 @@ 73621 EVENT_CMDWINENTER, /* after entering the cmdline window */ 73622 EVENT_CMDWINLEAVE, /* before leaving the cmdline window */ 73623 EVENT_COLORSCHEME, /* after loading a colorscheme */ 73624 + EVENT_COMPLETEDONE, /* after finishing insert complete */ 73625 EVENT_FILEAPPENDPOST, /* after appending to a file */ 73626 EVENT_FILEAPPENDPRE, /* before appending to a file */ 73627 EVENT_FILEAPPENDCMD, /* append to a file using command */ 73628 @@ -1253,8 +1267,9 @@ 73629 EVENT_INSERTENTER, /* when entering Insert mode */ 73630 EVENT_INSERTLEAVE, /* when leaving Insert mode */ 73631 EVENT_MENUPOPUP, /* just before popup menu is displayed */ 73632 - EVENT_QUICKFIXCMDPOST, /* after :make, :grep etc */ 73633 - EVENT_QUICKFIXCMDPRE, /* before :make, :grep etc */ 73634 + EVENT_QUICKFIXCMDPOST, /* after :make, :grep etc. */ 73635 + EVENT_QUICKFIXCMDPRE, /* before :make, :grep etc. */ 73636 + EVENT_QUITPRE, /* before :quit */ 73637 EVENT_SESSIONLOADPOST, /* after loading a session file */ 73638 EVENT_STDINREADPOST, /* after reading from stdin */ 73639 EVENT_STDINREADPRE, /* before reading from stdin */ 73640 @@ -1269,6 +1284,7 @@ 68330 73641 EVENT_WINENTER, /* after entering a window */ 68331 73642 EVENT_WINLEAVE, /* before leaving a window */ … … 68335 73646 EVENT_CURSORHOLDI, /* idem, in Insert mode */ 68336 73647 EVENT_FUNCUNDEFINED, /* if calling a function which doesn't exist */ 68337 @@ -1307,6 +13 19,7 @@73648 @@ -1307,6 +1323,7 @@ 68338 73649 , HLF_M /* "--More--" message */ 68339 73650 , HLF_CM /* Mode (e.g., "-- INSERT --") */ … … 68343 73654 , HLF_S /* status lines */ 68344 73655 , HLF_SNC /* status lines of not-current windows */ 68345 @@ -1344,7 +13 57,7 @@73656 @@ -1344,7 +1361,7 @@ 68346 73657 /* The HL_FLAGS must be in the same order as the HLF_ enums! 68347 73658 * When changing this also adjust the default for 'highlight'. */ … … 68352 73663 'B', 'P', 'R', 'L', \ 68353 73664 '+', '=', 'x', 'X', '*', '#', '_', '!', '.', 'o'} 68354 @@ -1423,6 +14 36,8 @@73665 @@ -1423,6 +1440,8 @@ 68355 73666 68356 73667 #define IOSIZE (1024+1) /* file i/o and sprintf buffer size */ … … 68361 73672 # define MSG_BUF_LEN 480 /* length of buffer for small messages */ 68362 73673 # define MSG_BUF_CLEN (MSG_BUF_LEN / 6) /* cell length (worst case: utf-8 68363 @@ -1640,6 +165 5,11 @@73674 @@ -1640,6 +1659,11 @@ 68364 73675 # define USE_INPUT_BUF 68365 73676 #endif … … 68373 73684 /* On MS-Windows the third argument isn't size_t. This matters for Win64, 68374 73685 * where sizeof(size_t)==8, not 4 */ 68375 @@ -1683,6 +170 3,8 @@73686 @@ -1683,6 +1707,8 @@ 68376 73687 * character of up to 6 bytes, or one 16-bit character of up to three bytes 68377 73688 * plus six following composing characters of three bytes each. */ … … 68382 73693 68383 73694 #if (defined(FEAT_PROFILE) || defined(FEAT_RELTIME)) && !defined(PROTO) 68384 @@ -1842,7 +186 4,8 @@73695 @@ -1842,7 +1868,8 @@ 68385 73696 #define VV_OP 52 68386 73697 #define VV_SEARCHFORWARD 53 … … 68392 73703 #ifdef FEAT_CLIPBOARD 68393 73704 68394 @@ -1996,6 +20 19,7 @@73705 @@ -1996,6 +2023,7 @@ 68395 73706 #pragma warning(disable : 4312) 68396 73707 #endif … … 68400 73711 # define vim_realloc(ptr, size) mem_realloc((ptr), (size)) 68401 73712 #else 68402 @@ -2193,4 +2217,14 @@ 73713 @@ -2098,6 +2126,12 @@ 73714 # endif 73715 #endif 73716 73717 +#if defined(FEAT_BROWSE) && defined(GTK_CHECK_VERSION) 73718 +# if GTK_CHECK_VERSION(2,4,0) 73719 +# define USE_FILE_CHOOSER 73720 +# endif 73721 +#endif 73722 + 73723 #ifndef FEAT_NETBEANS_INTG 73724 # undef NBDEBUG 73725 #endif 73726 @@ -2193,4 +2227,14 @@ 68403 73727 #define MSCR_LEFT -1 68404 73728 #define MSCR_RIGHT -2 … … 68416 73740 #endif /* VIM__H */ 68417 73741 diff -Naur vim73.orig/src/window.c vim73/src/window.c 68418 --- vim73.orig/src/window.c 201 2-06-03 23:09:52.940007057+000068419 +++ vim73/src/window.c 2012-0 6-03 23:09:55.896085721+000073742 --- vim73.orig/src/window.c 2010-07-20 20:23:49.000000000 +0000 73743 +++ vim73/src/window.c 2012-07-20 20:31:18.344311852 +0000 68420 73744 @@ -23,7 +23,7 @@ 68421 73745 static void win_totop __ARGS((int size, int flags)); … … 68427 73751 static frame_T *win_altframe __ARGS((win_T *win, tabpage_T *tp)); 68428 73752 static tabpage_T *alt_tabpage __ARGS((void)); 68429 @@ -70,7 +70,8 @@ 73753 @@ -45,7 +45,7 @@ 73754 #if defined(FEAT_WINDOWS) || defined(PROTO) 73755 static tabpage_T *alloc_tabpage __ARGS((void)); 73756 static int leave_tabpage __ARGS((buf_T *new_curbuf)); 73757 -static void enter_tabpage __ARGS((tabpage_T *tp, buf_T *old_curbuf)); 73758 +static void enter_tabpage __ARGS((tabpage_T *tp, buf_T *old_curbuf, int trigger_autocmds)); 73759 static void frame_fix_height __ARGS((win_T *wp)); 73760 static int frame_minheight __ARGS((frame_T *topfrp, win_T *next_curwin)); 73761 static void win_enter_ext __ARGS((win_T *wp, int undo_sync, int no_curwin)); 73762 @@ -54,7 +54,6 @@ 73763 static void frame_insert __ARGS((frame_T *before, frame_T *frp)); 73764 static void frame_remove __ARGS((frame_T *frp)); 73765 #ifdef FEAT_VERTSPLIT 73766 -static void win_new_width __ARGS((win_T *wp, int width)); 73767 static void win_goto_ver __ARGS((int up, long count)); 73768 static void win_goto_hor __ARGS((int left, long count)); 73769 #endif 73770 @@ -70,7 +69,7 @@ 68430 73771 #endif /* FEAT_WINDOWS */ 68431 73772 … … 68433 73774 -static void win_new_height __ARGS((win_T *, int)); 68434 73775 +static void set_fraction __ARGS((win_T *wp)); 68435 +static void win_new_height __ARGS((win_T *wp, int height));68436 73776 68437 73777 #define URL_SLASH 1 /* path_is_url() has found "://" */ 68438 73778 #define URL_BACKSLASH 2 /* path_is_url() has found ":\\" */ 68439 @@ -525,9 +526,7 @@ 73779 @@ -354,11 +353,11 @@ 73780 && valid_tabpage(oldtab)) 73781 { 73782 newtab = curtab; 73783 - goto_tabpage_tp(oldtab); 73784 + goto_tabpage_tp(oldtab, TRUE); 73785 if (curwin == wp) 73786 win_close(curwin, FALSE); 73787 if (valid_tabpage(newtab)) 73788 - goto_tabpage_tp(newtab); 73789 + goto_tabpage_tp(newtab, TRUE); 73790 } 73791 } 73792 break; 73793 @@ -525,9 +524,7 @@ 68440 73794 setpcmark(); 68441 73795 if (win_split(0, 0) == OK) … … 68448 73802 ECMD_HIDE, NULL); 68449 73803 if (nchar == 'F' && lnum >= 0) 68450 @@ -684,19 +68 3,19 @@73804 @@ -684,19 +681,19 @@ 68451 73805 } 68452 73806 … … 68473 73827 int new_size = size; 68474 73828 int i; 68475 @@ -719,7 +71 8,7 @@73829 @@ -719,7 +716,7 @@ 68476 73830 /* add a status line when p_ls == 1 and splitting the first window */ 68477 73831 if (lastwin == firstwin && p_ls == 1 && oldwin->w_status_height == 0) … … 68482 73836 EMSG(_(e_noroom)); 68483 73837 return FAIL; 68484 @@ -752,7 +7 51,7 @@73838 @@ -752,7 +749,7 @@ 68485 73839 } 68486 73840 else … … 68491 73845 EMSG(_(e_noroom)); 68492 73846 return FAIL; 68493 @@ -816,7 +81 5,7 @@73847 @@ -816,7 +813,7 @@ 68494 73848 available = oldwin->w_height; 68495 73849 needed += p_wmh; … … 68500 73854 EMSG(_(e_noroom)); 68501 73855 return FAIL; 68502 @@ -889,20 +88 8,20 @@73856 @@ -889,20 +886,20 @@ 68503 73857 p_sb)))) 68504 73858 { … … 68524 73878 if (wp == NULL) 68525 73879 return FAIL; 68526 @@ -973,10 +97 2,10 @@73880 @@ -973,10 +970,10 @@ 68527 73881 frp->fr_parent = curfrp; 68528 73882 } … … 68537 73891 68538 73892 /* Insert the new frame at the right place in the frame list. */ 68539 @@ -985,10 +98 4,17 @@73893 @@ -985,10 +982,17 @@ 68540 73894 else 68541 73895 frame_append(curfrp, frp); … … 68555 73909 { 68556 73910 win_new_height(oldwin, oldwin->w_height - 1); 68557 @@ -1220,15 +122 6,15 @@73911 @@ -1220,15 +1224,15 @@ 68558 73912 } 68559 73913 newp->w_tagstackidx = oldp->w_tagstackidx; … … 68575 73929 68576 73930 /* 68577 @@ -2077,7 +2083,7 @@ 73931 @@ -2028,7 +2032,11 @@ 73932 73933 for (wp = firstwin; wp != NULL && lastwin != firstwin; ) 73934 { 73935 - if (wp->w_buffer == buf && (!keep_curwin || wp != curwin)) 73936 + if (wp->w_buffer == buf && (!keep_curwin || wp != curwin) 73937 +#ifdef FEAT_AUTOCMD 73938 + && !(wp->w_closing || wp->w_buffer->b_closing) 73939 +#endif 73940 + ) 73941 { 73942 win_close(wp, FALSE); 73943 73944 @@ -2045,7 +2053,11 @@ 73945 nexttp = tp->tp_next; 73946 if (tp != curtab) 73947 for (wp = tp->tp_firstwin; wp != NULL; wp = wp->w_next) 73948 - if (wp->w_buffer == buf) 73949 + if (wp->w_buffer == buf 73950 +#ifdef FEAT_AUTOCMD 73951 + && !(wp->w_closing || wp->w_buffer->b_closing) 73952 +#endif 73953 + ) 73954 { 73955 win_close_othertab(wp, FALSE, tp); 73956 73957 @@ -2077,7 +2089,7 @@ 68578 73958 * Return TRUE if there is only one window other than "aucmd_win" in the 68579 73959 * current tab page. … … 68584 73964 { 68585 73965 #ifdef FEAT_AUTOCMD 68586 @@ -2100,10 +21 06,46@@73966 @@ -2100,10 +2112,54 @@ 68587 73967 } 68588 73968 … … 68604 73984 + * curwin and curtab are invalid while we are freeing memory, they may 68605 73985 + * be used in GUI events. 73986 + * Don't trigger autocommands yet, they may use wrong values, so do 73987 + * that below. 68606 73988 + */ 68607 + goto_tabpage_tp(alt_tabpage() );73989 + goto_tabpage_tp(alt_tabpage(), FALSE); 68608 73990 + redraw_tabline = TRUE; 68609 73991 + … … 68618 74000 + shell_new_rows(); 68619 74001 + } 74002 + /* Since goto_tabpage_tp above did not trigger *Enter autocommands, do 74003 + * that now. */ 74004 +#ifdef FEAT_AUTOCMD 74005 + apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf); 74006 + apply_autocmds(EVENT_WINENTER, NULL, NULL, FALSE, curbuf); 74007 +#endif 68620 74008 + return TRUE; 68621 74009 + } … … 68632 74020 void 68633 74021 win_close(win, free_buf) 68634 @@ -2138,33 +2180,15 @@ 74022 @@ -2126,6 +2182,8 @@ 74023 } 74024 74025 #ifdef FEAT_AUTOCMD 74026 + if (win->w_closing || (win->w_buffer != NULL && win->w_buffer->b_closing)) 74027 + return; /* window is already being closed */ 74028 if (win == aucmd_win) 74029 { 74030 EMSG(_("E813: Cannot close autocmd window")); 74031 @@ -2138,33 +2196,15 @@ 68635 74032 } 68636 74033 #endif … … 68672 74069 else 68673 74070 clear_snapshot(curtab, SNAP_HELP_IDX); 68674 @@ -2206,17 +2230,26 @@ 74071 @@ -2179,17 +2219,26 @@ 74072 wp = frame2win(win_altframe(win, NULL)); 74073 74074 /* 74075 - * Be careful: If autocommands delete the window, return now. 74076 + * Be careful: If autocommands delete the window or cause this window 74077 + * to be the last one left, return now. 74078 */ 74079 if (wp->w_buffer != curbuf) 74080 { 74081 other_buffer = TRUE; 74082 + win->w_closing = TRUE; 74083 apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf); 74084 - if (!win_valid(win) || last_window()) 74085 + if (!win_valid(win)) 74086 + return; 74087 + win->w_closing = FALSE; 74088 + if (last_window()) 74089 return; 74090 } 74091 + win->w_closing = TRUE; 74092 apply_autocmds(EVENT_WINLEAVE, NULL, NULL, FALSE, curbuf); 74093 - if (!win_valid(win) || last_window()) 74094 + if (!win_valid(win)) 74095 + return; 74096 + win->w_closing = FALSE; 74097 + if (last_window()) 74098 return; 74099 # ifdef FEAT_EVAL 74100 /* autocmds may abort script processing */ 74101 @@ -2206,17 +2255,35 @@ 68675 74102 out_flush(); 68676 74103 #endif … … 68687 74114 - close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0); 68688 74115 + if (win->w_buffer != NULL) 68689 + close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, TRUE); 74116 + { 74117 +#ifdef FEAT_AUTOCMD 74118 + win->w_closing = TRUE; 74119 +#endif 74120 + close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, FALSE); 74121 +#ifdef FEAT_AUTOCMD 74122 + if (win_valid(win)) 74123 + win->w_closing = FALSE; 74124 +#endif 74125 + } 68690 74126 68691 74127 /* Autocommands may have closed the window already, or closed the only … … 68702 74138 68703 74139 /* Make sure curwin isn't invalid. It can cause severe trouble when 68704 @@ -2297,7 +23 30,7 @@74140 @@ -2297,7 +2364,7 @@ 68705 74141 68706 74142 /* … … 68711 74147 * Caller must check if buffer is hidden and whether the tabline needs to be 68712 74148 * updated. 68713 @@ -2314,7 +2347,7 @@ 74149 @@ -2313,8 +2380,13 @@ 74150 tabpage_T *ptp = NULL; 68714 74151 int free_tp = FALSE; 68715 74152 74153 +#ifdef FEAT_AUTOCMD 74154 + if (win->w_closing || win->w_buffer->b_closing) 74155 + return; /* window is already being closed */ 74156 +#endif 74157 + 68716 74158 /* Close the link to the buffer. */ 68717 74159 - close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0); … … 68720 74162 /* Careful: Autocommands may have closed the tab page or made it the 68721 74163 * current tab page. */ 68722 @@ -3241,6 +3 274,9 @@74164 @@ -3241,6 +3313,9 @@ 68723 74165 else 68724 74166 wp->w_farsi = W_CONV; … … 68730 74172 68731 74173 /* 68732 @@ -3277,9 +33 13,7 @@74174 @@ -3277,9 +3352,7 @@ 68733 74175 if (aucmd_win != NULL) 68734 74176 { … … 68741 74183 } 68742 74184 } 68743 @@ -3320,10 +33 54,8 @@74185 @@ -3320,10 +3393,8 @@ 68744 74186 /* First window in new tab page, initialize it from "oldwin". */ 68745 74187 win_init(curwin, oldwin, 0); … … 68754 74196 #endif 68755 74197 68756 @@ -3664,13 +3696,6 @@ 74198 @@ -3395,7 +3466,7 @@ 74199 # endif 74200 #ifdef FEAT_EVAL 74201 /* init t: variables */ 74202 - init_var_dict(&tp->tp_vars, &tp->tp_winvar); 74203 + init_var_dict(&tp->tp_vars, &tp->tp_winvar, VAR_SCOPE); 74204 #endif 74205 tp->tp_ch_used = p_ch; 74206 } 74207 @@ -3491,7 +3562,7 @@ 74208 } 74209 74210 /* Failed, get back the previous Tab page */ 74211 - enter_tabpage(curtab, curbuf); 74212 + enter_tabpage(curtab, curbuf, TRUE); 74213 return FAIL; 74214 } 74215 74216 @@ -3644,11 +3715,13 @@ 74217 /* 74218 * Start using tab page "tp". 74219 * Only to be used after leave_tabpage() or freeing the current tab page. 74220 + * Only trigger *Enter autocommands when trigger_autocmds is TRUE. 74221 */ 74222 static void 74223 -enter_tabpage(tp, old_curbuf) 74224 +enter_tabpage(tp, old_curbuf, trigger_autocmds) 74225 tabpage_T *tp; 74226 buf_T *old_curbuf UNUSED; 74227 + int trigger_autocmds UNUSED; 74228 { 74229 int old_off = tp->tp_firstwin->w_winrow; 74230 win_T *next_prevwin = tp->tp_prevwin; 74231 @@ -3664,13 +3737,6 @@ 68757 74232 win_enter_ext(tp->tp_curwin, FALSE, TRUE); 68758 74233 prevwin = next_prevwin; … … 68768 74243 (void)win_comp_pos(); /* recompute w_winrow for all windows */ 68769 74244 must_redraw = CLEAR; /* need to redraw everything */ 68770 @@ -3700,6 +37 25,14@@74245 @@ -3700,6 +3766,17 @@ 68771 74246 gui_may_update_scrollbars(); 68772 74247 #endif … … 68775 74250 + /* Apply autocommands after updating the display, when 'rows' and 68776 74251 + * 'columns' have been set correctly. */ 68777 + apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf); 68778 + if (old_curbuf != curbuf) 68779 + apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf); 74252 + if (trigger_autocmds) 74253 + { 74254 + apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf); 74255 + if (old_curbuf != curbuf) 74256 + apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf); 74257 + } 68780 74258 +#endif 68781 74259 + … … 68783 74261 } 68784 74262 68785 @@ -4271,19 +4304,19 @@ 74263 @@ -3773,7 +3850,7 @@ 74264 } 74265 } 74266 74267 - goto_tabpage_tp(tp); 74268 + goto_tabpage_tp(tp, TRUE); 74269 74270 #ifdef FEAT_GUI_TABLINE 74271 if (gui_use_tabline()) 74272 @@ -3783,11 +3860,13 @@ 74273 74274 /* 74275 * Go to tabpage "tp". 74276 + * Only trigger *Enter autocommands when trigger_autocmds is TRUE. 74277 * Note: doesn't update the GUI tab. 74278 */ 74279 void 74280 -goto_tabpage_tp(tp) 74281 +goto_tabpage_tp(tp, trigger_autocmds) 74282 tabpage_T *tp; 74283 + int trigger_autocmds; 74284 { 74285 /* Don't repeat a message in another tab page. */ 74286 set_keep_msg(NULL, 0); 74287 @@ -3795,9 +3874,9 @@ 74288 if (tp != curtab && leave_tabpage(tp->tp_curwin->w_buffer) == OK) 74289 { 74290 if (valid_tabpage(tp)) 74291 - enter_tabpage(tp, curbuf); 74292 + enter_tabpage(tp, curbuf, trigger_autocmds); 74293 else 74294 - enter_tabpage(curtab, curbuf); 74295 + enter_tabpage(curtab, curbuf, trigger_autocmds); 74296 } 74297 } 74298 74299 @@ -3810,7 +3889,7 @@ 74300 tabpage_T *tp; 74301 win_T *wp; 74302 { 74303 - goto_tabpage_tp(tp); 74304 + goto_tabpage_tp(tp, TRUE); 74305 if (curtab == tp && win_valid(wp)) 74306 { 74307 win_enter(wp, TRUE); 74308 @@ -3848,7 +3927,7 @@ 74309 } 74310 74311 /* Re-insert it at the specified position. */ 74312 - if (n == 0) 74313 + if (n <= 0) 74314 { 74315 curtab->tp_next = first_tabpage; 74316 first_tabpage = curtab; 74317 @@ -4271,19 +4350,19 @@ 68786 74318 win_T *after UNUSED; 68787 74319 int hidden UNUSED; … … 68809 74341 #ifdef FEAT_AUTOCMD 68810 74342 /* Don't execute autocommands while the window is not properly 68811 @@ -4296,53 +43 29,53 @@74343 @@ -4296,53 +4375,53 @@ 68812 74344 */ 68813 74345 #ifdef FEAT_WINDOWS … … 68861 74393 /* init w: variables */ 68862 74394 - init_var_dict(&newwin->w_vars, &newwin->w_winvar); 68863 + init_var_dict(&new_wp->w_vars, &new_wp->w_winvar );74395 + init_var_dict(&new_wp->w_vars, &new_wp->w_winvar, VAR_SCOPE); 68864 74396 #endif 68865 74397 #ifdef FEAT_FOLDING … … 68882 74414 68883 74415 #if defined(FEAT_WINDOWS) || defined(PROTO) 68884 @@ -4435,7 +4 468,6 @@74416 @@ -4435,7 +4514,6 @@ 68885 74417 #endif /* FEAT_GUI */ 68886 74418 … … 68890 74422 #endif 68891 74423 68892 @@ -5459, 6 +5491,19@@74424 @@ -5459,19 +5537,31 @@ 68893 74425 68894 74426 #endif /* FEAT_WINDOWS */ … … 68910 74442 * Set the height of a window. 68911 74443 * This takes care of the things inside the window, not what happens to the 68912 @@ -5471,7 +5516,6 @@ 74444 * window position, the frame or to other windows. 74445 */ 74446 - static void 74447 + void 74448 win_new_height(wp, height) 74449 win_T *wp; 74450 int height; 68913 74451 { 68914 74452 linenr_T lnum; … … 68918 74456 /* Don't want a negative height. Happens when splitting a tiny window. 68919 74457 * Will equalize heights soon to fix it. */ 68920 @@ -5481,8 +55 25,7 @@74458 @@ -5481,8 +5571,7 @@ 68921 74459 return; /* nothing to do */ 68922 74460 … … 68928 74466 wp->w_height = height; 68929 74467 wp->w_skipcol = 0; 74468 @@ -5606,7 +5695,7 @@ 74469 /* 74470 * Set the width of a window. 74471 */ 74472 - static void 74473 + void 74474 win_new_width(wp, width) 74475 win_T *wp; 74476 int width; 68930 74477 diff -Naur vim73.orig/src/workshop.c vim73/src/workshop.c 68931 --- vim73.orig/src/workshop.c 201 2-06-03 23:09:52.924006631+000068932 +++ vim73/src/workshop.c 2012-0 6-03 23:09:53.540023023+000074478 --- vim73.orig/src/workshop.c 2010-08-08 13:18:24.000000000 +0000 74479 +++ vim73/src/workshop.c 2012-07-20 20:31:08.990971798 +0000 68933 74480 @@ -16,7 +16,6 @@ 68934 74481 #include <sys/types.h> … … 68940 74487 # include <libgen.h> 68941 74488 diff -Naur vim73.orig/src/xpm_w32.c vim73/src/xpm_w32.c 68942 --- vim73.orig/src/xpm_w32.c 201 2-06-03 23:09:52.940007057+000068943 +++ vim73/src/xpm_w32.c 2012-0 6-03 23:09:55.348071138+000074489 --- vim73.orig/src/xpm_w32.c 2010-05-15 11:04:07.000000000 +0000 74490 +++ vim73/src/xpm_w32.c 2012-07-20 20:31:14.540975795 +0000 68944 74491 @@ -1,4 +1,5 @@ 68945 74492 -/* … … 68992 74539 diff -Naur vim73.orig/src/xxd/Make_ming.mak vim73/src/xxd/Make_ming.mak 68993 74540 --- vim73.orig/src/xxd/Make_ming.mak 1970-01-01 00:00:00.000000000 +0000 68994 +++ vim73/src/xxd/Make_ming.mak 2012-0 6-03 23:09:54.804056662+000074541 +++ vim73/src/xxd/Make_ming.mak 2012-07-20 20:31:12.870974595 +0000 68995 74542 @@ -0,0 +1,28 @@ 68996 74543 +# The most simplistic Makefile, for MinGW gcc on MS-DOS … … 69023 74570 + -$(DEL) xxd.exe 69024 74571 diff -Naur vim73.orig/src/xxd/xxd.c vim73/src/xxd/xxd.c 69025 --- vim73.orig/src/xxd/xxd.c 201 2-06-03 23:09:52.944007163+000069026 +++ vim73/src/xxd/xxd.c 2012-0 6-03 23:09:53.932033457+000074572 --- vim73.orig/src/xxd/xxd.c 2010-05-15 11:04:06.000000000 +0000 74573 +++ vim73/src/xxd/xxd.c 2012-07-20 20:31:10.244306036 +0000 69027 74574 @@ -49,6 +49,8 @@ 69028 74575 * option -b added: 01000101 binary output in normal format.
Note:
See TracChangeset
for help on using the changeset viewer.