! :copen
! :let a=w:quickfix_title
! :wincmd p
-! gR\12=a\e
+! gR\12=a\r\e
! :cf Xerrorfile1
rA
:cn
+ :wincmd w
+ :let a=w:quickfix_title
+ :wincmd p
-+ gR\12=a\e
++ gR\12=a\r\e
:w! test.out " Write contents of this file
:qa!
ENDTEST
*** 0 ****
--- 1,2 ----
+ !_TAG_FILE_ENCODING cp932 //
-+ Â\82`Â\82aÂ\82b Xtags2.txt /Â\82`Â\82aÂ\82b
++ \82`\82a\82b Xtags2.txt /\82`\82a\82b
*** ../vim-7.3.335/src/testdir/test83-tags3 2011-10-12 19:49:38.000000000 +0200
--- src/testdir/test83-tags3 2011-10-12 19:35:42.000000000 +0200
***************
--- 1,102 ----
+ !_TAG_FILE_SORTED 1 //
+ !_TAG_FILE_ENCODING cp932 //
-+ abc1 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc2 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc3 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc4 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc5 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc6 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc7 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc8 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc9 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc10 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc11 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc12 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc13 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc14 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc15 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc16 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc17 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc18 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc19 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc20 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc21 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc22 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc23 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc24 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc25 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc26 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc27 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc28 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc29 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc30 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc31 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc32 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc33 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc34 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc35 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc36 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc37 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc38 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc39 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc40 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc41 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc42 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc43 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc44 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc45 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc46 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc47 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc48 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc49 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc50 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc51 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc52 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc53 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc54 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc55 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc56 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc57 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc58 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc59 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc60 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc61 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc62 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc63 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc64 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc65 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc66 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc67 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc68 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc69 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc70 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc71 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc72 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc73 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc74 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc75 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc76 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc77 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc78 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc79 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc80 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc81 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc82 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc83 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc84 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc85 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc86 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc87 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc88 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc89 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc90 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc91 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc92 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc93 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc94 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc95 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc96 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc97 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc98 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc99 Xtags3.txt /Â\82`Â\82aÂ\82b
-+ abc100 Xtags3.txt /Â\82`Â\82aÂ\82b
++ abc1 Xtags3.txt /\82`\82a\82b
++ abc2 Xtags3.txt /\82`\82a\82b
++ abc3 Xtags3.txt /\82`\82a\82b
++ abc4 Xtags3.txt /\82`\82a\82b
++ abc5 Xtags3.txt /\82`\82a\82b
++ abc6 Xtags3.txt /\82`\82a\82b
++ abc7 Xtags3.txt /\82`\82a\82b
++ abc8 Xtags3.txt /\82`\82a\82b
++ abc9 Xtags3.txt /\82`\82a\82b
++ abc10 Xtags3.txt /\82`\82a\82b
++ abc11 Xtags3.txt /\82`\82a\82b
++ abc12 Xtags3.txt /\82`\82a\82b
++ abc13 Xtags3.txt /\82`\82a\82b
++ abc14 Xtags3.txt /\82`\82a\82b
++ abc15 Xtags3.txt /\82`\82a\82b
++ abc16 Xtags3.txt /\82`\82a\82b
++ abc17 Xtags3.txt /\82`\82a\82b
++ abc18 Xtags3.txt /\82`\82a\82b
++ abc19 Xtags3.txt /\82`\82a\82b
++ abc20 Xtags3.txt /\82`\82a\82b
++ abc21 Xtags3.txt /\82`\82a\82b
++ abc22 Xtags3.txt /\82`\82a\82b
++ abc23 Xtags3.txt /\82`\82a\82b
++ abc24 Xtags3.txt /\82`\82a\82b
++ abc25 Xtags3.txt /\82`\82a\82b
++ abc26 Xtags3.txt /\82`\82a\82b
++ abc27 Xtags3.txt /\82`\82a\82b
++ abc28 Xtags3.txt /\82`\82a\82b
++ abc29 Xtags3.txt /\82`\82a\82b
++ abc30 Xtags3.txt /\82`\82a\82b
++ abc31 Xtags3.txt /\82`\82a\82b
++ abc32 Xtags3.txt /\82`\82a\82b
++ abc33 Xtags3.txt /\82`\82a\82b
++ abc34 Xtags3.txt /\82`\82a\82b
++ abc35 Xtags3.txt /\82`\82a\82b
++ abc36 Xtags3.txt /\82`\82a\82b
++ abc37 Xtags3.txt /\82`\82a\82b
++ abc38 Xtags3.txt /\82`\82a\82b
++ abc39 Xtags3.txt /\82`\82a\82b
++ abc40 Xtags3.txt /\82`\82a\82b
++ abc41 Xtags3.txt /\82`\82a\82b
++ abc42 Xtags3.txt /\82`\82a\82b
++ abc43 Xtags3.txt /\82`\82a\82b
++ abc44 Xtags3.txt /\82`\82a\82b
++ abc45 Xtags3.txt /\82`\82a\82b
++ abc46 Xtags3.txt /\82`\82a\82b
++ abc47 Xtags3.txt /\82`\82a\82b
++ abc48 Xtags3.txt /\82`\82a\82b
++ abc49 Xtags3.txt /\82`\82a\82b
++ abc50 Xtags3.txt /\82`\82a\82b
++ abc51 Xtags3.txt /\82`\82a\82b
++ abc52 Xtags3.txt /\82`\82a\82b
++ abc53 Xtags3.txt /\82`\82a\82b
++ abc54 Xtags3.txt /\82`\82a\82b
++ abc55 Xtags3.txt /\82`\82a\82b
++ abc56 Xtags3.txt /\82`\82a\82b
++ abc57 Xtags3.txt /\82`\82a\82b
++ abc58 Xtags3.txt /\82`\82a\82b
++ abc59 Xtags3.txt /\82`\82a\82b
++ abc60 Xtags3.txt /\82`\82a\82b
++ abc61 Xtags3.txt /\82`\82a\82b
++ abc62 Xtags3.txt /\82`\82a\82b
++ abc63 Xtags3.txt /\82`\82a\82b
++ abc64 Xtags3.txt /\82`\82a\82b
++ abc65 Xtags3.txt /\82`\82a\82b
++ abc66 Xtags3.txt /\82`\82a\82b
++ abc67 Xtags3.txt /\82`\82a\82b
++ abc68 Xtags3.txt /\82`\82a\82b
++ abc69 Xtags3.txt /\82`\82a\82b
++ abc70 Xtags3.txt /\82`\82a\82b
++ abc71 Xtags3.txt /\82`\82a\82b
++ abc72 Xtags3.txt /\82`\82a\82b
++ abc73 Xtags3.txt /\82`\82a\82b
++ abc74 Xtags3.txt /\82`\82a\82b
++ abc75 Xtags3.txt /\82`\82a\82b
++ abc76 Xtags3.txt /\82`\82a\82b
++ abc77 Xtags3.txt /\82`\82a\82b
++ abc78 Xtags3.txt /\82`\82a\82b
++ abc79 Xtags3.txt /\82`\82a\82b
++ abc80 Xtags3.txt /\82`\82a\82b
++ abc81 Xtags3.txt /\82`\82a\82b
++ abc82 Xtags3.txt /\82`\82a\82b
++ abc83 Xtags3.txt /\82`\82a\82b
++ abc84 Xtags3.txt /\82`\82a\82b
++ abc85 Xtags3.txt /\82`\82a\82b
++ abc86 Xtags3.txt /\82`\82a\82b
++ abc87 Xtags3.txt /\82`\82a\82b
++ abc88 Xtags3.txt /\82`\82a\82b
++ abc89 Xtags3.txt /\82`\82a\82b
++ abc90 Xtags3.txt /\82`\82a\82b
++ abc91 Xtags3.txt /\82`\82a\82b
++ abc92 Xtags3.txt /\82`\82a\82b
++ abc93 Xtags3.txt /\82`\82a\82b
++ abc94 Xtags3.txt /\82`\82a\82b
++ abc95 Xtags3.txt /\82`\82a\82b
++ abc96 Xtags3.txt /\82`\82a\82b
++ abc97 Xtags3.txt /\82`\82a\82b
++ abc98 Xtags3.txt /\82`\82a\82b
++ abc99 Xtags3.txt /\82`\82a\82b
++ abc100 Xtags3.txt /\82`\82a\82b
*** ../vim-7.3.335/src/testdir/test83.in 2011-10-12 19:49:38.000000000 +0200
--- src/testdir/test83.in 2011-10-12 19:40:47.000000000 +0200
***************
+ :new
+ :set tags=test83-tags2
+ :let v:errmsg = ''
-+ :tag /.BC
-+ :if v:errmsg =~ 'E426:' || getline('.') != 'ABC'
++ :tag /.BC
++ :if v:errmsg =~ 'E426:' || getline('.') != 'ABC'
+ : close
+ : put ='case2: failed'
+ :else
+ :set tags=test83-tags3
+ :let v:errmsg = ''
+ :tag abc50
-+ :if v:errmsg =~ 'E426:' || getline('.') != 'ABC'
++ :if v:errmsg =~ 'E426:' || getline('.') != 'ABC'
+ : close
+ : put ='case3: failed'
+ :else
+ abcdefghijklmnopqrs
+
+ text for tags2
-+ ABC
++ ABC
+
+ text for tags3
-+ ABC
++ ABC
+
+ tags1
+ !_TAG_FILE_ENCODING utf-8 //
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.516
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.516
+Problem: extend(o, o) may crash Vim.
+Solution: Fix crash and add test. (Thinca and Hirohito Higashi)
+Files: src/eval.c, src/testdir/test55.in, src/testdir/test55.ok
+
+
+*** ../vim-7.3.515/src/eval.c 2012-04-30 17:35:44.000000000 +0200
+--- src/eval.c 2012-05-18 12:02:44.000000000 +0200
+***************
+*** 10191,10197 ****
+ EMSG2(_("E737: Key already exists: %s"), hi2->hi_key);
+ break;
+ }
+! else if (*action == 'f')
+ {
+ clear_tv(&di1->di_tv);
+ copy_tv(&HI2DI(hi2)->di_tv, &di1->di_tv);
+--- 10191,10197 ----
+ EMSG2(_("E737: Key already exists: %s"), hi2->hi_key);
+ break;
+ }
+! else if (*action == 'f' && HI2DI(hi2) != di1)
+ {
+ clear_tv(&di1->di_tv);
+ copy_tv(&HI2DI(hi2)->di_tv, &di1->di_tv);
+*** ../vim-7.3.515/src/testdir/test55.in 2010-11-10 20:31:24.000000000 +0100
+--- src/testdir/test55.in 2012-05-18 11:57:23.000000000 +0200
+***************
+*** 352,357 ****
+--- 352,375 ----
+ :let dict4copy = deepcopy(dict4)
+ :$put =(l == lcopy)
+ :$put =(dict4 == dict4copy)
++ :"
++ :" Pass the same List to extend()
++ :let l = [1, 2, 3, 4, 5]
++ :call extend(l, l)
++ :$put =string(l)
++ :"
++ :" Pass the same Dict to extend()
++ :let d = { 'a': {'b': 'B'}}
++ :call extend(d, d)
++ :$put =string(d)
++ :"
++ :" Pass the same Dict to extend() with "error"
++ :try
++ : call extend(d, d, "error")
++ :catch
++ : $put =v:exception[:15] . v:exception[-1:-1]
++ :endtry
++ :$put =string(d)
+ :endfun
+ :"
+ :call Test(1, 2, [3, 4], {5: 6}) " This may take a while
+*** ../vim-7.3.515/src/testdir/test55.ok 2010-11-10 20:31:24.000000000 +0100
+--- src/testdir/test55.ok 2012-05-18 11:57:01.000000000 +0200
+***************
+*** 111,113 ****
+--- 111,117 ----
+ 0
+ 1
+ 1
++ [1, 2, 3, 4, 5, 1, 2, 3, 4, 5]
++ {'a': {'b': 'B'}}
++ Vim(call):E737: a
++ {'a': {'b': 'B'}}
+*** ../vim-7.3.515/src/version.c 2012-04-30 21:09:38.000000000 +0200
+--- src/version.c 2012-05-18 12:04:54.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 516,
+ /**/
+
+--
+I used to wonder about the meaning of life. But I looked it
+up in the dictionary under "L" and there it was - the meaning
+of life. It was less than I expected. - Dogbert
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.517
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.517
+Problem: Crash when using "vipvv". (Alexandre Provencio)
+Solution: Don't let the text length become negative.
+Files: src/ops.c
+
+
+*** ../vim-7.3.516/src/ops.c 2012-04-20 13:46:02.000000000 +0200
+--- src/ops.c 2012-05-18 12:28:09.000000000 +0200
+***************
+*** 3042,3047 ****
+--- 3042,3049 ----
+ }
+ #endif
+ }
++ if (endcol == MAXCOL)
++ endcol = (colnr_T)STRLEN(p);
+ if (startcol > endcol
+ #ifdef FEAT_VIRTUALEDIT
+ || is_oneChar
+***************
+*** 3050,3057 ****
+ bd.textlen = 0;
+ else
+ {
+- if (endcol == MAXCOL)
+- endcol = (colnr_T)STRLEN(p);
+ bd.textlen = endcol - startcol + oap->inclusive;
+ }
+ bd.textstart = p + startcol;
+--- 3052,3057 ----
+*** ../vim-7.3.516/src/version.c 2012-05-18 12:06:58.000000000 +0200
+--- src/version.c 2012-05-18 12:48:51.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 517,
+ /**/
+
+--
+BODY: I'm not dead!
+CART DRIVER: 'Ere. He says he's not dead.
+LARGE MAN: Yes he is.
+BODY: I'm not!
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.518
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.518
+Problem: When 'encoding' is a double-byte encoding ":helptags" may not find
+ tags correctly.
+Solution: Use vim_strbyte() instead of vim_strchr(). (Yasuhiro Matsumoto)
+Files: src/ex_cmds.c
+
+
+*** ../vim-7.3.517/src/ex_cmds.c 2012-04-25 17:32:14.000000000 +0200
+--- src/ex_cmds.c 2012-05-18 16:20:20.000000000 +0200
+***************
+*** 6535,6541 ****
+ p1 = vim_strchr(IObuff, '*'); /* find first '*' */
+ while (p1 != NULL)
+ {
+! p2 = vim_strchr(p1 + 1, '*'); /* find second '*' */
+ if (p2 != NULL && p2 > p1 + 1) /* skip "*" and "**" */
+ {
+ for (s = p1 + 1; s < p2; ++s)
+--- 6535,6544 ----
+ p1 = vim_strchr(IObuff, '*'); /* find first '*' */
+ while (p1 != NULL)
+ {
+! /* Use vim_strbyte() instead of vim_strchr() so that when
+! * 'encoding' is dbcs it still works, don't find '*' in the
+! * second byte. */
+! p2 = vim_strbyte(p1 + 1, '*'); /* find second '*' */
+ if (p2 != NULL && p2 > p1 + 1) /* skip "*" and "**" */
+ {
+ for (s = p1 + 1; s < p2; ++s)
+*** ../vim-7.3.517/src/version.c 2012-05-18 12:49:33.000000000 +0200
+--- src/version.c 2012-05-18 16:23:50.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 518,
+ /**/
+
+--
+If all you have is a hammer, everything looks like a nail.
+When your hammer is C++, everything begins to look like a thumb.
+ -- Steve Hoflich, comp.lang.c++
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.519
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.519
+Problem: When completefunction returns it cannot indicate end of completion
+ mode.
+Solution: Recognize completefunction returning -3. (Mtsushita Shougo)
+Files: src/edit.c
+
+
+*** ../vim-7.3.518/src/edit.c 2012-04-30 18:18:43.000000000 +0200
+--- src/edit.c 2012-05-18 16:35:06.000000000 +0200
+***************
+*** 5205,5213 ****
+ }
+
+ /* Return value -2 means the user complete function wants to
+! * cancel the complete without an error. */
+ if (col == -2)
+ return FAIL;
+
+ /*
+ * Reset extended parameters of completion, when start new
+--- 5205,5221 ----
+ }
+
+ /* Return value -2 means the user complete function wants to
+! * cancel the complete without an error.
+! * Return value -3 does the same as -2 and leaves CTRL-X mode.*/
+ if (col == -2)
+ return FAIL;
++ if (col == -3)
++ {
++ ctrl_x_mode = 0;
++ edit_submode = NULL;
++ msg_clr_cmdline();
++ return FAIL;
++ }
+
+ /*
+ * Reset extended parameters of completion, when start new
+*** ../vim-7.3.518/src/version.c 2012-05-18 16:24:06.000000000 +0200
+--- src/version.c 2012-05-18 16:34:27.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 519,
+ /**/
+
+--
+Looking at Perl through Lisp glasses, Perl looks atrocious.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.520
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.520
+Problem: Gvim starts up slow on Unbuntu 12.04.
+Solution: Move the call to gui_mch_init_check() to after fork(). (Yasuhiro
+ Matsumoto) Do check $DISPLAY being set.
+Files: src/gui.c, src/gui_gtk_x11.c, src/proto/gui_gtk_x11.pro
+
+
+*** ../vim-7.3.519/src/gui.c 2011-10-20 21:27:57.000000000 +0200
+--- src/gui.c 2012-05-18 16:53:14.000000000 +0200
+***************
+*** 270,275 ****
+--- 270,281 ----
+ }
+ /* Child */
+
++ #ifdef FEAT_GUI_GTK
++ /* Call gtk_init_check() here after fork(). See gui_init_check(). */
++ if (gui_mch_init_check() != OK)
++ exit(1);
++ #endif
++
+ # if defined(HAVE_SETSID) || defined(HAVE_SETPGID)
+ /*
+ * Change our process group. On some systems/shells a CTRL-C in the
+***************
+*** 430,436 ****
+--- 436,452 ----
+ #ifdef ALWAYS_USE_GUI
+ result = OK;
+ #else
++ # ifdef FEAT_GUI_GTK
++ /*
++ * Note: Don't call gtk_init_check() before fork, it will be called after
++ * the fork. When calling it before fork, it make vim hang for a while.
++ * See gui_do_fork().
++ * Use a simpler check if the GUI window can probably be opened.
++ */
++ result = gui.dofork ? gui_mch_early_init_check() : gui_mch_init_check();
++ # else
+ result = gui_mch_init_check();
++ # endif
+ #endif
+ return result;
+ }
+*** ../vim-7.3.519/src/gui_gtk_x11.c 2011-10-26 11:36:21.000000000 +0200
+--- src/gui_gtk_x11.c 2012-05-18 17:00:45.000000000 +0200
+***************
+*** 1414,1420 ****
+ }
+
+ /*
+! * Check if the GUI can be started. Called before gvimrc is sourced.
+ * Return OK or FAIL.
+ */
+ int
+--- 1414,1442 ----
+ }
+
+ /*
+! * Check if the GUI can be started. Called before gvimrc is sourced and
+! * before fork().
+! * Return OK or FAIL.
+! */
+! int
+! gui_mch_early_init_check(void)
+! {
+! char_u *p;
+!
+! /* Guess that when $DISPLAY isn't set the GUI can't start. */
+! p = mch_getenv((char_u *)"DISPLAY");
+! if (p == NULL || *p == NUL)
+! {
+! gui.dying = TRUE;
+! EMSG(_((char *)e_opendisp));
+! return FAIL;
+! }
+! return OK;
+! }
+!
+! /*
+! * Check if the GUI can be started. Called before gvimrc is sourced but after
+! * fork().
+ * Return OK or FAIL.
+ */
+ int
+***************
+*** 3050,3056 ****
+
+ for (i = 0; i < (int)N_SELECTION_TARGETS; ++i)
+ {
+! /* OpenOffice tries to use TARGET_HTML and fails when it doesn't
+ * return something, instead of trying another target. Therefore only
+ * offer TARGET_HTML when it works. */
+ if (!clip_html && selection_targets[i].info == TARGET_HTML)
+--- 3072,3078 ----
+
+ for (i = 0; i < (int)N_SELECTION_TARGETS; ++i)
+ {
+! /* OpenOffice tries to use TARGET_HTML and fails when we don't
+ * return something, instead of trying another target. Therefore only
+ * offer TARGET_HTML when it works. */
+ if (!clip_html && selection_targets[i].info == TARGET_HTML)
+*** ../vim-7.3.519/src/proto/gui_gtk_x11.pro 2011-08-10 17:44:41.000000000 +0200
+--- src/proto/gui_gtk_x11.pro 2012-05-18 16:54:28.000000000 +0200
+***************
+*** 4,9 ****
+--- 4,10 ----
+ void gui_mch_set_blinking __ARGS((long waittime, long on, long off));
+ void gui_mch_stop_blink __ARGS((void));
+ void gui_mch_start_blink __ARGS((void));
++ int gui_mch_early_init_check __ARGS((void));
+ int gui_mch_init_check __ARGS((void));
+ void gui_mch_show_tabline __ARGS((int showit));
+ int gui_mch_showing_tabline __ARGS((void));
+*** ../vim-7.3.519/src/version.c 2012-05-18 16:35:17.000000000 +0200
+--- src/version.c 2012-05-18 16:45:30.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 520,
+ /**/
+
+--
+Bad programs can be written in any language.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.521
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.521
+Problem: Using "z=" on a multi-byte character may cause a crash.
+Solution: Don't use strlen() on an int pointer.
+Files: src/spell.c
+
+
+*** ../vim-7.3.520/src/spell.c 2012-01-10 22:26:12.000000000 +0100
+--- src/spell.c 2012-05-18 18:01:58.000000000 +0200
+***************
+*** 14494,14506 ****
+ int p0 = -333;
+ int c0;
+ int did_white = FALSE;
+
+ /*
+ * Convert the multi-byte string to a wide-character string.
+ * Remove accents, if wanted. We actually remove all non-word characters.
+ * But keep white space.
+ */
+! n = 0;
+ for (s = inword; *s != NUL; )
+ {
+ t = s;
+--- 14494,14508 ----
+ int p0 = -333;
+ int c0;
+ int did_white = FALSE;
++ int wordlen;
++
+
+ /*
+ * Convert the multi-byte string to a wide-character string.
+ * Remove accents, if wanted. We actually remove all non-word characters.
+ * But keep white space.
+ */
+! wordlen = 0;
+ for (s = inword; *s != NUL; )
+ {
+ t = s;
+***************
+*** 14521,14532 ****
+ continue;
+ }
+ }
+! word[n++] = c;
+ }
+! word[n] = NUL;
+
+ /*
+! * This comes from Aspell phonet.cpp.
+ * Converted from C++ to C. Added support for multi-byte chars.
+ * Changed to keep spaces.
+ */
+--- 14523,14534 ----
+ continue;
+ }
+ }
+! word[wordlen++] = c;
+ }
+! word[wordlen] = NUL;
+
+ /*
+! * This algorithm comes from Aspell phonet.cpp.
+ * Converted from C++ to C. Added support for multi-byte chars.
+ * Changed to keep spaces.
+ */
+***************
+*** 14711,14717 ****
+ }
+ if (k > k0)
+ mch_memmove(word + i + k0, word + i + k,
+! sizeof(int) * (STRLEN(word + i + k) + 1));
+
+ /* new "actual letter" */
+ c = word[i];
+--- 14713,14719 ----
+ }
+ if (k > k0)
+ mch_memmove(word + i + k0, word + i + k,
+! sizeof(int) * (wordlen - (i + k) + 1));
+
+ /* new "actual letter" */
+ c = word[i];
+***************
+*** 14739,14745 ****
+ if (c != NUL)
+ wres[reslen++] = c;
+ mch_memmove(word, word + i + 1,
+! sizeof(int) * (STRLEN(word + i + 1) + 1));
+ i = 0;
+ z0 = 1;
+ }
+--- 14741,14747 ----
+ if (c != NUL)
+ wres[reslen++] = c;
+ mch_memmove(word, word + i + 1,
+! sizeof(int) * (wordlen - (i + 1) + 1));
+ i = 0;
+ z0 = 1;
+ }
+*** ../vim-7.3.520/src/version.c 2012-05-18 17:03:14.000000000 +0200
+--- src/version.c 2012-05-18 18:06:29.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 521,
+ /**/
+
+--
+OLD WOMAN: King of the WHO?
+ARTHUR: The Britons.
+OLD WOMAN: Who are the Britons?
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.522
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.522
+Problem: Crash in vim_realloc() when using MEM_PROFILE.
+Solution: Avoid using a NULL argument. (Dominique Pelle)
+Files: src/eval.c
+
+
+*** ../vim-7.3.521/src/eval.c 2012-05-18 12:06:58.000000000 +0200
+--- src/eval.c 2012-05-18 18:19:25.000000000 +0200
+***************
+*** 14643,14649 ****
+ long growmin = (long)((p - start) * 2 + prevlen);
+ prevsize = grow50pc > growmin ? grow50pc : growmin;
+ }
+! if ((newprev = vim_realloc(prev, prevsize)) == NULL)
+ {
+ do_outofmem_msg((long_u)prevsize);
+ failed = TRUE;
+--- 14643,14651 ----
+ long growmin = (long)((p - start) * 2 + prevlen);
+ prevsize = grow50pc > growmin ? grow50pc : growmin;
+ }
+! newprev = prev == NULL ? alloc(prevsize)
+! : vim_realloc(prev, prevsize);
+! if (newprev == NULL)
+ {
+ do_outofmem_msg((long_u)prevsize);
+ failed = TRUE;
+*** ../vim-7.3.521/src/version.c 2012-05-18 18:07:57.000000000 +0200
+--- src/version.c 2012-05-18 18:33:36.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 522,
+ /**/
+
+--
+ARTHUR: ... and I am your king ....
+OLD WOMAN: Ooooh! I didn't know we had a king. I thought we were an
+ autonomous collective ...
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.523
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.523
+Problem: ":diffupdate" doesn't check for files changed elsewhere.
+Solution: Add the ! flag. (Christian Brabandt)
+Files: runtime/doc/diff.txt, src/diff.c, src/ex_cmds.h
+
+
+*** ../vim-7.3.522/runtime/doc/diff.txt 2010-08-15 21:57:16.000000000 +0200
+--- runtime/doc/diff.txt 2012-05-18 18:41:49.000000000 +0200
+***************
+*** 178,184 ****
+ nodiff" before hiding it.
+
+ *:diffu* *:diffupdate*
+! :diffu[pdate] Update the diff highlighting and folds.
+
+ Vim attempts to keep the differences updated when you make changes to the
+ text. This mostly takes care of inserted and deleted lines. Changes within a
+--- 178,184 ----
+ nodiff" before hiding it.
+
+ *:diffu* *:diffupdate*
+! :diffu[pdate][!] Update the diff highlighting and folds.
+
+ Vim attempts to keep the differences updated when you make changes to the
+ text. This mostly takes care of inserted and deleted lines. Changes within a
+***************
+*** 187,192 ****
+--- 187,195 ----
+
+ :diffupdate
+
++ If the ! is included Vim will check if the file was changed externally and
++ needs to be reloaded. It will prompt for each changed file, like `:checktime`
++ was used.
+
+ Vim will show filler lines for lines that are missing in one window but are
+ present in another. These lines were inserted in another file or deleted in
+*** ../vim-7.3.522/src/diff.c 2010-09-21 16:56:29.000000000 +0200
+--- src/diff.c 2012-05-18 18:45:09.000000000 +0200
+***************
+*** 783,788 ****
+--- 783,797 ----
+ goto theend;
+ }
+
++ /* :diffupdate! */
++ if (eap != NULL && eap->forceit)
++ for (idx_new = idx_orig; idx_new < DB_COUNT; ++idx_new)
++ {
++ buf = curtab->tp_diffbuf[idx_new];
++ if (buf_valid(buf))
++ buf_check_timestamp(buf, FALSE);
++ }
++
+ /* Write the first buffer to a tempfile. */
+ buf = curtab->tp_diffbuf[idx_orig];
+ if (diff_write(buf, tmp_orig) == FAIL)
+*** ../vim-7.3.522/src/ex_cmds.h 2012-02-13 00:01:38.000000000 +0100
+--- src/ex_cmds.h 2012-05-18 18:37:56.000000000 +0200
+***************
+*** 304,310 ****
+ EX(CMD_display, "display", ex_display,
+ EXTRA|NOTRLCOM|TRLBAR|SBOXOK|CMDWIN),
+ EX(CMD_diffupdate, "diffupdate", ex_diffupdate,
+! TRLBAR),
+ EX(CMD_diffget, "diffget", ex_diffgetput,
+ RANGE|EXTRA|TRLBAR|MODIFY),
+ EX(CMD_diffoff, "diffoff", ex_diffoff,
+--- 304,310 ----
+ EX(CMD_display, "display", ex_display,
+ EXTRA|NOTRLCOM|TRLBAR|SBOXOK|CMDWIN),
+ EX(CMD_diffupdate, "diffupdate", ex_diffupdate,
+! BANG|TRLBAR),
+ EX(CMD_diffget, "diffget", ex_diffgetput,
+ RANGE|EXTRA|TRLBAR|MODIFY),
+ EX(CMD_diffoff, "diffoff", ex_diffoff,
+*** ../vim-7.3.522/src/version.c 2012-05-18 18:34:15.000000000 +0200
+--- src/version.c 2012-05-18 18:39:13.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 523
+ /**/
+
+--
+"The future's already arrived - it's just not evenly distributed yet."
+ -- William Gibson
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.524
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.524 (after 7.3.523)
+Problem: Missing comma.
+Solution: Add the comma.
+Files: src/version.c
+
+
+*** ../vim-7.3.523/src/version.c 2012-05-18 18:47:11.000000000 +0200
+--- src/version.c 2012-05-18 21:52:26.000000000 +0200
+***************
+*** 715,721 ****
+ static int included_patches[] =
+ { /* Add new patch number below this line */
+ /**/
+! 523
+ /**/
+ 522,
+ /**/
+--- 715,723 ----
+ static int included_patches[] =
+ { /* Add new patch number below this line */
+ /**/
+! 524,
+! /**/
+! 523,
+ /**/
+ 522,
+ /**/
+
+--
+DENNIS: You can't expect to wield supreme executive power just 'cause some
+ watery tart threw a sword at you!
+ "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.525
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.525
+Problem: Compiler warning on 64 bit MS-Windows.
+Solution: Add type cast. (Mike Williams)
+Files: src/ex_getln.c
+
+
+*** ../vim-7.3.524/src/ex_getln.c 2012-04-30 18:48:38.000000000 +0200
+--- src/ex_getln.c 2012-05-23 20:33:16.000000000 +0200
+***************
+*** 5263,5269 ****
+ {
+ static char_u compl[2] = { NUL, NUL };
+ char *short_names = ":=@>?/";
+! int short_names_count = STRLEN(short_names);
+ int history_name_count = sizeof(history_names) / sizeof(char *) - 1;
+
+ if (idx < short_names_count)
+--- 5263,5269 ----
+ {
+ static char_u compl[2] = { NUL, NUL };
+ char *short_names = ":=@>?/";
+! int short_names_count = (int)STRLEN(short_names);
+ int history_name_count = sizeof(history_names) / sizeof(char *) - 1;
+
+ if (idx < short_names_count)
+*** ../vim-7.3.524/src/version.c 2012-05-18 21:53:29.000000000 +0200
+--- src/version.c 2012-05-25 11:01:51.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 525,
+ /**/
+
+--
+For humans, honesty is a matter of degree. Engineers are always honest in
+matters of technology and human relationships. That's why it's a good idea
+to keep engineers away from customers, romantic interests, and other people
+who can't handle the truth.
+ (Scott Adams - The Dilbert principle)
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.526
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.526
+Problem: Confusing indenting for #ifdef.
+Solution: Remove and add indent. (Elias Diem)
+Files: src/normal.c
+
+
+*** ../vim-7.3.525/src/normal.c 2012-04-30 18:18:43.000000000 +0200
+--- src/normal.c 2012-05-23 20:35:13.000000000 +0200
+***************
+*** 29,37 ****
+ static void set_vcount_ca __ARGS((cmdarg_T *cap, int *set_prevcount));
+ #endif
+ static int
+! # ifdef __BORLANDC__
+! _RTLENTRYF
+! # endif
+ nv_compare __ARGS((const void *s1, const void *s2));
+ static int find_command __ARGS((int cmdchar));
+ static void op_colon __ARGS((oparg_T *oap));
+--- 29,37 ----
+ static void set_vcount_ca __ARGS((cmdarg_T *cap, int *set_prevcount));
+ #endif
+ static int
+! #ifdef __BORLANDC__
+! _RTLENTRYF
+! #endif
+ nv_compare __ARGS((const void *s1, const void *s2));
+ static int find_command __ARGS((int cmdchar));
+ static void op_colon __ARGS((oparg_T *oap));
+*** ../vim-7.3.525/src/version.c 2012-05-25 11:02:34.000000000 +0200
+--- src/version.c 2012-05-25 11:03:37.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 526,
+ /**/
+
+--
+While it's true that many normal people whould prefer not to _date_ an
+engineer, most normal people harbor an intense desire to _mate_ with them,
+thus producing engineerlike children who will have high-paying jobs long
+before losing their virginity.
+ (Scott Adams - The Dilbert principle)
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.527
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=latin1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.527
+Problem: Clang complains about non-ASCII characters in a string.
+Solution: Change to \x88 form. (Dominique Pelle)
+Files: src/charset.c
+
+
+*** ../vim-7.3.526/src/charset.c 2012-01-26 13:40:04.000000000 +0100
+--- src/charset.c 2012-05-25 11:49:58.000000000 +0200
+***************
+*** 1602,1611 ****
+ #define LATIN1LOWER 'l'
+ #define LATIN1UPPER 'U'
+
+- /* !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]%_'abcdefghijklmnopqrstuvwxyz{|}~ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ */
+ static char_u latin1flags[257] = " UUUUUUUUUUUUUUUUUUUUUUUUUU llllllllllllllllllllllllll UUUUUUUUUUUUUUUUUUUUUUU UUUUUUUllllllllllllllllllllllll llllllll";
+! static char_u latin1upper[257] = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~\7f\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ÷ØÙÚÛÜÝÞÿ";
+! static char_u latin1lower[257] = " !\"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\7f\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿àáâãäåæçèéêëìíîïðñòóôõö×øùúûüýþßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ";
+
+ int
+ vim_islower(c)
+--- 1602,1610 ----
+ #define LATIN1LOWER 'l'
+ #define LATIN1UPPER 'U'
+
+ static char_u latin1flags[257] = " UUUUUUUUUUUUUUUUUUUUUUUUUU llllllllllllllllllllllllll UUUUUUUUUUUUUUUUUUUUUUU UUUUUUUllllllllllllllllllllllll llllllll";
+! static char_u latin1upper[257] = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xf7\xd8\xd9\xda\xdb\xdc\xdd\xde\xff";
+! static char_u latin1lower[257] = " !\"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xd7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff";
+
+ int
+ vim_islower(c)
+*** ../vim-7.3.526/src/version.c 2012-05-25 11:04:34.000000000 +0200
+--- src/version.c 2012-05-25 11:52:06.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 527,
+ /**/
+
+--
+An alien life briefly visits earth. Just before departing it leaves a
+message in the dust on the back of a white van. The world is shocked
+and wants to know what it means. After months of studies the worlds
+best linguistic scientists are able to decipher the message: "Wash me!".
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.528
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.528
+Problem: Crash when closing last window in a tab. (Alex Efros)
+Solution: Use common code in close_last_window_tabpage(). (Christian
+ Brabandt)
+Files: src/window.c
+
+
+*** ../vim-7.3.527/src/window.c 2012-03-16 19:07:54.000000000 +0100
+--- src/window.c 2012-05-25 12:25:16.000000000 +0200
+***************
+*** 23,28 ****
+--- 23,29 ----
+ static void win_totop __ARGS((int size, int flags));
+ static void win_equal_rec __ARGS((win_T *next_curwin, int current, frame_T *topfr, int dir, int col, int row, int width, int height));
+ static int last_window __ARGS((void));
++ static int close_last_window_tabpage __ARGS((win_T *win, int free_buf, tabpage_T *prev_curtab));
+ static win_T *win_free_mem __ARGS((win_T *win, int *dirp, tabpage_T *tp));
+ static frame_T *win_altframe __ARGS((win_T *win, tabpage_T *tp));
+ static tabpage_T *alt_tabpage __ARGS((void));
+***************
+*** 2105,2110 ****
+--- 2106,2147 ----
+ }
+
+ /*
++ * Close the possibly last window in a tab page.
++ * Returns TRUE when the window was closed already.
++ */
++ static int
++ close_last_window_tabpage(win, free_buf, prev_curtab)
++ win_T *win;
++ int free_buf;
++ tabpage_T *prev_curtab;
++ {
++ if (firstwin == lastwin)
++ {
++ /*
++ * Closing the last window in a tab page. First go to another tab
++ * page and then close the window and the tab page. This avoids that
++ * curwin and curtab are invalid while we are freeing memory, they may
++ * be used in GUI events.
++ */
++ goto_tabpage_tp(alt_tabpage());
++ redraw_tabline = TRUE;
++
++ /* Safety check: Autocommands may have closed the window when jumping
++ * to the other tab page. */
++ if (valid_tabpage(prev_curtab) && prev_curtab->tp_firstwin == win)
++ {
++ int h = tabline_height();
++
++ win_close_othertab(win, free_buf, prev_curtab);
++ if (h != tabline_height())
++ shell_new_rows();
++ }
++ return TRUE;
++ }
++ return FALSE;
++ }
++
++ /*
+ * Close window "win". Only works for the current tab page.
+ * If "free_buf" is TRUE related buffer may be unloaded.
+ *
+***************
+*** 2143,2171 ****
+ }
+ #endif
+
+! /*
+! * When closing the last window in a tab page first go to another tab
+! * page and then close the window and the tab page. This avoids that
+! * curwin and curtab are not invalid while we are freeing memory, they may
+! * be used in GUI events.
+! */
+! if (firstwin == lastwin)
+! {
+! goto_tabpage_tp(alt_tabpage());
+! redraw_tabline = TRUE;
+!
+! /* Safety check: Autocommands may have closed the window when jumping
+! * to the other tab page. */
+! if (valid_tabpage(prev_curtab) && prev_curtab->tp_firstwin == win)
+! {
+! int h = tabline_height();
+!
+! win_close_othertab(win, free_buf, prev_curtab);
+! if (h != tabline_height())
+! shell_new_rows();
+! }
+! return;
+! }
+
+ /* When closing the help window, try restoring a snapshot after closing
+ * the window. Otherwise clear the snapshot, it's now invalid. */
+--- 2180,2190 ----
+ }
+ #endif
+
+! /* When closing the last window in a tab page first go to another tab page
+! * and then close the window and the tab page to avoid that curwin and
+! * curtab are invalid while we are freeing memory. */
+! if (close_last_window_tabpage(win, free_buf, prev_curtab))
+! return;
+
+ /* When closing the help window, try restoring a snapshot after closing
+ * the window. Otherwise clear the snapshot, it's now invalid. */
+***************
+*** 2225,2231 ****
+
+ /* Autocommands may have closed the window already, or closed the only
+ * other window or moved to another tab page. */
+! if (!win_valid(win) || last_window() || curtab != prev_curtab)
+ return;
+
+ /* Free the memory used for the window and get the window that received
+--- 2244,2251 ----
+
+ /* Autocommands may have closed the window already, or closed the only
+ * other window or moved to another tab page. */
+! if (!win_valid(win) || last_window() || curtab != prev_curtab
+! || close_last_window_tabpage(win, free_buf, prev_curtab))
+ return;
+
+ /* Free the memory used for the window and get the window that received
+***************
+*** 2310,2316 ****
+
+ /*
+ * Close window "win" in tab page "tp", which is not the current tab page.
+! * This may be the last window ih that tab page and result in closing the tab,
+ * thus "tp" may become invalid!
+ * Caller must check if buffer is hidden and whether the tabline needs to be
+ * updated.
+--- 2330,2336 ----
+
+ /*
+ * Close window "win" in tab page "tp", which is not the current tab page.
+! * This may be the last window in that tab page and result in closing the tab,
+ * thus "tp" may become invalid!
+ * Caller must check if buffer is hidden and whether the tabline needs to be
+ * updated.
+*** ../vim-7.3.527/src/version.c 2012-05-25 11:56:06.000000000 +0200
+--- src/version.c 2012-05-25 12:38:25.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 528,
+ /**/
+
+--
+For society, it's probably a good thing that engineers value function over
+appearance. For example, you wouldn't want engineers to build nuclear power
+plants that only _look_ like they would keep all the radiation inside.
+ (Scott Adams - The Dilbert principle)
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.529
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.529
+Problem: Using a count before "v" and "V" does not work (Kikyous)
+Solution: Make the count select that many characters or lines. (Christian
+ Brabandt)
+Files: src/normal.c
+
+
+*** ../vim-7.3.528/src/normal.c 2012-05-25 11:04:34.000000000 +0200
+--- src/normal.c 2012-05-25 13:12:06.000000000 +0200
+***************
+*** 7660,7672 ****
+ else /* start Visual mode */
+ {
+ check_visual_highlight();
+! if (cap->count0) /* use previously selected part */
+ {
+! if (resel_VIsual_mode == NUL) /* there is none */
+! {
+! beep_flush();
+! return;
+! }
+ VIsual = curwin->w_cursor;
+
+ VIsual_active = TRUE;
+--- 7660,7668 ----
+ else /* start Visual mode */
+ {
+ check_visual_highlight();
+! if (cap->count0 > 0 && resel_VIsual_mode != NUL)
+ {
+! /* use previously selected part */
+ VIsual = curwin->w_cursor;
+
+ VIsual_active = TRUE;
+***************
+*** 7725,7730 ****
+--- 7721,7736 ----
+ /* start Select mode when 'selectmode' contains "cmd" */
+ may_start_select('c');
+ n_start_visual_mode(cap->cmdchar);
++ if (VIsual_mode != 'V' && *p_sel == 'e')
++ ++cap->count1; /* include one more char */
++ if (cap->count0 > 0 && --cap->count1 > 0)
++ {
++ /* With a count select that many characters or lines. */
++ if (VIsual_mode == 'v' || VIsual_mode == Ctrl_V)
++ nv_right(cap);
++ else if (VIsual_mode == 'V')
++ nv_down(cap);
++ }
+ }
+ }
+ }
+*** ../vim-7.3.528/src/version.c 2012-05-25 12:38:57.000000000 +0200
+--- src/version.c 2012-05-25 12:59:58.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 529,
+ /**/
+
+--
+Normal people believe that if it ain't broke, don't fix it. Engineers believe
+that if it ain't broke, it doesn't have enough features yet.
+ (Scott Adams - The Dilbert principle)
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.530
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.530 (after 7.3.520)
+Problem: Gvim does not work when 'guioptions' includes "f". (Davido)
+Solution: Call gui_mch_init_check() when running GUI in the foreground.
+ (Yasuhiro Matsumoto)
+Files: src/gui.c
+
+
+*** ../vim-7.3.529/src/gui.c 2012-05-18 17:03:13.000000000 +0200
+--- src/gui.c 2012-05-25 14:01:26.000000000 +0200
+***************
+*** 102,107 ****
+--- 102,111 ----
+ else
+ #endif
+ {
++ /* If there is 'f' in 'guioptions' and specify -g argument,
++ * gui_mch_init_check() was not called yet. */
++ if (gui_mch_init_check() != OK)
++ exit(1);
+ gui_attempt_start();
+ }
+
+*** ../vim-7.3.529/src/version.c 2012-05-25 13:12:33.000000000 +0200
+--- src/version.c 2012-05-25 14:05:46.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 530,
+ /**/
+
+--
+I think that you'll agree that engineers are very effective in their social
+interactions. It's the "normal" people who are nuts.
+ (Scott Adams - The Dilbert principle)
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.531
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.531 (after 7.3.530)
+Problem: GUI does not work on MS-Windows.
+Solution: Add the missing #ifdef. (Patrick Avery)
+Files: src/gui.c
+
+
+*** ../vim-7.3.530/src/gui.c 2012-05-25 14:06:18.000000000 +0200
+--- src/gui.c 2012-05-27 00:34:51.000000000 +0200
+***************
+*** 102,111 ****
+--- 102,113 ----
+ else
+ #endif
+ {
++ #ifdef FEAT_GUI_GTK
+ /* If there is 'f' in 'guioptions' and specify -g argument,
+ * gui_mch_init_check() was not called yet. */
+ if (gui_mch_init_check() != OK)
+ exit(1);
++ #endif
+ gui_attempt_start();
+ }
+
+*** ../vim-7.3.530/src/version.c 2012-05-25 14:06:18.000000000 +0200
+--- src/version.c 2012-05-27 00:37:33.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 531,
+ /**/
+
+--
+I learned the customs and mannerisms of engineers by observing them, much the
+way Jane Goodall learned about the great apes, but without the hassle of
+grooming.
+ (Scott Adams - The Dilbert principle)
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.532
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.532
+Problem: Compiler warning from Clang.
+Solution: Use a different way to point inside a string. (Dominique Pelle)
+Files: src/syntax.c
+
+
+*** ../vim-7.3.531/src/syntax.c 2012-03-23 16:25:13.000000000 +0100
+--- src/syntax.c 2012-06-01 13:13:58.000000000 +0200
+***************
+*** 9476,9482 ****
+ int cnt;
+ int attr;
+ {
+! msg_puts_attr((char_u *)("N \bI \b! \b" + cnt / 11), attr);
+ msg_clr_eos();
+ out_flush();
+ ui_delay(cnt == 99 ? 40L : (long)cnt * 50L, FALSE);
+--- 9476,9482 ----
+ int cnt;
+ int attr;
+ {
+! msg_puts_attr((char_u *)&("N \bI \b! \b"[cnt / 11]), attr);
+ msg_clr_eos();
+ out_flush();
+ ui_delay(cnt == 99 ? 40L : (long)cnt * 50L, FALSE);
+*** ../vim-7.3.531/src/version.c 2012-05-27 00:37:45.000000000 +0200
+--- src/version.c 2012-06-01 13:14:51.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 532,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+8. You spend half of the plane trip with your laptop on your lap...and your
+ child in the overhead compartment.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.533
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.533
+Problem: Memory leak when writing undo file.
+Solution: Free the ACL. (Dominique Pelle)
+Files: src/undo.c
+
+
+*** ../vim-7.3.532/src/undo.c 2011-12-08 15:14:04.000000000 +0100
+--- src/undo.c 2012-06-01 13:38:42.000000000 +0200
+***************
+*** 1535,1540 ****
+--- 1535,1541 ----
+ /* For systems that support ACL: get the ACL from the original file. */
+ acl = mch_get_acl(buf->b_ffname);
+ mch_set_acl(file_name, acl);
++ mch_free_acl(acl);
+ }
+ #endif
+
+*** ../vim-7.3.532/src/version.c 2012-06-01 13:18:48.000000000 +0200
+--- src/version.c 2012-06-01 13:39:16.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 533,
+ /**/
+
+--
+"How is your new girlfriend?"
+"90-60-90 man!"
+"What, pale purple?"
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.534
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.534 (after 7.3.461)
+Problem: When using an InsertCharPre autocommand autoindent fails.
+Solution: Proper handling of v:char. (Alexey Radkov)
+Files: src/edit.c
+
+
+*** ../vim-7.3.533/src/edit.c 2012-05-18 16:35:17.000000000 +0200
+--- src/edit.c 2012-06-01 14:41:06.000000000 +0200
+***************
+*** 10108,10129 ****
+ do_insert_char_pre(c)
+ int c;
+ {
+! char_u *res;
+
+ /* Return quickly when there is nothing to do. */
+ if (!has_insertcharpre())
+ return NULL;
+
+ /* Lock the text to avoid weird things from happening. */
+ ++textlock;
+! set_vim_var_char(c); /* set v:char */
+
+ if (apply_autocmds(EVENT_INSERTCHARPRE, NULL, NULL, FALSE, curbuf))
+! /* Get the new value of v:char. It may be empty or more than one
+! * character. */
+! res = vim_strsave(get_vim_var_str(VV_CHAR));
+! else
+! res = NULL;
+
+ set_vim_var_string(VV_CHAR, NULL, -1); /* clear v:char */
+ --textlock;
+--- 10108,10147 ----
+ do_insert_char_pre(c)
+ int c;
+ {
+! char_u *res;
+! #ifdef FEAT_MBYTE
+! char_u buf[MB_MAXBYTES + 1];
+! #else
+! char_u buf[2];
+! #endif
+
+ /* Return quickly when there is nothing to do. */
+ if (!has_insertcharpre())
+ return NULL;
+
++ #ifdef FEAT_MBYTE
++ if (has_mbyte)
++ buf[(*mb_char2bytes)(c, buf)] = NUL;
++ else
++ #endif
++ {
++ buf[0] = c;
++ buf[1] = NUL;
++ }
++
+ /* Lock the text to avoid weird things from happening. */
+ ++textlock;
+! set_vim_var_string(VV_CHAR, buf, -1); /* set v:char */
+
++ res = NULL;
+ if (apply_autocmds(EVENT_INSERTCHARPRE, NULL, NULL, FALSE, curbuf))
+! {
+! /* Get the value of v:char. It may be empty or more than one
+! * character. Only use it when changed, otherwise continue with the
+! * original character to avoid breaking autoindent. */
+! if (STRCMP(buf, get_vim_var_str(VV_CHAR)) != 0)
+! res = vim_strsave(get_vim_var_str(VV_CHAR));
+! }
+
+ set_vim_var_string(VV_CHAR, NULL, -1); /* clear v:char */
+ --textlock;
+*** ../vim-7.3.533/src/version.c 2012-06-01 13:46:06.000000000 +0200
+--- src/version.c 2012-06-01 14:42:19.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 534,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+11. You find yourself typing "com" after every period when using a word
+ processor.com
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.535
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.535
+Problem: Many #ifdefs for MB_MAXBYTES.
+Solution: Also define MB_MAXBYTES without the +multi_byte feature. Fix
+ places where the buffer didn't include space for a NUL byte.
+Files: src/arabic.c, src/edit.c, src/eval.c, src/getchar.c, src/mbyte.c,
+ src/misc1.c, src/screen.c, src/spell.c, src/vim.h
+
+
+*** ../vim-7.3.534/src/arabic.c 2010-08-15 21:57:28.000000000 +0200
+--- src/arabic.c 2012-06-01 14:59:37.000000000 +0200
+***************
+*** 1066,1072 ****
+
+ if (curr_c != c && ccp != NULL)
+ {
+! char_u buf[MB_MAXBYTES];
+
+ /* Update the first byte of the character. */
+ (*mb_char2bytes)(curr_c, buf);
+--- 1066,1072 ----
+
+ if (curr_c != c && ccp != NULL)
+ {
+! char_u buf[MB_MAXBYTES + 1];
+
+ /* Update the first byte of the character. */
+ (*mb_char2bytes)(curr_c, buf);
+*** ../vim-7.3.534/src/edit.c 2012-06-01 14:57:47.000000000 +0200
+--- src/edit.c 2012-06-01 15:01:49.000000000 +0200
+***************
+*** 1648,1658 ****
+ #define PC_STATUS_RIGHT 1 /* right halve of double-wide char */
+ #define PC_STATUS_LEFT 2 /* left halve of double-wide char */
+ #define PC_STATUS_SET 3 /* pc_bytes was filled */
+- #ifdef FEAT_MBYTE
+ static char_u pc_bytes[MB_MAXBYTES + 1]; /* saved bytes */
+- #else
+- static char_u pc_bytes[2]; /* saved bytes */
+- #endif
+ static int pc_attr;
+ static int pc_row;
+ static int pc_col;
+--- 1648,1654 ----
+***************
+*** 6819,6829 ****
+ char_u *s;
+
+ vim_free(last_insert);
+- #ifdef FEAT_MBYTE
+ last_insert = alloc(MB_MAXBYTES * 3 + 5);
+- #else
+- last_insert = alloc(6);
+- #endif
+ if (last_insert != NULL)
+ {
+ s = last_insert;
+--- 6815,6821 ----
+***************
+*** 6861,6867 ****
+ char_u *s;
+ {
+ #ifdef FEAT_MBYTE
+! char_u temp[MB_MAXBYTES];
+ int i;
+ int len;
+
+--- 6853,6859 ----
+ char_u *s;
+ {
+ #ifdef FEAT_MBYTE
+! char_u temp[MB_MAXBYTES + 1];
+ int i;
+ int len;
+
+***************
+*** 7423,7429 ****
+ int cc;
+ {
+ int n;
+! char_u buf[MB_MAXBYTES];
+ int i;
+ int c;
+
+--- 7415,7421 ----
+ int cc;
+ {
+ int n;
+! char_u buf[MB_MAXBYTES + 1];
+ int i;
+ int c;
+
+***************
+*** 10109,10119 ****
+ int c;
+ {
+ char_u *res;
+- #ifdef FEAT_MBYTE
+ char_u buf[MB_MAXBYTES + 1];
+- #else
+- char_u buf[2];
+- #endif
+
+ /* Return quickly when there is nothing to do. */
+ if (!has_insertcharpre())
+--- 10101,10107 ----
+*** ../vim-7.3.534/src/eval.c 2012-05-18 18:34:15.000000000 +0200
+--- src/eval.c 2012-06-01 15:02:08.000000000 +0200
+***************
+*** 19170,19180 ****
+ set_vim_var_char(c)
+ int c;
+ {
+! #ifdef FEAT_MBYTE
+! char_u buf[MB_MAXBYTES];
+! #else
+! char_u buf[2];
+! #endif
+
+ #ifdef FEAT_MBYTE
+ if (has_mbyte)
+--- 19170,19176 ----
+ set_vim_var_char(c)
+ int c;
+ {
+! char_u buf[MB_MAXBYTES + 1];
+
+ #ifdef FEAT_MBYTE
+ if (has_mbyte)
+*** ../vim-7.3.534/src/getchar.c 2012-04-05 16:07:01.000000000 +0200
+--- src/getchar.c 2012-06-01 15:03:51.000000000 +0200
+***************
+*** 723,729 ****
+ int c;
+ #ifdef FEAT_MBYTE
+ int n;
+! char_u buf[MB_MAXBYTES];
+ int i;
+ #endif
+
+--- 723,729 ----
+ int c;
+ #ifdef FEAT_MBYTE
+ int n;
+! char_u buf[MB_MAXBYTES + 1];
+ int i;
+ #endif
+
+***************
+*** 1072,1078 ****
+ int c;
+ {
+ #ifdef FEAT_MBYTE
+! char_u buf[MB_MAXBYTES];
+ #else
+ char_u buf[4];
+ #endif
+--- 1072,1078 ----
+ int c;
+ {
+ #ifdef FEAT_MBYTE
+! char_u buf[MB_MAXBYTES + 1];
+ #else
+ char_u buf[4];
+ #endif
+***************
+*** 1547,1553 ****
+ int c, c2;
+ #ifdef FEAT_MBYTE
+ int n;
+! char_u buf[MB_MAXBYTES];
+ int i;
+ #endif
+
+--- 1547,1553 ----
+ int c, c2;
+ #ifdef FEAT_MBYTE
+ int n;
+! char_u buf[MB_MAXBYTES + 1];
+ int i;
+ #endif
+
+***************
+*** 4335,4345 ****
+ int scol; /* starting column of the abbr. */
+ int j;
+ char_u *s;
+- #ifdef FEAT_MBYTE
+ char_u tb[MB_MAXBYTES + 4];
+- #else
+- char_u tb[4];
+- #endif
+ mapblock_T *mp;
+ #ifdef FEAT_LOCALMAP
+ mapblock_T *mp2;
+--- 4335,4341 ----
+*** ../vim-7.3.534/src/mbyte.c 2012-03-07 19:38:52.000000000 +0100
+--- src/mbyte.c 2012-06-01 15:04:27.000000000 +0200
+***************
+*** 708,714 ****
+ */
+ n = (i & 0x80) ? 2 : 1;
+ # else
+! char buf[MB_MAXBYTES];
+ # ifdef X_LOCALE
+ # ifndef mblen
+ # define mblen _Xmblen
+--- 708,714 ----
+ */
+ n = (i & 0x80) ? 2 : 1;
+ # else
+! char buf[MB_MAXBYTES + 1];
+ # ifdef X_LOCALE
+ # ifndef mblen
+ # define mblen _Xmblen
+***************
+*** 1953,1959 ****
+ /*
+ * Convert the character at screen position "off" to a sequence of bytes.
+ * Includes the composing characters.
+! * "buf" must at least have the length MB_MAXBYTES.
+ * Only to be used when ScreenLinesUC[off] != 0.
+ * Returns the produced number of bytes.
+ */
+--- 1953,1959 ----
+ /*
+ * Convert the character at screen position "off" to a sequence of bytes.
+ * Includes the composing characters.
+! * "buf" must at least have the length MB_MAXBYTES + 1.
+ * Only to be used when ScreenLinesUC[off] != 0.
+ * Returns the produced number of bytes.
+ */
+*** ../vim-7.3.534/src/misc1.c 2012-04-30 21:09:38.000000000 +0200
+--- src/misc1.c 2012-06-01 15:04:56.000000000 +0200
+***************
+*** 1932,1938 ****
+ int c;
+ {
+ #if defined(FEAT_MBYTE) || defined(PROTO)
+! char_u buf[MB_MAXBYTES];
+ int n;
+
+ n = (*mb_char2bytes)(c, buf);
+--- 1932,1938 ----
+ int c;
+ {
+ #if defined(FEAT_MBYTE) || defined(PROTO)
+! char_u buf[MB_MAXBYTES + 1];
+ int n;
+
+ n = (*mb_char2bytes)(c, buf);
+*** ../vim-7.3.534/src/screen.c 2012-03-23 16:25:13.000000000 +0100
+--- src/screen.c 2012-06-01 15:06:03.000000000 +0200
+***************
+*** 6621,6636 ****
+ int row, col;
+ int attr;
+ {
+- #ifdef FEAT_MBYTE
+ char_u buf[MB_MAXBYTES + 1];
+
+! buf[(*mb_char2bytes)(c, buf)] = NUL;
+! #else
+! char_u buf[2];
+!
+! buf[0] = c;
+! buf[1] = NUL;
+ #endif
+ screen_puts(buf, row, col, attr);
+ }
+
+--- 6621,6637 ----
+ int row, col;
+ int attr;
+ {
+ char_u buf[MB_MAXBYTES + 1];
+
+! #ifdef FEAT_MBYTE
+! if (has_mbyte)
+! buf[(*mb_char2bytes)(c, buf)] = NUL;
+! else
+ #endif
++ {
++ buf[0] = c;
++ buf[1] = NUL;
++ }
+ screen_puts(buf, row, col, attr);
+ }
+
+*** ../vim-7.3.534/src/spell.c 2012-05-18 18:07:57.000000000 +0200
+--- src/spell.c 2012-06-01 15:06:30.000000000 +0200
+***************
+*** 13694,13700 ****
+ {
+ int m1, m2;
+ #ifdef FEAT_MBYTE
+! char_u buf[MB_MAXBYTES];
+ hashitem_T *hi;
+
+ if (c1 >= 256)
+--- 13694,13700 ----
+ {
+ int m1, m2;
+ #ifdef FEAT_MBYTE
+! char_u buf[MB_MAXBYTES + 1];
+ hashitem_T *hi;
+
+ if (c1 >= 256)
+*** ../vim-7.3.534/src/vim.h 2012-04-30 18:48:38.000000000 +0200
+--- src/vim.h 2012-06-01 14:59:28.000000000 +0200
+***************
+*** 1703,1708 ****
+--- 1703,1710 ----
+ * character of up to 6 bytes, or one 16-bit character of up to three bytes
+ * plus six following composing characters of three bytes each. */
+ # define MB_MAXBYTES 21
++ #else
++ # define MB_MAXBYTES 1
+ #endif
+
+ #if (defined(FEAT_PROFILE) || defined(FEAT_RELTIME)) && !defined(PROTO)
+***************
+*** 2017,2022 ****
+--- 2019,2025 ----
+ #pragma warning(disable : 4312)
+ #endif
+
++ /* Note: a NULL argument for vim_realloc() is not portable, don't use it. */
+ #if defined(MEM_PROFILE)
+ # define vim_realloc(ptr, size) mem_realloc((ptr), (size))
+ #else
+*** ../vim-7.3.534/src/version.c 2012-06-01 14:57:47.000000000 +0200
+--- src/version.c 2012-06-01 15:08:20.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 535,
+ /**/
+
+--
+Me? A skeptic? I trust you have proof.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.536
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.536
+Problem: When spell checking the German sharp s is not seen as a word
+ character. (Aexl Bender)
+Solution: In utf_islower() return true for the sharp s. Note: also need
+ updated spell file for this to take effect.
+Files: src/mbyte.c
+
+
+*** ../vim-7.3.535/src/mbyte.c 2012-06-01 15:20:49.000000000 +0200
+--- src/mbyte.c 2012-06-01 16:50:41.000000000 +0200
+***************
+*** 2949,2955 ****
+ {
+ {0x61,0x7a,1,-32},
+ {0xb5,0xb5,-1,743},
+! {0xe0,0xf6,1,-32},
+ {0xf8,0xfe,1,-32},
+ {0xff,0xff,-1,121},
+ {0x101,0x12f,2,-1},
+--- 2949,2955 ----
+ {
+ {0x61,0x7a,1,-32},
+ {0xb5,0xb5,-1,743},
+! {0xe0,0xf6,1,-32}, /* 0xdf (German sharp s) is not upper-cased */
+ {0xf8,0xfe,1,-32},
+ {0xff,0xff,-1,121},
+ {0x101,0x12f,2,-1},
+***************
+*** 3129,3135 ****
+ utf_islower(a)
+ int a;
+ {
+! return (utf_toupper(a) != a);
+ }
+
+ /*
+--- 3129,3136 ----
+ utf_islower(a)
+ int a;
+ {
+! /* German sharp s is lower case but has no upper case equivalent. */
+! return (utf_toupper(a) != a) || a == 0xdf;
+ }
+
+ /*
+*** ../vim-7.3.535/src/version.c 2012-06-01 15:20:49.000000000 +0200
+--- src/version.c 2012-06-01 17:45:17.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 536,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+16. You step out of your room and realize that your parents have moved and
+ you don't have a clue when it happened.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.537
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.537
+Problem: Unecessary call to init_spell_chartab().
+Solution: Delete the call.
+Files: src/spell.c
+
+
+*** ../vim-7.3.536/src/spell.c 2012-06-01 15:20:49.000000000 +0200
+--- src/spell.c 2012-06-01 17:49:44.000000000 +0200
+***************
+*** 4721,4728 ****
+ int_wordlist = NULL;
+ }
+
+- init_spell_chartab();
+-
+ vim_free(repl_to);
+ repl_to = NULL;
+ vim_free(repl_from);
+--- 4721,4726 ----
+*** ../vim-7.3.536/src/version.c 2012-06-01 17:46:52.000000000 +0200
+--- src/version.c 2012-06-01 17:49:08.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 537,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+17. You turn on your intercom when leaving the room so you can hear if new
+ e-mail arrives.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.538
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.538
+Problem: 'efm' does not handle Tabs in pointer lines.
+Solution: Add Tab support. Improve tests. (Lech Lorens)
+Files: src/quickfix.c, src/testdir/test10.in, src/testdir/test10.ok
+
+
+*** ../vim-7.3.537/src/quickfix.c 2012-04-25 18:57:17.000000000 +0200
+--- src/quickfix.c 2012-06-01 18:24:07.000000000 +0200
+***************
+*** 247,253 ****
+ {'t', "."},
+ {'m', ".\\+"},
+ {'r', ".*"},
+! {'p', "[- .]*"},
+ {'v', "\\d\\+"},
+ {'s', ".\\+"}
+ };
+--- 247,253 ----
+ {'t', "."},
+ {'m', ".\\+"},
+ {'r', ".*"},
+! {'p', "[- .]*"},
+ {'v', "\\d\\+"},
+ {'s', ".\\+"}
+ };
+***************
+*** 677,687 ****
+ }
+ if ((i = (int)fmt_ptr->addr[7]) > 0) /* %p */
+ {
+ if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
+ continue;
+! col = (int)(regmatch.endp[i] - regmatch.startp[i] + 1);
+! if (*((char_u *)regmatch.startp[i]) != TAB)
+! use_viscol = TRUE;
+ }
+ if ((i = (int)fmt_ptr->addr[8]) > 0) /* %v */
+ {
+--- 677,699 ----
+ }
+ if ((i = (int)fmt_ptr->addr[7]) > 0) /* %p */
+ {
++ char_u *match_ptr;
++
+ if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
+ continue;
+! col = 0;
+! for (match_ptr = regmatch.startp[i];
+! match_ptr != regmatch.endp[i]; ++match_ptr)
+! {
+! ++col;
+! if (*match_ptr == TAB)
+! {
+! col += 7;
+! col -= col % 8;
+! }
+! }
+! ++col;
+! use_viscol = TRUE;
+ }
+ if ((i = (int)fmt_ptr->addr[8]) > 0) /* %v */
+ {
+*** ../vim-7.3.537/src/testdir/test10.in 2011-08-10 18:36:49.000000000 +0200
+--- src/testdir/test10.in 2012-06-01 18:22:40.000000000 +0200
+***************
+*** 8,48 ****
+ :7/start of errorfile/,/end of errorfile/w! Xerrorfile1
+ :7/start of errorfile/,/end of errorfile/-1w! Xerrorfile2
+ :/start of testfile/,/end of testfile/w! Xtestfile
+ :cf Xerrorfile2
+ :clast
+ :copen
+ :let a=w:quickfix_title
+ :wincmd p
+! gR\12=a\r\e
+ :cf Xerrorfile1
+! rA
+ :cn
+! rB
+ :cn
+! rC
+ :cn
+! rD
+ :cn
+! rE
+ :cn
+ :wincmd w
+ :let a=w:quickfix_title
+ :wincmd p
+! gR\12=a\r\e
+ :w! test.out " Write contents of this file
+ :qa!
+ ENDTEST
+
+ start of errorfile
+ "Xtestfile", line 4.12: 1506-045 (S) Undeclared identifier fd_set.
+! "Xtestfile", line 7 col 19; this is an error
+ gcc -c -DHAVE_CONFIsing-prototypes -I/usr/X11R6/include version.c
+! Xtestfile:13: parse error before `asd'
+ make: *** [vim] Error 1
+! in file "Xtestfile" linenr 16: there is an error
+
+ 2 returned
+! "Xtestfile", linenr 19: yet another problem
+
+ Does anyone know what is the problem and how to correction it?
+ "Xtestfile", line 21 col 9: What is the title of the quickfix window?
+--- 8,88 ----
+ :7/start of errorfile/,/end of errorfile/w! Xerrorfile1
+ :7/start of errorfile/,/end of errorfile/-1w! Xerrorfile2
+ :/start of testfile/,/end of testfile/w! Xtestfile
++ :set efm+==%f=\\,\ line\ %l%*\\D%v%*[^\ ]\ %m
++ :set efm^=%AError\ in\ \"%f\"\ at\ line\ %l:,%Z%p^,%C%m
+ :cf Xerrorfile2
+ :clast
+ :copen
+ :let a=w:quickfix_title
+ :wincmd p
+! lgR\12=a\r\e
+ :cf Xerrorfile1
+! grA
+ :cn
+! gRLINE 6, COL 19\e
+ :cn
+! gRNO COLUMN SPECIFIED\e
+ :cn
+! gRAGAIN NO COLUMN\e
+ :cn
+! gRCOL 1\e
+ :cn
++ gRCOL 2\e
++ :cn
++ gRCOL 10\e
++ :cn
++ gRVCOL 10\e
++ :cn
++ grI
++ :cn
++ gR. SPACE POINTER\e
++ :cn
++ gR. DOT POINTER\e
++ :cn
++ gR. DASH POINTER\e
++ :cn
++ gR. TAB-SPACE POINTER\e
++ :clast
++ :cprev
++ :cprev
+ :wincmd w
+ :let a=w:quickfix_title
+ :wincmd p
+! lgR\12=a\r\e
+ :w! test.out " Write contents of this file
+ :qa!
+ ENDTEST
+
+ start of errorfile
+ "Xtestfile", line 4.12: 1506-045 (S) Undeclared identifier fd_set.
+! "Xtestfile", line 6 col 19; this is an error
+ gcc -c -DHAVE_CONFIsing-prototypes -I/usr/X11R6/include version.c
+! Xtestfile:9: parse error before `asd'
+ make: *** [vim] Error 1
+! in file "Xtestfile" linenr 10: there is an error
+
+ 2 returned
+! "Xtestfile", line 11 col 1; this is an error
+! "Xtestfile", line 12 col 2; this is another error
+! "Xtestfile", line 14:10; this is an error in column 10
+! =Xtestfile=, line 15:10; this is another error, but in vcol 10 this time
+! "Xtestfile", linenr 16: yet another problem
+! Error in "Xtestfile" at line 17:
+! x should be a dot
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 17
+! ^
+! Error in "Xtestfile" at line 18:
+! x should be a dot
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 18
+! .............^
+! Error in "Xtestfile" at line 19:
+! x should be a dot
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 19
+! --------------^
+! Error in "Xtestfile" at line 20:
+! x should be a dot
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 20
+! ^
+
+ Does anyone know what is the problem and how to correction it?
+ "Xtestfile", line 21 col 9: What is the title of the quickfix window?
+***************
+*** 50,74 ****
+ end of errorfile
+
+ start of testfile
+! line 2 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 4 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 5 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 7 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 8 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 9 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 10 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 11 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 12 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 13 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 14 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 15 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 16 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 17 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 18 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 19 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 20 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 21 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 22 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ end of testfile
+--- 90,114 ----
+ end of errorfile
+
+ start of testfile
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 2
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 3
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 4
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 5
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 6
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 7
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 8
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 9
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 10
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 11
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 12
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 13
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 14
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 15
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 16
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 17
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 18
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 19
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 20
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 21
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 22
+ end of testfile
+*** ../vim-7.3.537/src/testdir/test10.ok 2011-08-10 18:36:49.000000000 +0200
+--- src/testdir/test10.ok 2012-06-01 18:22:40.000000000 +0200
+***************
+*** 1,23 ****
+ start of testfile
+! line 2 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 4 xxxAxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 5 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 6 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 7 xxxxxxxxxxBxxxxxxxxxxxxxxxxxxx
+! line 8 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 9 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 10 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 11 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 12 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! Cine 13 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 14 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 15 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! Dine 16 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 17 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 18 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! Eine 19 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 20 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+! line 21 :cf Xerrorfile1xxxxxxxxxxxxxxx
+! line 22 :cf Xerrorfile2xxxxxxxxxxxxxxx
+ end of testfile
+--- 1,23 ----
+ start of testfile
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 2
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 3
+! xxxxxxxxxxAxxxxxxxxxxxxxxxxxxx line 4
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 5
+! xxxxxxxxxxxxxxxxxLINE 6, COL 19 line 6
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 7
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 8
+! NO COLUMN SPECIFIEDxxxxxxxxxxx line 9
+! AGAIN NO COLUMNxxxxxxxxxxxxxxx line 10
+! COL 1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 11
+! COL 2xxxxxxxxxxxxxxxxxxxxxxxxx line 12
+! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 13
+! xxxxxxxxCOL 10xxxxxxxxxxxxxxxx line 14
+! xVCOL 10xxxxxxxxxxxxxxxxxxxxxx line 15
+! Ixxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 16
+! xxxx. SPACE POINTERxxxxxxxxxxx line 17
+! xxxxx. DOT POINTERxxxxxxxxxxxx line 18
+! xxxxxx. DASH POINTERxxxxxxxxxx line 19
+! xxxxxxx. TAB-SPACE POINTERxxxx line 20
+! xxxxxxxx:cf Xerrorfile1xxxxxxx line 21
+! xxxxxxxx:cf Xerrorfile2xxxxxxx line 22
+ end of testfile
+*** ../vim-7.3.537/src/version.c 2012-06-01 17:49:51.000000000 +0200
+--- src/version.c 2012-06-01 18:22:27.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 538,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+18. Your wife drapes a blond wig over your monitor to remind you of what she
+ looks like.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.539
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.539
+Problem: Redrawing a character on the command line does not work properly
+ for multi-byte charactes.
+Solution: Count the number of bytes in a character. (Yukihiro Nakadaira)
+Files: src/ex_getln.c
+
+
+*** ../vim-7.3.538/src/ex_getln.c 2012-05-25 11:02:34.000000000 +0200
+--- src/ex_getln.c 2012-06-06 11:50:37.000000000 +0200
+***************
+*** 2764,2769 ****
+--- 2764,2774 ----
+ msg_no_more = TRUE;
+ if (ccline.cmdlen == ccline.cmdpos)
+ msg_putchar(' ');
++ #ifdef FEAT_MBYTE
++ else if (has_mbyte)
++ draw_cmdline(ccline.cmdpos,
++ (*mb_ptr2len)(ccline.cmdbuff + ccline.cmdpos));
++ #endif
+ else
+ draw_cmdline(ccline.cmdpos, 1);
+ msg_no_more = FALSE;
+*** ../vim-7.3.538/src/version.c 2012-06-01 18:34:37.000000000 +0200
+--- src/version.c 2012-06-06 12:02:45.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 539,
+ /**/
+
+--
+If they don't keep on exercising their lips, he thought, their brains
+start working.
+ -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.540
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.540
+Problem: Cursor is left on the text instead of the command line.
+Solution: Don't call setcursor() in command line mode.
+Files: src/getchar.c
+
+
+*** ../vim-7.3.539/src/getchar.c 2012-06-01 15:20:49.000000000 +0200
+--- src/getchar.c 2012-06-06 11:58:05.000000000 +0200
+***************
+*** 2819,2825 ****
+ edit_unputchar();
+ if (State & CMDLINE)
+ unputcmdline();
+! setcursor(); /* put cursor back where it belongs */
+ }
+
+ if (c < 0)
+--- 2819,2826 ----
+ edit_unputchar();
+ if (State & CMDLINE)
+ unputcmdline();
+! else
+! setcursor(); /* put cursor back where it belongs */
+ }
+
+ if (c < 0)
+*** ../vim-7.3.539/src/version.c 2012-06-06 12:02:57.000000000 +0200
+--- src/version.c 2012-06-06 12:05:22.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 540,
+ /**/
+
+--
+"Making it up? Why should I want to make anything up? Life's bad enough
+as it is without wanting to invent any more of it."
+ -- Marvin, the Paranoid Android in Douglas Adams'
+ "The Hitchhiker's Guide to the Galaxy"
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.541
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.541
+Problem: When joining lines comment leaders need to be removed manually.
+Solution: Add the 'j' flag to 'formatoptions'. (Lech Lorens)
+Files: runtime/doc/change.txt, src/edit.c, src/ex_docmd.c, src/misc1.c,
+ src/normal.c, src/ops.c, src/option.h, src/proto/misc1.pro,
+ src/proto/ops.pro, src/search.c, src/testdir/test29.in,
+ src/testdir/test29.ok
+
+
+*** ../vim-7.3.540/runtime/doc/change.txt 2011-05-05 14:26:37.000000000 +0200
+--- runtime/doc/change.txt 2012-06-06 13:05:04.000000000 +0200
+***************
+*** 1495,1500 ****
+--- 1522,1533 ----
+ characters. Overruled by the 'M' flag.
+ 1 Don't break a line after a one-letter word. It's broken before it
+ instead (if possible).
++ j Where it makes sense, remove a comment leader when joining lines. For
++ example, joining:
++ int i; // the index ~
++ // in the list ~
++ Becomes:
++ int i; // the index in the list ~
+
+
+ With 't' and 'c' you can specify when Vim performs auto-wrapping:
+*** ../vim-7.3.540/src/edit.c 2012-06-01 15:20:49.000000000 +0200
+--- src/edit.c 2012-06-06 13:00:29.000000000 +0200
+***************
+*** 5847,5853 ****
+ * Need to remove existing (middle) comment leader and insert end
+ * comment leader. First, check what comment leader we can find.
+ */
+! i = get_leader_len(line = ml_get_curline(), &p, FALSE);
+ if (i > 0 && vim_strchr(p, COM_MIDDLE) != NULL) /* Just checking */
+ {
+ /* Skip middle-comment string */
+--- 5847,5853 ----
+ * Need to remove existing (middle) comment leader and insert end
+ * comment leader. First, check what comment leader we can find.
+ */
+! i = get_leader_len(line = ml_get_curline(), &p, FALSE, TRUE);
+ if (i > 0 && vim_strchr(p, COM_MIDDLE) != NULL) /* Just checking */
+ {
+ /* Skip middle-comment string */
+***************
+*** 6085,6091 ****
+
+ /* Don't break until after the comment leader */
+ if (do_comments)
+! leader_len = get_leader_len(ml_get_curline(), NULL, FALSE);
+ else
+ leader_len = 0;
+
+--- 6085,6091 ----
+
+ /* Don't break until after the comment leader */
+ if (do_comments)
+! leader_len = get_leader_len(ml_get_curline(), NULL, FALSE, TRUE);
+ else
+ leader_len = 0;
+
+***************
+*** 6411,6417 ****
+ /* With the 'c' flag in 'formatoptions' and 't' missing: only format
+ * comments. */
+ if (has_format_option(FO_WRAP_COMS) && !has_format_option(FO_WRAP)
+! && get_leader_len(old, NULL, FALSE) == 0)
+ return;
+ #endif
+
+--- 6411,6417 ----
+ /* With the 'c' flag in 'formatoptions' and 't' missing: only format
+ * comments. */
+ if (has_format_option(FO_WRAP_COMS) && !has_format_option(FO_WRAP)
+! && get_leader_len(old, NULL, FALSE, TRUE) == 0)
+ return;
+ #endif
+
+***************
+*** 8565,8571 ****
+ {
+ temp = curwin->w_cursor.col;
+ if (!can_bs(BS_EOL) /* only if "eol" included */
+! || do_join(2, FALSE, TRUE) == FAIL)
+ vim_beep();
+ else
+ curwin->w_cursor.col = temp;
+--- 8565,8571 ----
+ {
+ temp = curwin->w_cursor.col;
+ if (!can_bs(BS_EOL) /* only if "eol" included */
+! || do_join(2, FALSE, TRUE, FALSE) == FAIL)
+ vim_beep();
+ else
+ curwin->w_cursor.col = temp;
+***************
+*** 8746,8752 ****
+ ptr[len - 1] = NUL;
+ }
+
+! (void)do_join(2, FALSE, FALSE);
+ if (temp == NUL && gchar_cursor() != NUL)
+ inc_cursor();
+ }
+--- 8746,8752 ----
+ ptr[len - 1] = NUL;
+ }
+
+! (void)do_join(2, FALSE, FALSE, FALSE);
+ if (temp == NUL && gchar_cursor() != NUL)
+ inc_cursor();
+ }
+*** ../vim-7.3.540/src/ex_docmd.c 2012-04-30 18:48:38.000000000 +0200
+--- src/ex_docmd.c 2012-06-06 13:00:29.000000000 +0200
+***************
+*** 8545,8551 ****
+ }
+ ++eap->line2;
+ }
+! (void)do_join(eap->line2 - eap->line1 + 1, !eap->forceit, TRUE);
+ beginline(BL_WHITE | BL_FIX);
+ ex_may_print(eap);
+ }
+--- 8545,8551 ----
+ }
+ ++eap->line2;
+ }
+! (void)do_join(eap->line2 - eap->line1 + 1, !eap->forceit, TRUE, TRUE);
+ beginline(BL_WHITE | BL_FIX);
+ ex_may_print(eap);
+ }
+*** ../vim-7.3.540/src/misc1.c 2012-06-01 15:20:49.000000000 +0200
+--- src/misc1.c 2012-06-06 13:27:32.000000000 +0200
+***************
+*** 671,677 ****
+ ptr = saved_line;
+ # ifdef FEAT_COMMENTS
+ if (flags & OPENLINE_DO_COM)
+! lead_len = get_leader_len(ptr, NULL, FALSE);
+ else
+ lead_len = 0;
+ # endif
+--- 671,677 ----
+ ptr = saved_line;
+ # ifdef FEAT_COMMENTS
+ if (flags & OPENLINE_DO_COM)
+! lead_len = get_leader_len(ptr, NULL, FALSE, TRUE);
+ else
+ lead_len = 0;
+ # endif
+***************
+*** 693,699 ****
+ }
+ # ifdef FEAT_COMMENTS
+ if (flags & OPENLINE_DO_COM)
+! lead_len = get_leader_len(ptr, NULL, FALSE);
+ else
+ lead_len = 0;
+ if (lead_len > 0)
+--- 693,699 ----
+ }
+ # ifdef FEAT_COMMENTS
+ if (flags & OPENLINE_DO_COM)
+! lead_len = get_leader_len(ptr, NULL, FALSE, TRUE);
+ else
+ lead_len = 0;
+ if (lead_len > 0)
+***************
+*** 836,842 ****
+ */
+ end_comment_pending = NUL;
+ if (flags & OPENLINE_DO_COM)
+! lead_len = get_leader_len(saved_line, &lead_flags, dir == BACKWARD);
+ else
+ lead_len = 0;
+ if (lead_len > 0)
+--- 836,842 ----
+ */
+ end_comment_pending = NUL;
+ if (flags & OPENLINE_DO_COM)
+! lead_len = get_leader_len(saved_line, &lead_flags, dir == BACKWARD, TRUE);
+ else
+ lead_len = 0;
+ if (lead_len > 0)
+***************
+*** 1548,1561 ****
+ * When "flags" is not NULL, it is set to point to the flags of the recognized
+ * comment leader.
+ * "backward" must be true for the "O" command.
+ */
+ int
+! get_leader_len(line, flags, backward)
+ char_u *line;
+ char_u **flags;
+ int backward;
+ {
+ int i, j;
+ int got_com = FALSE;
+ int found_one;
+ char_u part_buf[COM_MAX_LEN]; /* buffer for one option part */
+--- 1548,1565 ----
+ * When "flags" is not NULL, it is set to point to the flags of the recognized
+ * comment leader.
+ * "backward" must be true for the "O" command.
++ * If "include_space" is set, include trailing whitespace while calculating the
++ * length.
+ */
+ int
+! get_leader_len(line, flags, backward, include_space)
+ char_u *line;
+ char_u **flags;
+ int backward;
++ int include_space;
+ {
+ int i, j;
++ int result;
+ int got_com = FALSE;
+ int found_one;
+ char_u part_buf[COM_MAX_LEN]; /* buffer for one option part */
+***************
+*** 1565,1571 ****
+ char_u *prev_list;
+ char_u *saved_flags = NULL;
+
+! i = 0;
+ while (vim_iswhite(line[i])) /* leading white space is ignored */
+ ++i;
+
+--- 1569,1575 ----
+ char_u *prev_list;
+ char_u *saved_flags = NULL;
+
+! result = i = 0;
+ while (vim_iswhite(line[i])) /* leading white space is ignored */
+ ++i;
+
+***************
+*** 1668,1684 ****
+ if (!found_one)
+ break;
+
+ /* Include any trailing white space. */
+ while (vim_iswhite(line[i]))
+ ++i;
+
+ /* If this comment doesn't nest, stop here. */
+ got_com = TRUE;
+ if (vim_strchr(part_buf, COM_NEST) == NULL)
+ break;
+ }
+
+! return (got_com ? i : 0);
+ }
+ #endif
+
+--- 1672,1838 ----
+ if (!found_one)
+ break;
+
++ result = i;
++
+ /* Include any trailing white space. */
+ while (vim_iswhite(line[i]))
+ ++i;
+
++ if (include_space)
++ result = i;
++
+ /* If this comment doesn't nest, stop here. */
+ got_com = TRUE;
+ if (vim_strchr(part_buf, COM_NEST) == NULL)
+ break;
+ }
++ return result;
++ }
++
++ /*
++ * Return the offset at which the last comment in line starts. If there is no
++ * comment in the whole line, -1 is returned.
++ *
++ * When "flags" is not null, it is set to point to the flags describing the
++ * recognized comment leader.
++ */
++ int
++ get_last_leader_offset(line, flags)
++ char_u *line;
++ char_u **flags;
++ {
++ int result = -1;
++ int i, j;
++ int lower_check_bound = 0;
++ char_u *string;
++ char_u *com_leader;
++ char_u *com_flags;
++ char_u *list;
++ int found_one;
++ char_u part_buf[COM_MAX_LEN]; /* buffer for one option part */
++
++ /*
++ * Repeat to match several nested comment strings.
++ */
++ i = (int)STRLEN(line);
++ while (--i >= lower_check_bound)
++ {
++ /*
++ * scan through the 'comments' option for a match
++ */
++ found_one = FALSE;
++ for (list = curbuf->b_p_com; *list; )
++ {
++ char_u *flags_save = list;
++
++ /*
++ * Get one option part into part_buf[]. Advance list to next one.
++ * put string at start of string.
++ */
++ (void)copy_option_part(&list, part_buf, COM_MAX_LEN, ",");
++ string = vim_strchr(part_buf, ':');
++ if (string == NULL) /* If everything is fine, this cannot actually
++ * happen. */
++ {
++ continue;
++ }
++ *string++ = NUL; /* Isolate flags from string. */
++ com_leader = string;
++
++ /*
++ * Line contents and string must match.
++ * When string starts with white space, must have some white space
++ * (but the amount does not need to match, there might be a mix of
++ * TABs and spaces).
++ */
++ if (vim_iswhite(string[0]))
++ {
++ if (i == 0 || !vim_iswhite(line[i - 1]))
++ continue;
++ while (vim_iswhite(string[0]))
++ ++string;
++ }
++ for (j = 0; string[j] != NUL && string[j] == line[i + j]; ++j)
++ /* do nothing */;
++ if (string[j] != NUL)
++ continue;
++
++ /*
++ * When 'b' flag used, there must be white space or an
++ * end-of-line after the string in the line.
++ */
++ if (vim_strchr(part_buf, COM_BLANK) != NULL
++ && !vim_iswhite(line[i + j]) && line[i + j] != NUL)
++ {
++ continue;
++ }
++
++ /*
++ * We have found a match, stop searching.
++ */
++ found_one = TRUE;
++
++ if (flags)
++ *flags = flags_save;
++ com_flags = flags_save;
++
++ break;
++ }
+
+! if (found_one)
+! {
+! char_u part_buf2[COM_MAX_LEN]; /* buffer for one option part */
+! int len1, len2, off;
+!
+! result = i;
+! /*
+! * If this comment nests, continue searching.
+! */
+! if (vim_strchr(part_buf, COM_NEST) != NULL)
+! continue;
+!
+! lower_check_bound = i;
+!
+! /* Let's verify whether the comment leader found is a substring
+! * of other comment leaders. If it is, let's adjust the
+! * lower_check_bound so that we make sure that we have determined
+! * the comment leader correctly.
+! */
+!
+! while (vim_iswhite(*com_leader))
+! ++com_leader;
+! len1 = (int)STRLEN(com_leader);
+!
+! for (list = curbuf->b_p_com; *list; )
+! {
+! char_u *flags_save = list;
+!
+! (void)copy_option_part(&list, part_buf2, COM_MAX_LEN, ",");
+! if (flags_save == com_flags)
+! continue;
+! string = vim_strchr(part_buf2, ':');
+! ++string;
+! while (vim_iswhite(*string))
+! ++string;
+! len2 = (int)STRLEN(string);
+! if (len2 == 0)
+! continue;
+!
+! /* Now we have to verify whether string ends with a substring
+! * beginning the com_leader. */
+! for (off = (len2 > i ? i : len2); off > 0 && off + len1 > len2;)
+! {
+! --off;
+! if (!STRNCMP(string + off, com_leader, len2 - off))
+! {
+! if (i - off < lower_check_bound)
+! lower_check_bound = i - off;
+! }
+! }
+! }
+! }
+! }
+! return result;
+ }
+ #endif
+
+*** ../vim-7.3.540/src/normal.c 2012-05-25 13:12:33.000000000 +0200
+--- src/normal.c 2012-06-06 13:00:29.000000000 +0200
+***************
+*** 1968,1974 ****
+ beep_flush();
+ else
+ {
+! (void)do_join(oap->line_count, oap->op_type == OP_JOIN, TRUE);
+ auto_format(FALSE, TRUE);
+ }
+ break;
+--- 1968,1974 ----
+ beep_flush();
+ else
+ {
+! (void)do_join(oap->line_count, oap->op_type == OP_JOIN, TRUE, TRUE);
+ auto_format(FALSE, TRUE);
+ }
+ break;
+***************
+*** 4426,4432 ****
+ break;
+ }
+ #ifdef FEAT_COMMENTS
+! if (get_leader_len(ml_get_curline(), NULL, FALSE) > 0)
+ {
+ /* Ignore this line, continue at start of next line. */
+ ++curwin->w_cursor.lnum;
+--- 4426,4432 ----
+ break;
+ }
+ #ifdef FEAT_COMMENTS
+! if (get_leader_len(ml_get_curline(), NULL, FALSE, TRUE) > 0)
+ {
+ /* Ignore this line, continue at start of next line. */
+ ++curwin->w_cursor.lnum;
+***************
+*** 9324,9330 ****
+ {
+ prep_redo(cap->oap->regname, cap->count0,
+ NUL, cap->cmdchar, NUL, NUL, cap->nchar);
+! (void)do_join(cap->count0, cap->nchar == NUL, TRUE);
+ }
+ }
+ }
+--- 9324,9330 ----
+ {
+ prep_redo(cap->oap->regname, cap->count0,
+ NUL, cap->cmdchar, NUL, NUL, cap->nchar);
+! (void)do_join(cap->count0, cap->nchar == NUL, TRUE, TRUE);
+ }
+ }
+ }
+*** ../vim-7.3.540/src/ops.c 2012-05-18 12:49:33.000000000 +0200
+--- src/ops.c 2012-06-06 15:43:31.000000000 +0200
+***************
+*** 112,117 ****
+--- 112,120 ----
+ # endif
+ #endif
+ static void dis_msg __ARGS((char_u *p, int skip_esc));
++ #if defined(FEAT_COMMENTS) || defined(PROTO)
++ static char_u *skip_comment __ARGS((char_u *line, int process, int include_space, int *is_comment));
++ #endif
+ #ifdef FEAT_VISUAL
+ static void block_prep __ARGS((oparg_T *oap, struct block_def *, linenr_T, int));
+ #endif
+***************
+*** 1987,1993 ****
+ curwin->w_cursor = curpos; /* restore curwin->w_cursor */
+ }
+ if (curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count)
+! (void)do_join(2, FALSE, FALSE);
+ }
+ }
+
+--- 1990,1996 ----
+ curwin->w_cursor = curpos; /* restore curwin->w_cursor */
+ }
+ if (curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count)
+! (void)do_join(2, FALSE, FALSE, FALSE);
+ }
+ }
+
+***************
+*** 4197,4213 ****
+ ui_breakcheck();
+ }
+
+ /*
+ * Join 'count' lines (minimal 2) at cursor position.
+ * When "save_undo" is TRUE save lines for undo first.
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+! do_join(count, insert_space, save_undo)
+ long count;
+ int insert_space;
+ int save_undo;
+ {
+ char_u *curr = NULL;
+ char_u *curr_start = NULL;
+--- 4200,4297 ----
+ ui_breakcheck();
+ }
+
++ #if defined(FEAT_COMMENTS) || defined(PROTO)
++ /*
++ * If "process" is TRUE and the line begins with a comment leader (possibly
++ * after some white space), return a pointer to the text after it. Put a boolean
++ * value indicating whether the line ends with an unclosed comment in
++ * "is_comment".
++ * line - line to be processed,
++ * process - if FALSE, will only check whether the line ends with an unclosed
++ * comment,
++ * include_space - whether to also skip space following the comment leader,
++ * is_comment - will indicate whether the current line ends with an unclosed
++ * comment.
++ */
++ static char_u *
++ skip_comment(line, process, include_space, is_comment)
++ char_u *line;
++ int process;
++ int include_space;
++ int *is_comment;
++ {
++ char_u *comment_flags = NULL;
++ int lead_len;
++ int leader_offset = get_last_leader_offset(line, &comment_flags);
++
++ *is_comment = FALSE;
++ if (leader_offset != -1)
++ {
++ /* Let's check whether the line ends with an unclosed comment.
++ * If the last comment leader has COM_END in flags, there's no comment.
++ */
++ while (*comment_flags)
++ {
++ if (*comment_flags == COM_END
++ || *comment_flags == ':')
++ break;
++ ++comment_flags;
++ }
++ if (*comment_flags != COM_END)
++ *is_comment = TRUE;
++ }
++
++ if (process == FALSE)
++ return line;
++
++ lead_len = get_leader_len(line, &comment_flags, FALSE, include_space);
++
++ if (lead_len == 0)
++ return line;
++
++ /* Find:
++ * - COM_START,
++ * - COM_END,
++ * - colon,
++ * whichever comes first.
++ */
++ while (*comment_flags)
++ {
++ if (*comment_flags == COM_START
++ || *comment_flags == COM_END
++ || *comment_flags == ':')
++ {
++ break;
++ }
++ ++comment_flags;
++ }
++
++ /* If we found a colon, it means that we are not processing a line
++ * starting with an opening or a closing part of a three-part
++ * comment. That's good, because we don't want to remove those as
++ * this would be annoying.
++ */
++ if (*comment_flags == ':' || *comment_flags == NUL)
++ line += lead_len;
++
++ return line;
++ }
++ #endif
++
+ /*
+ * Join 'count' lines (minimal 2) at cursor position.
+ * When "save_undo" is TRUE save lines for undo first.
++ * Set "use_formatoptions" to FALSE when e.g. processing
++ * backspace and comment leaders should not be removed.
+ *
+ * return FAIL for failure, OK otherwise
+ */
+ int
+! do_join(count, insert_space, save_undo, use_formatoptions)
+ long count;
+ int insert_space;
+ int save_undo;
++ int use_formatoptions UNUSED;
+ {
+ char_u *curr = NULL;
+ char_u *curr_start = NULL;
+***************
+*** 4221,4226 ****
+--- 4305,4317 ----
+ linenr_T t;
+ colnr_T col = 0;
+ int ret = OK;
++ #if defined(FEAT_COMMENTS) || defined(PROTO)
++ int *comments;
++ int remove_comments = (use_formatoptions == TRUE)
++ && has_format_option(FO_REMOVE_COMS);
++ int prev_was_comment;
++ #endif
++
+
+ if (save_undo && u_save((linenr_T)(curwin->w_cursor.lnum - 1),
+ (linenr_T)(curwin->w_cursor.lnum + count)) == FAIL)
+***************
+*** 4232,4237 ****
+--- 4323,4339 ----
+ spaces = lalloc_clear((long_u)count, TRUE);
+ if (spaces == NULL)
+ return FAIL;
++ #if defined(FEAT_COMMENTS) || defined(PROTO)
++ if (remove_comments)
++ {
++ comments = (int *)lalloc_clear((long_u)count * sizeof(int), TRUE);
++ if (comments == NULL)
++ {
++ vim_free(spaces);
++ return FAIL;
++ }
++ }
++ #endif
+
+ /*
+ * Don't move anything, just compute the final line length
+***************
+*** 4240,4245 ****
+--- 4342,4366 ----
+ for (t = 0; t < count; ++t)
+ {
+ curr = curr_start = ml_get((linenr_T)(curwin->w_cursor.lnum + t));
++ #if defined(FEAT_COMMENTS) || defined(PROTO)
++ if (remove_comments)
++ {
++ /* We don't want to remove the comment leader if the
++ * previous line is not a comment. */
++ if (t > 0 && prev_was_comment)
++ {
++
++ char_u *new_curr = skip_comment(curr, TRUE, insert_space,
++ &prev_was_comment);
++ comments[t] = new_curr - curr;
++ curr = new_curr;
++ }
++ else
++ curr = skip_comment(curr, FALSE, insert_space,
++ &prev_was_comment);
++ }
++ #endif
++
+ if (insert_space && t > 0)
+ {
+ curr = skipwhite(curr);
+***************
+*** 4327,4332 ****
+--- 4448,4457 ----
+ if (t == 0)
+ break;
+ curr = curr_start = ml_get((linenr_T)(curwin->w_cursor.lnum + t - 1));
++ #if defined(FEAT_COMMENTS) || defined(PROTO)
++ if (remove_comments)
++ curr += comments[t - 1];
++ #endif
+ if (insert_space && t > 1)
+ curr = skipwhite(curr);
+ currsize = (int)STRLEN(curr);
+***************
+*** 4364,4369 ****
+--- 4489,4498 ----
+
+ theend:
+ vim_free(spaces);
++ #if defined(FEAT_COMMENTS) || defined(PROTO)
++ if (remove_comments)
++ vim_free(comments);
++ #endif
+ return ret;
+ }
+
+***************
+*** 4788,4794 ****
+ (long)-next_leader_len);
+ #endif
+ curwin->w_cursor.lnum--;
+! if (do_join(2, TRUE, FALSE) == FAIL)
+ {
+ beep_flush();
+ break;
+--- 4917,4923 ----
+ (long)-next_leader_len);
+ #endif
+ curwin->w_cursor.lnum--;
+! if (do_join(2, TRUE, FALSE, FALSE) == FAIL)
+ {
+ beep_flush();
+ break;
+***************
+*** 4844,4850 ****
+
+ ptr = ml_get(lnum);
+ if (do_comments)
+! *leader_len = get_leader_len(ptr, leader_flags, FALSE);
+ else
+ *leader_len = 0;
+
+--- 4973,4979 ----
+
+ ptr = ml_get(lnum);
+ if (do_comments)
+! *leader_len = get_leader_len(ptr, leader_flags, FALSE, TRUE);
+ else
+ *leader_len = 0;
+
+*** ../vim-7.3.540/src/option.h 2012-02-20 22:18:22.000000000 +0100
+--- src/option.h 2012-06-06 13:00:29.000000000 +0200
+***************
+*** 104,113 ****
+ #define FO_ONE_LETTER '1'
+ #define FO_WHITE_PAR 'w' /* trailing white space continues paragr. */
+ #define FO_AUTO 'a' /* automatic formatting */
+
+ #define DFLT_FO_VI "vt"
+ #define DFLT_FO_VIM "tcq"
+! #define FO_ALL "tcroq2vlb1mMBn,aw" /* for do_set() */
+
+ /* characters for the p_cpo option: */
+ #define CPO_ALTREAD 'a' /* ":read" sets alternate file name */
+--- 104,114 ----
+ #define FO_ONE_LETTER '1'
+ #define FO_WHITE_PAR 'w' /* trailing white space continues paragr. */
+ #define FO_AUTO 'a' /* automatic formatting */
++ #define FO_REMOVE_COMS 'j' /* remove comment leaders when joining lines */
+
+ #define DFLT_FO_VI "vt"
+ #define DFLT_FO_VIM "tcq"
+! #define FO_ALL "tcroq2vlb1mMBn,awj" /* for do_set() */
+
+ /* characters for the p_cpo option: */
+ #define CPO_ALTREAD 'a' /* ":read" sets alternate file name */
+*** ../vim-7.3.540/src/proto/misc1.pro 2010-08-15 21:57:28.000000000 +0200
+--- src/proto/misc1.pro 2012-06-06 13:00:29.000000000 +0200
+***************
+*** 6,12 ****
+ int set_indent __ARGS((int size, int flags));
+ int get_number_indent __ARGS((linenr_T lnum));
+ int open_line __ARGS((int dir, int flags, int old_indent));
+! int get_leader_len __ARGS((char_u *line, char_u **flags, int backward));
+ int plines __ARGS((linenr_T lnum));
+ int plines_win __ARGS((win_T *wp, linenr_T lnum, int winheight));
+ int plines_nofill __ARGS((linenr_T lnum));
+--- 6,13 ----
+ int set_indent __ARGS((int size, int flags));
+ int get_number_indent __ARGS((linenr_T lnum));
+ int open_line __ARGS((int dir, int flags, int old_indent));
+! int get_leader_len __ARGS((char_u *line, char_u **flags, int backward, int do_skip_space));
+! int get_last_leader_offset __ARGS((char_u *line, char_u **flags));
+ int plines __ARGS((linenr_T lnum));
+ int plines_win __ARGS((win_T *wp, linenr_T lnum, int winheight));
+ int plines_nofill __ARGS((linenr_T lnum));
+*** ../vim-7.3.540/src/proto/ops.pro 2010-08-15 21:57:28.000000000 +0200
+--- src/proto/ops.pro 2012-06-06 13:00:29.000000000 +0200
+***************
+*** 36,42 ****
+ int preprocs_left __ARGS((void));
+ int get_register_name __ARGS((int num));
+ void ex_display __ARGS((exarg_T *eap));
+! int do_join __ARGS((long count, int insert_space, int save_undo));
+ void op_format __ARGS((oparg_T *oap, int keep_cursor));
+ void op_formatexpr __ARGS((oparg_T *oap));
+ int fex_format __ARGS((linenr_T lnum, long count, int c));
+--- 36,42 ----
+ int preprocs_left __ARGS((void));
+ int get_register_name __ARGS((int num));
+ void ex_display __ARGS((exarg_T *eap));
+! int do_join __ARGS((long count, int insert_space, int save_undo, int use_formatoptions));
+ void op_format __ARGS((oparg_T *oap, int keep_cursor));
+ void op_formatexpr __ARGS((oparg_T *oap));
+ int fex_format __ARGS((linenr_T lnum, long count, int c));
+*** ../vim-7.3.540/src/search.c 2012-02-04 23:34:57.000000000 +0100
+--- src/search.c 2012-06-06 13:00:29.000000000 +0200
+***************
+*** 1548,1554 ****
+ int len;
+ int stop = TRUE;
+ #ifdef FEAT_MBYTE
+! static char_u bytes[MB_MAXBYTES];
+ static int bytelen = 1; /* >1 for multi-byte char */
+ #endif
+
+--- 1548,1554 ----
+ int len;
+ int stop = TRUE;
+ #ifdef FEAT_MBYTE
+! static char_u bytes[MB_MAXBYTES + 1];
+ static int bytelen = 1; /* >1 for multi-byte char */
+ #endif
+
+***************
+*** 4901,4907 ****
+ #ifdef FEAT_COMMENTS
+ if ((*line != '#' ||
+ STRNCMP(skipwhite(line + 1), "define", 6) != 0)
+! && get_leader_len(line, NULL, FALSE))
+ matched = FALSE;
+
+ /*
+--- 4901,4907 ----
+ #ifdef FEAT_COMMENTS
+ if ((*line != '#' ||
+ STRNCMP(skipwhite(line + 1), "define", 6) != 0)
+! && get_leader_len(line, NULL, FALSE, TRUE))
+ matched = FALSE;
+
+ /*
+*** ../vim-7.3.540/src/testdir/test29.in 2010-08-15 21:57:29.000000000 +0200
+--- src/testdir/test29.in 2012-06-06 15:44:38.000000000 +0200
+***************
+*** 4,19 ****
+ and with 'cpoptions' flag 'j' set or not
+
+ STARTTEST
+ :set nocompatible viminfo+=nviminfo
+ :set nojoinspaces
+ :set cpoptions-=j
+ /firstline/
+! j"tdGpJjJjJjJjJjJjJjJjJjJjJjJjJjJj05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions+=j
+ j05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions-=j joinspaces
+ j"tpJjJjJjJjJjJjJjJjJjJjJjJjJjJj05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions+=j
+ j05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions-=j nojoinspaces compatible
+! j"tpJjJjJjJjJjJjJjJjJjJjJjJjJjJj4Jy3l$pjdG:?firstline?+1,$w! test.out
+! :qa!
+ ENDTEST
+
+ firstline
+--- 4,20 ----
+ and with 'cpoptions' flag 'j' set or not
+
+ STARTTEST
++ :so small.vim
+ :set nocompatible viminfo+=nviminfo
+ :set nojoinspaces
+ :set cpoptions-=j
+ /firstline/
+! j"td/^STARTTEST/-1
+! PJjJjJjJjJjJjJjJjJjJjJjJjJjJj05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions+=j
+ j05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions-=j joinspaces
+ j"tpJjJjJjJjJjJjJjJjJjJjJjJjJjJj05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions+=j
+ j05lmx2j06lmy2k4Jy3l$p`xyl$p`yy2l$p:set cpoptions-=j nojoinspaces compatible
+! j"tpJjJjJjJjJjJjJjJjJjJjJjJjJjJj4Jy3l$pjd/STARTTEST/-2
+ ENDTEST
+
+ firstline
+***************
+*** 54,56 ****
+--- 55,181 ----
+ hjkl iop!
+ ert
+
++ STARTTEST
++ /^{/+1
++ :set comments=s1:/*,mb:*,ex:*/,://
++ :set nojoinspaces fo=j
++ :set backspace=eol,start
++ :.,+3join
++ j4J
++ :.,+2join
++ j3J
++ :.,+2join
++ j3J
++ :.,+2join
++ jj3J
++ ENDTEST
++
++ {
++
++ /*
++ * Make sure the previous comment leader is not removed.
++ */
++
++ /*
++ * Make sure the previous comment leader is not removed.
++ */
++
++ // Should the next comment leader be left alone?
++ // Yes.
++
++ // Should the next comment leader be left alone?
++ // Yes.
++
++ /* Here the comment leader should be left intact. */
++ // And so should this one.
++
++ /* Here the comment leader should be left intact. */
++ // And so should this one.
++
++ if (condition) // Remove the next comment leader!
++ // OK, I will.
++ action();
++
++ if (condition) // Remove the next comment leader!
++ // OK, I will.
++ action();
++ }
++
++ STARTTEST
++ /^{/+1
++ :set comments=s1:/*,mb:*,ex:*/,://
++ :set comments+=s1:>#,mb:#,ex:#<,:<
++ :set cpoptions-=j joinspaces fo=j
++ :set backspace=eol,start
++ :.,+3join
++ j4J
++ :.,+2join
++ j3J
++ :.,+2join
++ j3J
++ :.,+2join
++ jj3J
++ j:.,+2join
++ jj3J
++ j:.,+5join
++ j6J
++ oSome code!\r// Make sure backspacing does not remove this comment leader.\e0i\b\e
++ ENDTEST
++
++ {
++
++ /*
++ * Make sure the previous comment leader is not removed.
++ */
++
++ /*
++ * Make sure the previous comment leader is not removed.
++ */
++
++ // Should the next comment leader be left alone?
++ // Yes.
++
++ // Should the next comment leader be left alone?
++ // Yes.
++
++ /* Here the comment leader should be left intact. */
++ // And so should this one.
++
++ /* Here the comment leader should be left intact. */
++ // And so should this one.
++
++ if (condition) // Remove the next comment leader!
++ // OK, I will.
++ action();
++
++ if (condition) // Remove the next comment leader!
++ // OK, I will.
++ action();
++
++ int i = 7 /* foo *// 3
++ // comment
++ ;
++
++ int i = 7 /* foo *// 3
++ // comment
++ ;
++
++ ># 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.
++
++ ># 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.
++
++ }
++
++ STARTTEST
++ :g/^STARTTEST/.,/^ENDTEST/d
++ :?firstline?+1,$w! test.out
++ :qa!
++ ENDTEST
+*** ../vim-7.3.540/src/testdir/test29.ok 2010-08-15 21:57:29.000000000 +0200
+--- src/testdir/test29.ok 2012-06-06 13:00:29.000000000 +0200
+***************
+*** 47,49 ****
+--- 47,86 ----
+ asdfasdf asdf
+ asdfasdf asdf
+ zx cvn. as dfg? hjkl iop! ert a
++
++
++ {
++ /* Make sure the previous comment leader is not removed. */
++ /* Make sure the previous comment leader is not removed. */
++ // Should the next comment leader be left alone? Yes.
++ // Should the next comment leader be left alone? Yes.
++ /* Here the comment leader should be left intact. */ // And so should this one.
++ /* Here the comment leader should be left intact. */ // And so should this one.
++ if (condition) // Remove the next comment leader! OK, I will.
++ action();
++ if (condition) // Remove the next comment leader! OK, I will.
++ action();
++ }
++
++
++ {
++ /* Make sure the previous comment leader is not removed. */
++ /* Make sure the previous comment leader is not removed. */
++ // Should the next comment leader be left alone? Yes.
++ // Should the next comment leader be left alone? Yes.
++ /* Here the comment leader should be left intact. */ // And so should this one.
++ /* Here the comment leader should be left intact. */ // And so should this one.
++ if (condition) // Remove the next comment leader! OK, I will.
++ action();
++ if (condition) // Remove the next comment leader! OK, I will.
++ action();
++ int i = 7 /* foo *// 3 // comment
++ ;
++ int i = 7 /* foo *// 3 // comment
++ ;
++ ># 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.
++ ># 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.
++
++ Some code!// Make sure backspacing does not remove this comment leader.
++ }
++
+*** ../vim-7.3.540/src/version.c 2012-06-06 12:06:10.000000000 +0200
+--- src/version.c 2012-06-06 16:10:03.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 541,
+ /**/
+
+--
+I have a drinking problem -- I don't have a drink!
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.542
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.542 (after 7.3.506)
+Problem: Function is sometimes unused.
+Solution: Add #ifdef.
+Files: src/gui_gtk.c
+
+
+*** ../vim-7.3.541/src/gui_gtk.c 2012-04-25 17:10:12.000000000 +0200
+--- src/gui_gtk.c 2012-06-06 15:25:12.000000000 +0200
+***************
+*** 90,100 ****
+--- 90,102 ----
+ static void entry_activate_cb(GtkWidget *widget, gpointer data);
+ static void entry_changed_cb(GtkWidget *entry, GtkWidget *dialog);
+ static void find_replace_cb(GtkWidget *widget, gpointer data);
++ #if defined(FEAT_BROWSE) || defined(PROTO)
+ static void recent_func_log_func(
+ const gchar *log_domain,
+ GLogLevelFlags log_level,
+ const gchar *message,
+ gpointer user_data);
++ #endif
+
+ #if defined(FEAT_TOOLBAR)
+ /*
+***************
+*** 1896,1901 ****
+--- 1898,1904 ----
+ do_cmdline_cmd((char_u *)"emenu ToolBar.FindHelp");
+ }
+
++ #if defined(FEAT_BROWSE) || defined(PROTO)
+ static void
+ recent_func_log_func(const gchar *log_domain UNUSED,
+ GLogLevelFlags log_level UNUSED,
+***************
+*** 1905,1908 ****
+ /* We just want to suppress the warnings. */
+ /* http://bugzilla.gnome.org/show_bug.cgi?id=664587 */
+ }
+!
+--- 1908,1911 ----
+ /* We just want to suppress the warnings. */
+ /* http://bugzilla.gnome.org/show_bug.cgi?id=664587 */
+ }
+! #endif
+*** ../vim-7.3.541/src/version.c 2012-06-06 16:12:54.000000000 +0200
+--- src/version.c 2012-06-06 16:14:17.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 542,
+ /**/
+
+--
+How To Keep A Healthy Level Of Insanity:
+1. At lunch time, sit in your parked car with sunglasses on and point
+ a hair dryer at passing cars. See if they slow down.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.543
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.543
+Problem: The cursor is in the wrong line after using ":copen". (John
+ Beckett)
+Solution: Invoke more drastic redraw method.
+Files: src/eval.c
+
+
+*** ../vim-7.3.542/src/eval.c 2012-06-01 15:20:49.000000000 +0200
+--- src/eval.c 2012-06-06 16:28:11.000000000 +0200
+***************
+*** 18507,18515 ****
+ curwin->w_skipcol = get_dict_number(dict, (char_u *)"skipcol");
+
+ check_cursor();
+! changed_cline_bef_curs();
+! invalidate_botline();
+! redraw_later(VALID);
+
+ if (curwin->w_topline == 0)
+ curwin->w_topline = 1;
+--- 18507,18513 ----
+ curwin->w_skipcol = get_dict_number(dict, (char_u *)"skipcol");
+
+ check_cursor();
+! changed_window_setting();
+
+ if (curwin->w_topline == 0)
+ curwin->w_topline = 1;
+*** ../vim-7.3.542/src/version.c 2012-06-06 16:14:36.000000000 +0200
+--- src/version.c 2012-06-06 16:28:16.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 543,
+ /**/
+
+--
+How To Keep A Healthy Level Of Insanity:
+2. Page yourself over the intercom. Don't disguise your voice.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.544
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.544
+Problem: There is no good way to close a quickfix window when closing the
+ last ordinary window.
+Solution: Add the QuitPre autocommand.
+Files: src/ex_docmd.c, src/fileio.c, src/vim.h
+
+
+*** ../vim-7.3.543/src/ex_docmd.c 2012-06-06 16:12:54.000000000 +0200
+--- src/ex_docmd.c 2012-06-06 17:58:41.000000000 +0200
+***************
+*** 6458,6463 ****
+--- 6458,6464 ----
+ return;
+ }
+ #ifdef FEAT_AUTOCMD
++ apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf);
+ if (curbuf_locked())
+ return;
+ #endif
+*** ../vim-7.3.543/src/fileio.c 2012-04-30 17:04:47.000000000 +0200
+--- src/fileio.c 2012-06-06 17:32:12.000000000 +0200
+***************
+*** 7678,7683 ****
+--- 7678,7684 ----
+ {"MenuPopup", EVENT_MENUPOPUP},
+ {"QuickFixCmdPost", EVENT_QUICKFIXCMDPOST},
+ {"QuickFixCmdPre", EVENT_QUICKFIXCMDPRE},
++ {"QuitPre", EVENT_QUITPRE},
+ {"RemoteReply", EVENT_REMOTEREPLY},
+ {"SessionLoadPost", EVENT_SESSIONLOADPOST},
+ {"ShellCmdPost", EVENT_SHELLCMDPOST},
+*** ../vim-7.3.543/src/vim.h 2012-06-01 15:20:49.000000000 +0200
+--- src/vim.h 2012-06-06 17:30:01.000000000 +0200
+***************
+*** 1264,1271 ****
+ EVENT_INSERTENTER, /* when entering Insert mode */
+ EVENT_INSERTLEAVE, /* when leaving Insert mode */
+ EVENT_MENUPOPUP, /* just before popup menu is displayed */
+! EVENT_QUICKFIXCMDPOST, /* after :make, :grep etc */
+! EVENT_QUICKFIXCMDPRE, /* before :make, :grep etc */
+ EVENT_SESSIONLOADPOST, /* after loading a session file */
+ EVENT_STDINREADPOST, /* after reading from stdin */
+ EVENT_STDINREADPRE, /* before reading from stdin */
+--- 1264,1272 ----
+ EVENT_INSERTENTER, /* when entering Insert mode */
+ EVENT_INSERTLEAVE, /* when leaving Insert mode */
+ EVENT_MENUPOPUP, /* just before popup menu is displayed */
+! EVENT_QUICKFIXCMDPOST, /* after :make, :grep etc. */
+! EVENT_QUICKFIXCMDPRE, /* before :make, :grep etc. */
+! EVENT_QUITPRE, /* before :quit */
+ EVENT_SESSIONLOADPOST, /* after loading a session file */
+ EVENT_STDINREADPOST, /* after reading from stdin */
+ EVENT_STDINREADPRE, /* before reading from stdin */
+*** ../vim-7.3.543/src/version.c 2012-06-06 16:29:06.000000000 +0200
+--- src/version.c 2012-06-06 18:02:09.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 544,
+ /**/
+
+--
+How To Keep A Healthy Level Of Insanity:
+3. Every time someone asks you to do something, ask if they want fries
+ with that.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.545
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.545
+Problem: When closing a window or buffer autocommands may close it too,
+ causing problems for where the autocommand was invoked from.
+Solution: Add the w_closing and b_closing flags. When set disallow ":q" and
+ ":close" to prevent recursive closing.
+Files: src/structs.h, src/buffer.c, src/ex_docmd.c, src/window.c
+
+
+*** ../vim-7.3.544/src/structs.h 2012-02-04 21:57:44.000000000 +0100
+--- src/structs.h 2012-06-06 16:43:34.000000000 +0200
+***************
+*** 1201,1206 ****
+--- 1201,1210 ----
+ typedef struct qf_info_S qf_info_T;
+ #endif
+
++ /*
++ * These are items normally related to a buffer. But when using ":ownsyntax"
++ * a window may have its own instance.
++ */
+ typedef struct {
+ #ifdef FEAT_SYN_HL
+ hashtab_T b_keywtab; /* syntax keywords hash table */
+***************
+*** 1290,1295 ****
+--- 1294,1303 ----
+ int b_nwindows; /* nr of windows open on this buffer */
+
+ int b_flags; /* various BF_ flags */
++ #ifdef FEAT_AUTOCMD
++ int b_closing; /* buffer is being closed, don't let
++ autocommands close it too. */
++ #endif
+
+ /*
+ * b_ffname has the full path of the file (NULL for no name).
+***************
+*** 1853,1858 ****
+--- 1861,1870 ----
+ win_T *w_prev; /* link to previous window */
+ win_T *w_next; /* link to next window */
+ #endif
++ #ifdef FEAT_AUTOCMD
++ int w_closing; /* window is being closed, don't let
++ autocommands close it too. */
++ #endif
+
+ frame_T *w_frame; /* frame containing this window */
+
+*** ../vim-7.3.544/src/buffer.c 2012-03-16 14:32:10.000000000 +0100
+--- src/buffer.c 2012-06-06 18:57:27.000000000 +0200
+***************
+*** 377,404 ****
+ /* When the buffer is no longer in a window, trigger BufWinLeave */
+ if (buf->b_nwindows == 1)
+ {
+ apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname, buf->b_fname,
+ FALSE, buf);
+! /* Return if autocommands deleted the buffer or made it the only one. */
+! if (!buf_valid(buf) || (abort_if_last && one_window()))
+ {
+ EMSG(_(e_auabort));
+ return;
+ }
+
+ /* When the buffer becomes hidden, but is not unloaded, trigger
+ * BufHidden */
+ if (!unload_buf)
+ {
+ apply_autocmds(EVENT_BUFHIDDEN, buf->b_fname, buf->b_fname,
+ FALSE, buf);
+! /* Return if autocommands deleted the buffer or made it the only
+! * one. */
+! if (!buf_valid(buf) || (abort_if_last && one_window()))
+! {
+! EMSG(_(e_auabort));
+! return;
+! }
+ }
+ # ifdef FEAT_EVAL
+ if (aborting()) /* autocmds may abort script processing */
+--- 377,411 ----
+ /* When the buffer is no longer in a window, trigger BufWinLeave */
+ if (buf->b_nwindows == 1)
+ {
++ buf->b_closing = TRUE;
+ apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname, buf->b_fname,
+ FALSE, buf);
+! if (!buf_valid(buf))
+ {
++ /* Autocommands deleted the buffer. */
++ aucmd_abort:
+ EMSG(_(e_auabort));
+ return;
+ }
++ buf->b_closing = FALSE;
++ if (abort_if_last && one_window())
++ /* Autocommands made this the only window. */
++ goto aucmd_abort;
+
+ /* When the buffer becomes hidden, but is not unloaded, trigger
+ * BufHidden */
+ if (!unload_buf)
+ {
++ buf->b_closing = TRUE;
+ apply_autocmds(EVENT_BUFHIDDEN, buf->b_fname, buf->b_fname,
+ FALSE, buf);
+! if (!buf_valid(buf))
+! /* Autocommands deleted the buffer. */
+! goto aucmd_abort;
+! buf->b_closing = FALSE;
+! if (abort_if_last && one_window())
+! /* Autocommands made this the only window. */
+! goto aucmd_abort;
+ }
+ # ifdef FEAT_EVAL
+ if (aborting()) /* autocmds may abort script processing */
+***************
+*** 552,557 ****
+--- 559,565 ----
+ #ifdef FEAT_AUTOCMD
+ int is_curbuf = (buf == curbuf);
+
++ buf->b_closing = TRUE;
+ apply_autocmds(EVENT_BUFUNLOAD, buf->b_fname, buf->b_fname, FALSE, buf);
+ if (!buf_valid(buf)) /* autocommands may delete the buffer */
+ return;
+***************
+*** 568,573 ****
+--- 576,582 ----
+ if (!buf_valid(buf)) /* autocommands may delete the buffer */
+ return;
+ }
++ buf->b_closing = FALSE;
+ # ifdef FEAT_EVAL
+ if (aborting()) /* autocmds may abort script processing */
+ return;
+***************
+*** 1150,1155 ****
+--- 1159,1167 ----
+ * a window with this buffer.
+ */
+ while (buf == curbuf
++ # ifdef FEAT_AUTOCMD
++ && !(curwin->w_closing || curwin->w_buffer->b_closing)
++ # endif
+ && (firstwin != lastwin || first_tabpage->tp_next != NULL))
+ win_close(curwin, FALSE);
+ #endif
+***************
+*** 4750,4756 ****
+ #ifdef FEAT_WINDOWS
+ || (had_tab > 0 && wp != firstwin)
+ #endif
+! ) && firstwin != lastwin)
+ {
+ win_close(wp, FALSE);
+ #ifdef FEAT_AUTOCMD
+--- 4762,4772 ----
+ #ifdef FEAT_WINDOWS
+ || (had_tab > 0 && wp != firstwin)
+ #endif
+! ) && firstwin != lastwin
+! #ifdef FEAT_AUTOCMD
+! && !(wp->w_closing || wp->w_buffer->b_closing)
+! #endif
+! )
+ {
+ win_close(wp, FALSE);
+ #ifdef FEAT_AUTOCMD
+*** ../vim-7.3.544/src/ex_docmd.c 2012-06-06 18:03:01.000000000 +0200
+--- src/ex_docmd.c 2012-06-06 18:06:46.000000000 +0200
+***************
+*** 6459,6465 ****
+ }
+ #ifdef FEAT_AUTOCMD
+ apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf);
+! if (curbuf_locked())
+ return;
+ #endif
+
+--- 6459,6467 ----
+ }
+ #ifdef FEAT_AUTOCMD
+ apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf);
+! /* Refuse to quick when locked or when the buffer in the last window is
+! * being closed (can only happen in autocommands). */
+! if (curbuf_locked() || (curbuf->b_nwindows == 1 && curbuf->b_closing))
+ return;
+ #endif
+
+*** ../vim-7.3.544/src/window.c 2012-05-25 12:38:57.000000000 +0200
+--- src/window.c 2012-06-06 18:47:19.000000000 +0200
+***************
+*** 2034,2040 ****
+
+ for (wp = firstwin; wp != NULL && lastwin != firstwin; )
+ {
+! if (wp->w_buffer == buf && (!keep_curwin || wp != curwin))
+ {
+ win_close(wp, FALSE);
+
+--- 2034,2044 ----
+
+ for (wp = firstwin; wp != NULL && lastwin != firstwin; )
+ {
+! if (wp->w_buffer == buf && (!keep_curwin || wp != curwin)
+! #ifdef FEAT_AUTOCMD
+! && !(wp->w_closing || wp->w_buffer->b_closing)
+! #endif
+! )
+ {
+ win_close(wp, FALSE);
+
+***************
+*** 2051,2057 ****
+ nexttp = tp->tp_next;
+ if (tp != curtab)
+ for (wp = tp->tp_firstwin; wp != NULL; wp = wp->w_next)
+! if (wp->w_buffer == buf)
+ {
+ win_close_othertab(wp, FALSE, tp);
+
+--- 2055,2065 ----
+ nexttp = tp->tp_next;
+ if (tp != curtab)
+ for (wp = tp->tp_firstwin; wp != NULL; wp = wp->w_next)
+! if (wp->w_buffer == buf
+! #ifdef FEAT_AUTOCMD
+! && !(wp->w_closing || wp->w_buffer->b_closing)
+! #endif
+! )
+ {
+ win_close_othertab(wp, FALSE, tp);
+
+***************
+*** 2168,2173 ****
+--- 2176,2183 ----
+ }
+
+ #ifdef FEAT_AUTOCMD
++ if (win->w_closing || win->w_buffer->b_closing)
++ return; /* window is already being closed */
+ if (win == aucmd_win)
+ {
+ EMSG(_("E813: Cannot close autocmd window"));
+***************
+*** 2203,2219 ****
+ wp = frame2win(win_altframe(win, NULL));
+
+ /*
+! * Be careful: If autocommands delete the window, return now.
+ */
+ if (wp->w_buffer != curbuf)
+ {
+ other_buffer = TRUE;
+ apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf);
+! if (!win_valid(win) || last_window())
+ return;
+ }
+ apply_autocmds(EVENT_WINLEAVE, NULL, NULL, FALSE, curbuf);
+! if (!win_valid(win) || last_window())
+ return;
+ # ifdef FEAT_EVAL
+ /* autocmds may abort script processing */
+--- 2213,2238 ----
+ wp = frame2win(win_altframe(win, NULL));
+
+ /*
+! * Be careful: If autocommands delete the window or cause this window
+! * to be the last one left, return now.
+ */
+ if (wp->w_buffer != curbuf)
+ {
+ other_buffer = TRUE;
++ win->w_closing = TRUE;
+ apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf);
+! if (!win_valid(win))
+! return;
+! win->w_closing = FALSE;
+! if (last_window())
+ return;
+ }
++ win->w_closing = TRUE;
+ apply_autocmds(EVENT_WINLEAVE, NULL, NULL, FALSE, curbuf);
+! if (!win_valid(win))
+! return;
+! win->w_closing = FALSE;
+! if (last_window())
+ return;
+ # ifdef FEAT_EVAL
+ /* autocmds may abort script processing */
+***************
+*** 2240,2246 ****
+ * Close the link to the buffer.
+ */
+ if (win->w_buffer != NULL)
+! close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, TRUE);
+
+ /* Autocommands may have closed the window already, or closed the only
+ * other window or moved to another tab page. */
+--- 2259,2274 ----
+ * Close the link to the buffer.
+ */
+ if (win->w_buffer != NULL)
+! {
+! #ifdef FEAT_AUTOCMD
+! win->w_closing = TRUE;
+! #endif
+! close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, FALSE);
+! #ifdef FEAT_AUTOCMD
+! if (win_valid(win))
+! win->w_closing = FALSE;
+! #endif
+! }
+
+ /* Autocommands may have closed the window already, or closed the only
+ * other window or moved to another tab page. */
+***************
+*** 2346,2351 ****
+--- 2374,2384 ----
+ tabpage_T *ptp = NULL;
+ int free_tp = FALSE;
+
++ #ifdef FEAT_AUTOCMD
++ if (win->w_closing || win->w_buffer->b_closing)
++ return; /* window is already being closed */
++ #endif
++
+ /* Close the link to the buffer. */
+ close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, FALSE);
+
+*** ../vim-7.3.544/src/version.c 2012-06-06 18:03:01.000000000 +0200
+--- src/version.c 2012-06-06 18:53:06.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 545,
+ /**/
+
+--
+How To Keep A Healthy Level Of Insanity:
+4. Put your garbage can on your desk and label it "in".
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.546
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.546
+Problem: Bogus line break.
+Solution: Remove the line break.
+Files: src/screen.c
+
+
+*** ../vim-7.3.545/src/screen.c 2012-06-01 15:20:49.000000000 +0200
+--- src/screen.c 2012-06-01 16:31:30.000000000 +0200
+***************
+*** 3228,3235 ****
+ /* no bad word found at line start, don't check until end of a
+ * word */
+ spell_hlf = HLF_COUNT;
+! word_end = (int)(spell_to_word_end(ptr, wp)
+! - line + 1);
+ }
+ else
+ {
+--- 3228,3234 ----
+ /* no bad word found at line start, don't check until end of a
+ * word */
+ spell_hlf = HLF_COUNT;
+! word_end = (int)(spell_to_word_end(ptr, wp) - line + 1);
+ }
+ else
+ {
+*** ../vim-7.3.545/src/version.c 2012-06-06 19:02:40.000000000 +0200
+--- src/version.c 2012-06-06 19:05:11.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 546,
+ /**/
+
+--
+How To Keep A Healthy Level Of Insanity:
+5. Put decaf in the coffee maker for 3 weeks. Once everyone has gotten
+ over their caffeine addictions, switch to espresso.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.547
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.547 (after 7.3.541)
+Problem: Compiler warning for uninitialized variable.
+Solution: Initialize it.
+Files: src/ops.c
+
+
+*** ../vim-7.3.546/src/ops.c 2012-06-06 16:12:54.000000000 +0200
+--- src/ops.c 2012-06-06 23:06:45.000000000 +0200
+***************
+*** 4306,4312 ****
+ colnr_T col = 0;
+ int ret = OK;
+ #if defined(FEAT_COMMENTS) || defined(PROTO)
+! int *comments;
+ int remove_comments = (use_formatoptions == TRUE)
+ && has_format_option(FO_REMOVE_COMS);
+ int prev_was_comment;
+--- 4306,4312 ----
+ colnr_T col = 0;
+ int ret = OK;
+ #if defined(FEAT_COMMENTS) || defined(PROTO)
+! int *comments = NULL;
+ int remove_comments = (use_formatoptions == TRUE)
+ && has_format_option(FO_REMOVE_COMS);
+ int prev_was_comment;
+*** ../vim-7.3.546/src/version.c 2012-06-06 19:05:45.000000000 +0200
+--- src/version.c 2012-06-06 23:07:26.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 547,
+ /**/
+
+--
+How To Keep A Healthy Level Of Insanity:
+9. As often as possible, skip rather than walk.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.548
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.548
+Problem: Compiler warning on 64 bit Windows.
+Solution: Add type cast. (Mike Williams)
+Files: src/ops.c
+
+
+*** ../vim-7.3.547/src/ops.c 2012-06-06 23:08:33.000000000 +0200
+--- src/ops.c 2012-06-07 21:07:57.000000000 +0200
+***************
+*** 4352,4358 ****
+
+ char_u *new_curr = skip_comment(curr, TRUE, insert_space,
+ &prev_was_comment);
+! comments[t] = new_curr - curr;
+ curr = new_curr;
+ }
+ else
+--- 4352,4358 ----
+
+ char_u *new_curr = skip_comment(curr, TRUE, insert_space,
+ &prev_was_comment);
+! comments[t] = (int)(new_curr - curr);
+ curr = new_curr;
+ }
+ else
+*** ../vim-7.3.547/src/version.c 2012-06-06 23:08:33.000000000 +0200
+--- src/version.c 2012-06-07 21:08:35.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 548,
+ /**/
+
+--
+How To Keep A Healthy Level Of Insanity:
+17. When the money comes out the ATM, scream "I won!, I won! 3rd
+ time this week!!!!!"
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.549
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.549
+Problem: In 'cinoptions' "0s" is interpreted as one shiftwidth. (David
+ Pineau)
+Solution: Use the zero as zero. (Lech Lorens)
+Files: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok
+
+
+*** ../vim-7.3.548/src/misc1.c 2012-06-06 16:12:54.000000000 +0200
+--- src/misc1.c 2012-06-13 13:17:11.000000000 +0200
+***************
+*** 6635,6640 ****
+--- 6635,6641 ----
+ int whilelevel;
+ linenr_T lnum;
+ char_u *options;
++ char_u *digits;
+ int fraction = 0; /* init for GCC */
+ int divider;
+ int n;
+***************
+*** 6650,6655 ****
+--- 6651,6657 ----
+ l = options++;
+ if (*options == '-')
+ ++options;
++ digits = options; /* remember where the digits start */
+ n = getdigits(&options);
+ divider = 0;
+ if (*options == '.') /* ".5s" means a fraction */
+***************
+*** 6666,6672 ****
+ }
+ if (*options == 's') /* "2s" means two times 'shiftwidth' */
+ {
+! if (n == 0 && fraction == 0)
+ n = curbuf->b_p_sw; /* just "s" is one 'shiftwidth' */
+ else
+ {
+--- 6668,6674 ----
+ }
+ if (*options == 's') /* "2s" means two times 'shiftwidth' */
+ {
+! if (options == digits)
+ n = curbuf->b_p_sw; /* just "s" is one 'shiftwidth' */
+ else
+ {
+*** ../vim-7.3.548/src/testdir/test3.in 2012-04-05 17:17:38.000000000 +0200
+--- src/testdir/test3.in 2012-06-13 13:17:31.000000000 +0200
+***************
+*** 977,982 ****
+--- 977,1000 ----
+
+ STARTTEST
+ :set cin
++ :set cino=es,n0s
++ /main
++ =][
++ ENDTEST
++
++ main(void)
++ {
++ /* Make sure that cino=X0s is not parsed like cino=Xs. */
++ if (cond)
++ foo();
++ else
++ {
++ bar();
++ }
++ }
++
++ STARTTEST
++ :set cin
+ :set cino=
+ ]]=][
+ ENDTEST
+*** ../vim-7.3.548/src/testdir/test3.ok 2012-04-05 17:17:38.000000000 +0200
+--- src/testdir/test3.ok 2012-06-13 13:17:31.000000000 +0200
+***************
+*** 940,945 ****
+--- 940,957 ----
+ }
+
+
++ main(void)
++ {
++ /* Make sure that cino=X0s is not parsed like cino=Xs. */
++ if (cond)
++ foo();
++ else
++ {
++ bar();
++ }
++ }
++
++
+ {
+ do
+ {
+*** ../vim-7.3.548/src/version.c 2012-06-07 21:09:35.000000000 +0200
+--- src/version.c 2012-06-13 13:37:18.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 549,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+29. Your phone bill comes to your doorstep in a box.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.550
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.550 (after 7.3.541)
+Problem: With "j" in 'formatoptions' a list leader is not removed. (Gary
+ Johnson)
+Solution: Don't ignore the start of a three part comment. (Lech Lorens)
+Files: src/ops.c, src/testdir/test29.in, src/testdir/test29.ok
+
+
+*** ../vim-7.3.549/src/ops.c 2012-06-07 21:09:35.000000000 +0200
+--- src/ops.c 2012-06-13 13:48:26.000000000 +0200
+***************
+*** 4250,4264 ****
+ return line;
+
+ /* Find:
+- * - COM_START,
+ * - COM_END,
+ * - colon,
+ * whichever comes first.
+ */
+ while (*comment_flags)
+ {
+! if (*comment_flags == COM_START
+! || *comment_flags == COM_END
+ || *comment_flags == ':')
+ {
+ break;
+--- 4250,4262 ----
+ return line;
+
+ /* Find:
+ * - COM_END,
+ * - colon,
+ * whichever comes first.
+ */
+ while (*comment_flags)
+ {
+! if (*comment_flags == COM_END
+ || *comment_flags == ':')
+ {
+ break;
+***************
+*** 4267,4275 ****
+ }
+
+ /* If we found a colon, it means that we are not processing a line
+! * starting with an opening or a closing part of a three-part
+! * comment. That's good, because we don't want to remove those as
+! * this would be annoying.
+ */
+ if (*comment_flags == ':' || *comment_flags == NUL)
+ line += lead_len;
+--- 4265,4272 ----
+ }
+
+ /* If we found a colon, it means that we are not processing a line
+! * starting with a closing part of a three-part comment. That's good,
+! * because we don't want to remove those as this would be annoying.
+ */
+ if (*comment_flags == ':' || *comment_flags == NUL)
+ line += lead_len;
+*** ../vim-7.3.549/src/testdir/test29.in 2012-06-06 16:12:54.000000000 +0200
+--- src/testdir/test29.in 2012-06-13 13:48:26.000000000 +0200
+***************
+*** 103,114 ****
+
+ STARTTEST
+ /^{/+1
+! :set comments=s1:/*,mb:*,ex:*/,://
+ :set comments+=s1:>#,mb:#,ex:#<,:<
+ :set cpoptions-=j joinspaces fo=j
+ :set backspace=eol,start
+ :.,+3join
+ j4J
+ :.,+2join
+ j3J
+ :.,+2join
+--- 103,117 ----
+
+ STARTTEST
+ /^{/+1
+! :set comments=sO:*\ -,mO:*\ \ ,exO:*/
+! :set comments+=s1:/*,mb:*,ex:*/,://
+ :set comments+=s1:>#,mb:#,ex:#<,:<
+ :set cpoptions-=j joinspaces fo=j
+ :set backspace=eol,start
+ :.,+3join
+ j4J
++ :.,+8join
++ j9J
+ :.,+2join
+ j3J
+ :.,+2join
+***************
+*** 132,137 ****
+--- 135,158 ----
+ * Make sure the previous comment leader is not removed.
+ */
+
++ /* List:
++ * - item1
++ * foo bar baz
++ * foo bar baz
++ * - item2
++ * foo bar baz
++ * foo bar baz
++ */
++
++ /* List:
++ * - item1
++ * foo bar baz
++ * foo bar baz
++ * - item2
++ * foo bar baz
++ * foo bar baz
++ */
++
+ // Should the next comment leader be left alone?
+ // Yes.
+
+*** ../vim-7.3.549/src/testdir/test29.ok 2012-06-06 16:12:54.000000000 +0200
+--- src/testdir/test29.ok 2012-06-13 13:48:26.000000000 +0200
+***************
+*** 66,71 ****
+--- 66,73 ----
+ {
+ /* Make sure the previous comment leader is not removed. */
+ /* Make sure the previous comment leader is not removed. */
++ /* List: item1 foo bar baz foo bar baz item2 foo bar baz foo bar baz */
++ /* List: item1 foo bar baz foo bar baz item2 foo bar baz foo bar baz */
+ // Should the next comment leader be left alone? Yes.
+ // Should the next comment leader be left alone? Yes.
+ /* Here the comment leader should be left intact. */ // And so should this one.
+*** ../vim-7.3.549/src/version.c 2012-06-13 13:40:45.000000000 +0200
+--- src/version.c 2012-06-13 13:50:23.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 550,
+ /**/
+
+--
+If you put 7 of the most talented OSS developers in a room for a week
+and asked them to fix a bug in a spreadsheet program, in 1 week
+you'd have 2 new mail readers and a text-based web browser.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.551
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.551
+Problem: When using :tablose a TabEnter autocommand is triggered too early.
+ (Karthick)
+Solution: Don't trigger *Enter autocommands before closing the tab.
+ (Christian Brabandt)
+Files: src/buffer.c, src/eval.c, src/ex_cmds2.c, src/fileio.c,
+ src/proto/window.pro, src/window.c
+
+
+*** ../vim-7.3.550/src/buffer.c 2012-06-06 19:02:40.000000000 +0200
+--- src/buffer.c 2012-06-13 14:18:58.000000000 +0200
+***************
+*** 4470,4476 ****
+ * When the ":tab" modifier was used do this for all tab pages.
+ */
+ if (had_tab > 0)
+! goto_tabpage_tp(first_tabpage);
+ for (;;)
+ {
+ tpnext = curtab->tp_next;
+--- 4470,4476 ----
+ * When the ":tab" modifier was used do this for all tab pages.
+ */
+ if (had_tab > 0)
+! goto_tabpage_tp(first_tabpage, TRUE);
+ for (;;)
+ {
+ tpnext = curtab->tp_next;
+***************
+*** 4582,4588 ****
+ if (!valid_tabpage(tpnext))
+ tpnext = first_tabpage; /* start all over...*/
+ # endif
+! goto_tabpage_tp(tpnext);
+ }
+
+ /*
+--- 4582,4588 ----
+ if (!valid_tabpage(tpnext))
+ tpnext = first_tabpage; /* start all over...*/
+ # endif
+! goto_tabpage_tp(tpnext, TRUE);
+ }
+
+ /*
+***************
+*** 4686,4698 ****
+ if (last_curtab != new_curtab)
+ {
+ if (valid_tabpage(last_curtab))
+! goto_tabpage_tp(last_curtab);
+ if (win_valid(last_curwin))
+ win_enter(last_curwin, FALSE);
+ }
+ /* to window with first arg */
+ if (valid_tabpage(new_curtab))
+! goto_tabpage_tp(new_curtab);
+ if (win_valid(new_curwin))
+ win_enter(new_curwin, FALSE);
+
+--- 4686,4698 ----
+ if (last_curtab != new_curtab)
+ {
+ if (valid_tabpage(last_curtab))
+! goto_tabpage_tp(last_curtab, TRUE);
+ if (win_valid(last_curwin))
+ win_enter(last_curwin, FALSE);
+ }
+ /* to window with first arg */
+ if (valid_tabpage(new_curtab))
+! goto_tabpage_tp(new_curtab, TRUE);
+ if (win_valid(new_curwin))
+ win_enter(new_curwin, FALSE);
+
+***************
+*** 4744,4750 ****
+ */
+ #ifdef FEAT_WINDOWS
+ if (had_tab > 0)
+! goto_tabpage_tp(first_tabpage);
+ for (;;)
+ {
+ #endif
+--- 4744,4750 ----
+ */
+ #ifdef FEAT_WINDOWS
+ if (had_tab > 0)
+! goto_tabpage_tp(first_tabpage, TRUE);
+ for (;;)
+ {
+ #endif
+***************
+*** 4784,4790 ****
+ /* Without the ":tab" modifier only do the current tab page. */
+ if (had_tab == 0 || tpnext == NULL)
+ break;
+! goto_tabpage_tp(tpnext);
+ }
+ #endif
+
+--- 4784,4790 ----
+ /* Without the ":tab" modifier only do the current tab page. */
+ if (had_tab == 0 || tpnext == NULL)
+ break;
+! goto_tabpage_tp(tpnext, TRUE);
+ }
+ #endif
+
+*** ../vim-7.3.550/src/eval.c 2012-06-06 16:29:06.000000000 +0200
+--- src/eval.c 2012-06-13 14:18:58.000000000 +0200
+***************
+*** 16415,16421 ****
+ if (tp != NULL && varname != NULL && varp != NULL)
+ {
+ save_curtab = curtab;
+! goto_tabpage_tp(tp);
+
+ tabvarname = alloc((unsigned)STRLEN(varname) + 3);
+ if (tabvarname != NULL)
+--- 16415,16421 ----
+ if (tp != NULL && varname != NULL && varp != NULL)
+ {
+ save_curtab = curtab;
+! goto_tabpage_tp(tp, TRUE);
+
+ tabvarname = alloc((unsigned)STRLEN(varname) + 3);
+ if (tabvarname != NULL)
+***************
+*** 16428,16434 ****
+
+ /* Restore current tabpage */
+ if (valid_tabpage(save_curtab))
+! goto_tabpage_tp(save_curtab);
+ }
+ }
+
+--- 16428,16434 ----
+
+ /* Restore current tabpage */
+ if (valid_tabpage(save_curtab))
+! goto_tabpage_tp(save_curtab, TRUE);
+ }
+ }
+
+***************
+*** 16492,16498 ****
+ /* set curwin to be our win, temporarily */
+ save_curwin = curwin;
+ save_curtab = curtab;
+! goto_tabpage_tp(tp);
+ if (!win_valid(win))
+ return;
+ curwin = win;
+--- 16492,16498 ----
+ /* set curwin to be our win, temporarily */
+ save_curwin = curwin;
+ save_curtab = curtab;
+! goto_tabpage_tp(tp, TRUE);
+ if (!win_valid(win))
+ return;
+ curwin = win;
+***************
+*** 16527,16533 ****
+ /* Restore current tabpage and window, if still valid (autocomands can
+ * make them invalid). */
+ if (valid_tabpage(save_curtab))
+! goto_tabpage_tp(save_curtab);
+ if (win_valid(save_curwin))
+ {
+ curwin = save_curwin;
+--- 16527,16533 ----
+ /* Restore current tabpage and window, if still valid (autocomands can
+ * make them invalid). */
+ if (valid_tabpage(save_curtab))
+! goto_tabpage_tp(save_curtab, TRUE);
+ if (win_valid(save_curwin))
+ {
+ curwin = save_curwin;
+*** ../vim-7.3.550/src/ex_cmds2.c 2012-04-25 17:32:14.000000000 +0200
+--- src/ex_cmds2.c 2012-06-13 14:18:58.000000000 +0200
+***************
+*** 2476,2482 ****
+ /* go to window "tp" */
+ if (!valid_tabpage(tp))
+ break;
+! goto_tabpage_tp(tp);
+ tp = tp->tp_next;
+ }
+ #endif
+--- 2476,2482 ----
+ /* go to window "tp" */
+ if (!valid_tabpage(tp))
+ break;
+! goto_tabpage_tp(tp, TRUE);
+ tp = tp->tp_next;
+ }
+ #endif
+*** ../vim-7.3.550/src/fileio.c 2012-06-06 18:03:01.000000000 +0200
+--- src/fileio.c 2012-06-13 14:18:58.000000000 +0200
+***************
+*** 8918,8924 ****
+ if (wp == aucmd_win)
+ {
+ if (tp != curtab)
+! goto_tabpage_tp(tp);
+ win_goto(aucmd_win);
+ goto win_found;
+ }
+--- 8918,8924 ----
+ if (wp == aucmd_win)
+ {
+ if (tp != curtab)
+! goto_tabpage_tp(tp, TRUE);
+ win_goto(aucmd_win);
+ goto win_found;
+ }
+*** ../vim-7.3.550/src/proto/window.pro 2012-02-22 14:58:24.000000000 +0100
+--- src/proto/window.pro 2012-06-13 14:23:06.000000000 +0200
+***************
+*** 27,33 ****
+ tabpage_T *find_tabpage __ARGS((int n));
+ int tabpage_index __ARGS((tabpage_T *ftp));
+ void goto_tabpage __ARGS((int n));
+! void goto_tabpage_tp __ARGS((tabpage_T *tp));
+ void goto_tabpage_win __ARGS((tabpage_T *tp, win_T *wp));
+ void tabpage_move __ARGS((int nr));
+ void win_goto __ARGS((win_T *wp));
+--- 27,33 ----
+ tabpage_T *find_tabpage __ARGS((int n));
+ int tabpage_index __ARGS((tabpage_T *ftp));
+ void goto_tabpage __ARGS((int n));
+! void goto_tabpage_tp __ARGS((tabpage_T *tp, int trigger_autocmds));
+ void goto_tabpage_win __ARGS((tabpage_T *tp, win_T *wp));
+ void tabpage_move __ARGS((int nr));
+ void win_goto __ARGS((win_T *wp));
+*** ../vim-7.3.550/src/window.c 2012-06-06 19:02:40.000000000 +0200
+--- src/window.c 2012-06-13 14:24:38.000000000 +0200
+***************
+*** 45,51 ****
+ #if defined(FEAT_WINDOWS) || defined(PROTO)
+ static tabpage_T *alloc_tabpage __ARGS((void));
+ static int leave_tabpage __ARGS((buf_T *new_curbuf));
+! static void enter_tabpage __ARGS((tabpage_T *tp, buf_T *old_curbuf));
+ static void frame_fix_height __ARGS((win_T *wp));
+ static int frame_minheight __ARGS((frame_T *topfrp, win_T *next_curwin));
+ static void win_enter_ext __ARGS((win_T *wp, int undo_sync, int no_curwin));
+--- 45,51 ----
+ #if defined(FEAT_WINDOWS) || defined(PROTO)
+ static tabpage_T *alloc_tabpage __ARGS((void));
+ static int leave_tabpage __ARGS((buf_T *new_curbuf));
+! static void enter_tabpage __ARGS((tabpage_T *tp, buf_T *old_curbuf, int trigger_autocmds));
+ static void frame_fix_height __ARGS((win_T *wp));
+ static int frame_minheight __ARGS((frame_T *topfrp, win_T *next_curwin));
+ static void win_enter_ext __ARGS((win_T *wp, int undo_sync, int no_curwin));
+***************
+*** 355,365 ****
+ && valid_tabpage(oldtab))
+ {
+ newtab = curtab;
+! goto_tabpage_tp(oldtab);
+ if (curwin == wp)
+ win_close(curwin, FALSE);
+ if (valid_tabpage(newtab))
+! goto_tabpage_tp(newtab);
+ }
+ }
+ break;
+--- 355,365 ----
+ && valid_tabpage(oldtab))
+ {
+ newtab = curtab;
+! goto_tabpage_tp(oldtab, TRUE);
+ if (curwin == wp)
+ win_close(curwin, FALSE);
+ if (valid_tabpage(newtab))
+! goto_tabpage_tp(newtab, TRUE);
+ }
+ }
+ break;
+***************
+*** 2130,2137 ****
+ * page and then close the window and the tab page. This avoids that
+ * curwin and curtab are invalid while we are freeing memory, they may
+ * be used in GUI events.
+ */
+! goto_tabpage_tp(alt_tabpage());
+ redraw_tabline = TRUE;
+
+ /* Safety check: Autocommands may have closed the window when jumping
+--- 2130,2139 ----
+ * page and then close the window and the tab page. This avoids that
+ * curwin and curtab are invalid while we are freeing memory, they may
+ * be used in GUI events.
++ * Don't trigger autocommands yet, they may use wrong values, so do
++ * that below.
+ */
+! goto_tabpage_tp(alt_tabpage(), FALSE);
+ redraw_tabline = TRUE;
+
+ /* Safety check: Autocommands may have closed the window when jumping
+***************
+*** 2144,2149 ****
+--- 2146,2157 ----
+ if (h != tabline_height())
+ shell_new_rows();
+ }
++ /* Since goto_tabpage_tp above did not trigger *Enter autocommands, do
++ * that now. */
++ #ifdef FEAT_AUTOCMD
++ apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf);
++ apply_autocmds(EVENT_WINENTER, NULL, NULL, FALSE, curbuf);
++ #endif
+ return TRUE;
+ }
+ return FALSE;
+***************
+*** 3556,3562 ****
+ }
+
+ /* Failed, get back the previous Tab page */
+! enter_tabpage(curtab, curbuf);
+ return FAIL;
+ }
+
+--- 3564,3570 ----
+ }
+
+ /* Failed, get back the previous Tab page */
+! enter_tabpage(curtab, curbuf, TRUE);
+ return FAIL;
+ }
+
+***************
+*** 3709,3719 ****
+ /*
+ * Start using tab page "tp".
+ * Only to be used after leave_tabpage() or freeing the current tab page.
+ */
+ static void
+! enter_tabpage(tp, old_curbuf)
+ tabpage_T *tp;
+ buf_T *old_curbuf UNUSED;
+ {
+ int old_off = tp->tp_firstwin->w_winrow;
+ win_T *next_prevwin = tp->tp_prevwin;
+--- 3717,3729 ----
+ /*
+ * Start using tab page "tp".
+ * Only to be used after leave_tabpage() or freeing the current tab page.
++ * Only trigger *Enter autocommands when trigger_autocmds is TRUE.
+ */
+ static void
+! enter_tabpage(tp, old_curbuf, trigger_autocmds)
+ tabpage_T *tp;
+ buf_T *old_curbuf UNUSED;
++ int trigger_autocmds;
+ {
+ int old_off = tp->tp_firstwin->w_winrow;
+ win_T *next_prevwin = tp->tp_prevwin;
+***************
+*** 3761,3769 ****
+ #ifdef FEAT_AUTOCMD
+ /* Apply autocommands after updating the display, when 'rows' and
+ * 'columns' have been set correctly. */
+! apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf);
+! if (old_curbuf != curbuf)
+! apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf);
+ #endif
+
+ redraw_all_later(CLEAR);
+--- 3771,3782 ----
+ #ifdef FEAT_AUTOCMD
+ /* Apply autocommands after updating the display, when 'rows' and
+ * 'columns' have been set correctly. */
+! if (trigger_autocmds)
+! {
+! apply_autocmds(EVENT_TABENTER, NULL, NULL, FALSE, curbuf);
+! if (old_curbuf != curbuf)
+! apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf);
+! }
+ #endif
+
+ redraw_all_later(CLEAR);
+***************
+*** 3839,3845 ****
+ }
+ }
+
+! goto_tabpage_tp(tp);
+
+ #ifdef FEAT_GUI_TABLINE
+ if (gui_use_tabline())
+--- 3852,3858 ----
+ }
+ }
+
+! goto_tabpage_tp(tp, TRUE);
+
+ #ifdef FEAT_GUI_TABLINE
+ if (gui_use_tabline())
+***************
+*** 3849,3859 ****
+
+ /*
+ * Go to tabpage "tp".
+ * Note: doesn't update the GUI tab.
+ */
+ void
+! goto_tabpage_tp(tp)
+ tabpage_T *tp;
+ {
+ /* Don't repeat a message in another tab page. */
+ set_keep_msg(NULL, 0);
+--- 3862,3874 ----
+
+ /*
+ * Go to tabpage "tp".
++ * Only trigger *Enter autocommands when trigger_autocmds is TRUE.
+ * Note: doesn't update the GUI tab.
+ */
+ void
+! goto_tabpage_tp(tp, trigger_autocmds)
+ tabpage_T *tp;
++ int trigger_autocmds;
+ {
+ /* Don't repeat a message in another tab page. */
+ set_keep_msg(NULL, 0);
+***************
+*** 3861,3869 ****
+ if (tp != curtab && leave_tabpage(tp->tp_curwin->w_buffer) == OK)
+ {
+ if (valid_tabpage(tp))
+! enter_tabpage(tp, curbuf);
+ else
+! enter_tabpage(curtab, curbuf);
+ }
+ }
+
+--- 3876,3884 ----
+ if (tp != curtab && leave_tabpage(tp->tp_curwin->w_buffer) == OK)
+ {
+ if (valid_tabpage(tp))
+! enter_tabpage(tp, curbuf, trigger_autocmds);
+ else
+! enter_tabpage(curtab, curbuf, trigger_autocmds);
+ }
+ }
+
+***************
+*** 3876,3882 ****
+ tabpage_T *tp;
+ win_T *wp;
+ {
+! goto_tabpage_tp(tp);
+ if (curtab == tp && win_valid(wp))
+ {
+ win_enter(wp, TRUE);
+--- 3891,3897 ----
+ tabpage_T *tp;
+ win_T *wp;
+ {
+! goto_tabpage_tp(tp, TRUE);
+ if (curtab == tp && win_valid(wp))
+ {
+ win_enter(wp, TRUE);
+*** ../vim-7.3.550/src/version.c 2012-06-13 14:01:36.000000000 +0200
+--- src/version.c 2012-06-13 14:28:00.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 551,
+ /**/
+
+--
+Give a man a computer program and you give him a headache,
+but teach him to program computers and you give him the power
+to create headaches for others for the rest of his life...
+ R. B. Forest
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.552
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.552
+Problem: Formatting inside comments does not use the "2" flag in
+ 'formatoptions'.
+Solution: Support the "2" flag. (Tor Perkins)
+Files: src/vim.h, src/ops.c, src/edit.c, src/misc1.c,
+ src/testdir/test68.in, src/testdir/test68.ok
+
+
+*** ../vim-7.3.551/src/vim.h 2012-06-06 18:03:01.000000000 +0200
+--- src/vim.h 2012-06-13 16:07:27.000000000 +0200
+***************
+*** 1072,1083 ****
+--- 1072,1085 ----
+ #define INSCHAR_DO_COM 2 /* format comments */
+ #define INSCHAR_CTRLV 4 /* char typed just after CTRL-V */
+ #define INSCHAR_NO_FEX 8 /* don't use 'formatexpr' */
++ #define INSCHAR_COM_LIST 16 /* format comments with list/2nd line indent */
+
+ /* flags for open_line() */
+ #define OPENLINE_DELSPACES 1 /* delete spaces after cursor */
+ #define OPENLINE_DO_COM 2 /* format comments */
+ #define OPENLINE_KEEPTRAIL 4 /* keep trailing spaces */
+ #define OPENLINE_MARKFIX 8 /* fix mark positions */
++ #define OPENLINE_COM_LIST 16 /* format comments with list/2nd line indent */
+
+ /*
+ * There are four history tables:
+*** ../vim-7.3.551/src/ops.c 2012-06-13 14:01:36.000000000 +0200
+--- src/ops.c 2012-06-13 16:53:44.000000000 +0200
+***************
+*** 1727,1734 ****
+ * and the delete is within one line. */
+ if ((
+ #ifdef FEAT_CLIPBOARD
+! ((clip_unnamed & CLIP_UNNAMED) && oap->regname == '*') ||
+! ((clip_unnamed & CLIP_UNNAMED_PLUS) && oap->regname == '+') ||
+ #endif
+ oap->regname == 0) && oap->motion_type != MLINE
+ && oap->line_count == 1)
+--- 1727,1734 ----
+ * and the delete is within one line. */
+ if ((
+ #ifdef FEAT_CLIPBOARD
+! ((clip_unnamed & CLIP_UNNAMED) && oap->regname == '*') ||
+! ((clip_unnamed & CLIP_UNNAMED_PLUS) && oap->regname == '+') ||
+ #endif
+ oap->regname == 0) && oap->motion_type != MLINE
+ && oap->line_count == 1)
+***************
+*** 4208,4217 ****
+ * "is_comment".
+ * line - line to be processed,
+ * process - if FALSE, will only check whether the line ends with an unclosed
+! * comment,
+ * include_space - whether to also skip space following the comment leader,
+ * is_comment - will indicate whether the current line ends with an unclosed
+! * comment.
+ */
+ static char_u *
+ skip_comment(line, process, include_space, is_comment)
+--- 4208,4217 ----
+ * "is_comment".
+ * line - line to be processed,
+ * process - if FALSE, will only check whether the line ends with an unclosed
+! * comment,
+ * include_space - whether to also skip space following the comment leader,
+ * is_comment - will indicate whether the current line ends with an unclosed
+! * comment.
+ */
+ static char_u *
+ skip_comment(line, process, include_space, is_comment)
+***************
+*** 4723,4731 ****
+ char_u *leader_flags = NULL; /* flags for leader of current line */
+ char_u *next_leader_flags; /* flags for leader of next line */
+ int do_comments; /* format comments */
+ #endif
+ int advance = TRUE;
+! int second_indent = -1;
+ int do_second_indent;
+ int do_number_indent;
+ int do_trail_white;
+--- 4723,4733 ----
+ char_u *leader_flags = NULL; /* flags for leader of current line */
+ char_u *next_leader_flags; /* flags for leader of next line */
+ int do_comments; /* format comments */
++ int do_comments_list = 0; /* format comments with 'n' or '2' */
+ #endif
+ int advance = TRUE;
+! int second_indent = -1; /* indent for second line (comment
+! * aware) */
+ int do_second_indent;
+ int do_number_indent;
+ int do_trail_white;
+***************
+*** 4828,4845 ****
+ if (first_par_line
+ && (do_second_indent || do_number_indent)
+ && prev_is_end_par
+! && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count
+ #ifdef FEAT_COMMENTS
+! && leader_len == 0
+! && next_leader_len == 0
+ #endif
+! )
+! {
+! if (do_second_indent
+! && !lineempty(curwin->w_cursor.lnum + 1))
+! second_indent = get_indent_lnum(curwin->w_cursor.lnum + 1);
+ else if (do_number_indent)
+! second_indent = get_number_indent(curwin->w_cursor.lnum);
+ }
+
+ /*
+--- 4830,4875 ----
+ if (first_par_line
+ && (do_second_indent || do_number_indent)
+ && prev_is_end_par
+! && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count)
+! {
+! if (do_second_indent && !lineempty(curwin->w_cursor.lnum + 1))
+! {
+ #ifdef FEAT_COMMENTS
+! if (leader_len == 0 && next_leader_len == 0)
+! {
+! /* no comment found */
+ #endif
+! second_indent =
+! get_indent_lnum(curwin->w_cursor.lnum + 1);
+! #ifdef FEAT_COMMENTS
+! }
+! else
+! {
+! second_indent = next_leader_len;
+! do_comments_list = 1;
+! }
+! #endif
+! }
+ else if (do_number_indent)
+! {
+! #ifdef FEAT_COMMENTS
+! if (leader_len == 0 && next_leader_len == 0)
+! {
+! /* no comment found */
+! #endif
+! second_indent =
+! get_number_indent(curwin->w_cursor.lnum);
+! #ifdef FEAT_COMMENTS
+! }
+! else
+! {
+! /* get_number_indent() is now "comment aware"... */
+! second_indent =
+! get_number_indent(curwin->w_cursor.lnum);
+! do_comments_list = 1;
+! }
+! #endif
+! }
+ }
+
+ /*
+***************
+*** 4878,4883 ****
+--- 4908,4915 ----
+ insertchar(NUL, INSCHAR_FORMAT
+ #ifdef FEAT_COMMENTS
+ + (do_comments ? INSCHAR_DO_COM : 0)
++ + (do_comments && do_comments_list
++ ? INSCHAR_COM_LIST : 0)
+ #endif
+ + (avoid_fex ? INSCHAR_NO_FEX : 0), second_indent);
+ State = old_State;
+*** ../vim-7.3.551/src/edit.c 2012-06-06 16:12:54.000000000 +0200
+--- src/edit.c 2012-06-13 16:54:10.000000000 +0200
+***************
+*** 1463,1469 ****
+ * what check_abbr() expects. */
+ (has_mbyte && c >= 0x100) ? (c + ABBR_OFF) :
+ #endif
+! c) && c != Ctrl_RSB))
+ {
+ insert_special(c, FALSE, FALSE);
+ #ifdef FEAT_RIGHTLEFT
+--- 1463,1469 ----
+ * what check_abbr() expects. */
+ (has_mbyte && c >= 0x100) ? (c + ABBR_OFF) :
+ #endif
+! c) && c != Ctrl_RSB))
+ {
+ insert_special(c, FALSE, FALSE);
+ #ifdef FEAT_RIGHTLEFT
+***************
+*** 5769,5774 ****
+--- 5769,5784 ----
+ # define WHITECHAR(cc) vim_iswhite(cc)
+ #endif
+
++ /*
++ * "flags": INSCHAR_FORMAT - force formatting
++ * INSCHAR_CTRLV - char typed just after CTRL-V
++ * INSCHAR_NO_FEX - don't use 'formatexpr'
++ *
++ * NOTE: passes the flags value straight through to internal_format() which,
++ * beside INSCHAR_FORMAT (above), is also looking for these:
++ * INSCHAR_DO_COM - format comments
++ * INSCHAR_COM_LIST - format comments with num list or 2nd line indent
++ */
+ void
+ insertchar(c, flags, second_indent)
+ int c; /* character to insert or NUL */
+***************
+*** 6011,6016 ****
+--- 6021,6029 ----
+
+ /*
+ * Format text at the current insert position.
++ *
++ * If the INSCHAR_COM_LIST flag is present, then the value of second_indent
++ * will be the comment leader length sent to open_line().
+ */
+ static void
+ internal_format(textwidth, second_indent, flags, format_only, c)
+***************
+*** 6289,6311 ****
+ + (fo_white_par ? OPENLINE_KEEPTRAIL : 0)
+ #ifdef FEAT_COMMENTS
+ + (do_comments ? OPENLINE_DO_COM : 0)
+ #endif
+! , old_indent);
+! old_indent = 0;
+
+ replace_offset = 0;
+ if (first_line)
+ {
+! if (second_indent < 0 && has_format_option(FO_Q_NUMBER))
+! second_indent = get_number_indent(curwin->w_cursor.lnum -1);
+! if (second_indent >= 0)
+ {
+ #ifdef FEAT_VREPLACE
+! if (State & VREPLACE_FLAG)
+! change_indent(INDENT_SET, second_indent, FALSE, NUL, TRUE);
+! else
+ #endif
+! (void)set_indent(second_indent, SIN_CHANGED);
+ }
+ first_line = FALSE;
+ }
+--- 6302,6337 ----
+ + (fo_white_par ? OPENLINE_KEEPTRAIL : 0)
+ #ifdef FEAT_COMMENTS
+ + (do_comments ? OPENLINE_DO_COM : 0)
++ + ((flags & INSCHAR_COM_LIST) ? OPENLINE_COM_LIST : 0)
+ #endif
+! , ((flags & INSCHAR_COM_LIST) ? second_indent : old_indent));
+! if (!(flags & INSCHAR_COM_LIST))
+! old_indent = 0;
+
+ replace_offset = 0;
+ if (first_line)
+ {
+! if (!(flags & INSCHAR_COM_LIST))
+ {
++ /*
++ * This section is for numeric lists w/o comments. If comment
++ * indents are needed with numeric lists (formatoptions=nq),
++ * then the INSCHAR_COM_LIST flag will cause the corresponding
++ * OPENLINE_COM_LIST flag to be passed through to open_line()
++ * (as seen above)...
++ */
++ if (second_indent < 0 && has_format_option(FO_Q_NUMBER))
++ second_indent = get_number_indent(curwin->w_cursor.lnum -1);
++ if (second_indent >= 0)
++ {
+ #ifdef FEAT_VREPLACE
+! if (State & VREPLACE_FLAG)
+! change_indent(INDENT_SET, second_indent,
+! FALSE, NUL, TRUE);
+! else
+ #endif
+! (void)set_indent(second_indent, SIN_CHANGED);
+! }
+ }
+ first_line = FALSE;
+ }
+*** ../vim-7.3.551/src/misc1.c 2012-06-13 13:40:45.000000000 +0200
+--- src/misc1.c 2012-06-13 16:54:59.000000000 +0200
+***************
+*** 423,449 ****
+ {
+ colnr_T col;
+ pos_T pos;
+- regmmatch_T regmatch;
+
+ if (lnum > curbuf->b_ml.ml_line_count)
+ return -1;
+ pos.lnum = 0;
+! regmatch.regprog = vim_regcomp(curbuf->b_p_flp, RE_MAGIC);
+! if (regmatch.regprog != NULL)
+ {
+! regmatch.rmm_ic = FALSE;
+! regmatch.rmm_maxcol = 0;
+! if (vim_regexec_multi(®match, curwin, curbuf, lnum,
+! (colnr_T)0, NULL))
+ {
+! pos.lnum = regmatch.endpos[0].lnum + lnum;
+! pos.col = regmatch.endpos[0].col;
+ #ifdef FEAT_VIRTUALEDIT
+! pos.coladd = 0;
+ #endif
+ }
+ vim_free(regmatch.regprog);
+ }
+
+ if (pos.lnum == 0 || *ml_get_pos(&pos) == NUL)
+ return -1;
+--- 423,492 ----
+ {
+ colnr_T col;
+ pos_T pos;
+
+ if (lnum > curbuf->b_ml.ml_line_count)
+ return -1;
+ pos.lnum = 0;
+!
+! #ifdef FEAT_COMMENTS
+! if (has_format_option(FO_Q_COMS) && has_format_option(FO_Q_NUMBER))
+ {
+! regmatch_T regmatch;
+! int lead_len; /* length of comment leader */
+!
+! lead_len = get_leader_len(ml_get(lnum), NULL, FALSE, TRUE);
+! regmatch.regprog = vim_regcomp(curbuf->b_p_flp, RE_MAGIC);
+! if (regmatch.regprog != NULL)
+ {
+! regmatch.rm_ic = FALSE;
+!
+! /* vim_regexec() expects a pointer to a line. This lets us
+! * start matching for the flp beyond any comment leader... */
+! if (vim_regexec(®match, ml_get(lnum) + lead_len, (colnr_T)0))
+! {
+! pos.lnum = lnum;
+! pos.col = *regmatch.endp - (ml_get(lnum) + lead_len);
+! pos.col += lead_len;
+ #ifdef FEAT_VIRTUALEDIT
+! pos.coladd = 0;
+ #endif
++ }
+ }
+ vim_free(regmatch.regprog);
+ }
++ else
++ {
++ /*
++ * What follows is the orig code that is not "comment aware"...
++ *
++ * I'm not sure if regmmatch_T (multi-match) is needed in this case.
++ * It may be true that this section would work properly using the
++ * regmatch_T code above, in which case, these two seperate sections
++ * should be consolidated w/ FEAT_COMMENTS making lead_len > 0...
++ */
++ #endif
++ regmmatch_T regmatch;
++
++ regmatch.regprog = vim_regcomp(curbuf->b_p_flp, RE_MAGIC);
++
++ if (regmatch.regprog != NULL)
++ {
++ regmatch.rmm_ic = FALSE;
++ regmatch.rmm_maxcol = 0;
++ if (vim_regexec_multi(®match, curwin, curbuf,
++ lnum, (colnr_T)0, NULL))
++ {
++ pos.lnum = regmatch.endpos[0].lnum + lnum;
++ pos.col = regmatch.endpos[0].col;
++ #ifdef FEAT_VIRTUALEDIT
++ pos.coladd = 0;
++ #endif
++ }
++ vim_free(regmatch.regprog);
++ }
++ #ifdef FEAT_COMMENTS
++ }
++ #endif
+
+ if (pos.lnum == 0 || *ml_get_pos(&pos) == NUL)
+ return -1;
+***************
+*** 502,515 ****
+ * OPENLINE_DO_COM format comments
+ * OPENLINE_KEEPTRAIL keep trailing spaces
+ * OPENLINE_MARKFIX adjust mark positions after the line break
+ *
+ * Return TRUE for success, FALSE for failure
+ */
+ int
+! open_line(dir, flags, old_indent)
+ int dir; /* FORWARD or BACKWARD */
+ int flags;
+! int old_indent; /* indent for after ^^D in Insert mode */
+ {
+ char_u *saved_line; /* copy of the original line */
+ char_u *next_line = NULL; /* copy of the next line */
+--- 545,562 ----
+ * OPENLINE_DO_COM format comments
+ * OPENLINE_KEEPTRAIL keep trailing spaces
+ * OPENLINE_MARKFIX adjust mark positions after the line break
++ * OPENLINE_COM_LIST format comments with list or 2nd line indent
++ *
++ * "second_line_indent": indent for after ^^D in Insert mode or if flag
++ * OPENLINE_COM_LIST
+ *
+ * Return TRUE for success, FALSE for failure
+ */
+ int
+! open_line(dir, flags, second_line_indent)
+ int dir; /* FORWARD or BACKWARD */
+ int flags;
+! int second_line_indent;
+ {
+ char_u *saved_line; /* copy of the original line */
+ char_u *next_line = NULL; /* copy of the next line */
+***************
+*** 650,657 ****
+ * count white space on current line
+ */
+ newindent = get_indent_str(saved_line, (int)curbuf->b_p_ts);
+! if (newindent == 0)
+! newindent = old_indent; /* for ^^D command in insert mode */
+
+ #ifdef FEAT_SMARTINDENT
+ /*
+--- 697,704 ----
+ * count white space on current line
+ */
+ newindent = get_indent_str(saved_line, (int)curbuf->b_p_ts);
+! if (newindent == 0 && !(flags & OPENLINE_COM_LIST))
+! newindent = second_line_indent; /* for ^^D command in insert mode */
+
+ #ifdef FEAT_SMARTINDENT
+ /*
+***************
+*** 1008,1015 ****
+ if (lead_len)
+ {
+ /* allocate buffer (may concatenate p_exta later) */
+! leader = alloc(lead_len + lead_repl_len + extra_space +
+! extra_len + 1);
+ allocated = leader; /* remember to free it later */
+
+ if (leader == NULL)
+--- 1055,1062 ----
+ if (lead_len)
+ {
+ /* allocate buffer (may concatenate p_exta later) */
+! leader = alloc(lead_len + lead_repl_len + extra_space + extra_len
+! + (second_line_indent > 0 ? second_line_indent : 0));
+ allocated = leader; /* remember to free it later */
+
+ if (leader == NULL)
+***************
+*** 1304,1309 ****
+--- 1351,1370 ----
+ /* concatenate leader and p_extra, if there is a leader */
+ if (lead_len)
+ {
++ if (flags & OPENLINE_COM_LIST && second_line_indent > 0)
++ {
++ int i;
++ int padding = second_line_indent - (newindent + STRLEN(leader));
++
++ /* Here whitespace is inserted after the comment char.
++ * Below, set_indent(newindent, SIN_INSERT) will insert the
++ * whitespace needed before the comment char. */
++ for (i = 0; i < padding; i++)
++ {
++ STRCAT(leader, " ");
++ newcol++;
++ }
++ }
+ STRCAT(leader, p_extra);
+ p_extra = leader;
+ did_ai = TRUE; /* So truncating blanks works with comments */
+***************
+*** 4966,4973 ****
+ char_u *
+ FullName_save(fname, force)
+ char_u *fname;
+! int force; /* force expansion, even when it already looks
+! like a full path name */
+ {
+ char_u *buf;
+ char_u *new_fname = NULL;
+--- 5027,5034 ----
+ char_u *
+ FullName_save(fname, force)
+ char_u *fname;
+! int force; /* force expansion, even when it already looks
+! * like a full path name */
+ {
+ char_u *buf;
+ char_u *new_fname = NULL;
+*** ../vim-7.3.551/src/testdir/test68.in 2010-10-09 17:21:42.000000000 +0200
+--- src/testdir/test68.in 2012-06-13 15:49:38.000000000 +0200
+***************
+*** 51,56 ****
+--- 51,77 ----
+ }
+
+ STARTTEST
++ /^{/+1
++ :set tw=5 fo=qn comments=:#
++ gwap
++ ENDTEST
++
++ {
++ # 1 a b
++ }
++
++ STARTTEST
++ /^{/+1
++ :set tw=5 fo=q2 comments=:#
++ gwap
++ ENDTEST
++
++ {
++ # x
++ # a b
++ }
++
++ STARTTEST
+ /^{/+2
+ :set tw& fo=a
+ I^^\e
+*** ../vim-7.3.551/src/testdir/test68.ok 2010-10-09 17:21:42.000000000 +0200
+--- src/testdir/test68.ok 2012-06-13 15:49:38.000000000 +0200
+***************
+*** 34,38 ****
+--- 34,50 ----
+ }
+
+
++ {
++ # 1 a
++ # b
++ }
++
++
++ {
++ # x a
++ # b
++ }
++
++
+ { 1aa ^^2bb }
+
+*** ../vim-7.3.551/src/version.c 2012-06-13 14:28:16.000000000 +0200
+--- src/version.c 2012-06-13 16:36:14.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 552,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+31. You code your homework in HTML and give your instructor the URL.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.553
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.553
+Problem: With double-width characters and 'listchars' containing "precedes"
+ the text is displayed one cell off.
+Solution: Check for double-width character being overwritten by the
+ "precedes" character. (Yasuhiro Matsumoto)
+Files: src/screen.c
+
+
+*** ../vim-7.3.552/src/screen.c 2012-06-06 19:05:45.000000000 +0200
+--- src/screen.c 2012-06-13 17:55:10.000000000 +0200
+***************
+*** 89,94 ****
+--- 89,97 ----
+
+ #include "vim.h"
+
++ #define MB_FILLER_CHAR '<' /* character used when a double-width character
++ * doesn't fit. */
++
+ /*
+ * The attributes that are actually active for writing to the screen.
+ */
+***************
+*** 4016,4022 ****
+ if (n_skip > 0 && mb_l > 1 && n_extra == 0)
+ {
+ n_extra = 1;
+! c_extra = '<';
+ c = ' ';
+ if (area_attr == 0 && search_attr == 0)
+ {
+--- 4019,4025 ----
+ if (n_skip > 0 && mb_l > 1 && n_extra == 0)
+ {
+ n_extra = 1;
+! c_extra = MB_FILLER_CHAR;
+ c = ' ';
+ if (area_attr == 0 && search_attr == 0)
+ {
+***************
+*** 4576,4581 ****
+--- 4579,4593 ----
+ c = lcs_prec;
+ lcs_prec_todo = NUL;
+ #ifdef FEAT_MBYTE
++ if (has_mbyte && (*mb_char2cells)(mb_c) > 1)
++ {
++ /* Double-width character being overwritten by the "precedes"
++ * character, need to fill up half the character. */
++ c_extra = MB_FILLER_CHAR;
++ n_extra = 1;
++ n_attr = 2;
++ extra_attr = hl_attr(HLF_AT);
++ }
+ mb_c = c;
+ if (enc_utf8 && (*mb_char2len)(c) > 1)
+ {
+*** ../vim-7.3.552/src/version.c 2012-06-13 17:28:51.000000000 +0200
+--- src/version.c 2012-06-13 17:48:45.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 553,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+32. You don't know what sex three of your closest friends are, because they
+ have neutral nicknames and you never bothered to ask.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.554
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.554 (after 7.3.551)
+Problem: Compiler warning for unused argument.
+Solution: Add UNUSED.
+Files: src/window.c
+
+
+*** ../vim-7.3.553/src/window.c 2012-06-13 14:28:16.000000000 +0200
+--- src/window.c 2012-06-13 17:46:49.000000000 +0200
+***************
+*** 3723,3729 ****
+ enter_tabpage(tp, old_curbuf, trigger_autocmds)
+ tabpage_T *tp;
+ buf_T *old_curbuf UNUSED;
+! int trigger_autocmds;
+ {
+ int old_off = tp->tp_firstwin->w_winrow;
+ win_T *next_prevwin = tp->tp_prevwin;
+--- 3723,3729 ----
+ enter_tabpage(tp, old_curbuf, trigger_autocmds)
+ tabpage_T *tp;
+ buf_T *old_curbuf UNUSED;
+! int trigger_autocmds UNUSED;
+ {
+ int old_off = tp->tp_firstwin->w_winrow;
+ win_T *next_prevwin = tp->tp_prevwin;
+*** ../vim-7.3.553/src/version.c 2012-06-13 18:06:32.000000000 +0200
+--- src/version.c 2012-06-13 18:15:08.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 554,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+33. You name your children Eudora, Mozilla and Dotcom.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.555
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.555
+Problem: Building on IBM z/OS fails.
+Solution: Adjust configure. Use the QUOTESED value from config.mk instead of
+ the hard coded one in Makefile. (Stephen Bovy)
+Files: src/configure.in, src/auto/configure, src/Makefile
+
+
+*** ../vim-7.3.554/src/configure.in 2012-02-05 22:51:27.000000000 +0100
+--- src/configure.in 2012-06-13 18:52:11.000000000 +0200
+***************
+*** 329,343 ****
+ echo ""
+ echo "------------------------------------------"
+ echo " On z/OS Unix, the environment variable"
+! echo " __CC_${ccn}MODE must be set to \"1\"!"
+ echo " Do:"
+ echo " export _CC_${ccn}MODE=1"
+ echo " and then call configure again."
+ echo "------------------------------------------"
+ exit 1
+ fi
+! CFLAGS="$CFLAGS -D_ALL_SOURCE -Wc,float\\(IEEE\\)";
+! LDFLAGS="$LDFLAGS -Wl,EDIT=NO"
+ AC_MSG_RESULT(yes)
+ ;;
+ *) zOSUnix="no";
+--- 329,346 ----
+ echo ""
+ echo "------------------------------------------"
+ echo " On z/OS Unix, the environment variable"
+! echo " _CC_${ccn}MODE must be set to \"1\"!"
+ echo " Do:"
+ echo " export _CC_${ccn}MODE=1"
+ echo " and then call configure again."
+ echo "------------------------------------------"
+ exit 1
+ fi
+! # Set CFLAGS for configure process.
+! # This will be reset later for config.mk.
+! # Use haltonmsg to force error for missing H files.
+! CFLAGS="$CFLAGS -D_ALL_SOURCE -Wc,float(ieee),haltonmsg(3296)";
+! LDFLAGS="$LDFLAGS -Wl,EDIT=NO"
+ AC_MSG_RESULT(yes)
+ ;;
+ *) zOSUnix="no";
+***************
+*** 2378,2387 ****
+ if test -z "$SKIP_MOTIF"; then
+ cppflags_save=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+! AC_CHECK_HEADERS(Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h \
+! Xm/UnhighlightT.h Xm/Notebook.h)
+
+! if test $ac_cv_header_Xm_XpmP_h = yes; then
+ dnl Solaris uses XpmAttributes_21, very annoying.
+ AC_MSG_CHECKING([for XpmAttributes_21 in Xm/XpmP.h])
+ AC_TRY_COMPILE([#include <Xm/XpmP.h>], [XpmAttributes_21 attr;],
+--- 2381,2395 ----
+ if test -z "$SKIP_MOTIF"; then
+ cppflags_save=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+! if test "$zOSUnix" = "yes"; then
+! xmheader="Xm/Xm.h"
+! else
+! xmheader="Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h
+! Xm/UnhighlightT.h Xm/Notebook.h"
+! fi
+! AC_CHECK_HEADERS($xmheader)
+
+! if test "x$ac_cv_header_Xm_XpmP_h" = "xyes"; then
+ dnl Solaris uses XpmAttributes_21, very annoying.
+ AC_MSG_CHECKING([for XpmAttributes_21 in Xm/XpmP.h])
+ AC_TRY_COMPILE([#include <Xm/XpmP.h>], [XpmAttributes_21 attr;],
+***************
+*** 3642,3647 ****
+--- 3650,3660 ----
+ fi
+ AC_SUBST(LINK_AS_NEEDED)
+
++ # IBM z/OS reset CFLAGS for config.mk
++ if test "$zOSUnix" = "yes"; then
++ CFLAGS="-D_ALL_SOURCE -Wc,float\(ieee\),dll"
++ fi
++
+ dnl write output files
+ AC_OUTPUT(auto/config.mk:config.mk.in)
+
+*** ../vim-7.3.554/src/auto/configure 2012-02-05 22:51:27.000000000 +0100
+--- src/auto/configure 2012-06-13 18:53:04.000000000 +0200
+***************
+*** 4426,4440 ****
+ echo ""
+ echo "------------------------------------------"
+ echo " On z/OS Unix, the environment variable"
+! echo " __CC_${ccn}MODE must be set to \"1\"!"
+ echo " Do:"
+ echo " export _CC_${ccn}MODE=1"
+ echo " and then call configure again."
+ echo "------------------------------------------"
+ exit 1
+ fi
+! CFLAGS="$CFLAGS -D_ALL_SOURCE -Wc,float\\(IEEE\\)";
+! LDFLAGS="$LDFLAGS -Wl,EDIT=NO"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+ ;;
+--- 4426,4443 ----
+ echo ""
+ echo "------------------------------------------"
+ echo " On z/OS Unix, the environment variable"
+! echo " _CC_${ccn}MODE must be set to \"1\"!"
+ echo " Do:"
+ echo " export _CC_${ccn}MODE=1"
+ echo " and then call configure again."
+ echo "------------------------------------------"
+ exit 1
+ fi
+! # Set CFLAGS for configure process.
+! # This will be reset later for config.mk.
+! # Use haltonmsg to force error for missing H files.
+! CFLAGS="$CFLAGS -D_ALL_SOURCE -Wc,float(ieee),haltonmsg(3296)";
+! LDFLAGS="$LDFLAGS -Wl,EDIT=NO"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+ ;;
+***************
+*** 8697,8704 ****
+ if test -z "$SKIP_MOTIF"; then
+ cppflags_save=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+! for ac_header in Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h \
+! Xm/UnhighlightT.h Xm/Notebook.h
+ do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+--- 8700,8712 ----
+ if test -z "$SKIP_MOTIF"; then
+ cppflags_save=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+! if test "$zOSUnix" = "yes"; then
+! xmheader="Xm/Xm.h"
+! else
+! xmheader="Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h
+! Xm/UnhighlightT.h Xm/Notebook.h"
+! fi
+! for ac_header in $xmheader
+ do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+***************
+*** 8713,8719 ****
+ done
+
+
+! if test $ac_cv_header_Xm_XpmP_h = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XpmAttributes_21 in Xm/XpmP.h" >&5
+ $as_echo_n "checking for XpmAttributes_21 in Xm/XpmP.h... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+--- 8721,8727 ----
+ done
+
+
+! if test "x$ac_cv_header_Xm_XpmP_h" = "xyes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XpmAttributes_21 in Xm/XpmP.h" >&5
+ $as_echo_n "checking for XpmAttributes_21 in Xm/XpmP.h... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+***************
+*** 12590,12595 ****
+--- 12598,12608 ----
+ fi
+
+
++ # IBM z/OS reset CFLAGS for config.mk
++ if test "$zOSUnix" = "yes"; then
++ CFLAGS="-D_ALL_SOURCE -Wc,float\(ieee\),dll"
++ fi
++
+ ac_config_files="$ac_config_files auto/config.mk:config.mk.in"
+
+ cat >confcache <<\_ACEOF
+*** ../vim-7.3.554/src/Makefile 2012-03-28 17:17:45.000000000 +0200
+--- src/Makefile 2012-06-13 18:48:13.000000000 +0200
+***************
+*** 875,880 ****
+--- 875,884 ----
+ #CFLAGS = -O -Qtarget=m88110compat
+ #EXTRA_LIBS = -lgen
+
++ # The value of QUOTESED comes from auto/config.mk.
++ # Uncomment the next line to use the default value.
++ # QUOTESED = sed -e 's/[\\"]/\\&/g' -e 's/\\"/"/' -e 's/\\";$$/";/'
++
+ ##################### end of system specific lines ################### }}}
+
+ ### Names of the programs and targets {{{1
+***************
+*** 2411,2417 ****
+ auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in
+ CC="$(CC) $(OSDEF_CFLAGS)" srcdir=$(srcdir) sh $(srcdir)/osdef.sh
+
+- QUOTESED = sed -e 's/[\\"]/\\&/g' -e 's/\\"/"/' -e 's/\\";$$/";/'
+ auto/pathdef.c: Makefile auto/config.mk
+ -@echo creating $@
+ -@echo '/* pathdef.c */' > $@
+--- 2415,2420 ----
+*** ../vim-7.3.554/src/version.c 2012-06-13 18:15:13.000000000 +0200
+--- src/version.c 2012-06-13 19:13:54.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 555,
+ /**/
+
+--
+My sister Cecilia opened a computer store in Hawaii.
+She sells C shells by the seashore.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.556
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.556
+Problem: Compiler warnings on 64 bit Windows.
+Solution: Add type casts. (Mike Williams)
+Files: src/misc1.c
+
+
+*** ../vim-7.3.555/src/misc1.c 2012-06-13 17:28:51.000000000 +0200
+--- src/misc1.c 2012-06-14 20:55:47.000000000 +0200
+***************
+*** 445,452 ****
+ if (vim_regexec(®match, ml_get(lnum) + lead_len, (colnr_T)0))
+ {
+ pos.lnum = lnum;
+! pos.col = *regmatch.endp - (ml_get(lnum) + lead_len);
+! pos.col += lead_len;
+ #ifdef FEAT_VIRTUALEDIT
+ pos.coladd = 0;
+ #endif
+--- 445,451 ----
+ if (vim_regexec(®match, ml_get(lnum) + lead_len, (colnr_T)0))
+ {
+ pos.lnum = lnum;
+! pos.col = (colnr_T)(*regmatch.endp - ml_get(lnum));
+ #ifdef FEAT_VIRTUALEDIT
+ pos.coladd = 0;
+ #endif
+***************
+*** 1354,1360 ****
+ if (flags & OPENLINE_COM_LIST && second_line_indent > 0)
+ {
+ int i;
+! int padding = second_line_indent - (newindent + STRLEN(leader));
+
+ /* Here whitespace is inserted after the comment char.
+ * Below, set_indent(newindent, SIN_INSERT) will insert the
+--- 1353,1360 ----
+ if (flags & OPENLINE_COM_LIST && second_line_indent > 0)
+ {
+ int i;
+! int padding = second_line_indent
+! - (newindent + (int)STRLEN(leader));
+
+ /* Here whitespace is inserted after the comment char.
+ * Below, set_indent(newindent, SIN_INSERT) will insert the
+*** ../vim-7.3.555/src/version.c 2012-06-13 19:19:36.000000000 +0200
+--- src/version.c 2012-06-14 20:54:59.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 556,
+ /**/
+
+--
+He who laughs last, thinks slowest.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.557
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.557
+Problem: Crash when an autocommand wipes out a buffer when it is hidden.
+Solution: Restore the current window when needed. (Christian Brabandt)
+Files: src/buffer.c
+
+
+*** ../vim-7.3.556/src/buffer.c 2012-06-13 14:28:16.000000000 +0200
+--- src/buffer.c 2012-06-20 11:49:54.000000000 +0200
+***************
+*** 1363,1368 ****
+--- 1363,1369 ----
+ int action;
+ {
+ buf_T *prevbuf;
++ win_T *prevwin;
+ int unload = (action == DOBUF_UNLOAD || action == DOBUF_DEL
+ || action == DOBUF_WIPE);
+
+***************
+*** 1402,1423 ****
+ if (buf_valid(prevbuf))
+ #endif
+ {
+ if (prevbuf == curbuf)
+ u_sync(FALSE);
+ close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL, prevbuf,
+ unload ? action : (action == DOBUF_GOTO
+ && !P_HID(prevbuf)
+ && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0, FALSE);
+ }
+ }
+ #ifdef FEAT_AUTOCMD
+ /* An autocommand may have deleted "buf", already entered it (e.g., when
+! * it did ":bunload") or aborted the script processing! */
+! # ifdef FEAT_EVAL
+! if (buf_valid(buf) && buf != curbuf && !aborting())
+! # else
+! if (buf_valid(buf) && buf != curbuf)
+! # endif
+ #endif
+ enter_buffer(buf);
+ }
+--- 1403,1432 ----
+ if (buf_valid(prevbuf))
+ #endif
+ {
++ prevwin = curwin;
+ if (prevbuf == curbuf)
+ u_sync(FALSE);
+ close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL, prevbuf,
+ unload ? action : (action == DOBUF_GOTO
+ && !P_HID(prevbuf)
+ && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0, FALSE);
++ if (curwin != prevwin && win_valid(prevwin))
++ /* autocommands changed curwin, Grr! */
++ curwin = prevwin;
+ }
+ }
+ #ifdef FEAT_AUTOCMD
+ /* An autocommand may have deleted "buf", already entered it (e.g., when
+! * it did ":bunload") or aborted the script processing!
+! * If curwin->w_buffer is null, enter_buffer() will make it valid again */
+! if ((buf_valid(buf) && buf != curbuf
+! #ifdef FEAT_EVAL
+! && !aborting()
+! #endif
+! #ifdef FEAT_WINDOWS
+! ) || curwin->w_buffer == NULL
+! #endif
+! )
+ #endif
+ enter_buffer(buf);
+ }
+*** ../vim-7.3.556/src/version.c 2012-06-14 20:59:20.000000000 +0200
+--- src/version.c 2012-06-20 11:53:56.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 557,
+ /**/
+
+--
+Don't read everything you believe.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.558
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.558
+Problem: Memory access error. (Gary Johnson)
+Solution: Allocate one more byte. (Dominique Pelle)
+Files: src/misc1.c
+
+
+*** ../vim-7.3.557/src/misc1.c 2012-06-14 20:59:20.000000000 +0200
+--- src/misc1.c 2012-06-20 12:34:57.000000000 +0200
+***************
+*** 460,466 ****
+ *
+ * I'm not sure if regmmatch_T (multi-match) is needed in this case.
+ * It may be true that this section would work properly using the
+! * regmatch_T code above, in which case, these two seperate sections
+ * should be consolidated w/ FEAT_COMMENTS making lead_len > 0...
+ */
+ #endif
+--- 460,466 ----
+ *
+ * I'm not sure if regmmatch_T (multi-match) is needed in this case.
+ * It may be true that this section would work properly using the
+! * regmatch_T code above, in which case, these two separate sections
+ * should be consolidated w/ FEAT_COMMENTS making lead_len > 0...
+ */
+ #endif
+***************
+*** 1053,1061 ****
+ }
+ if (lead_len)
+ {
+! /* allocate buffer (may concatenate p_exta later) */
+ leader = alloc(lead_len + lead_repl_len + extra_space + extra_len
+! + (second_line_indent > 0 ? second_line_indent : 0));
+ allocated = leader; /* remember to free it later */
+
+ if (leader == NULL)
+--- 1053,1061 ----
+ }
+ if (lead_len)
+ {
+! /* allocate buffer (may concatenate p_extra later) */
+ leader = alloc(lead_len + lead_repl_len + extra_space + extra_len
+! + (second_line_indent > 0 ? second_line_indent : 0) + 1);
+ allocated = leader; /* remember to free it later */
+
+ if (leader == NULL)
+***************
+*** 3342,3348 ****
+ buf = alloc(buflen);
+ else if (maxlen < 10)
+ {
+! /* Need some more space. This migth happen when receiving a long
+ * escape sequence. */
+ buflen += 100;
+ buf = vim_realloc(buf, buflen);
+--- 3342,3348 ----
+ buf = alloc(buflen);
+ else if (maxlen < 10)
+ {
+! /* Need some more space. This might happen when receiving a long
+ * escape sequence. */
+ buflen += 100;
+ buf = vim_realloc(buf, buflen);
+*** ../vim-7.3.557/src/version.c 2012-06-20 11:54:55.000000000 +0200
+--- src/version.c 2012-06-20 12:36:29.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 558,
+ /**/
+
+--
+George: "I just got a new set of golf clubs for my wife!"
+ John: "Great trade!"
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.559
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.559
+Problem: home_replace() does not work with 8.3 filename.
+Solution: Make ":p" expand 8.3 name to full path. (Yasuhiro Matsumoto)
+Files: src/eval.c, src/misc1.c
+
+
+*** ../vim-7.3.558/src/eval.c 2012-06-13 14:28:16.000000000 +0200
+--- src/eval.c 2012-06-20 13:52:47.000000000 +0200
+***************
+*** 23554,23559 ****
+--- 23554,23580 ----
+ return -1;
+ }
+
++ #ifdef WIN3264
++ # if _WIN32_WINNT >= 0x0500
++ if (vim_strchr(*fnamep, '~') != NULL)
++ {
++ /* Expand 8.3 filename to full path. Needed to make sure the same
++ * file does not have two different names.
++ * Note: problem does not occur if _WIN32_WINNT < 0x0500. */
++ p = alloc(_MAX_PATH + 1);
++ if (p != NULL)
++ {
++ if (GetLongPathName(*fnamep, p, MAXPATHL))
++ {
++ vim_free(*bufp);
++ *bufp = *fnamep = p;
++ }
++ else
++ vim_free(p);
++ }
++ }
++ # endif
++ #endif
+ /* Append a path separator to a directory. */
+ if (mch_isdir(*fnamep))
+ {
+*** ../vim-7.3.558/src/misc1.c 2012-06-20 12:40:01.000000000 +0200
+--- src/misc1.c 2012-06-20 13:57:22.000000000 +0200
+***************
+*** 4499,4505 ****
+ {
+ size_t dirlen = 0, envlen = 0;
+ size_t len;
+! char_u *homedir_env;
+ char_u *p;
+
+ if (src == NULL)
+--- 4499,4505 ----
+ {
+ size_t dirlen = 0, envlen = 0;
+ size_t len;
+! char_u *homedir_env, *homedir_env_orig;
+ char_u *p;
+
+ if (src == NULL)
+***************
+*** 4525,4533 ****
+ dirlen = STRLEN(homedir);
+
+ #ifdef VMS
+! homedir_env = mch_getenv((char_u *)"SYS$LOGIN");
+ #else
+! homedir_env = mch_getenv((char_u *)"HOME");
+ #endif
+
+ if (homedir_env != NULL && *homedir_env == NUL)
+--- 4525,4548 ----
+ dirlen = STRLEN(homedir);
+
+ #ifdef VMS
+! homedir_env_orig = homedir_env = mch_getenv((char_u *)"SYS$LOGIN");
+ #else
+! homedir_env_orig = homedir_env = mch_getenv((char_u *)"HOME");
+! #endif
+! #if defined(FEAT_MODIFY_FNAME) || defined(WIN3264)
+! if (vim_strchr(homedir_env, '~') != NULL)
+! {
+! int usedlen = 0;
+! int flen;
+! char_u *fbuf = NULL;
+!
+! flen = (int)STRLEN(homedir_env);
+! (void)modify_fname(":p", &usedlen, &homedir_env, &fbuf, &flen);
+! flen = (int)STRLEN(homedir_env);
+! if (flen > 0 && vim_ispathsep(homedir_env[flen - 1]))
+! /* Remove the trailing / that is added to a directory. */
+! homedir_env[flen - 1] = NUL;
+! }
+ #endif
+
+ if (homedir_env != NULL && *homedir_env == NUL)
+***************
+*** 4585,4590 ****
+--- 4600,4608 ----
+ /* if (dstlen == 0) out of space, what to do??? */
+
+ *dst = NUL;
++
++ if (homedir_env != homedir_env_orig)
++ vim_free(homedir_env);
+ }
+
+ /*
+*** ../vim-7.3.558/src/version.c 2012-06-20 12:40:01.000000000 +0200
+--- src/version.c 2012-06-20 14:02:11.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 559,
+ /**/
+
+--
+The future isn't what it used to be.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.560
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.560
+Problem: Get an error for a locked argument in extend().
+Solution: Initialize the lock flag for a dictionary. (Yukihiro Nakadaira)
+Files: src/eval.c
+
+
+*** ../vim-7.3.559/src/eval.c 2012-06-20 14:02:23.000000000 +0200
+--- src/eval.c 2012-06-20 14:08:34.000000000 +0200
+***************
+*** 19981,19986 ****
+--- 19981,19987 ----
+ dictitem_T *dict_var;
+ {
+ hash_init(&dict->dv_hashtab);
++ dict->dv_lock = 0;
+ dict->dv_refcount = DO_NOT_FREE_CNT;
+ dict->dv_copyID = 0;
+ dict_var->di_tv.vval.v_dict = dict;
+*** ../vim-7.3.559/src/version.c 2012-06-20 14:02:23.000000000 +0200
+--- src/version.c 2012-06-20 14:09:34.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 560,
+ /**/
+
+--
+"Oh, no! NOT the Spanish Inquisition!"
+"NOBODY expects the Spanish Inquisition!!!"
+ -- Monty Python sketch --
+"Oh, no! NOT another option!"
+"EVERYBODY expects another option!!!"
+ -- Discussion in vim-dev mailing list --
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.561
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.561
+Problem: Using refresh: always in a complete function breaks the "."
+ command. (Val Markovic)
+Solution: Add match leader to the redo buffer. (Yasuhiro Matsumoto)
+Files: src/edit.c
+
+
+*** ../vim-7.3.560/src/edit.c 2012-06-13 17:28:51.000000000 +0200
+--- src/edit.c 2012-06-20 14:22:23.000000000 +0200
+***************
+*** 3467,3476 ****
+--- 3467,3480 ----
+ (*mb_char2bytes)(c, buf);
+ buf[cc] = NUL;
+ ins_char_bytes(buf, cc);
++ AppendToRedobuff(buf);
+ }
+ else
+ #endif
++ {
+ ins_char(c);
++ AppendCharToRedobuff(c);
++ }
+
+ /* If we didn't complete finding matches we must search again. */
+ if (ins_compl_need_restart())
+*** ../vim-7.3.560/src/version.c 2012-06-20 14:13:02.000000000 +0200
+--- src/version.c 2012-06-20 14:20:13.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 561,
+ /**/
+
+--
+Microsoft is to software what McDonalds is to gourmet cooking
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.562
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.562
+Problem: ":profdel" should not work when the +profile feature is disabled.
+Solution: Call ex_ni(). (Yasuhiro Matsumoto)
+Files: src/ex_cmds2.c
+
+
+*** ../vim-7.3.561/src/ex_cmds2.c 2012-06-13 14:28:16.000000000 +0200
+--- src/ex_cmds2.c 2012-06-20 15:43:44.000000000 +0200
+***************
+*** 596,605 ****
+ garray_T *gap;
+
+ gap = &dbg_breakp;
+- #ifdef FEAT_PROFILE
+ if (eap->cmdidx == CMD_profdel)
+ gap = &prof_ga;
+ #endif
+
+ if (vim_isdigit(*eap->arg))
+ {
+--- 596,610 ----
+ garray_T *gap;
+
+ gap = &dbg_breakp;
+ if (eap->cmdidx == CMD_profdel)
++ {
++ #ifdef FEAT_PROFILE
+ gap = &prof_ga;
++ #else
++ ex_ni(eap);
++ return;
+ #endif
++ }
+
+ if (vim_isdigit(*eap->arg))
+ {
+*** ../vim-7.3.561/src/version.c 2012-06-20 14:26:30.000000000 +0200
+--- src/version.c 2012-06-20 15:44:00.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 562,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+42. Your virtual girlfriend finds a new net sweetheart with a larger bandwidth.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.563
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.563 (after 7.3.557)
+Problem: Can't build with tiny features.
+Solution: Add #ifdef.
+Files: src/buffer.c
+
+
+*** ../vim-7.3.562/src/buffer.c 2012-06-20 11:54:55.000000000 +0200
+--- src/buffer.c 2012-06-20 17:40:59.000000000 +0200
+***************
+*** 1363,1369 ****
+--- 1363,1371 ----
+ int action;
+ {
+ buf_T *prevbuf;
++ #ifdef FEAT_WINDOWS
+ win_T *prevwin;
++ #endif
+ int unload = (action == DOBUF_UNLOAD || action == DOBUF_DEL
+ || action == DOBUF_WIPE);
+
+***************
+*** 1403,1418 ****
+--- 1405,1424 ----
+ if (buf_valid(prevbuf))
+ #endif
+ {
++ #ifdef FEAT_WINDOWS
+ prevwin = curwin;
++ #endif
+ if (prevbuf == curbuf)
+ u_sync(FALSE);
+ close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL, prevbuf,
+ unload ? action : (action == DOBUF_GOTO
+ && !P_HID(prevbuf)
+ && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0, FALSE);
++ #ifdef FEAT_WINDOWS
+ if (curwin != prevwin && win_valid(prevwin))
+ /* autocommands changed curwin, Grr! */
+ curwin = prevwin;
++ #endif
+ }
+ }
+ #ifdef FEAT_AUTOCMD
+***************
+*** 1420,1431 ****
+ * it did ":bunload") or aborted the script processing!
+ * If curwin->w_buffer is null, enter_buffer() will make it valid again */
+ if ((buf_valid(buf) && buf != curbuf
+! #ifdef FEAT_EVAL
+ && !aborting()
+! #endif
+! #ifdef FEAT_WINDOWS
+ ) || curwin->w_buffer == NULL
+! #endif
+ )
+ #endif
+ enter_buffer(buf);
+--- 1426,1437 ----
+ * it did ":bunload") or aborted the script processing!
+ * If curwin->w_buffer is null, enter_buffer() will make it valid again */
+ if ((buf_valid(buf) && buf != curbuf
+! # ifdef FEAT_EVAL
+ && !aborting()
+! # endif
+! # ifdef FEAT_WINDOWS
+ ) || curwin->w_buffer == NULL
+! # endif
+ )
+ #endif
+ enter_buffer(buf);
+*** ../vim-7.3.562/src/version.c 2012-06-20 15:48:53.000000000 +0200
+--- src/version.c 2012-06-20 17:54:01.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 563,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+45. You buy a Captain Kirk chair with a built-in keyboard and mouse.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.564
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.564 (after 7.3.559)
+Problem: Warning for pointer conversion.
+Solution: Add type cast.
+Files: src/misc1.c
+
+
+*** ../vim-7.3.563/src/misc1.c 2012-06-20 14:02:23.000000000 +0200
+--- src/misc1.c 2012-06-20 17:41:22.000000000 +0200
+***************
+*** 4537,4543 ****
+ char_u *fbuf = NULL;
+
+ flen = (int)STRLEN(homedir_env);
+! (void)modify_fname(":p", &usedlen, &homedir_env, &fbuf, &flen);
+ flen = (int)STRLEN(homedir_env);
+ if (flen > 0 && vim_ispathsep(homedir_env[flen - 1]))
+ /* Remove the trailing / that is added to a directory. */
+--- 4537,4544 ----
+ char_u *fbuf = NULL;
+
+ flen = (int)STRLEN(homedir_env);
+! (void)modify_fname((char_u *)":p", &usedlen,
+! &homedir_env, &fbuf, &flen);
+ flen = (int)STRLEN(homedir_env);
+ if (flen > 0 && vim_ispathsep(homedir_env[flen - 1]))
+ /* Remove the trailing / that is added to a directory. */
+*** ../vim-7.3.563/src/version.c 2012-06-20 17:54:34.000000000 +0200
+--- src/version.c 2012-06-20 17:55:26.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 564,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+46. Your wife makes a new rule: "The computer cannot come to bed."
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.566
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.566
+Problem: Can't generate proto file for Python 3.
+Solution: Add PYTHON3_CFLAGS to LINT_CFLAGS.
+Files: src/Makefile
+
+
+*** ../vim-7.3.564/src/Makefile 2012-06-13 19:19:36.000000000 +0200
+--- src/Makefile 2012-06-20 18:36:14.000000000 +0200
+***************
+*** 1339,1345 ****
+ # with "-E".
+ OSDEF_CFLAGS = $(PRE_DEFS) $(POST_DEFS)
+
+! LINT_CFLAGS = -DLINT -I. $(PRE_DEFS) $(POST_DEFS) $(RUBY_CFLAGS) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) -Dinline= -D__extension__= -Dalloca=alloca
+
+ LINT_EXTRA = -DUSE_SNIFF -DHANGUL_INPUT -D"__attribute__(x)="
+
+--- 1339,1345 ----
+ # with "-E".
+ OSDEF_CFLAGS = $(PRE_DEFS) $(POST_DEFS)
+
+! LINT_CFLAGS = -DLINT -I. $(PRE_DEFS) $(POST_DEFS) $(RUBY_CFLAGS) $(LUA_CFLAGS) $(PERL_CFLAGS) $(PYTHON_CFLAGS) $(PYTHON3_CFLAGS) -Dinline= -D__extension__= -Dalloca=alloca
+
+ LINT_EXTRA = -DUSE_SNIFF -DHANGUL_INPUT -D"__attribute__(x)="
+
+*** ../vim-7.3.564/src/version.c 2012-06-20 17:56:06.000000000 +0200
+--- src/version.c 2012-06-20 18:39:04.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 565,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+47. You are so familiar with the WWW that you find the search engines useless.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.566
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.566 (after 7.3.561)
+Problem: Redo after completion does not work correctly when refresh: always
+ is not used. (Raymond Ko)
+Solution: Check the compl_opt_refresh_always flag. (Christian Brabandt)
+Files: src/edit.c
+
+
+*** ../vim-7.3.565/src/edit.c 2012-06-20 14:26:30.000000000 +0200
+--- src/edit.c 2012-06-20 22:52:03.000000000 +0200
+***************
+*** 3467,3479 ****
+ (*mb_char2bytes)(c, buf);
+ buf[cc] = NUL;
+ ins_char_bytes(buf, cc);
+! AppendToRedobuff(buf);
+ }
+ else
+ #endif
+ {
+ ins_char(c);
+! AppendCharToRedobuff(c);
+ }
+
+ /* If we didn't complete finding matches we must search again. */
+--- 3467,3481 ----
+ (*mb_char2bytes)(c, buf);
+ buf[cc] = NUL;
+ ins_char_bytes(buf, cc);
+! if (compl_opt_refresh_always)
+! AppendToRedobuff(buf);
+ }
+ else
+ #endif
+ {
+ ins_char(c);
+! if (compl_opt_refresh_always)
+! AppendCharToRedobuff(c);
+ }
+
+ /* If we didn't complete finding matches we must search again. */
+***************
+*** 3481,3487 ****
+ ins_compl_restart();
+
+ /* When 'always' is set, don't reset compl_leader. While completing,
+! * cursor don't point original position, changing compl_leader would
+ * break redo. */
+ if (!compl_opt_refresh_always)
+ {
+--- 3483,3489 ----
+ ins_compl_restart();
+
+ /* When 'always' is set, don't reset compl_leader. While completing,
+! * cursor doesn't point original position, changing compl_leader would
+ * break redo. */
+ if (!compl_opt_refresh_always)
+ {
+*** ../vim-7.3.565/src/version.c 2012-06-20 18:39:12.000000000 +0200
+--- src/version.c 2012-06-20 22:54:27.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 566,
+ /**/
+
+--
+CVS sux, men don't like commitment
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.567
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.567
+Problem: Missing copyright notice.
+Solution: Add Vim copyright notice. (Taro Muraoka)
+Files: src/dehqx.py
+
+
+*** ../vim-7.3.566/src/dehqx.py 2010-08-15 21:57:32.000000000 +0200
+--- src/dehqx.py 2012-06-29 11:27:41.000000000 +0200
+***************
+*** 1,7 ****
+ # Python script to get both the data and resource fork from a BinHex encoded
+ # file.
+! # Author: Taro Muraoka
+! # Last Change: 2003 Oct 25
+
+ import sys
+ import binhex
+--- 1,10 ----
+ # Python script to get both the data and resource fork from a BinHex encoded
+ # file.
+! # Author: MURAOKA Taro <koron.kaoriya@gmail.com>
+! # Last Change: 2012 Jun 29
+! #
+! # Copyright (C) 2003,12 MURAOKA Taro <koron.kaoriya@gmail.com>
+! # THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE.
+
+ import sys
+ import binhex
+*** ../vim-7.3.566/src/version.c 2012-06-20 22:55:56.000000000 +0200
+--- src/version.c 2012-06-29 11:45:36.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 567,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+66. You create a homepage with the impression to cure the afflicted...but
+ your hidden agenda is to receive more e-mail.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.568
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.568
+Problem: Bad indents for #ifdefs.
+Solution: Add and remove spaces. (Elias Diem)
+Files: src/globals.h
+
+
+*** ../vim-7.3.567/src/globals.h 2012-02-11 23:45:30.000000000 +0100
+--- src/globals.h 2012-06-29 12:32:14.000000000 +0200
+***************
+*** 513,520 ****
+ # define ONE_CLIPBOARD
+ # endif
+
+! #define CLIP_UNNAMED 1
+! #define CLIP_UNNAMED_PLUS 2
+ EXTERN int clip_unnamed INIT(= 0); /* above two values or'ed */
+
+ EXTERN int clip_autoselect INIT(= FALSE);
+--- 513,520 ----
+ # define ONE_CLIPBOARD
+ # endif
+
+! # define CLIP_UNNAMED 1
+! # define CLIP_UNNAMED_PLUS 2
+ EXTERN int clip_unnamed INIT(= 0); /* above two values or'ed */
+
+ EXTERN int clip_autoselect INIT(= FALSE);
+***************
+*** 737,745 ****
+ #endif
+
+ EXTERN pos_T saved_cursor /* w_cursor before formatting text. */
+! # ifdef DO_INIT
+ = INIT_POS_T(0, 0, 0)
+! # endif
+ ;
+
+ /*
+--- 737,745 ----
+ #endif
+
+ EXTERN pos_T saved_cursor /* w_cursor before formatting text. */
+! #ifdef DO_INIT
+ = INIT_POS_T(0, 0, 0)
+! #endif
+ ;
+
+ /*
+***************
+*** 807,815 ****
+ # endif
+ EXTERN int has_mbyte INIT(= 0); /* any multi-byte encoding */
+
+! #if defined(WIN3264) && defined(FEAT_MBYTE)
+ EXTERN int wide_WindowProc INIT(= FALSE); /* use wide WindowProc() */
+! #endif
+
+ /*
+ * To speed up BYTELEN() we fill a table with the byte lengths whenever
+--- 807,815 ----
+ # endif
+ EXTERN int has_mbyte INIT(= 0); /* any multi-byte encoding */
+
+! # if defined(WIN3264) && defined(FEAT_MBYTE)
+ EXTERN int wide_WindowProc INIT(= FALSE); /* use wide WindowProc() */
+! # endif
+
+ /*
+ * To speed up BYTELEN() we fill a table with the byte lengths whenever
+***************
+*** 1099,1106 ****
+ EXTERN int save_p_ls INIT(= -1); /* Save 'laststatus' setting */
+ EXTERN int save_p_wmh INIT(= -1); /* Save 'winminheight' setting */
+ EXTERN int wild_menu_showing INIT(= 0);
+! #define WM_SHOWN 1 /* wildmenu showing */
+! #define WM_SCROLLED 2 /* wildmenu showing with scroll */
+ #endif
+
+ #ifdef MSWIN
+--- 1099,1106 ----
+ EXTERN int save_p_ls INIT(= -1); /* Save 'laststatus' setting */
+ EXTERN int save_p_wmh INIT(= -1); /* Save 'winminheight' setting */
+ EXTERN int wild_menu_showing INIT(= 0);
+! # define WM_SHOWN 1 /* wildmenu showing */
+! # define WM_SCROLLED 2 /* wildmenu showing with scroll */
+ #endif
+
+ #ifdef MSWIN
+***************
+*** 1310,1318 ****
+ EXTERN Atom commProperty INIT(= None);
+ EXTERN char_u *serverDelayedStartName INIT(= NULL);
+ # else
+! # ifdef PROTO
+ typedef int HWND;
+! # endif
+ EXTERN HWND clientWindow INIT(= 0);
+ # endif
+ #endif
+--- 1310,1318 ----
+ EXTERN Atom commProperty INIT(= None);
+ EXTERN char_u *serverDelayedStartName INIT(= NULL);
+ # else
+! # ifdef PROTO
+ typedef int HWND;
+! # endif
+ EXTERN HWND clientWindow INIT(= 0);
+ # endif
+ #endif
+*** ../vim-7.3.567/src/version.c 2012-06-29 11:46:28.000000000 +0200
+--- src/version.c 2012-06-29 12:34:21.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 568,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+67. Your hard drive crashes. You haven't logged in for two hours. You start
+ to twitch. You pick up the phone and manually dial your ISP's access
+ number. You try to hum to communicate with the modem. You succeed.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.569
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.569
+Problem: Evaluating Vim expression in Python is insufficient.
+Solution: Add vim.bindeval(). Also add pyeval() and py3eval(). (ZyX)
+Files: runtime/doc/eval.txt, runtime/doc/if_pyth.txt, src/eval.c,
+ src/if_lua.c, src/if_py_both.h, src/if_python.c, src/if_python3.c,
+ src/proto/eval.pro, src/proto/if_python.pro,
+ src/proto/if_python3.pro, src/testdir/Make_amiga.mak,
+ src/testdir/Make_dos.mak, src/testdir/Make_ming.mak,
+ src/testdir/Make_os2.mak, src/testdir/Makefile,
+ src/testdir/test86.in, src/testdir/test86.ok,
+ src/testdir/test87.in, src/testdir/test87.ok
+
+
+*** ../vim-7.3.568/runtime/doc/eval.txt 2012-03-07 19:16:49.000000000 +0100
+--- runtime/doc/eval.txt 2012-06-20 18:01:02.000000000 +0200
+***************
+*** 1836,1844 ****
+ localtime() Number current time
+ log( {expr}) Float natural logarithm (base e) of {expr}
+ log10( {expr}) Float logarithm of Float {expr} to base 10
+ map( {expr}, {string}) List/Dict change each item in {expr} to {expr}
+ maparg( {name}[, {mode} [, {abbr} [, {dict}]]])
+! String rhs of mapping {name} in mode {mode}
+ mapcheck( {name}[, {mode} [, {abbr}]])
+ String check for mappings matching {name}
+ match( {expr}, {pat}[, {start}[, {count}]])
+--- 1847,1857 ----
+ localtime() Number current time
+ log( {expr}) Float natural logarithm (base e) of {expr}
+ log10( {expr}) Float logarithm of Float {expr} to base 10
++ luaeval( {expr}[, {expr}]) any evaluate |Lua| expression
+ map( {expr}, {string}) List/Dict change each item in {expr} to {expr}
+ maparg( {name}[, {mode} [, {abbr} [, {dict}]]])
+! String or Dict
+! rhs of mapping {name} in mode {mode}
+ mapcheck( {name}[, {mode} [, {abbr}]])
+ String check for mappings matching {name}
+ match( {expr}, {pat}[, {start}[, {count}]])
+***************
+*** 1867,1872 ****
+--- 1880,1887 ----
+ prevnonblank( {lnum}) Number line nr of non-blank line <= {lnum}
+ printf( {fmt}, {expr1}...) String format text
+ pumvisible() Number whether popup menu is visible
++ pyeval( {expr}) any evaluate |Python| expression
++ py3eval( {expr}) any evaluate |python3| expression
+ range( {expr} [, {max} [, {stride}]])
+ List items from {expr} to {max}
+ readfile( {fname} [, {binary} [, {max}]])
+***************
+*** 3980,3985 ****
+--- 4003,4022 ----
+ < -2.0
+ {only available when compiled with the |+float| feature}
+
++ luaeval({expr}[, {expr}]) *luaeval()*
++ Evaluate Lua expression {expr} and return its result converted
++ to Vim data structures. Second {expr} may hold additional
++ argument accessible as _A inside first {expr}.
++ Strings are returned as they are.
++ Boolean objects are converted to numbers.
++ Numbers are converted to |Float| values if vim was compiled
++ with |+float| and to numbers otherwise.
++ Dictionaries and lists obtained by vim.eval() are returned
++ as-is.
++ Other objects are returned as zero without any errors.
++ See |lua-luaeval| for more details.
++ {only available when compiled with the |+lua| feature}
++
+ map({expr}, {string}) *map()*
+ {expr} must be a |List| or a |Dictionary|.
+ Replace each item in {expr} with the result of evaluating
+***************
+*** 4574,4579 ****
+--- 4612,4640 ----
+ This can be used to avoid some things that would remove the
+ popup menu.
+
++ *E860* *E861*
++ py3eval({expr}) *py3eval()*
++ Evaluate Python expression {expr} and return its result
++ converted to Vim data structures.
++ Numbers and strings are returned as they are (strings are
++ copied though, unicode strings are additionally converted to
++ 'encoding').
++ Lists are represented as Vim |List| type.
++ Dictionaries are represented as Vim |Dictionary| type with
++ keys converted to strings.
++ {only available when compiled with the |+python3| feature}
++
++ *E858* *E859*
++ pyeval({expr}) *pyeval()*
++ Evaluate Python expression {expr} and return its result
++ converted to Vim data structures.
++ Numbers and strings are returned as they are (strings are
++ copied though).
++ Lists are represented as Vim |List| type.
++ Dictionaries are represented as Vim |Dictionary| type with
++ keys converted to strings.
++ {only available when compiled with the |+python| feature}
++
+ *E726* *E727*
+ range({expr} [, {max} [, {stride}]]) *range()*
+ Returns a |List| with Numbers:
+***************
+*** 4807,4812 ****
+--- 4868,4877 ----
+ Search for regexp pattern {pattern}. The search starts at the
+ cursor position (you can use |cursor()| to set it).
+
++ If there is no match a 0 is returned and the cursor doesn't
++ move. No error message is given.
++ When a match has been found its line number is returned.
++
+ {flags} is a String, which can contain these character flags:
+ 'b' search backward instead of forward
+ 'c' accept a match at the cursor position
+*** ../vim-7.3.568/runtime/doc/if_pyth.txt 2010-08-15 21:57:12.000000000 +0200
+--- runtime/doc/if_pyth.txt 2012-06-20 18:01:02.000000000 +0200
+***************
+*** 1,4 ****
+! *if_pyth.txt* For Vim version 7.3. Last change: 2010 Aug 13
+
+
+ VIM REFERENCE MANUAL by Paul Moore
+--- 1,4 ----
+! *if_pyth.txt* For Vim version 7.3. Last change: 2012 Feb 04
+
+
+ VIM REFERENCE MANUAL by Paul Moore
+***************
+*** 6,18 ****
+
+ The Python Interface to Vim *python* *Python*
+
+! 1. Commands |python-commands|
+! 2. The vim module |python-vim|
+! 3. Buffer objects |python-buffer|
+! 4. Range objects |python-range|
+! 5. Window objects |python-window|
+! 6. Dynamic loading |python-dynamic|
+! 7. Python 3 |python3|
+
+ {Vi does not have any of these commands}
+
+--- 6,19 ----
+
+ The Python Interface to Vim *python* *Python*
+
+! 1. Commands |python-commands|
+! 2. The vim module |python-vim|
+! 3. Buffer objects |python-buffer|
+! 4. Range objects |python-range|
+! 5. Window objects |python-window|
+! 6. pyeval(), py3eval() Vim functions |python-pyeval|
+! 7. Dynamic loading |python-dynamic|
+! 8. Python 3 |python3|
+
+ {Vi does not have any of these commands}
+
+***************
+*** 150,155 ****
+--- 151,172 ----
+ [{'cmd': '/^eval_expr(arg, nextcmd)$/', 'static': 0, 'name':
+ 'eval_expr', 'kind': 'f', 'filename': './src/eval.c'}]
+
++ vim.bindeval(str) *python-bindeval*
++ Like |python-eval|, but
++ 1. if expression evaluates to |List| or |Dictionary| it is returned as
++ vimlist or vimdictionary python type that are connected to original
++ list or dictionary. Thus modifications to these objects imply
++ modifications of the original.
++ 2. if expression evaluates to a function reference, then it returns
++ callable vimfunction object. Use self keyword argument to assign
++ |self| object for dictionary functions.
++
++ Note: this function has the same behavior as |lua-eval| (except that
++ lua does not support running vim functions), |python-eval| is
++ kept for backwards compatibility in order not to make scripts
++ relying on outputs of vim.eval() being a copy of original or
++ vim.eval("1") returning a string.
++
+
+
+ Error object of the "vim" module
+***************
+*** 222,229 ****
+ - from indexing vim.buffers (|python-buffers|)
+ - from the "buffer" attribute of a window (|python-window|)
+
+! Buffer objects have one read-only attribute - name - the full file name for
+! the buffer. They also have three methods (append, mark, and range; see below).
+
+ You can also treat buffer objects as sequence objects. In this context, they
+ act as if they were lists (yes, they are mutable) of strings, with each
+--- 239,247 ----
+ - from indexing vim.buffers (|python-buffers|)
+ - from the "buffer" attribute of a window (|python-window|)
+
+! Buffer objects have two read-only attributes - name - the full file name for
+! the buffer, and number - the buffer number. They also have three methods
+! (append, mark, and range; see below).
+
+ You can also treat buffer objects as sequence objects. In this context, they
+ act as if they were lists (yes, they are mutable) of strings, with each
+***************
+*** 318,324 ****
+ The width attribute is writable only if the screen is split vertically.
+
+ ==============================================================================
+! 6. Dynamic loading *python-dynamic*
+
+ On MS-Windows the Python library can be loaded dynamically. The |:version|
+ output then includes |+python/dyn|.
+--- 336,348 ----
+ The width attribute is writable only if the screen is split vertically.
+
+ ==============================================================================
+! 6. pyeval() and py3eval() Vim functions *python-pyeval*
+!
+! To facilitate bi-directional interface, you can use |pyeval()| and |py3eval()|
+! functions to evaluate Python expressions and pass their values to VimL.
+!
+! ==============================================================================
+! 7. Dynamic loading *python-dynamic*
+
+ On MS-Windows the Python library can be loaded dynamically. The |:version|
+ output then includes |+python/dyn|.
+***************
+*** 335,347 ****
+ sure edit "gvim.exe" and search for "python\d*.dll\c".
+
+ ==============================================================================
+! 7. Python 3 *python3*
+
+ *:py3* *:python3*
+ The |:py3| and |:python3| commands work similar to |:python|.
+ *:py3file*
+ The |:py3file| command works similar to |:pyfile|.
+
+ Vim can be built in four ways (:version output):
+ 1. No Python support (-python, -python3)
+ 2. Python 2 support only (+python or +python/dyn, -python3)
+--- 359,372 ----
+ sure edit "gvim.exe" and search for "python\d*.dll\c".
+
+ ==============================================================================
+! 8. Python 3 *python3*
+
+ *:py3* *:python3*
+ The |:py3| and |:python3| commands work similar to |:python|.
+ *:py3file*
+ The |:py3file| command works similar to |:pyfile|.
+
++
+ Vim can be built in four ways (:version output):
+ 1. No Python support (-python, -python3)
+ 2. Python 2 support only (+python or +python/dyn, -python3)
+***************
+*** 355,361 ****
+ When doing this on Linux/Unix systems and importing global symbols, this leads
+ to a crash when the second Python version is used. So either global symbols
+ are loaded but only one Python version is activated, or no global symbols are
+! loaded. The latter makes Python's "import" fail on libaries that expect the
+ symbols to be provided by Vim.
+ *E836* *E837*
+ Vim's configuration script makes a guess for all libraries based on one
+--- 380,386 ----
+ When doing this on Linux/Unix systems and importing global symbols, this leads
+ to a crash when the second Python version is used. So either global symbols
+ are loaded but only one Python version is activated, or no global symbols are
+! loaded. The latter makes Python's "import" fail on libraries that expect the
+ symbols to be provided by Vim.
+ *E836* *E837*
+ Vim's configuration script makes a guess for all libraries based on one
+***************
+*** 377,382 ****
+--- 402,419 ----
+ 3. You undefine PY_NO_RTLD_GLOBAL in auto/config.h after configuration. This
+ may crash Vim though.
+
++ *has-python*
++ You can test what Python version is available with: >
++ if has('python')
++ echo 'there is Python 2.x'
++ elseif has('python3')
++ echo 'there is Python 3.x'
++ endif
++
++ Note however, that when Python 2 and 3 are both available and loaded
++ dynamically, these has() calls will try to load them. If only one can be
++ loaded at a time, just checking if Python 2 or 3 are available will prevent
++ the other one from being available.
+
+ ==============================================================================
+ vim:tw=78:ts=8:ft=help:norl:
+*** ../vim-7.3.568/src/eval.c 2012-06-20 14:13:02.000000000 +0200
+--- src/eval.c 2012-06-20 18:29:15.000000000 +0200
+***************
+*** 424,453 ****
+ static int get_lit_string_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate));
+ static int get_list_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate));
+ static int rettv_list_alloc __ARGS((typval_T *rettv));
+- static listitem_T *listitem_alloc __ARGS((void));
+ static void listitem_free __ARGS((listitem_T *item));
+- static void listitem_remove __ARGS((list_T *l, listitem_T *item));
+ static long list_len __ARGS((list_T *l));
+ static int list_equal __ARGS((list_T *l1, list_T *l2, int ic, int recursive));
+ static int dict_equal __ARGS((dict_T *d1, dict_T *d2, int ic, int recursive));
+ static int tv_equal __ARGS((typval_T *tv1, typval_T *tv2, int ic, int recursive));
+- static listitem_T *list_find __ARGS((list_T *l, long n));
+ static long list_find_nr __ARGS((list_T *l, long idx, int *errorp));
+ static long list_idx_of_item __ARGS((list_T *l, listitem_T *item));
+- static void list_append __ARGS((list_T *l, listitem_T *item));
+ static int list_append_number __ARGS((list_T *l, varnumber_T n));
+- static int list_insert_tv __ARGS((list_T *l, typval_T *tv, listitem_T *item));
+ static int list_extend __ARGS((list_T *l1, list_T *l2, listitem_T *bef));
+ static int list_concat __ARGS((list_T *l1, list_T *l2, typval_T *tv));
+ static list_T *list_copy __ARGS((list_T *orig, int deep, int copyID));
+- static void list_remove __ARGS((list_T *l, listitem_T *item, listitem_T *item2));
+ static char_u *list2string __ARGS((typval_T *tv, int copyID));
+ static int list_join_inner __ARGS((garray_T *gap, list_T *l, char_u *sep, int echo_style, int copyID, garray_T *join_gap));
+ static int list_join __ARGS((garray_T *gap, list_T *l, char_u *sep, int echo, int copyID));
+ static int free_unref_items __ARGS((int copyID));
+- static void set_ref_in_ht __ARGS((hashtab_T *ht, int copyID));
+- static void set_ref_in_list __ARGS((list_T *l, int copyID));
+- static void set_ref_in_item __ARGS((typval_T *tv, int copyID));
+ static int rettv_dict_alloc __ARGS((typval_T *rettv));
+ static void dict_free __ARGS((dict_T *d, int recurse));
+ static dictitem_T *dictitem_copy __ARGS((dictitem_T *org));
+--- 424,444 ----
+***************
+*** 654,659 ****
+--- 645,656 ----
+ static void f_prevnonblank __ARGS((typval_T *argvars, typval_T *rettv));
+ static void f_printf __ARGS((typval_T *argvars, typval_T *rettv));
+ static void f_pumvisible __ARGS((typval_T *argvars, typval_T *rettv));
++ #ifdef FEAT_PYTHON3
++ static void f_py3eval __ARGS((typval_T *argvars, typval_T *rettv));
++ #endif
++ #ifdef FEAT_PYTHON
++ static void f_pyeval __ARGS((typval_T *argvars, typval_T *rettv));
++ #endif
+ static void f_range __ARGS((typval_T *argvars, typval_T *rettv));
+ static void f_readfile __ARGS((typval_T *argvars, typval_T *rettv));
+ static void f_reltime __ARGS((typval_T *argvars, typval_T *rettv));
+***************
+*** 824,831 ****
+ static char_u *autoload_name __ARGS((char_u *name));
+ static void cat_func_name __ARGS((char_u *buf, ufunc_T *fp));
+ static void func_free __ARGS((ufunc_T *fp));
+- static void func_unref __ARGS((char_u *name));
+- static void func_ref __ARGS((char_u *name));
+ 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));
+ static int can_free_funccal __ARGS((funccall_T *fc, int copyID)) ;
+ static void free_funccal __ARGS((funccall_T *fc, int free_val));
+--- 821,826 ----
+***************
+*** 5927,5933 ****
+ /*
+ * Allocate a list item.
+ */
+! static listitem_T *
+ listitem_alloc()
+ {
+ return (listitem_T *)alloc(sizeof(listitem_T));
+--- 5922,5928 ----
+ /*
+ * Allocate a list item.
+ */
+! listitem_T *
+ listitem_alloc()
+ {
+ return (listitem_T *)alloc(sizeof(listitem_T));
+***************
+*** 5947,5953 ****
+ /*
+ * Remove a list item from a List and free it. Also clears the value.
+ */
+! static void
+ listitem_remove(l, item)
+ list_T *l;
+ listitem_T *item;
+--- 5942,5948 ----
+ /*
+ * Remove a list item from a List and free it. Also clears the value.
+ */
+! void
+ listitem_remove(l, item)
+ list_T *l;
+ listitem_T *item;
+***************
+*** 6123,6129 ****
+ * A negative index is counted from the end; -1 is the last item.
+ * Returns NULL when "n" is out of range.
+ */
+! static listitem_T *
+ list_find(l, n)
+ list_T *l;
+ long n;
+--- 6118,6124 ----
+ * A negative index is counted from the end; -1 is the last item.
+ * Returns NULL when "n" is out of range.
+ */
+! listitem_T *
+ list_find(l, n)
+ list_T *l;
+ long n;
+***************
+*** 6265,6271 ****
+ /*
+ * Append item "item" to the end of list "l".
+ */
+! static void
+ list_append(l, item)
+ list_T *l;
+ listitem_T *item;
+--- 6260,6266 ----
+ /*
+ * Append item "item" to the end of list "l".
+ */
+! void
+ list_append(l, item)
+ list_T *l;
+ listitem_T *item;
+***************
+*** 6378,6384 ****
+ * If "item" is NULL append at the end.
+ * Return FAIL when out of memory.
+ */
+! static int
+ list_insert_tv(l, tv, item)
+ list_T *l;
+ typval_T *tv;
+--- 6373,6379 ----
+ * If "item" is NULL append at the end.
+ * Return FAIL when out of memory.
+ */
+! int
+ list_insert_tv(l, tv, item)
+ list_T *l;
+ typval_T *tv;
+***************
+*** 6523,6529 ****
+ * Remove items "item" to "item2" from list "l".
+ * Does not free the listitem or the value!
+ */
+! static void
+ list_remove(l, item, item2)
+ list_T *l;
+ listitem_T *item;
+--- 6518,6524 ----
+ * Remove items "item" to "item2" from list "l".
+ * Does not free the listitem or the value!
+ */
+! void
+ list_remove(l, item, item2)
+ list_T *l;
+ listitem_T *item;
+***************
+*** 6785,6790 ****
+--- 6780,6793 ----
+ set_ref_in_lua(copyID);
+ #endif
+
++ #ifdef FEAT_PYTHON
++ set_ref_in_python(copyID);
++ #endif
++
++ #ifdef FEAT_PYTHON3
++ set_ref_in_python3(copyID);
++ #endif
++
+ /*
+ * 2. Free lists and dictionaries that are not referenced.
+ */
+***************
+*** 6870,6876 ****
+ /*
+ * Mark all lists and dicts referenced through hashtab "ht" with "copyID".
+ */
+! static void
+ set_ref_in_ht(ht, copyID)
+ hashtab_T *ht;
+ int copyID;
+--- 6873,6879 ----
+ /*
+ * Mark all lists and dicts referenced through hashtab "ht" with "copyID".
+ */
+! void
+ set_ref_in_ht(ht, copyID)
+ hashtab_T *ht;
+ int copyID;
+***************
+*** 6890,6896 ****
+ /*
+ * Mark all lists and dicts referenced through list "l" with "copyID".
+ */
+! static void
+ set_ref_in_list(l, copyID)
+ list_T *l;
+ int copyID;
+--- 6893,6899 ----
+ /*
+ * Mark all lists and dicts referenced through list "l" with "copyID".
+ */
+! void
+ set_ref_in_list(l, copyID)
+ list_T *l;
+ int copyID;
+***************
+*** 6904,6910 ****
+ /*
+ * Mark all lists and dicts referenced through typval "tv" with "copyID".
+ */
+! static void
+ set_ref_in_item(tv, copyID)
+ typval_T *tv;
+ int copyID;
+--- 6907,6913 ----
+ /*
+ * Mark all lists and dicts referenced through typval "tv" with "copyID".
+ */
+! void
+ set_ref_in_item(tv, copyID)
+ typval_T *tv;
+ int copyID;
+***************
+*** 7986,7991 ****
+--- 7989,8000 ----
+ {"prevnonblank", 1, 1, f_prevnonblank},
+ {"printf", 2, 19, f_printf},
+ {"pumvisible", 0, 0, f_pumvisible},
++ #ifdef FEAT_PYTHON3
++ {"py3eval", 1, 1, f_py3eval},
++ #endif
++ #ifdef FEAT_PYTHON
++ {"pyeval", 1, 1, f_pyeval},
++ #endif
+ {"range", 1, 3, f_range},
+ {"readfile", 1, 3, f_readfile},
+ {"reltime", 0, 2, f_reltime},
+***************
+*** 9150,9155 ****
+--- 9159,9203 ----
+ #endif
+ }
+
++ int
++ func_call(name, args, selfdict, rettv)
++ char_u *name;
++ typval_T *args;
++ dict_T *selfdict;
++ typval_T *rettv;
++ {
++ listitem_T *item;
++ typval_T argv[MAX_FUNC_ARGS + 1];
++ int argc = 0;
++ int dummy;
++ int r = 0;
++
++ for (item = args->vval.v_list->lv_first; item != NULL;
++ item = item->li_next)
++ {
++ if (argc == MAX_FUNC_ARGS)
++ {
++ EMSG(_("E699: Too many arguments"));
++ break;
++ }
++ /* Make a copy of each argument. This is needed to be able to set
++ * v_lock to VAR_FIXED in the copy without changing the original list.
++ */
++ copy_tv(&item->li_tv, &argv[argc++]);
++ }
++
++ if (item == NULL)
++ r = call_func(name, (int)STRLEN(name), rettv, argc, argv,
++ curwin->w_cursor.lnum, curwin->w_cursor.lnum,
++ &dummy, TRUE, selfdict);
++
++ /* Free the arguments. */
++ while (argc > 0)
++ clear_tv(&argv[--argc]);
++
++ return r;
++ }
++
+ /*
+ * "call(func, arglist)" function
+ */
+***************
+*** 9159,9168 ****
+ typval_T *rettv;
+ {
+ char_u *func;
+- typval_T argv[MAX_FUNC_ARGS + 1];
+- int argc = 0;
+- listitem_T *item;
+- int dummy;
+ dict_T *selfdict = NULL;
+
+ if (argvars[1].v_type != VAR_LIST)
+--- 9207,9212 ----
+***************
+*** 9190,9217 ****
+ selfdict = argvars[2].vval.v_dict;
+ }
+
+! for (item = argvars[1].vval.v_list->lv_first; item != NULL;
+! item = item->li_next)
+! {
+! if (argc == MAX_FUNC_ARGS)
+! {
+! EMSG(_("E699: Too many arguments"));
+! break;
+! }
+! /* Make a copy of each argument. This is needed to be able to set
+! * v_lock to VAR_FIXED in the copy without changing the original list.
+! */
+! copy_tv(&item->li_tv, &argv[argc++]);
+! }
+!
+! if (item == NULL)
+! (void)call_func(func, (int)STRLEN(func), rettv, argc, argv,
+! curwin->w_cursor.lnum, curwin->w_cursor.lnum,
+! &dummy, TRUE, selfdict);
+!
+! /* Free the arguments. */
+! while (argc > 0)
+! clear_tv(&argv[--argc]);
+ }
+
+ #ifdef FEAT_FLOAT
+--- 9234,9240 ----
+ selfdict = argvars[2].vval.v_dict;
+ }
+
+! (void)func_call(func, &argvars[1], selfdict, rettv);
+ }
+
+ #ifdef FEAT_FLOAT
+***************
+*** 14424,14429 ****
+--- 14447,14486 ----
+ #endif
+ }
+
++ #ifdef FEAT_PYTHON3
++ /*
++ * "py3eval()" function
++ */
++ static void
++ f_py3eval(argvars, rettv)
++ typval_T *argvars;
++ typval_T *rettv;
++ {
++ char_u *str;
++ char_u buf[NUMBUFLEN];
++
++ str = get_tv_string_buf(&argvars[0], buf);
++ do_py3eval(str, rettv);
++ }
++ #endif
++
++ #ifdef FEAT_PYTHON
++ /*
++ * "pyeval()" function
++ */
++ static void
++ f_pyeval(argvars, rettv)
++ typval_T *argvars;
++ typval_T *rettv;
++ {
++ char_u *str;
++ char_u buf[NUMBUFLEN];
++
++ str = get_tv_string_buf(&argvars[0], buf);
++ do_pyeval(str, rettv);
++ }
++ #endif
++
+ /*
+ * "range()" function
+ */
+***************
+*** 22139,22145 ****
+ * Unreference a Function: decrement the reference count and free it when it
+ * becomes zero. Only for numbered functions.
+ */
+! static void
+ func_unref(name)
+ char_u *name;
+ {
+--- 22196,22202 ----
+ * Unreference a Function: decrement the reference count and free it when it
+ * becomes zero. Only for numbered functions.
+ */
+! void
+ func_unref(name)
+ char_u *name;
+ {
+***************
+*** 22163,22169 ****
+ /*
+ * Count a reference to a Function.
+ */
+! static void
+ func_ref(name)
+ char_u *name;
+ {
+--- 22220,22226 ----
+ /*
+ * Count a reference to a Function.
+ */
+! void
+ func_ref(name)
+ char_u *name;
+ {
+*** ../vim-7.3.568/src/if_lua.c 2012-04-06 14:30:55.000000000 +0200
+--- src/if_lua.c 2012-06-20 18:16:33.000000000 +0200
+***************
+*** 199,207 ****
+ lua_Number (*dll_lua_tonumberx) (lua_State *L, int idx, int *isnum);
+ lua_Integer (*dll_lua_tointegerx) (lua_State *L, int idx, int *isnum);
+ void (*dll_lua_callk) (lua_State *L, int nargs, int nresults, int ctx,
+! lua_CFunction k);
+ int (*dll_lua_pcallk) (lua_State *L, int nargs, int nresults, int errfunc,
+! int ctx, lua_CFunction k);
+ void (*dll_lua_getglobal) (lua_State *L, const char *var);
+ void (*dll_lua_setglobal) (lua_State *L, const char *var);
+ #endif
+--- 199,207 ----
+ lua_Number (*dll_lua_tonumberx) (lua_State *L, int idx, int *isnum);
+ lua_Integer (*dll_lua_tointegerx) (lua_State *L, int idx, int *isnum);
+ void (*dll_lua_callk) (lua_State *L, int nargs, int nresults, int ctx,
+! lua_CFunction k);
+ int (*dll_lua_pcallk) (lua_State *L, int nargs, int nresults, int errfunc,
+! int ctx, lua_CFunction k);
+ void (*dll_lua_getglobal) (lua_State *L, const char *var);
+ void (*dll_lua_setglobal) (lua_State *L, const char *var);
+ #endif
+***************
+*** 394,400 ****
+ luaL_typeerror (lua_State *L, int narg, const char *tname)
+ {
+ const char *msg = lua_pushfstring(L, "%s expected, got %s",
+! tname, luaL_typename(L, narg));
+ return luaL_argerror(L, narg, msg);
+ }
+ #endif
+--- 394,400 ----
+ luaL_typeerror (lua_State *L, int narg, const char *tname)
+ {
+ const char *msg = lua_pushfstring(L, "%s expected, got %s",
+! tname, luaL_typename(L, narg));
+ return luaL_argerror(L, narg, msg);
+ }
+ #endif
+***************
+*** 646,786 ****
+ return 1; \
+ }
+
+-
+- /* adapted from eval.c */
+-
+- #define listitem_alloc() (listitem_T *)alloc(sizeof(listitem_T))
+-
+- static listitem_T *
+- list_find (list_T *l, long n)
+- {
+- listitem_T *li;
+- if (l == NULL || n < -l->lv_len || n >= l->lv_len)
+- return NULL;
+- if (n < 0) /* search backward? */
+- for (li = l->lv_last; n < -1; li = li->li_prev)
+- n++;
+- else /* search forward */
+- for (li = l->lv_first; n > 0; li = li->li_next)
+- n--;
+- return li;
+- }
+-
+- static void
+- list_remove (list_T *l, listitem_T *li)
+- {
+- listwatch_T *lw;
+- --l->lv_len;
+- /* fix watchers */
+- for (lw = l->lv_watch; lw != NULL; lw = lw->lw_next)
+- if (lw->lw_item == li)
+- lw->lw_item = li->li_next;
+- /* fix list pointers */
+- if (li->li_next == NULL) /* last? */
+- l->lv_last = li->li_prev;
+- else
+- li->li_next->li_prev = li->li_prev;
+- if (li->li_prev == NULL) /* first? */
+- l->lv_first = li->li_next;
+- else
+- li->li_prev->li_next = li->li_next;
+- l->lv_idx_item = NULL;
+- }
+-
+- static void
+- list_append(list_T *l, listitem_T *item)
+- {
+- if (l->lv_last == NULL) /* empty list? */
+- l->lv_first = item;
+- else
+- l->lv_last->li_next = item;
+- item->li_prev = l->lv_last;
+- item->li_next = NULL;
+- l->lv_last = item;
+- ++l->lv_len;
+- }
+-
+- static int
+- list_insert_tv(list_T *l, typval_T *tv, listitem_T *item)
+- {
+- listitem_T *ni = listitem_alloc();
+-
+- if (ni == NULL)
+- return FAIL;
+- copy_tv(tv, &ni->li_tv);
+- if (item == NULL)
+- list_append(l, ni);
+- else
+- {
+- ni->li_prev = item->li_prev;
+- ni->li_next = item;
+- if (item->li_prev == NULL)
+- {
+- l->lv_first = ni;
+- ++l->lv_idx;
+- }
+- else
+- {
+- item->li_prev->li_next = ni;
+- l->lv_idx_item = NULL;
+- }
+- item->li_prev = ni;
+- ++l->lv_len;
+- }
+- return OK;
+- }
+-
+- /* set references */
+-
+- static void set_ref_in_tv (typval_T *tv, int copyID);
+-
+- static void
+- set_ref_in_dict(dict_T *d, int copyID)
+- {
+- hashtab_T *ht = &d->dv_hashtab;
+- int n = ht->ht_used;
+- hashitem_T *hi;
+- for (hi = ht->ht_array; n > 0; ++hi)
+- if (!HASHITEM_EMPTY(hi))
+- {
+- dictitem_T *di = dict_lookup(hi);
+- set_ref_in_tv(&di->di_tv, copyID);
+- --n;
+- }
+- }
+-
+- static void
+- set_ref_in_list(list_T *l, int copyID)
+- {
+- listitem_T *li;
+- for (li = l->lv_first; li != NULL; li = li->li_next)
+- set_ref_in_tv(&li->li_tv, copyID);
+- }
+-
+- static void
+- set_ref_in_tv(typval_T *tv, int copyID)
+- {
+- if (tv->v_type == VAR_LIST)
+- {
+- list_T *l = tv->vval.v_list;
+- if (l != NULL && l->lv_copyID != copyID)
+- {
+- l->lv_copyID = copyID;
+- set_ref_in_list(l, copyID);
+- }
+- }
+- else if (tv->v_type == VAR_DICT)
+- {
+- dict_T *d = tv->vval.v_dict;
+- if (d != NULL && d->dv_copyID != copyID)
+- {
+- d->dv_copyID = copyID;
+- set_ref_in_dict(d, copyID);
+- }
+- }
+- }
+-
+-
+ /* ======= List type ======= */
+
+ static luaV_List *
+--- 646,651 ----
+***************
+*** 876,882 ****
+ if (li == NULL) return 0;
+ if (lua_isnil(L, 3)) /* remove? */
+ {
+! list_remove(l, li);
+ clear_tv(&li->li_tv);
+ vim_free(li);
+ }
+--- 741,747 ----
+ if (li == NULL) return 0;
+ if (lua_isnil(L, 3)) /* remove? */
+ {
+! list_remove(l, li, li);
+ clear_tv(&li->li_tv);
+ vim_free(li);
+ }
+***************
+*** 904,911 ****
+ typval_T v;
+ lua_settop(L, 2);
+ luaV_totypval(L, 2, &v);
+! copy_tv(&v, &li->li_tv);
+! list_append(l, li);
+ }
+ lua_settop(L, 1);
+ return 1;
+--- 769,775 ----
+ typval_T v;
+ lua_settop(L, 2);
+ luaV_totypval(L, 2, &v);
+! list_append_tv(l, &v);
+ }
+ lua_settop(L, 1);
+ return 1;
+***************
+*** 1682,1688 ****
+ tv.vval.v_dict = (dict_T *) lua_touserdata(L, 4); /* key */
+ }
+ lua_pop(L, 2); /* metatable and value */
+! set_ref_in_tv(&tv, copyID);
+ }
+ return 0;
+ }
+--- 1546,1552 ----
+ tv.vval.v_dict = (dict_T *) lua_touserdata(L, 4); /* key */
+ }
+ lua_pop(L, 2); /* metatable and value */
+! set_ref_in_item(&tv, copyID);
+ }
+ return 0;
+ }
+*** ../vim-7.3.568/src/if_py_both.h 2012-04-20 13:31:16.000000000 +0200
+--- src/if_py_both.h 2012-06-29 12:03:52.000000000 +0200
+***************
+*** 1,4 ****
+! /* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+--- 1,4 ----
+! /* vi:set ts=8 sts=4 sw=4 noet:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+***************
+*** 105,111 ****
+ return NULL;
+ Py_INCREF(list);
+
+! if (!PyList_Check(list)) {
+ PyErr_SetString(PyExc_TypeError, _("writelines() requires list of strings"));
+ Py_DECREF(list);
+ return NULL;
+--- 105,112 ----
+ return NULL;
+ Py_INCREF(list);
+
+! if (!PyList_Check(list))
+! {
+ PyErr_SetString(PyExc_TypeError, _("writelines() requires list of strings"));
+ Py_DECREF(list);
+ return NULL;
+***************
+*** 119,125 ****
+ char *str = NULL;
+ PyInt len;
+
+! if (!PyArg_Parse(line, "et#", ENC_OPT, &str, &len)) {
+ PyErr_SetString(PyExc_TypeError, _("writelines() requires list of strings"));
+ Py_DECREF(list);
+ return NULL;
+--- 120,127 ----
+ char *str = NULL;
+ PyInt len;
+
+! if (!PyArg_Parse(line, "et#", ENC_OPT, &str, &len))
+! {
+ PyErr_SetString(PyExc_TypeError, _("writelines() requires list of strings"));
+ Py_DECREF(list);
+ return NULL;
+***************
+*** 297,303 ****
+ {
+ PyObject *result;
+ PyObject *newObj;
+! char ptrBuf[NUMBUFLEN];
+
+ /* Avoid infinite recursion */
+ if (depth > 100)
+--- 299,305 ----
+ {
+ PyObject *result;
+ PyObject *newObj;
+! char ptrBuf[sizeof(void *) * 2 + 3];
+
+ /* Avoid infinite recursion */
+ if (depth > 100)
+***************
+*** 312,320 ****
+ if ((our_tv->v_type == VAR_LIST && our_tv->vval.v_list != NULL)
+ || (our_tv->v_type == VAR_DICT && our_tv->vval.v_dict != NULL))
+ {
+! sprintf(ptrBuf, PRINTF_DECIMAL_LONG_U,
+! our_tv->v_type == VAR_LIST ? (long_u)our_tv->vval.v_list
+! : (long_u)our_tv->vval.v_dict);
+ result = PyDict_GetItemString(lookupDict, ptrBuf);
+ if (result != NULL)
+ {
+--- 314,322 ----
+ if ((our_tv->v_type == VAR_LIST && our_tv->vval.v_list != NULL)
+ || (our_tv->v_type == VAR_DICT && our_tv->vval.v_dict != NULL))
+ {
+! sprintf(ptrBuf, "%p",
+! our_tv->v_type == VAR_LIST ? (void *)our_tv->vval.v_list
+! : (void *)our_tv->vval.v_dict);
+ result = PyDict_GetItemString(lookupDict, ptrBuf);
+ if (result != NULL)
+ {
+***************
+*** 374,509 ****
+ hashitem_T *hi;
+ dictitem_T *di;
+
+! PyDict_SetItemString(lookupDict, ptrBuf, result);
+
+! for (hi = ht->ht_array; todo > 0; ++hi)
+ {
+! if (!HASHITEM_EMPTY(hi))
+! {
+! --todo;
+!
+! di = dict_lookup(hi);
+! newObj = VimToPython(&di->di_tv, depth + 1, lookupDict);
+! PyDict_SetItemString(result, (char *)hi->hi_key, newObj);
+! Py_DECREF(newObj);
+! }
+ }
+ }
+ }
+! else
+ {
+! Py_INCREF(Py_None);
+! result = Py_None;
+ }
+
+! return result;
+ }
+- #endif
+
+ static PyObject *
+! VimEval(PyObject *self UNUSED, PyObject *args UNUSED)
+ {
+! #ifdef FEAT_EVAL
+! char *expr;
+! typval_T *our_tv;
+! PyObject *result;
+! PyObject *lookup_dict;
+
+! if (!PyArg_ParseTuple(args, "s", &expr))
+ return NULL;
+
+! Py_BEGIN_ALLOW_THREADS
+! Python_Lock_Vim();
+! our_tv = eval_expr((char_u *)expr, NULL);
+!
+! Python_Release_Vim();
+! Py_END_ALLOW_THREADS
+!
+! if (our_tv == NULL)
+ {
+! PyErr_SetVim(_("invalid expression"));
+ return NULL;
+ }
+
+- /* Convert the Vim type into a Python type. Create a dictionary that's
+- * used to check for recursive loops. */
+ lookup_dict = PyDict_New();
+! result = VimToPython(our_tv, 1, lookup_dict);
+ Py_DECREF(lookup_dict);
+
+!
+! Py_BEGIN_ALLOW_THREADS
+! Python_Lock_Vim();
+! free_tv(our_tv);
+! Python_Release_Vim();
+! Py_END_ALLOW_THREADS
+!
+! return result;
+! #else
+! PyErr_SetVim(_("expressions disabled at compile time"));
+! return NULL;
+! #endif
+ }
+
+! /*
+! * Vim module - Definitions
+! */
+!
+! static struct PyMethodDef VimMethods[] = {
+! /* name, function, calling, documentation */
+! {"command", VimCommand, 1, "Execute a Vim ex-mode command" },
+! {"eval", VimEval, 1, "Evaluate an expression using Vim evaluator" },
+! { NULL, NULL, 0, NULL }
+ };
+
+ typedef struct
+ {
+ PyObject_HEAD
+! buf_T *buf;
+! }
+! BufferObject;
+
+! #define INVALID_BUFFER_VALUE ((buf_T *)(-1))
+!
+! /*
+! * Buffer list object - Implementation
+! */
+
+! static PyInt
+! BufListLength(PyObject *self UNUSED)
+ {
+! buf_T *b = firstbuf;
+! PyInt n = 0;
+
+! while (b)
+ {
+! ++n;
+! b = b->b_next;
+ }
+!
+! return n;
+ }
+
+ static PyObject *
+! BufListItem(PyObject *self UNUSED, PyInt n)
+ {
+! buf_T *b;
+
+! for (b = firstbuf; b; b = b->b_next, --n)
+ {
+! if (n == 0)
+! return BufferNew(b);
+ }
+
+! PyErr_SetString(PyExc_IndexError, _("no such buffer"));
+! return NULL;
+ }
+
+! typedef struct
+! {
+! PyObject_HEAD
+! win_T *win;
+! } WindowObject;
+
+ #define INVALID_WINDOW_VALUE ((win_T *)(-1))
+
+--- 376,1325 ----
+ hashitem_T *hi;
+ dictitem_T *di;
+
+! PyDict_SetItemString(lookupDict, ptrBuf, result);
+!
+! for (hi = ht->ht_array; todo > 0; ++hi)
+! {
+! if (!HASHITEM_EMPTY(hi))
+! {
+! --todo;
+!
+! di = dict_lookup(hi);
+! newObj = VimToPython(&di->di_tv, depth + 1, lookupDict);
+! PyDict_SetItemString(result, (char *)hi->hi_key, newObj);
+! Py_DECREF(newObj);
+! }
+! }
+! }
+! }
+! else
+! {
+! Py_INCREF(Py_None);
+! result = Py_None;
+! }
+!
+! return result;
+! }
+! #endif
+!
+! static PyObject *
+! VimEval(PyObject *self UNUSED, PyObject *args UNUSED)
+! {
+! #ifdef FEAT_EVAL
+! char *expr;
+! typval_T *our_tv;
+! PyObject *result;
+! PyObject *lookup_dict;
+!
+! if (!PyArg_ParseTuple(args, "s", &expr))
+! return NULL;
+!
+! Py_BEGIN_ALLOW_THREADS
+! Python_Lock_Vim();
+! our_tv = eval_expr((char_u *)expr, NULL);
+!
+! Python_Release_Vim();
+! Py_END_ALLOW_THREADS
+!
+! if (our_tv == NULL)
+! {
+! PyErr_SetVim(_("invalid expression"));
+! return NULL;
+! }
+!
+! /* Convert the Vim type into a Python type. Create a dictionary that's
+! * used to check for recursive loops. */
+! lookup_dict = PyDict_New();
+! result = VimToPython(our_tv, 1, lookup_dict);
+! Py_DECREF(lookup_dict);
+!
+!
+! Py_BEGIN_ALLOW_THREADS
+! Python_Lock_Vim();
+! free_tv(our_tv);
+! Python_Release_Vim();
+! Py_END_ALLOW_THREADS
+!
+! return result;
+! #else
+! PyErr_SetVim(_("expressions disabled at compile time"));
+! return NULL;
+! #endif
+! }
+!
+! static PyObject *ConvertToPyObject(typval_T *);
+!
+! static PyObject *
+! VimEvalPy(PyObject *self UNUSED, PyObject *args UNUSED)
+! {
+! #ifdef FEAT_EVAL
+! char *expr;
+! typval_T *our_tv;
+! PyObject *result;
+!
+! if (!PyArg_ParseTuple(args, "s", &expr))
+! return NULL;
+!
+! Py_BEGIN_ALLOW_THREADS
+! Python_Lock_Vim();
+! our_tv = eval_expr((char_u *)expr, NULL);
+!
+! Python_Release_Vim();
+! Py_END_ALLOW_THREADS
+!
+! if (our_tv == NULL)
+! {
+! PyErr_SetVim(_("invalid expression"));
+! return NULL;
+! }
+!
+! result = ConvertToPyObject(our_tv);
+! Py_BEGIN_ALLOW_THREADS
+! Python_Lock_Vim();
+! free_tv(our_tv);
+! Python_Release_Vim();
+! Py_END_ALLOW_THREADS
+!
+! return result;
+! #else
+! PyErr_SetVim(_("expressions disabled at compile time"));
+! return NULL;
+! #endif
+! }
+!
+! static PyObject *
+! VimStrwidth(PyObject *self UNUSED, PyObject *args)
+! {
+! char *expr;
+!
+! if (!PyArg_ParseTuple(args, "s", &expr))
+! return NULL;
+!
+! return PyLong_FromLong(mb_string2cells((char_u *)expr, STRLEN(expr)));
+! }
+!
+! /*
+! * Vim module - Definitions
+! */
+!
+! static struct PyMethodDef VimMethods[] = {
+! /* name, function, calling, documentation */
+! {"command", VimCommand, 1, "Execute a Vim ex-mode command" },
+! {"eval", VimEval, 1, "Evaluate an expression using Vim evaluator" },
+! {"bindeval", VimEvalPy, 1, "Like eval(), but returns objects attached to vim ones"},
+! {"strwidth", VimStrwidth, 1, "Screen string width, counts <Tab> as having width 1"},
+! { NULL, NULL, 0, NULL }
+! };
+!
+! typedef struct
+! {
+! PyObject_HEAD
+! buf_T *buf;
+! } BufferObject;
+!
+! #define INVALID_BUFFER_VALUE ((buf_T *)(-1))
+!
+! /*
+! * Buffer list object - Implementation
+! */
+!
+! static PyInt
+! BufListLength(PyObject *self UNUSED)
+! {
+! buf_T *b = firstbuf;
+! PyInt n = 0;
+!
+! while (b)
+! {
+! ++n;
+! b = b->b_next;
+! }
+!
+! return n;
+! }
+!
+! static PyObject *
+! BufListItem(PyObject *self UNUSED, PyInt n)
+! {
+! buf_T *b;
+!
+! for (b = firstbuf; b; b = b->b_next, --n)
+! {
+! if (n == 0)
+! return BufferNew(b);
+! }
+!
+! PyErr_SetString(PyExc_IndexError, _("no such buffer"));
+! return NULL;
+! }
+!
+! typedef struct
+! {
+! PyObject_HEAD
+! win_T *win;
+! } WindowObject;
+!
+! static int ConvertFromPyObject(PyObject *, typval_T *);
+! static int _ConvertFromPyObject(PyObject *, typval_T *, PyObject *);
+!
+! typedef struct pylinkedlist_S {
+! struct pylinkedlist_S *pll_next;
+! struct pylinkedlist_S *pll_prev;
+! PyObject *pll_obj;
+! } pylinkedlist_T;
+!
+! static pylinkedlist_T *lastdict = NULL;
+! static pylinkedlist_T *lastlist = NULL;
+!
+! static void
+! pyll_remove(pylinkedlist_T *ref, pylinkedlist_T **last)
+! {
+! if (ref->pll_prev == NULL)
+! {
+! if (ref->pll_next == NULL)
+! {
+! *last = NULL;
+! return;
+! }
+! }
+! else
+! ref->pll_prev->pll_next = ref->pll_next;
+!
+! if (ref->pll_next == NULL)
+! *last = ref->pll_prev;
+! else
+! ref->pll_next->pll_prev = ref->pll_prev;
+! }
+!
+! static void
+! pyll_add(PyObject *self, pylinkedlist_T *ref, pylinkedlist_T **last)
+! {
+! if (*last == NULL)
+! ref->pll_prev = NULL;
+! else
+! {
+! (*last)->pll_next = ref;
+! ref->pll_prev = *last;
+! }
+! ref->pll_next = NULL;
+! ref->pll_obj = self;
+! *last = ref;
+! }
+!
+! static PyTypeObject DictionaryType;
+!
+! typedef struct
+! {
+! PyObject_HEAD
+! dict_T *dict;
+! pylinkedlist_T ref;
+! } DictionaryObject;
+!
+! static PyObject *
+! DictionaryNew(dict_T *dict)
+! {
+! DictionaryObject *self;
+!
+! self = PyObject_NEW(DictionaryObject, &DictionaryType);
+! if (self == NULL)
+! return NULL;
+! self->dict = dict;
+! ++dict->dv_refcount;
+!
+! pyll_add((PyObject *)(self), &self->ref, &lastdict);
+!
+! return (PyObject *)(self);
+! }
+!
+! static int
+! pydict_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict)
+! {
+! dict_T *d;
+! char_u *key;
+! dictitem_T *di;
+! PyObject *keyObject;
+! PyObject *valObject;
+! Py_ssize_t iter = 0;
+!
+! d = dict_alloc();
+! if (d == NULL)
+! {
+! PyErr_NoMemory();
+! return -1;
+! }
+!
+! tv->v_type = VAR_DICT;
+! tv->vval.v_dict = d;
+!
+! while (PyDict_Next(obj, &iter, &keyObject, &valObject))
+! {
+! DICTKEY_DECL
+!
+! if (keyObject == NULL)
+! return -1;
+! if (valObject == NULL)
+! return -1;
+!
+! DICTKEY_GET(-1)
+!
+! di = dictitem_alloc(key);
+!
+! DICTKEY_UNREF
+!
+! if (di == NULL)
+! {
+! PyErr_NoMemory();
+! return -1;
+! }
+! di->di_tv.v_lock = 0;
+!
+! if (_ConvertFromPyObject(valObject, &di->di_tv, lookupDict) == -1)
+! {
+! vim_free(di);
+! return -1;
+! }
+! if (dict_add(d, di) == FAIL)
+! {
+! vim_free(di);
+! PyErr_SetVim(_("failed to add key to dictionary"));
+! return -1;
+! }
+! }
+! return 0;
+! }
+!
+! static int
+! pymap_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict)
+! {
+! dict_T *d;
+! char_u *key;
+! dictitem_T *di;
+! PyObject *list;
+! PyObject *litem;
+! PyObject *keyObject;
+! PyObject *valObject;
+! Py_ssize_t lsize;
+!
+! d = dict_alloc();
+! if (d == NULL)
+! {
+! PyErr_NoMemory();
+! return -1;
+! }
+!
+! tv->v_type = VAR_DICT;
+! tv->vval.v_dict = d;
+!
+! list = PyMapping_Items(obj);
+! lsize = PyList_Size(list);
+! while (lsize--)
+! {
+! DICTKEY_DECL
+!
+! litem = PyList_GetItem(list, lsize);
+! if (litem == NULL)
+! {
+! Py_DECREF(list);
+! return -1;
+! }
+!
+! keyObject = PyTuple_GetItem(litem, 0);
+! if (keyObject == NULL)
+! {
+! Py_DECREF(list);
+! Py_DECREF(litem);
+! return -1;
+! }
+!
+! DICTKEY_GET(-1)
+!
+! valObject = PyTuple_GetItem(litem, 1);
+! if (valObject == NULL)
+! {
+! Py_DECREF(list);
+! Py_DECREF(litem);
+! return -1;
+! }
+!
+! di = dictitem_alloc(key);
+!
+! DICTKEY_UNREF
+!
+! if (di == NULL)
+! {
+! Py_DECREF(list);
+! Py_DECREF(litem);
+! PyErr_NoMemory();
+! return -1;
+! }
+! di->di_tv.v_lock = 0;
+!
+! if (_ConvertFromPyObject(valObject, &di->di_tv, lookupDict) == -1)
+! {
+! vim_free(di);
+! Py_DECREF(list);
+! Py_DECREF(litem);
+! return -1;
+! }
+! if (dict_add(d, di) == FAIL)
+! {
+! vim_free(di);
+! Py_DECREF(list);
+! Py_DECREF(litem);
+! PyErr_SetVim(_("failed to add key to dictionary"));
+! return -1;
+! }
+! Py_DECREF(litem);
+! }
+! Py_DECREF(list);
+! return 0;
+! }
+!
+! static PyInt
+! DictionaryLength(PyObject *self)
+! {
+! return ((PyInt) ((((DictionaryObject *)(self))->dict->dv_hashtab.ht_used)));
+! }
+!
+! static PyObject *
+! DictionaryItem(PyObject *self, PyObject *keyObject)
+! {
+! char_u *key;
+! dictitem_T *val;
+! DICTKEY_DECL
+!
+! DICTKEY_GET(NULL)
+!
+! val = dict_find(((DictionaryObject *) (self))->dict, key, -1);
+!
+! DICTKEY_UNREF
+!
+! return ConvertToPyObject(&val->di_tv);
+! }
+!
+! static PyInt
+! DictionaryAssItem(PyObject *self, PyObject *keyObject, PyObject *valObject)
+! {
+! char_u *key;
+! typval_T tv;
+! dict_T *d = ((DictionaryObject *)(self))->dict;
+! dictitem_T *di;
+! DICTKEY_DECL
+!
+! if (d->dv_lock)
+! {
+! PyErr_SetVim(_("dict is locked"));
+! return -1;
+! }
+!
+! DICTKEY_GET(-1)
+!
+! di = dict_find(d, key, -1);
+!
+! if (valObject == NULL)
+! {
+! if (di == NULL)
+! {
+! PyErr_SetString(PyExc_IndexError, _("no such key in dictionary"));
+! return -1;
+! }
+! hashitem_T *hi = hash_find(&d->dv_hashtab, di->di_key);
+! hash_remove(&d->dv_hashtab, hi);
+! dictitem_free(di);
+! return 0;
+! }
+!
+! if (ConvertFromPyObject(valObject, &tv) == -1)
+! {
+! return -1;
+! }
+!
+! if (di == NULL)
+! {
+! di = dictitem_alloc(key);
+! if (di == NULL)
+! {
+! PyErr_NoMemory();
+! return -1;
+! }
+! di->di_tv.v_lock = 0;
+!
+! if (dict_add(d, di) == FAIL)
+! {
+! vim_free(di);
+! PyErr_SetVim(_("failed to add key to dictionary"));
+! return -1;
+! }
+! }
+! else
+! clear_tv(&di->di_tv);
+!
+! DICTKEY_UNREF
+!
+! copy_tv(&tv, &di->di_tv);
+! return 0;
+! }
+!
+! static PyObject *
+! DictionaryListKeys(PyObject *self)
+! {
+! dict_T *dict = ((DictionaryObject *)(self))->dict;
+! long_u todo = dict->dv_hashtab.ht_used;
+! Py_ssize_t i = 0;
+! PyObject *r;
+! hashitem_T *hi;
+!
+! r = PyList_New(todo);
+! for (hi = dict->dv_hashtab.ht_array; todo > 0; ++hi)
+! {
+! if (!HASHITEM_EMPTY(hi))
+! {
+! PyList_SetItem(r, i, PyBytes_FromString((char *)(hi->hi_key)));
+! --todo;
+! ++i;
+! }
+! }
+! return r;
+! }
+!
+! static struct PyMethodDef DictionaryMethods[] = {
+! {"keys", (PyCFunction)DictionaryListKeys, METH_NOARGS, ""},
+! { NULL, NULL, 0, NULL }
+! };
+!
+! static PyTypeObject ListType;
+!
+! typedef struct
+! {
+! PyObject_HEAD
+! list_T *list;
+! pylinkedlist_T ref;
+! } ListObject;
+!
+! static PyObject *
+! ListNew(list_T *list)
+! {
+! ListObject *self;
+!
+! self = PyObject_NEW(ListObject, &ListType);
+! if (self == NULL)
+! return NULL;
+! self->list = list;
+! ++list->lv_refcount;
+!
+! pyll_add((PyObject *)(self), &self->ref, &lastlist);
+!
+! return (PyObject *)(self);
+! }
+!
+! static int
+! list_py_concat(list_T *l, PyObject *obj, PyObject *lookupDict)
+! {
+! Py_ssize_t i;
+! Py_ssize_t lsize = PySequence_Size(obj);
+! PyObject *litem;
+! listitem_T *li;
+!
+! for(i=0; i<lsize; i++)
+! {
+! li = listitem_alloc();
+! if (li == NULL)
+! {
+! PyErr_NoMemory();
+! return -1;
+! }
+! li->li_tv.v_lock = 0;
+!
+! litem = PySequence_GetItem(obj, i);
+! if (litem == NULL)
+! return -1;
+! if (_ConvertFromPyObject(litem, &li->li_tv, lookupDict) == -1)
+! return -1;
+!
+! list_append(l, li);
+! }
+! return 0;
+! }
+!
+! static int
+! pyseq_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict)
+! {
+! list_T *l;
+!
+! l = list_alloc();
+! if (l == NULL)
+! {
+! PyErr_NoMemory();
+! return -1;
+! }
+!
+! tv->v_type = VAR_LIST;
+! tv->vval.v_list = l;
+!
+! if (list_py_concat(l, obj, lookupDict) == -1)
+! return -1;
+!
+! return 0;
+! }
+!
+! static int
+! pyiter_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict)
+! {
+! PyObject *iterator = PyObject_GetIter(obj);
+! PyObject *item;
+! list_T *l;
+! listitem_T *li;
+!
+! l = list_alloc();
+!
+! if (l == NULL)
+! {
+! PyErr_NoMemory();
+! return -1;
+! }
+!
+! tv->vval.v_list = l;
+! tv->v_type = VAR_LIST;
+!
+!
+! if (iterator == NULL)
+! return -1;
+!
+! while ((item = PyIter_Next(obj)))
+! {
+! li = listitem_alloc();
+! if (li == NULL)
+! {
+! PyErr_NoMemory();
+! return -1;
+! }
+! li->li_tv.v_lock = 0;
+!
+! if (_ConvertFromPyObject(item, &li->li_tv, lookupDict) == -1)
+! return -1;
+!
+! list_append(l, li);
+!
+! Py_DECREF(item);
+! }
+!
+! Py_DECREF(iterator);
+! return 0;
+! }
+!
+! static PyInt
+! ListLength(PyObject *self)
+! {
+! return ((PyInt) (((ListObject *) (self))->list->lv_len));
+! }
+!
+! static PyObject *
+! ListItem(PyObject *self, Py_ssize_t index)
+! {
+! listitem_T *li;
+!
+! if (index>=ListLength(self))
+! {
+! PyErr_SetString(PyExc_IndexError, "list index out of range");
+! return NULL;
+! }
+! li = list_find(((ListObject *) (self))->list, (long) index);
+! if (li == NULL)
+! {
+! PyErr_SetVim(_("internal error: failed to get vim list item"));
+! return NULL;
+! }
+! return ConvertToPyObject(&li->li_tv);
+! }
+!
+! #define PROC_RANGE \
+! if (last < 0) {\
+! if (last < -size) \
+! last = 0; \
+! else \
+! last += size; \
+! } \
+! if (first < 0) \
+! first = 0; \
+! if (first > size) \
+! first = size; \
+! if (last > size) \
+! last = size;
+!
+! static PyObject *
+! ListSlice(PyObject *self, Py_ssize_t first, Py_ssize_t last)
+! {
+! PyInt i;
+! PyInt size = ListLength(self);
+! PyInt n;
+! PyObject *list;
+! int reversed = 0;
+!
+! PROC_RANGE
+! if (first >= last)
+! first = last;
+!
+! n = last-first;
+! list = PyList_New(n);
+! if (list == NULL)
+! return NULL;
+!
+! for (i = 0; i < n; ++i)
+! {
+! PyObject *item = ListItem(self, i);
+! if (item == NULL)
+! {
+! Py_DECREF(list);
+! return NULL;
+! }
+!
+! if ((PyList_SetItem(list, ((reversed)?(n-i-1):(i)), item)))
+! {
+! Py_DECREF(item);
+! Py_DECREF(list);
+! return NULL;
+! }
+! }
+!
+! return list;
+! }
+!
+! static int
+! ListAssItem(PyObject *self, Py_ssize_t index, PyObject *obj)
+! {
+! typval_T tv;
+! list_T *l = ((ListObject *) (self))->list;
+! listitem_T *li;
+! Py_ssize_t length = ListLength(self);
+!
+! if (l->lv_lock)
+! {
+! PyErr_SetVim(_("list is locked"));
+! return -1;
+! }
+! if (index>length || (index==length && obj==NULL))
+! {
+! PyErr_SetString(PyExc_IndexError, "list index out of range");
+! return -1;
+! }
+!
+! if (obj == NULL)
+! {
+! li = list_find(l, (long) index);
+! list_remove(l, li, li);
+! clear_tv(&li->li_tv);
+! vim_free(li);
+! return 0;
+! }
+!
+! if (ConvertFromPyObject(obj, &tv) == -1)
+! return -1;
+!
+! if (index == length)
+! {
+! if (list_append_tv(l, &tv) == FAIL)
+! {
+! PyErr_SetVim(_("Failed to add item to list"));
+! return -1;
+! }
+! }
+! else
+! {
+! li = list_find(l, (long) index);
+! clear_tv(&li->li_tv);
+! copy_tv(&tv, &li->li_tv);
+! }
+! return 0;
+! }
+!
+! static int
+! ListAssSlice(PyObject *self, Py_ssize_t first, Py_ssize_t last, PyObject *obj)
+! {
+! PyInt size = ListLength(self);
+! Py_ssize_t i;
+! Py_ssize_t lsize;
+! PyObject *litem;
+! listitem_T *li;
+! listitem_T *next;
+! typval_T v;
+! list_T *l = ((ListObject *) (self))->list;
+!
+! if (l->lv_lock)
+! {
+! PyErr_SetVim(_("list is locked"));
+! return -1;
+! }
+!
+! PROC_RANGE
+
+! if (first == size)
+! li = NULL;
+! else
+! {
+! li = list_find(l, (long) first);
+! if (li == NULL)
+! {
+! PyErr_SetVim(_("internal error: no vim list item"));
+! return -1;
+! }
+! if (last > first)
+! {
+! i = last - first;
+! while (i-- && li != NULL)
+ {
+! next = li->li_next;
+! listitem_remove(l, li);
+! li = next;
+ }
+ }
+ }
+!
+! if (obj == NULL)
+! return 0;
+!
+! if (!PyList_Check(obj))
+ {
+! PyErr_SetString(PyExc_TypeError, _("can only assign lists to slice"));
+! return -1;
+ }
+
+! lsize = PyList_Size(obj);
+!
+! for(i=0; i<lsize; i++)
+! {
+! litem = PyList_GetItem(obj, i);
+! if (litem == NULL)
+! return -1;
+! if (ConvertFromPyObject(litem, &v) == -1)
+! return -1;
+! if (list_insert_tv(l, &v, li) == FAIL)
+! {
+! PyErr_SetVim(_("internal error: failed to add item to list"));
+! return -1;
+! }
+! }
+! return 0;
+ }
+
+ static PyObject *
+! ListConcatInPlace(PyObject *self, PyObject *obj)
+ {
+! list_T *l = ((ListObject *) (self))->list;
+! PyObject *lookup_dict;
+
+! if (l->lv_lock)
+! {
+! PyErr_SetVim(_("list is locked"));
+ return NULL;
++ }
+
+! if (!PySequence_Check(obj))
+ {
+! PyErr_SetString(PyExc_TypeError, _("can only concatenate with lists"));
+ return NULL;
+ }
+
+ lookup_dict = PyDict_New();
+! if (list_py_concat(l, obj, lookup_dict) == -1)
+! {
+! Py_DECREF(lookup_dict);
+! return NULL;
+! }
+ Py_DECREF(lookup_dict);
+
+! Py_INCREF(self);
+! return self;
+ }
+
+! static struct PyMethodDef ListMethods[] = {
+! {"extend", (PyCFunction)ListConcatInPlace, METH_O, ""},
+! { NULL, NULL, 0, NULL }
+ };
+
+ typedef struct
+ {
+ PyObject_HEAD
+! char_u *name;
+! } FunctionObject;
+
+! static PyTypeObject FunctionType;
+
+! static PyObject *
+! FunctionNew(char_u *name)
+ {
+! FunctionObject *self;
+
+! self = PyObject_NEW(FunctionObject, &FunctionType);
+! if (self == NULL)
+! return NULL;
+! self->name = PyMem_New(char_u, STRLEN(name) + 1);
+! if (self->name == NULL)
+ {
+! PyErr_NoMemory();
+! return NULL;
+ }
+! STRCPY(self->name, name);
+! func_ref(name);
+! return (PyObject *)(self);
+ }
+
+ static PyObject *
+! FunctionCall(PyObject *self, PyObject *argsObject, PyObject *kwargs)
+ {
+! FunctionObject *this = (FunctionObject *)(self);
+! char_u *name = this->name;
+! typval_T args;
+! typval_T selfdicttv;
+! typval_T rettv;
+! dict_T *selfdict = NULL;
+! PyObject *selfdictObject;
+! PyObject *result;
+! int error;
+
+! if (ConvertFromPyObject(argsObject, &args) == -1)
+! return NULL;
+!
+! if (kwargs != NULL)
+ {
+! selfdictObject = PyDict_GetItemString(kwargs, "self");
+! if (selfdictObject != NULL)
+! {
+! if (!PyDict_Check(selfdictObject))
+! {
+! PyErr_SetString(PyExc_TypeError, _("'self' argument must be a dictionary"));
+! clear_tv(&args);
+! return NULL;
+! }
+! if (ConvertFromPyObject(selfdictObject, &selfdicttv) == -1)
+! return NULL;
+! selfdict = selfdicttv.vval.v_dict;
+! }
+ }
+
+! error = func_call(name, &args, selfdict, &rettv);
+! if (error != OK)
+! {
+! result = NULL;
+! PyErr_SetVim(_("failed to run function"));
+! }
+! else
+! result = ConvertToPyObject(&rettv);
+!
+! /* FIXME Check what should really be cleared. */
+! clear_tv(&args);
+! clear_tv(&rettv);
+! /*
+! * if (selfdict!=NULL)
+! * clear_tv(selfdicttv);
+! */
+!
+! return result;
+ }
+
+! static struct PyMethodDef FunctionMethods[] = {
+! {"__call__", (PyCFunction)FunctionCall, METH_VARARGS|METH_KEYWORDS, ""},
+! { NULL, NULL, 0, NULL }
+! };
+
+ #define INVALID_WINDOW_VALUE ((win_T *)(-1))
+
+***************
+*** 1567,1569 ****
+--- 2383,2638 ----
+ { NULL, NULL, 0, NULL }
+ };
+
++ static void
++ set_ref_in_py(const int copyID)
++ {
++ pylinkedlist_T *cur;
++ dict_T *dd;
++ list_T *ll;
++
++ if (lastdict != NULL)
++ for(cur = lastdict ; cur != NULL ; cur = cur->pll_prev)
++ {
++ dd = ((DictionaryObject *) (cur->pll_obj))->dict;
++ if (dd->dv_copyID != copyID)
++ {
++ dd->dv_copyID = copyID;
++ set_ref_in_ht(&dd->dv_hashtab, copyID);
++ }
++ }
++
++ if (lastlist != NULL)
++ for(cur = lastlist ; cur != NULL ; cur = cur->pll_prev)
++ {
++ ll = ((ListObject *) (cur->pll_obj))->list;
++ if (ll->lv_copyID != copyID)
++ {
++ ll->lv_copyID = copyID;
++ set_ref_in_list(ll, copyID);
++ }
++ }
++ }
++
++ static int
++ set_string_copy(char_u *str, typval_T *tv)
++ {
++ tv->vval.v_string = vim_strsave(str);
++ if (tv->vval.v_string == NULL)
++ {
++ PyErr_NoMemory();
++ return -1;
++ }
++ return 0;
++ }
++
++ #ifdef FEAT_EVAL
++ typedef int (*pytotvfunc)(PyObject *, typval_T *, PyObject *);
++
++ static int
++ convert_dl(PyObject *obj, typval_T *tv,
++ pytotvfunc py_to_tv, PyObject *lookupDict)
++ {
++ PyObject *capsule;
++ char hexBuf[sizeof(void *) * 2 + 3];
++
++ sprintf(hexBuf, "%p", obj);
++
++ capsule = PyDict_GetItemString(lookupDict, hexBuf);
++ if (capsule == NULL)
++ {
++ capsule = PyCapsule_New(tv, NULL, NULL);
++ PyDict_SetItemString(lookupDict, hexBuf, capsule);
++ Py_DECREF(capsule);
++ if (py_to_tv(obj, tv, lookupDict) == -1)
++ {
++ tv->v_type = VAR_UNKNOWN;
++ return -1;
++ }
++ /* As we are not using copy_tv which increments reference count we must
++ * do it ourself. */
++ switch(tv->v_type)
++ {
++ case VAR_DICT: ++tv->vval.v_dict->dv_refcount; break;
++ case VAR_LIST: ++tv->vval.v_list->lv_refcount; break;
++ }
++ }
++ else
++ {
++ typval_T *v = PyCapsule_GetPointer(capsule, NULL);
++ copy_tv(v, tv);
++ }
++ return 0;
++ }
++
++ static int
++ ConvertFromPyObject(PyObject *obj, typval_T *tv)
++ {
++ PyObject *lookup_dict;
++ int r;
++
++ lookup_dict = PyDict_New();
++ r = _ConvertFromPyObject(obj, tv, lookup_dict);
++ Py_DECREF(lookup_dict);
++ return r;
++ }
++
++ static int
++ _ConvertFromPyObject(PyObject *obj, typval_T *tv, PyObject *lookupDict)
++ {
++ if (obj->ob_type == &DictionaryType)
++ {
++ tv->v_type = VAR_DICT;
++ tv->vval.v_dict = (((DictionaryObject *)(obj))->dict);
++ ++tv->vval.v_dict->dv_refcount;
++ }
++ else if (obj->ob_type == &ListType)
++ {
++ tv->v_type = VAR_LIST;
++ tv->vval.v_list = (((ListObject *)(obj))->list);
++ ++tv->vval.v_list->lv_refcount;
++ }
++ else if (obj->ob_type == &FunctionType)
++ {
++ if (set_string_copy(((FunctionObject *) (obj))->name, tv) == -1)
++ return -1;
++
++ tv->v_type = VAR_FUNC;
++ func_ref(tv->vval.v_string);
++ }
++ #if PY_MAJOR_VERSION >= 3
++ else if (PyBytes_Check(obj))
++ {
++ char_u *result = (char_u *) PyBytes_AsString(obj);
++
++ if (result == NULL)
++ return -1;
++
++ if (set_string_copy(result, tv) == -1)
++ return -1;
++
++ tv->v_type = VAR_STRING;
++ }
++ else if (PyUnicode_Check(obj))
++ {
++ PyObject *bytes;
++ char_u *result;
++
++ bytes = PyString_AsBytes(obj);
++ if (bytes == NULL)
++ return -1;
++
++ result = (char_u *) PyBytes_AsString(bytes);
++ if (result == NULL)
++ return -1;
++
++ if (set_string_copy(result, tv) == -1)
++ {
++ Py_XDECREF(bytes);
++ return -1;
++ }
++ Py_XDECREF(bytes);
++
++ tv->v_type = VAR_STRING;
++ }
++ #else
++ else if (PyUnicode_Check(obj))
++ {
++ PyObject *bytes;
++ char_u *result;
++
++ bytes = PyUnicode_AsEncodedString(obj, (char *)ENC_OPT, NULL);
++ if (bytes == NULL)
++ return -1;
++
++ result=(char_u *) PyString_AsString(bytes);
++ if (result == NULL)
++ return -1;
++
++ if (set_string_copy(result, tv) == -1)
++ {
++ Py_XDECREF(bytes);
++ return -1;
++ }
++ Py_XDECREF(bytes);
++
++ tv->v_type = VAR_STRING;
++ }
++ else if (PyString_Check(obj))
++ {
++ char_u *result = (char_u *) PyString_AsString(obj);
++
++ if (result == NULL)
++ return -1;
++
++ if (set_string_copy(result, tv) == -1)
++ return -1;
++
++ tv->v_type = VAR_STRING;
++ }
++ else if (PyInt_Check(obj))
++ {
++ tv->v_type = VAR_NUMBER;
++ tv->vval.v_number = (varnumber_T) PyInt_AsLong(obj);
++ }
++ #endif
++ else if (PyLong_Check(obj))
++ {
++ tv->v_type = VAR_NUMBER;
++ tv->vval.v_number = (varnumber_T) PyLong_AsLong(obj);
++ }
++ else if (PyDict_Check(obj))
++ return convert_dl(obj, tv, pydict_to_tv, lookupDict);
++ #ifdef FEAT_FLOAT
++ else if (PyFloat_Check(obj))
++ {
++ tv->v_type = VAR_FLOAT;
++ tv->vval.v_float = (float_T) PyFloat_AsDouble(obj);
++ }
++ #endif
++ else if (PyIter_Check(obj))
++ return convert_dl(obj, tv, pyiter_to_tv, lookupDict);
++ else if (PySequence_Check(obj))
++ return convert_dl(obj, tv, pyseq_to_tv, lookupDict);
++ else if (PyMapping_Check(obj))
++ return convert_dl(obj, tv, pymap_to_tv, lookupDict);
++ else
++ {
++ PyErr_SetString(PyExc_TypeError, _("unable to convert to vim structure"));
++ return -1;
++ }
++ return 0;
++ }
++
++ static PyObject *
++ ConvertToPyObject(typval_T *tv)
++ {
++ if (tv == NULL)
++ {
++ PyErr_SetVim(_("NULL reference passed"));
++ return NULL;
++ }
++ switch (tv->v_type)
++ {
++ case VAR_STRING:
++ return PyBytes_FromString((char *) tv->vval.v_string);
++ case VAR_NUMBER:
++ return PyLong_FromLong((long) tv->vval.v_number);
++ #ifdef FEAT_FLOAT
++ case VAR_FLOAT:
++ return PyFloat_FromDouble((double) tv->vval.v_float);
++ #endif
++ case VAR_LIST:
++ return ListNew(tv->vval.v_list);
++ case VAR_DICT:
++ return DictionaryNew(tv->vval.v_dict);
++ case VAR_FUNC:
++ return FunctionNew(tv->vval.v_string);
++ case VAR_UNKNOWN:
++ Py_INCREF(Py_None);
++ return Py_None;
++ default:
++ PyErr_SetVim(_("internal error: invalid value type"));
++ return NULL;
++ }
++ }
++ #endif
+*** ../vim-7.3.568/src/if_python.c 2011-08-28 16:00:14.000000000 +0200
+--- src/if_python.c 2012-06-29 12:47:48.000000000 +0200
+***************
+*** 1,4 ****
+! /* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+--- 1,4 ----
+! /* vi:set ts=8 sts=4 sw=4 noet:
+ *
+ * VIM - Vi IMproved by Bram Moolenaar
+ *
+***************
+*** 56,61 ****
+--- 56,63 ----
+
+ static void init_structs(void);
+
++ #define PyBytes_FromString PyString_FromString
++
+ /* No-op conversion functions, use with care! */
+ #define PyString_AsBytes(obj) (obj)
+ #define PyString_FreeBytes(obj)
+***************
+*** 122,132 ****
+--- 124,136 ----
+ /* This makes if_python.c compile without warnings against Python 2.5
+ * on Win32 and Win64. */
+ # undef PyRun_SimpleString
++ # undef PyRun_String
+ # undef PyArg_Parse
+ # undef PyArg_ParseTuple
+ # undef Py_BuildValue
+ # undef Py_InitModule4
+ # undef Py_InitModule4_64
++ # undef PyObject_CallMethod
+
+ /*
+ * Wrapper defines
+***************
+*** 134,139 ****
+--- 138,144 ----
+ # define PyArg_Parse dll_PyArg_Parse
+ # define PyArg_ParseTuple dll_PyArg_ParseTuple
+ # define PyMem_Free dll_PyMem_Free
++ # define PyMem_Malloc dll_PyMem_Malloc
+ # define PyDict_SetItemString dll_PyDict_SetItemString
+ # define PyErr_BadArgument dll_PyErr_BadArgument
+ # define PyErr_Clear dll_PyErr_Clear
+***************
+*** 150,172 ****
+--- 155,202 ----
+ # endif
+ # define PyInt_AsLong dll_PyInt_AsLong
+ # define PyInt_FromLong dll_PyInt_FromLong
++ # define PyLong_AsLong dll_PyLong_AsLong
++ # define PyLong_FromLong dll_PyLong_FromLong
+ # define PyInt_Type (*dll_PyInt_Type)
++ # define PyLong_Type (*dll_PyLong_Type)
+ # define PyList_GetItem dll_PyList_GetItem
+ # define PyList_Append dll_PyList_Append
+ # define PyList_New dll_PyList_New
+ # define PyList_SetItem dll_PyList_SetItem
+ # define PyList_Size dll_PyList_Size
+ # define PyList_Type (*dll_PyList_Type)
++ # define PySequence_Check dll_PySequence_Check
++ # define PySequence_Size dll_PySequence_Size
++ # define PySequence_GetItem dll_PySequence_GetItem
++ # define PyTuple_Size dll_PyTuple_Size
++ # define PyTuple_GetItem dll_PyTuple_GetItem
++ # define PyTuple_Type (*dll_PyTuple_Type)
+ # define PyImport_ImportModule dll_PyImport_ImportModule
+ # define PyDict_New dll_PyDict_New
+ # define PyDict_GetItemString dll_PyDict_GetItemString
++ # define PyDict_Next dll_PyDict_Next
++ # ifdef PyMapping_Items
++ # define PY_NO_MAPPING_ITEMS
++ # else
++ # define PyMapping_Items dll_PyMapping_Items
++ # endif
++ # define PyObject_CallMethod dll_PyObject_CallMethod
++ # define PyMapping_Check dll_PyMapping_Check
++ # define PyIter_Next dll_PyIter_Next
+ # define PyModule_GetDict dll_PyModule_GetDict
+ # define PyRun_SimpleString dll_PyRun_SimpleString
++ # define PyRun_String dll_PyRun_String
+ # define PyString_AsString dll_PyString_AsString
+ # define PyString_FromString dll_PyString_FromString
+ # define PyString_FromStringAndSize dll_PyString_FromStringAndSize
+ # define PyString_Size dll_PyString_Size
+ # define PyString_Type (*dll_PyString_Type)
++ # define PyUnicode_Type (*dll_PyUnicode_Type)
++ # define PyUnicodeUCS4_AsEncodedString (*dll_PyUnicodeUCS4_AsEncodedString)
++ # define PyFloat_AsDouble dll_PyFloat_AsDouble
++ # define PyFloat_FromDouble dll_PyFloat_FromDouble
++ # define PyFloat_Type (*dll_PyFloat_Type)
++ # define PyImport_AddModule (*dll_PyImport_AddModule)
+ # define PySys_SetObject dll_PySys_SetObject
+ # define PySys_SetArgv dll_PySys_SetArgv
+ # define PyType_Type (*dll_PyType_Type)
+***************
+*** 179,186 ****
+--- 209,218 ----
+ # define Py_Finalize dll_Py_Finalize
+ # define Py_IsInitialized dll_Py_IsInitialized
+ # define _PyObject_New dll__PyObject_New
++ # define _PyObject_NextNotImplemented (*dll__PyObject_NextNotImplemented)
+ # define _Py_NoneStruct (*dll__Py_NoneStruct)
+ # define PyObject_Init dll__PyObject_Init
++ # define PyObject_GetIter dll_PyObject_GetIter
+ # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000
+ # define PyType_IsSubtype dll_PyType_IsSubtype
+ # endif
+***************
+*** 188,193 ****
+--- 220,227 ----
+ # define PyObject_Malloc dll_PyObject_Malloc
+ # define PyObject_Free dll_PyObject_Free
+ # endif
++ # define PyCapsule_New dll_PyCapsule_New
++ # define PyCapsule_GetPointer dll_PyCapsule_GetPointer
+
+ /*
+ * Pointers for dynamic link
+***************
+*** 195,200 ****
+--- 229,235 ----
+ static int(*dll_PyArg_Parse)(PyObject *, char *, ...);
+ static int(*dll_PyArg_ParseTuple)(PyObject *, char *, ...);
+ static int(*dll_PyMem_Free)(void *);
++ static void* (*dll_PyMem_Malloc)(size_t);
+ static int(*dll_PyDict_SetItemString)(PyObject *dp, char *key, PyObject *item);
+ static int(*dll_PyErr_BadArgument)(void);
+ static void(*dll_PyErr_Clear)(void);
+***************
+*** 208,233 ****
+ # ifdef PY_CAN_RECURSE
+ static PyGILState_STATE (*dll_PyGILState_Ensure)(void);
+ static void (*dll_PyGILState_Release)(PyGILState_STATE);
+! #endif
+ static long(*dll_PyInt_AsLong)(PyObject *);
+ static PyObject*(*dll_PyInt_FromLong)(long);
+ static PyTypeObject* dll_PyInt_Type;
+ static PyObject*(*dll_PyList_GetItem)(PyObject *, PyInt);
+ static PyObject*(*dll_PyList_Append)(PyObject *, PyObject *);
+ static PyObject*(*dll_PyList_New)(PyInt size);
+ static int(*dll_PyList_SetItem)(PyObject *, PyInt, PyObject *);
+ static PyInt(*dll_PyList_Size)(PyObject *);
+ static PyTypeObject* dll_PyList_Type;
+ static PyObject*(*dll_PyImport_ImportModule)(const char *);
+ static PyObject*(*dll_PyDict_New)(void);
+ static PyObject*(*dll_PyDict_GetItemString)(PyObject *, const char *);
+ static PyObject*(*dll_PyModule_GetDict)(PyObject *);
+ static int(*dll_PyRun_SimpleString)(char *);
+ static char*(*dll_PyString_AsString)(PyObject *);
+ static PyObject*(*dll_PyString_FromString)(const char *);
+ static PyObject*(*dll_PyString_FromStringAndSize)(const char *, PyInt);
+ static PyInt(*dll_PyString_Size)(PyObject *);
+ static PyTypeObject* dll_PyString_Type;
+ static int(*dll_PySys_SetObject)(char *, PyObject *);
+ static int(*dll_PySys_SetArgv)(int, char **);
+ static PyTypeObject* dll_PyType_Type;
+--- 243,290 ----
+ # ifdef PY_CAN_RECURSE
+ static PyGILState_STATE (*dll_PyGILState_Ensure)(void);
+ static void (*dll_PyGILState_Release)(PyGILState_STATE);
+! # endif
+ static long(*dll_PyInt_AsLong)(PyObject *);
+ static PyObject*(*dll_PyInt_FromLong)(long);
++ static long(*dll_PyLong_AsLong)(PyObject *);
++ static PyObject*(*dll_PyLong_FromLong)(long);
+ static PyTypeObject* dll_PyInt_Type;
++ static PyTypeObject* dll_PyLong_Type;
+ static PyObject*(*dll_PyList_GetItem)(PyObject *, PyInt);
+ static PyObject*(*dll_PyList_Append)(PyObject *, PyObject *);
+ static PyObject*(*dll_PyList_New)(PyInt size);
+ static int(*dll_PyList_SetItem)(PyObject *, PyInt, PyObject *);
+ static PyInt(*dll_PyList_Size)(PyObject *);
+ static PyTypeObject* dll_PyList_Type;
++ static int (*dll_PySequence_Check)(PyObject *);
++ static PyInt(*dll_PySequence_Size)(PyObject *);
++ static PyObject*(*dll_PySequence_GetItem)(PyObject *, PyInt);
++ static PyInt(*dll_PyTuple_Size)(PyObject *);
++ static PyObject*(*dll_PyTuple_GetItem)(PyObject *, PyInt);
++ static PyTypeObject* dll_PyTuple_Type;
+ static PyObject*(*dll_PyImport_ImportModule)(const char *);
+ static PyObject*(*dll_PyDict_New)(void);
+ static PyObject*(*dll_PyDict_GetItemString)(PyObject *, const char *);
++ static int (*dll_PyDict_Next)(PyObject *, Py_ssize_t *, PyObject **, PyObject **);
++ # ifndef PY_NO_MAPPING_ITEMS
++ static PyObject* (*dll_PyMapping_Items)(PyObject *);
++ # endif
++ static PyObject* (*dll_PyObject_CallMethod)(PyObject *, char *, PyObject *);
++ static int (*dll_PyMapping_Check)(PyObject *);
++ static PyObject* (*dll_PyIter_Next)(PyObject *);
+ static PyObject*(*dll_PyModule_GetDict)(PyObject *);
+ static int(*dll_PyRun_SimpleString)(char *);
++ static PyObject *(*dll_PyRun_String)(char *, int, PyObject *, PyObject *);
+ static char*(*dll_PyString_AsString)(PyObject *);
+ static PyObject*(*dll_PyString_FromString)(const char *);
+ static PyObject*(*dll_PyString_FromStringAndSize)(const char *, PyInt);
+ static PyInt(*dll_PyString_Size)(PyObject *);
+ static PyTypeObject* dll_PyString_Type;
++ static PyTypeObject* dll_PyUnicode_Type;
++ static PyObject *(*PyUnicodeUCS4_AsEncodedString)(PyObject *, char *, char *);
++ static double(*dll_PyFloat_AsDouble)(PyObject *);
++ static PyObject*(*dll_PyFloat_FromDouble)(double);
++ static PyTypeObject* dll_PyFloat_Type;
+ static int(*dll_PySys_SetObject)(char *, PyObject *);
+ static int(*dll_PySys_SetArgv)(int, char **);
+ static PyTypeObject* dll_PyType_Type;
+***************
+*** 235,246 ****
+--- 292,306 ----
+ static PyObject*(*dll_Py_BuildValue)(char *, ...);
+ static PyObject*(*dll_Py_FindMethod)(struct PyMethodDef[], PyObject *, char *);
+ static PyObject*(*dll_Py_InitModule4)(char *, struct PyMethodDef *, char *, PyObject *, int);
++ static PyObject*(*dll_PyImport_AddModule)(char *);
+ static void(*dll_Py_SetPythonHome)(char *home);
+ static void(*dll_Py_Initialize)(void);
+ static void(*dll_Py_Finalize)(void);
+ static int(*dll_Py_IsInitialized)(void);
+ static PyObject*(*dll__PyObject_New)(PyTypeObject *, PyObject *);
+ static PyObject*(*dll__PyObject_Init)(PyObject *, PyTypeObject *);
++ static PyObject* (*dll_PyObject_GetIter)(PyObject *);
++ static iternextfunc dll__PyObject_NextNotImplemented;
+ static PyObject* dll__Py_NoneStruct;
+ # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000
+ static int (*dll_PyType_IsSubtype)(PyTypeObject *, PyTypeObject *);
+***************
+*** 249,254 ****
+--- 309,316 ----
+ static void* (*dll_PyObject_Malloc)(size_t);
+ static void (*dll_PyObject_Free)(void*);
+ # endif
++ static PyObject* (*dll_PyCapsule_New)(void *, char *, PyCapsule_Destructor);
++ static void* (*dll_PyCapsule_GetPointer)(PyObject *, char *);
+
+ static HINSTANCE hinstPython = 0; /* Instance of python.dll */
+
+***************
+*** 278,283 ****
+--- 340,346 ----
+ {"PyArg_Parse", (PYTHON_PROC*)&dll_PyArg_Parse},
+ {"PyArg_ParseTuple", (PYTHON_PROC*)&dll_PyArg_ParseTuple},
+ {"PyMem_Free", (PYTHON_PROC*)&dll_PyMem_Free},
++ {"PyMem_Malloc", (PYTHON_PROC*)&dll_PyMem_Malloc},
+ {"PyDict_SetItemString", (PYTHON_PROC*)&dll_PyDict_SetItemString},
+ {"PyErr_BadArgument", (PYTHON_PROC*)&dll_PyErr_BadArgument},
+ {"PyErr_Clear", (PYTHON_PROC*)&dll_PyErr_Clear},
+***************
+*** 294,316 ****
+--- 357,402 ----
+ # endif
+ {"PyInt_AsLong", (PYTHON_PROC*)&dll_PyInt_AsLong},
+ {"PyInt_FromLong", (PYTHON_PROC*)&dll_PyInt_FromLong},
++ {"PyLong_AsLong", (PYTHON_PROC*)&dll_PyLong_AsLong},
++ {"PyLong_FromLong", (PYTHON_PROC*)&dll_PyLong_FromLong},
+ {"PyInt_Type", (PYTHON_PROC*)&dll_PyInt_Type},
++ {"PyLong_Type", (PYTHON_PROC*)&dll_PyLong_Type},
+ {"PyList_GetItem", (PYTHON_PROC*)&dll_PyList_GetItem},
+ {"PyList_Append", (PYTHON_PROC*)&dll_PyList_Append},
+ {"PyList_New", (PYTHON_PROC*)&dll_PyList_New},
+ {"PyList_SetItem", (PYTHON_PROC*)&dll_PyList_SetItem},
+ {"PyList_Size", (PYTHON_PROC*)&dll_PyList_Size},
+ {"PyList_Type", (PYTHON_PROC*)&dll_PyList_Type},
++ {"PySequence_GetItem", (PYTHON_PROC*)&dll_PySequence_GetItem},
++ {"PySequence_Size", (PYTHON_PROC*)&dll_PySequence_Size},
++ {"PySequence_Check", (PYTHON_PROC*)&dll_PySequence_Check},
++ {"PyTuple_GetItem", (PYTHON_PROC*)&dll_PyTuple_GetItem},
++ {"PyTuple_Size", (PYTHON_PROC*)&dll_PyTuple_Size},
++ {"PyTuple_Type", (PYTHON_PROC*)&dll_PyTuple_Type},
+ {"PyImport_ImportModule", (PYTHON_PROC*)&dll_PyImport_ImportModule},
+ {"PyDict_GetItemString", (PYTHON_PROC*)&dll_PyDict_GetItemString},
++ {"PyDict_Next", (PYTHON_PROC*)&dll_PyDict_Next},
+ {"PyDict_New", (PYTHON_PROC*)&dll_PyDict_New},
++ # ifndef PY_NO_MAPPING_ITEMS
++ {"PyMapping_Items", (PYTHON_PROC*)&dll_PyMapping_Items},
++ # endif
++ {"PyObject_CallMethod", (PYTHON_PROC*)&dll_PyObject_CallMethod},
++ {"PyMapping_Check", (PYTHON_PROC*)&dll_PyMapping_Check},
++ {"PyIter_Next", (PYTHON_PROC*)&dll_PyIter_Next},
+ {"PyModule_GetDict", (PYTHON_PROC*)&dll_PyModule_GetDict},
+ {"PyRun_SimpleString", (PYTHON_PROC*)&dll_PyRun_SimpleString},
++ {"PyRun_String", (PYTHON_PROC*)&dll_PyRun_String},
+ {"PyString_AsString", (PYTHON_PROC*)&dll_PyString_AsString},
+ {"PyString_FromString", (PYTHON_PROC*)&dll_PyString_FromString},
+ {"PyString_FromStringAndSize", (PYTHON_PROC*)&dll_PyString_FromStringAndSize},
+ {"PyString_Size", (PYTHON_PROC*)&dll_PyString_Size},
+ {"PyString_Type", (PYTHON_PROC*)&dll_PyString_Type},
++ {"PyUnicode_Type", (PYTHON_PROC*)&dll_PyUnicode_Type},
++ {"PyUnicodeUCS4_AsEncodedString", (PYTHON_PROC*)&dll_PyUnicodeUCS4_AsEncodedString},
++ {"PyFloat_Type", (PYTHON_PROC*)&dll_PyFloat_Type},
++ {"PyFloat_AsDouble", (PYTHON_PROC*)&dll_PyFloat_AsDouble},
++ {"PyFloat_FromDouble", (PYTHON_PROC*)&dll_PyFloat_FromDouble},
++ {"PyImport_AddModule", (PYTHON_PROC*)&dll_PyImport_AddModule},
+ {"PySys_SetObject", (PYTHON_PROC*)&dll_PySys_SetObject},
+ {"PySys_SetArgv", (PYTHON_PROC*)&dll_PySys_SetArgv},
+ {"PyType_Type", (PYTHON_PROC*)&dll_PyType_Type},
+***************
+*** 328,333 ****
+--- 414,421 ----
+ {"Py_IsInitialized", (PYTHON_PROC*)&dll_Py_IsInitialized},
+ {"_PyObject_New", (PYTHON_PROC*)&dll__PyObject_New},
+ {"PyObject_Init", (PYTHON_PROC*)&dll__PyObject_Init},
++ {"PyObject_GetIter", (PYTHON_PROC*)&dll_PyObject_GetIter},
++ {"_PyObject_NextNotImplemented", (PYTHON_PROC*)&dll__PyObject_NextNotImplemented},
+ {"_Py_NoneStruct", (PYTHON_PROC*)&dll__Py_NoneStruct},
+ # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000
+ {"PyType_IsSubtype", (PYTHON_PROC*)&dll_PyType_IsSubtype},
+***************
+*** 336,341 ****
+--- 424,431 ----
+ {"PyObject_Malloc", (PYTHON_PROC*)&dll_PyObject_Malloc},
+ {"PyObject_Free", (PYTHON_PROC*)&dll_PyObject_Free},
+ # endif
++ {"PyCapsule_New", (PYTHON_PROC*)&dll_PyCapsule_New},
++ {"PyCapsule_GetPointer", (PYTHON_PROC*)&dll_PyCapsule_GetPointer},
+ {"", NULL},
+ };
+
+***************
+*** 434,443 ****
+--- 524,548 ----
+
+ static PyObject *BufferNew (buf_T *);
+ static PyObject *WindowNew(win_T *);
++ static PyObject *DictionaryNew(dict_T *);
+ static PyObject *LineToString(const char *);
+
+ static PyTypeObject RangeType;
+
++ static int initialised = 0;
++ #define PYINITIALISED initialised
++
++ /* Add conversion from PyInt? */
++ #define DICTKEY_GET(err) \
++ if (!PyString_Check(keyObject)) \
++ { \
++ PyErr_SetString(PyExc_TypeError, _("only string keys are allowed")); \
++ return err; \
++ } \
++ key = (char_u *) PyString_AsString(keyObject);
++ #define DICTKEY_UNREF
++ #define DICTKEY_DECL
++
+ /*
+ * Include the code shared with if_python3.c
+ */
+***************
+*** 451,456 ****
+--- 556,563 ----
+ static PyInt RangeStart;
+ static PyInt RangeEnd;
+
++ static PyObject *globals;
++
+ static void PythonIO_Flush(void);
+ static int PythonIO_Init(void);
+ static int PythonMod_Init(void);
+***************
+*** 466,473 ****
+ * 1. Python interpreter main program.
+ */
+
+- static int initialised = 0;
+-
+ #if PYTHON_API_VERSION < 1007 /* Python 1.4 */
+ typedef PyObject PyThreadState;
+ #endif
+--- 573,578 ----
+***************
+*** 581,586 ****
+--- 686,693 ----
+ if (PythonMod_Init())
+ goto fail;
+
++ globals = PyModule_GetDict(PyImport_AddModule("__main__"));
++
+ /* Remove the element from sys.path that was added because of our
+ * argv[0] value in PythonMod_Init(). Previously we used an empty
+ * string, but dependinding on the OS we then get an empty entry or
+***************
+*** 609,615 ****
+ * External interface
+ */
+ static void
+! DoPythonCommand(exarg_T *eap, const char *cmd)
+ {
+ #ifndef PY_CAN_RECURSE
+ static int recursive = 0;
+--- 716,722 ----
+ * External interface
+ */
+ static void
+! DoPythonCommand(exarg_T *eap, const char *cmd, typval_T *rettv)
+ {
+ #ifndef PY_CAN_RECURSE
+ static int recursive = 0;
+***************
+*** 639,646 ****
+ if (Python_Init())
+ goto theend;
+
+! RangeStart = eap->line1;
+! RangeEnd = eap->line2;
+ Python_Release_Vim(); /* leave vim */
+
+ #if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
+--- 746,761 ----
+ if (Python_Init())
+ goto theend;
+
+! if (rettv == NULL)
+! {
+! RangeStart = eap->line1;
+! RangeEnd = eap->line2;
+! }
+! else
+! {
+! RangeStart = (PyInt) curwin->w_cursor.lnum;
+! RangeEnd = RangeStart;
+! }
+ Python_Release_Vim(); /* leave vim */
+
+ #if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
+***************
+*** 658,664 ****
+
+ Python_RestoreThread(); /* enter python */
+
+! PyRun_SimpleString((char *)(cmd));
+
+ Python_SaveThread(); /* leave python */
+
+--- 773,795 ----
+
+ Python_RestoreThread(); /* enter python */
+
+! if (rettv == NULL)
+! PyRun_SimpleString((char *)(cmd));
+! else
+! {
+! PyObject *r;
+!
+! r = PyRun_String((char *)(cmd), Py_eval_input, globals, globals);
+! if (r == NULL)
+! EMSG(_("E858: Eval did not return a valid python object"));
+! else
+! {
+! if (ConvertFromPyObject(r, rettv) == -1)
+! EMSG(_("E859: Failed to convert returned python object to vim value"));
+! Py_DECREF(r);
+! }
+! PyErr_Clear();
+! }
+
+ Python_SaveThread(); /* leave python */
+
+***************
+*** 680,686 ****
+ #ifndef PY_CAN_RECURSE
+ --recursive;
+ #endif
+! return; /* keeps lint happy */
+ }
+
+ /*
+--- 811,817 ----
+ #ifndef PY_CAN_RECURSE
+ --recursive;
+ #endif
+! return;
+ }
+
+ /*
+***************
+*** 695,703 ****
+ if (!eap->skip)
+ {
+ if (script == NULL)
+! DoPythonCommand(eap, (char *)eap->arg);
+ else
+! DoPythonCommand(eap, (char *)script);
+ }
+ vim_free(script);
+ }
+--- 826,834 ----
+ if (!eap->skip)
+ {
+ if (script == NULL)
+! DoPythonCommand(eap, (char *)eap->arg, NULL);
+ else
+! DoPythonCommand(eap, (char *)script, NULL);
+ }
+ vim_free(script);
+ }
+***************
+*** 743,749 ****
+ *p++ = '\0';
+
+ /* Execute the file */
+! DoPythonCommand(eap, buffer);
+ }
+
+ /******************************************************
+--- 874,880 ----
+ *p++ = '\0';
+
+ /* Execute the file */
+! DoPythonCommand(eap, buffer, NULL);
+ }
+
+ /******************************************************
+***************
+*** 765,778 ****
+ static int
+ OutputSetattr(PyObject *self, char *name, PyObject *val)
+ {
+! if (val == NULL) {
+ PyErr_SetString(PyExc_AttributeError, _("can't delete OutputObject attributes"));
+ return -1;
+ }
+
+ if (strcmp(name, "softspace") == 0)
+ {
+! if (!PyInt_Check(val)) {
+ PyErr_SetString(PyExc_TypeError, _("softspace must be an integer"));
+ return -1;
+ }
+--- 896,911 ----
+ static int
+ OutputSetattr(PyObject *self, char *name, PyObject *val)
+ {
+! if (val == NULL)
+! {
+ PyErr_SetString(PyExc_AttributeError, _("can't delete OutputObject attributes"));
+ return -1;
+ }
+
+ if (strcmp(name, "softspace") == 0)
+ {
+! if (!PyInt_Check(val))
+! {
+ PyErr_SetString(PyExc_TypeError, _("softspace must be an integer"));
+ return -1;
+ }
+***************
+*** 800,805 ****
+--- 933,941 ----
+ * 3. Implementation of the Vim module for Python
+ */
+
++ static PyObject *ConvertToPyObject(typval_T *);
++ static int ConvertFromPyObject(PyObject *, typval_T *);
++
+ /* Window type - Implementation functions
+ * --------------------------------------
+ */
+***************
+*** 1441,1446 ****
+--- 1577,1748 ----
+ return result;
+ }
+
++ static void DictionaryDestructor(PyObject *);
++ static PyObject *DictionaryGetattr(PyObject *, char*);
++
++ static PyMappingMethods DictionaryAsMapping = {
++ (PyInquiry) DictionaryLength,
++ (binaryfunc) DictionaryItem,
++ (objobjargproc) DictionaryAssItem,
++ };
++
++ static PyTypeObject DictionaryType = {
++ PyObject_HEAD_INIT(0)
++ 0,
++ "vimdictionary",
++ sizeof(DictionaryObject),
++ 0,
++
++ (destructor) DictionaryDestructor,
++ (printfunc) 0,
++ (getattrfunc) DictionaryGetattr,
++ (setattrfunc) 0,
++ (cmpfunc) 0,
++ (reprfunc) 0,
++
++ 0, /* as number */
++ 0, /* as sequence */
++ &DictionaryAsMapping, /* as mapping */
++
++ (hashfunc) 0,
++ (ternaryfunc) 0,
++ (reprfunc) 0,
++ };
++
++ static void
++ DictionaryDestructor(PyObject *self)
++ {
++ DictionaryObject *this = ((DictionaryObject *) (self));
++
++ pyll_remove(&this->ref, &lastdict);
++ dict_unref(this->dict);
++
++ Py_DECREF(self);
++ }
++
++ static PyObject *
++ DictionaryGetattr(PyObject *self, char *name)
++ {
++ return Py_FindMethod(DictionaryMethods, self, name);
++ }
++
++ static void ListDestructor(PyObject *);
++ static PyObject *ListGetattr(PyObject *, char *);
++
++ static PySequenceMethods ListAsSeq = {
++ (PyInquiry) ListLength,
++ (binaryfunc) 0,
++ (PyIntArgFunc) 0,
++ (PyIntArgFunc) ListItem,
++ (PyIntIntArgFunc) ListSlice,
++ (PyIntObjArgProc) ListAssItem,
++ (PyIntIntObjArgProc) ListAssSlice,
++ (objobjproc) 0,
++ #if PY_MAJOR_VERSION >= 2
++ (binaryfunc) ListConcatInPlace,
++ 0,
++ #endif
++ };
++
++ static PyTypeObject ListType = {
++ PyObject_HEAD_INIT(0)
++ 0,
++ "vimlist",
++ sizeof(ListObject),
++ 0,
++
++ (destructor) ListDestructor,
++ (printfunc) 0,
++ (getattrfunc) ListGetattr,
++ (setattrfunc) 0,
++ (cmpfunc) 0,
++ (reprfunc) 0,
++
++ 0, /* as number */
++ &ListAsSeq, /* as sequence */
++ 0, /* as mapping */
++
++ (hashfunc) 0,
++ (ternaryfunc) 0,
++ (reprfunc) 0,
++ };
++
++ static void
++ ListDestructor(PyObject *self)
++ {
++ ListObject *this = ((ListObject *) (self));
++
++ pyll_remove(&this->ref, &lastlist);
++ list_unref(this->list);
++
++ Py_DECREF(self);
++ }
++
++ static PyObject *
++ ListGetattr(PyObject *self, char *name)
++ {
++ return Py_FindMethod(ListMethods, self, name);
++ }
++
++ static void FunctionDestructor(PyObject *);
++ static PyObject *FunctionGetattr(PyObject *, char *);
++
++ static PyTypeObject FunctionType = {
++ PyObject_HEAD_INIT(0)
++ 0,
++ "vimfunction",
++ sizeof(FunctionObject),
++ 0,
++
++ (destructor) FunctionDestructor,
++ (printfunc) 0,
++ (getattrfunc) FunctionGetattr,
++ (setattrfunc) 0,
++ (cmpfunc) 0,
++ (reprfunc) 0,
++
++ 0, /* as number */
++ 0, /* as sequence */
++ 0, /* as mapping */
++
++ (hashfunc) 0,
++ (ternaryfunc) FunctionCall,
++ (reprfunc) 0,
++ };
++
++ static void
++ FunctionDestructor(PyObject *self)
++ {
++ FunctionObject *this = (FunctionObject *) (self);
++
++ func_unref(this->name);
++ PyMem_Del(this->name);
++
++ Py_DECREF(self);
++ }
++
++ static PyObject *
++ FunctionGetattr(PyObject *self, char *name)
++ {
++ FunctionObject *this = (FunctionObject *)(self);
++
++ if (strcmp(name, "name") == 0)
++ return PyString_FromString((char *)(this->name));
++ else
++ return Py_FindMethod(FunctionMethods, self, name);
++ }
++
++ void
++ do_pyeval (char_u *str, typval_T *rettv)
++ {
++ DoPythonCommand(NULL, (char *) str, rettv);
++ switch(rettv->v_type)
++ {
++ case VAR_DICT: ++rettv->vval.v_dict->dv_refcount; break;
++ case VAR_LIST: ++rettv->vval.v_list->lv_refcount; break;
++ case VAR_FUNC: func_ref(rettv->vval.v_string); break;
++ }
++ }
+
+ /* Don't generate a prototype for the next function, it generates an error on
+ * newer Python versions. */
+***************
+*** 1453,1458 ****
+--- 1755,1766 ----
+ }
+ #endif /* Python 1.4 */
+
++ void
++ set_ref_in_python (int copyID)
++ {
++ set_ref_in_py(copyID);
++ }
++
+ static void
+ init_structs(void)
+ {
+*** ../vim-7.3.568/src/if_python3.c 2012-02-04 20:17:21.000000000 +0100
+--- src/if_python3.c 2012-06-29 11:54:10.000000000 +0200
+***************
+*** 77,83 ****
+
+ #define PyInt Py_ssize_t
+ #define PyString_Check(obj) PyUnicode_Check(obj)
+! #define PyString_AsBytes(obj) PyUnicode_AsEncodedString(obj, (char *)ENC_OPT, CODEC_ERROR_HANDLER);
+ #define PyString_FreeBytes(obj) Py_XDECREF(bytes)
+ #define PyString_AsString(obj) PyBytes_AsString(obj)
+ #define PyString_Size(obj) PyBytes_GET_SIZE(bytes)
+--- 77,83 ----
+
+ #define PyInt Py_ssize_t
+ #define PyString_Check(obj) PyUnicode_Check(obj)
+! #define PyString_AsBytes(obj) PyUnicode_AsEncodedString(obj, (char *)ENC_OPT, CODEC_ERROR_HANDLER)
+ #define PyString_FreeBytes(obj) Py_XDECREF(bytes)
+ #define PyString_AsString(obj) PyBytes_AsString(obj)
+ #define PyString_Size(obj) PyBytes_GET_SIZE(bytes)
+***************
+*** 109,114 ****
+--- 109,115 ----
+ # undef PyArg_ParseTuple
+ # define PyArg_ParseTuple py3_PyArg_ParseTuple
+ # define PyMem_Free py3_PyMem_Free
++ # define PyMem_Malloc py3_PyMem_Malloc
+ # define PyDict_SetItemString py3_PyDict_SetItemString
+ # define PyErr_BadArgument py3_PyErr_BadArgument
+ # define PyErr_Clear py3_PyErr_Clear
+***************
+*** 128,141 ****
+--- 129,155 ----
+ # define PyList_New py3_PyList_New
+ # define PyList_SetItem py3_PyList_SetItem
+ # define PyList_Size py3_PyList_Size
++ # define PySequence_Check py3_PySequence_Check
++ # define PySequence_Size py3_PySequence_Size
++ # define PySequence_GetItem py3_PySequence_GetItem
++ # define PyTuple_Size py3_PyTuple_Size
++ # define PyTuple_GetItem py3_PyTuple_GetItem
+ # define PySlice_GetIndicesEx py3_PySlice_GetIndicesEx
+ # define PyImport_ImportModule py3_PyImport_ImportModule
++ # define PyImport_AddModule py3_PyImport_AddModule
+ # define PyObject_Init py3__PyObject_Init
+ # define PyDict_New py3_PyDict_New
+ # define PyDict_GetItemString py3_PyDict_GetItemString
++ # define PyDict_Next py3_PyDict_Next
++ # define PyMapping_Check py3_PyMapping_Check
++ # define PyMapping_Items py3_PyMapping_Items
++ # define PyIter_Next py3_PyIter_Next
++ # define PyObject_GetIter py3_PyObject_GetIter
+ # define PyModule_GetDict py3_PyModule_GetDict
+ #undef PyRun_SimpleString
+ # define PyRun_SimpleString py3_PyRun_SimpleString
++ #undef PyRun_String
++ # define PyRun_String py3_PyRun_String
+ # define PySys_SetObject py3_PySys_SetObject
+ # define PySys_SetArgv py3_PySys_SetArgv
+ # define PyType_Type (*py3_PyType_Type)
+***************
+*** 147,152 ****
+--- 161,167 ----
+ # define Py_Finalize py3_Py_Finalize
+ # define Py_IsInitialized py3_Py_IsInitialized
+ # define _Py_NoneStruct (*py3__Py_NoneStruct)
++ # define _PyObject_NextNotImplemented (*py3__PyObject_NextNotImplemented)
+ # define PyModule_AddObject py3_PyModule_AddObject
+ # define PyImport_AppendInittab py3_PyImport_AppendInittab
+ # define _PyUnicode_AsString py3__PyUnicode_AsString
+***************
+*** 154,161 ****
+--- 169,181 ----
+ # define PyUnicode_AsEncodedString py3_PyUnicode_AsEncodedString
+ # undef PyBytes_AsString
+ # define PyBytes_AsString py3_PyBytes_AsString
++ # undef PyBytes_FromString
++ # define PyBytes_FromString py3_PyBytes_FromString
++ # define PyFloat_FromDouble py3_PyFloat_FromDouble
++ # define PyFloat_AsDouble py3_PyFloat_AsDouble
+ # define PyObject_GenericGetAttr py3_PyObject_GenericGetAttr
+ # define PySlice_Type (*py3_PySlice_Type)
++ # define PyFloat_Type (*py3_PyFloat_Type)
+ # define PyErr_NewException py3_PyErr_NewException
+ # ifdef Py_DEBUG
+ # define _Py_NegativeRefcount py3__Py_NegativeRefcount
+***************
+*** 174,179 ****
+--- 194,202 ----
+ # define PyUnicode_FromString py3_PyUnicode_FromString
+ # undef PyUnicode_Decode
+ # define PyUnicode_Decode py3_PyUnicode_Decode
++ # define PyType_IsSubtype py3_PyType_IsSubtype
++ # define PyCapsule_New py3_PyCapsule_New
++ # define PyCapsule_GetPointer py3_PyCapsule_GetPointer
+
+ # ifdef Py_DEBUG
+ # undef PyObject_NEW
+***************
+*** 194,215 ****
+--- 217,250 ----
+ static int (*py3_PySys_SetObject)(char *, PyObject *);
+ static PyObject* (*py3_PyList_Append)(PyObject *, PyObject *);
+ static Py_ssize_t (*py3_PyList_Size)(PyObject *);
++ static int (*py3_PySequence_Check)(PyObject *);
++ static Py_ssize_t (*py3_PySequence_Size)(PyObject *);
++ static PyObject* (*py3_PySequence_GetItem)(PyObject *, Py_ssize_t);
++ static Py_ssize_t (*py3_PyTuple_Size)(PyObject *);
++ static PyObject* (*py3_PyTuple_GetItem)(PyObject *, Py_ssize_t);
++ static int (*py3_PyMapping_Check)(PyObject *);
++ static PyObject* (*py3_PyMapping_Items)(PyObject *);
+ static int (*py3_PySlice_GetIndicesEx)(PyObject *r, Py_ssize_t length,
+ Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength);
+ static PyObject* (*py3_PyErr_NoMemory)(void);
+ static void (*py3_Py_Finalize)(void);
+ static void (*py3_PyErr_SetString)(PyObject *, const char *);
+ static int (*py3_PyRun_SimpleString)(char *);
++ static PyObject* (*py3_PyRun_String)(char *, int, PyObject *, PyObject *);
+ static PyObject* (*py3_PyList_GetItem)(PyObject *, Py_ssize_t);
+ static PyObject* (*py3_PyImport_ImportModule)(const char *);
++ static PyObject* (*py3_PyImport_AddModule)(const char *);
+ static int (*py3_PyErr_BadArgument)(void);
+ static PyTypeObject* py3_PyType_Type;
+ static PyObject* (*py3_PyErr_Occurred)(void);
+ static PyObject* (*py3_PyModule_GetDict)(PyObject *);
+ static int (*py3_PyList_SetItem)(PyObject *, Py_ssize_t, PyObject *);
+ static PyObject* (*py3_PyDict_GetItemString)(PyObject *, const char *);
++ static int (*py3_PyDict_Next)(PyObject *, Py_ssize_t *, PyObject **, PyObject **);
+ static PyObject* (*py3_PyLong_FromLong)(long);
+ static PyObject* (*py3_PyDict_New)(void);
++ static PyObject* (*py3_PyIter_Next)(PyObject *);
++ static PyObject* (*py3_PyObject_GetIter)(PyObject *);
+ static PyObject* (*py3_Py_BuildValue)(char *, ...);
+ static int (*py3_PyType_Ready)(PyTypeObject *type);
+ static int (*py3_PyDict_SetItemString)(PyObject *dp, char *key, PyObject *item);
+***************
+*** 224,244 ****
+--- 259,287 ----
+ static int (*py3_PyArg_Parse)(PyObject *, char *, ...);
+ static int (*py3_PyArg_ParseTuple)(PyObject *, char *, ...);
+ static int (*py3_PyMem_Free)(void *);
++ static void* (*py3_PyMem_Malloc)(size_t);
+ static int (*py3_Py_IsInitialized)(void);
+ static void (*py3_PyErr_Clear)(void);
+ static PyObject*(*py3__PyObject_Init)(PyObject *, PyTypeObject *);
++ static iternextfunc py3__PyObject_NextNotImplemented;
+ static PyObject* py3__Py_NoneStruct;
+ static int (*py3_PyModule_AddObject)(PyObject *m, const char *name, PyObject *o);
+ static int (*py3_PyImport_AppendInittab)(const char *name, PyObject* (*initfunc)(void));
+ static char* (*py3__PyUnicode_AsString)(PyObject *unicode);
+ static PyObject* (*py3_PyUnicode_AsEncodedString)(PyObject *unicode, const char* encoding, const char* errors);
+ static char* (*py3_PyBytes_AsString)(PyObject *bytes);
++ static PyObject* (*py3_PyBytes_FromString)(char *str);
++ static PyObject* (*py3_PyFloat_FromDouble)(double num);
++ static double (*py3_PyFloat_AsDouble)(PyObject *);
+ static PyObject* (*py3_PyObject_GenericGetAttr)(PyObject *obj, PyObject *name);
+ static PyObject* (*py3_PyModule_Create2)(struct PyModuleDef* module, int module_api_version);
+ static PyObject* (*py3_PyType_GenericAlloc)(PyTypeObject *type, Py_ssize_t nitems);
+ static PyObject* (*py3_PyType_GenericNew)(PyTypeObject *type, PyObject *args, PyObject *kwds);
+ static PyTypeObject* py3_PySlice_Type;
++ static PyTypeObject* py3_PyFloat_Type;
+ static PyObject* (*py3_PyErr_NewException)(char *name, PyObject *base, PyObject *dict);
++ static PyObject* (*py3_PyCapsule_New)(void *, char *, PyCapsule_Destructor);
++ static void* (*py3_PyCapsule_GetPointer)(PyObject *, char *);
+ # ifdef Py_DEBUG
+ static void (*py3__Py_NegativeRefcount)(const char *fname, int lineno, PyObject *op);
+ static Py_ssize_t* py3__Py_RefTotal;
+***************
+*** 249,254 ****
+--- 292,298 ----
+ static void (*py3_PyObject_Free)(void*);
+ static void* (*py3_PyObject_Malloc)(size_t);
+ # endif
++ static int (*py3_PyType_IsSubtype)(PyTypeObject *, PyTypeObject *);
+
+ static HINSTANCE hinstPy3 = 0; /* Instance of python.dll */
+
+***************
+*** 280,304 ****
+--- 324,361 ----
+ {"Py_Initialize", (PYTHON_PROC*)&py3_Py_Initialize},
+ {"PyArg_ParseTuple", (PYTHON_PROC*)&py3_PyArg_ParseTuple},
+ {"PyMem_Free", (PYTHON_PROC*)&py3_PyMem_Free},
++ {"PyMem_Malloc", (PYTHON_PROC*)&py3_PyMem_Malloc},
+ {"PyList_New", (PYTHON_PROC*)&py3_PyList_New},
+ {"PyGILState_Ensure", (PYTHON_PROC*)&py3_PyGILState_Ensure},
+ {"PyGILState_Release", (PYTHON_PROC*)&py3_PyGILState_Release},
+ {"PySys_SetObject", (PYTHON_PROC*)&py3_PySys_SetObject},
+ {"PyList_Append", (PYTHON_PROC*)&py3_PyList_Append},
+ {"PyList_Size", (PYTHON_PROC*)&py3_PyList_Size},
++ {"PySequence_Check", (PYTHON_PROC*)&py3_PySequence_Check},
++ {"PySequence_Size", (PYTHON_PROC*)&py3_PySequence_Size},
++ {"PySequence_GetItem", (PYTHON_PROC*)&py3_PySequence_GetItem},
++ {"PyTuple_Size", (PYTHON_PROC*)&py3_PyTuple_Size},
++ {"PyTuple_GetItem", (PYTHON_PROC*)&py3_PyTuple_GetItem},
+ {"PySlice_GetIndicesEx", (PYTHON_PROC*)&py3_PySlice_GetIndicesEx},
+ {"PyErr_NoMemory", (PYTHON_PROC*)&py3_PyErr_NoMemory},
+ {"Py_Finalize", (PYTHON_PROC*)&py3_Py_Finalize},
+ {"PyErr_SetString", (PYTHON_PROC*)&py3_PyErr_SetString},
+ {"PyRun_SimpleString", (PYTHON_PROC*)&py3_PyRun_SimpleString},
++ {"PyRun_String", (PYTHON_PROC*)&py3_PyRun_String},
+ {"PyList_GetItem", (PYTHON_PROC*)&py3_PyList_GetItem},
+ {"PyImport_ImportModule", (PYTHON_PROC*)&py3_PyImport_ImportModule},
++ {"PyImport_AddModule", (PYTHON_PROC*)&py3_PyImport_AddModule},
+ {"PyErr_BadArgument", (PYTHON_PROC*)&py3_PyErr_BadArgument},
+ {"PyType_Type", (PYTHON_PROC*)&py3_PyType_Type},
+ {"PyErr_Occurred", (PYTHON_PROC*)&py3_PyErr_Occurred},
+ {"PyModule_GetDict", (PYTHON_PROC*)&py3_PyModule_GetDict},
+ {"PyList_SetItem", (PYTHON_PROC*)&py3_PyList_SetItem},
+ {"PyDict_GetItemString", (PYTHON_PROC*)&py3_PyDict_GetItemString},
++ {"PyDict_Next", (PYTHON_PROC*)&py3_PyDict_Next},
++ {"PyMapping_Check", (PYTHON_PROC*)&py3_PyMapping_Check},
++ {"PyMapping_Items", (PYTHON_PROC*)&py3_PyMapping_Items},
++ {"PyIter_Next", (PYTHON_PROC*)&py3_PyIter_Next},
++ {"PyObject_GetIter", (PYTHON_PROC*)&py3_PyObject_GetIter},
+ {"PyLong_FromLong", (PYTHON_PROC*)&py3_PyLong_FromLong},
+ {"PyDict_New", (PYTHON_PROC*)&py3_PyDict_New},
+ {"Py_BuildValue", (PYTHON_PROC*)&py3_Py_BuildValue},
+***************
+*** 311,316 ****
+--- 368,374 ----
+ {"PyEval_SaveThread", (PYTHON_PROC*)&py3_PyEval_SaveThread},
+ {"PyArg_Parse", (PYTHON_PROC*)&py3_PyArg_Parse},
+ {"Py_IsInitialized", (PYTHON_PROC*)&py3_Py_IsInitialized},
++ {"_PyObject_NextNotImplemented", (PYTHON_PROC*)&py3__PyObject_NextNotImplemented},
+ {"_Py_NoneStruct", (PYTHON_PROC*)&py3__Py_NoneStruct},
+ {"PyErr_Clear", (PYTHON_PROC*)&py3_PyErr_Clear},
+ {"PyObject_Init", (PYTHON_PROC*)&py3__PyObject_Init},
+***************
+*** 318,328 ****
+--- 376,390 ----
+ {"PyImport_AppendInittab", (PYTHON_PROC*)&py3_PyImport_AppendInittab},
+ {"_PyUnicode_AsString", (PYTHON_PROC*)&py3__PyUnicode_AsString},
+ {"PyBytes_AsString", (PYTHON_PROC*)&py3_PyBytes_AsString},
++ {"PyBytes_FromString", (PYTHON_PROC*)&py3_PyBytes_FromString},
++ {"PyFloat_FromDouble", (PYTHON_PROC*)&py3_PyFloat_FromDouble},
++ {"PyFloat_AsDouble", (PYTHON_PROC*)&py3_PyFloat_AsDouble},
+ {"PyObject_GenericGetAttr", (PYTHON_PROC*)&py3_PyObject_GenericGetAttr},
+ {"PyModule_Create2", (PYTHON_PROC*)&py3_PyModule_Create2},
+ {"PyType_GenericAlloc", (PYTHON_PROC*)&py3_PyType_GenericAlloc},
+ {"PyType_GenericNew", (PYTHON_PROC*)&py3_PyType_GenericNew},
+ {"PySlice_Type", (PYTHON_PROC*)&py3_PySlice_Type},
++ {"PyFloat_Type", (PYTHON_PROC*)&py3_PyFloat_Type},
+ {"PyErr_NewException", (PYTHON_PROC*)&py3_PyErr_NewException},
+ # ifdef Py_DEBUG
+ {"_Py_NegativeRefcount", (PYTHON_PROC*)&py3__Py_NegativeRefcount},
+***************
+*** 334,339 ****
+--- 396,404 ----
+ {"PyObject_Malloc", (PYTHON_PROC*)&py3_PyObject_Malloc},
+ {"PyObject_Free", (PYTHON_PROC*)&py3_PyObject_Free},
+ # endif
++ {"PyType_IsSubtype", (PYTHON_PROC*)&py3_PyType_IsSubtype},
++ {"PyCapsule_New", (PYTHON_PROC*)&py3_PyCapsule_New},
++ {"PyCapsule_GetPointer", (PYTHON_PROC*)&py3_PyCapsule_GetPointer},
+ {"", NULL},
+ };
+
+***************
+*** 472,482 ****
+--- 537,577 ----
+
+ static PyTypeObject RangeType;
+
++ static int py3initialised = 0;
++
++ #define PYINITIALISED py3initialised
++
++ /* Add conversion from PyInt? */
++ #define DICTKEY_GET(err) \
++ if (PyBytes_Check(keyObject)) \
++ key = (char_u *) PyBytes_AsString(keyObject); \
++ else if (PyUnicode_Check(keyObject)) \
++ { \
++ bytes = PyString_AsBytes(keyObject); \
++ if (bytes == NULL) \
++ return err; \
++ key = (char_u *) PyBytes_AsString(bytes); \
++ if (key == NULL) \
++ return err; \
++ } \
++ else \
++ { \
++ PyErr_SetString(PyExc_TypeError, _("only string keys are allowed")); \
++ return err; \
++ }
++ #define DICTKEY_UNREF \
++ if (bytes != NULL) \
++ Py_XDECREF(bytes);
++
++ #define DICTKEY_DECL PyObject *bytes = NULL;
++
+ /*
+ * Include the code shared with if_python.c
+ */
+ #include "if_py_both.h"
+
++ #define PY3OBJ_DELETED(obj) (obj->ob_base.ob_refcnt<=0)
++
+ static void
+ call_PyObject_Free(void *p)
+ {
+***************
+*** 506,511 ****
+--- 601,608 ----
+ static Py_ssize_t RangeStart;
+ static Py_ssize_t RangeEnd;
+
++ static PyObject *globals;
++
+ static int PythonIO_Init(void);
+ static void PythonIO_Fini(void);
+ PyMODINIT_FUNC Py3Init_vim(void);
+***************
+*** 514,521 ****
+ * 1. Python interpreter main program.
+ */
+
+- static int py3initialised = 0;
+-
+ static PyGILState_STATE pygilstate = PyGILState_UNLOCKED;
+
+ void
+--- 611,616 ----
+***************
+*** 593,598 ****
+--- 688,695 ----
+
+ PyImport_AppendInittab("vim", Py3Init_vim);
+
++ globals = PyModule_GetDict(PyImport_AddModule("__main__"));
++
+ /* Remove the element from sys.path that was added because of our
+ * argv[0] value in Py3Init_vim(). Previously we used an empty
+ * string, but dependinding on the OS we then get an empty entry or
+***************
+*** 629,635 ****
+ * External interface
+ */
+ static void
+! DoPy3Command(exarg_T *eap, const char *cmd)
+ {
+ #if defined(MACOS) && !defined(MACOS_X_UNIX)
+ GrafPtr oldPort;
+--- 726,732 ----
+ * External interface
+ */
+ static void
+! DoPy3Command(exarg_T *eap, const char *cmd, typval_T *rettv)
+ {
+ #if defined(MACOS) && !defined(MACOS_X_UNIX)
+ GrafPtr oldPort;
+***************
+*** 649,656 ****
+ if (Python3_Init())
+ goto theend;
+
+! RangeStart = eap->line1;
+! RangeEnd = eap->line2;
+ Python_Release_Vim(); /* leave vim */
+
+ #if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
+--- 746,761 ----
+ if (Python3_Init())
+ goto theend;
+
+! if (rettv == NULL)
+! {
+! RangeStart = eap->line1;
+! RangeEnd = eap->line2;
+! }
+! else
+! {
+! RangeStart = (PyInt) curwin->w_cursor.lnum;
+! RangeEnd = RangeStart;
+! }
+ Python_Release_Vim(); /* leave vim */
+
+ #if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
+***************
+*** 674,680 ****
+ (char *)ENC_OPT, CODEC_ERROR_HANDLER);
+ cmdbytes = PyUnicode_AsEncodedString(cmdstr, "utf-8", CODEC_ERROR_HANDLER);
+ Py_XDECREF(cmdstr);
+! PyRun_SimpleString(PyBytes_AsString(cmdbytes));
+ Py_XDECREF(cmdbytes);
+
+ PyGILState_Release(pygilstate);
+--- 779,802 ----
+ (char *)ENC_OPT, CODEC_ERROR_HANDLER);
+ cmdbytes = PyUnicode_AsEncodedString(cmdstr, "utf-8", CODEC_ERROR_HANDLER);
+ Py_XDECREF(cmdstr);
+! if (rettv == NULL)
+! PyRun_SimpleString(PyBytes_AsString(cmdbytes));
+! else
+! {
+! PyObject *r;
+!
+! r = PyRun_String(PyBytes_AsString(cmdbytes), Py_eval_input,
+! globals, globals);
+! if (r == NULL)
+! EMSG(_("E860: Eval did not return a valid python 3 object"));
+! else
+! {
+! if (ConvertFromPyObject(r, rettv) == -1)
+! EMSG(_("E861: Failed to convert returned python 3 object to vim value"));
+! Py_DECREF(r);
+! }
+! PyErr_Clear();
+! }
+ Py_XDECREF(cmdbytes);
+
+ PyGILState_Release(pygilstate);
+***************
+*** 709,717 ****
+ if (!eap->skip)
+ {
+ if (script == NULL)
+! DoPy3Command(eap, (char *)eap->arg);
+ else
+! DoPy3Command(eap, (char *)script);
+ }
+ vim_free(script);
+ }
+--- 831,839 ----
+ if (!eap->skip)
+ {
+ if (script == NULL)
+! DoPy3Command(eap, (char *)eap->arg, NULL);
+ else
+! DoPy3Command(eap, (char *)script, NULL);
+ }
+ vim_free(script);
+ }
+***************
+*** 772,778 ****
+
+
+ /* Execute the file */
+! DoPy3Command(eap, buffer);
+ }
+
+ /******************************************************
+--- 894,900 ----
+
+
+ /* Execute the file */
+! DoPy3Command(eap, buffer, NULL);
+ }
+
+ /******************************************************
+***************
+*** 802,815 ****
+ if (PyUnicode_Check(nameobj))
+ name = _PyUnicode_AsString(nameobj);
+
+! if (val == NULL) {
+ PyErr_SetString(PyExc_AttributeError, _("can't delete OutputObject attributes"));
+ return -1;
+ }
+
+ if (strcmp(name, "softspace") == 0)
+ {
+! if (!PyLong_Check(val)) {
+ PyErr_SetString(PyExc_TypeError, _("softspace must be an integer"));
+ return -1;
+ }
+--- 924,939 ----
+ if (PyUnicode_Check(nameobj))
+ name = _PyUnicode_AsString(nameobj);
+
+! if (val == NULL)
+! {
+ PyErr_SetString(PyExc_AttributeError, _("can't delete OutputObject attributes"));
+ return -1;
+ }
+
+ if (strcmp(name, "softspace") == 0)
+ {
+! if (!PyLong_Check(val))
+! {
+ PyErr_SetString(PyExc_TypeError, _("softspace must be an integer"));
+ return -1;
+ }
+***************
+*** 1030,1049 ****
+ static PyObject *
+ BufferSubscript(PyObject *self, PyObject* idx)
+ {
+! if (PyLong_Check(idx)) {
+ long _idx = PyLong_AsLong(idx);
+ return BufferItem(self,_idx);
+! } else if (PySlice_Check(idx)) {
+ Py_ssize_t start, stop, step, slicelen;
+
+ if (PySlice_GetIndicesEx((PyObject *)idx,
+ (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count+1,
+ &start, &stop,
+! &step, &slicelen) < 0) {
+ return NULL;
+ }
+ return BufferSlice(self, start, stop);
+! } else {
+ PyErr_SetString(PyExc_IndexError, "Index must be int or slice");
+ return NULL;
+ }
+--- 1154,1178 ----
+ static PyObject *
+ BufferSubscript(PyObject *self, PyObject* idx)
+ {
+! if (PyLong_Check(idx))
+! {
+ long _idx = PyLong_AsLong(idx);
+ return BufferItem(self,_idx);
+! } else if (PySlice_Check(idx))
+! {
+ Py_ssize_t start, stop, step, slicelen;
+
+ if (PySlice_GetIndicesEx((PyObject *)idx,
+ (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count+1,
+ &start, &stop,
+! &step, &slicelen) < 0)
+! {
+ return NULL;
+ }
+ return BufferSlice(self, start, stop);
+! }
+! else
+! {
+ PyErr_SetString(PyExc_IndexError, "Index must be int or slice");
+ return NULL;
+ }
+***************
+*** 1052,1075 ****
+ static Py_ssize_t
+ BufferAsSubscript(PyObject *self, PyObject* idx, PyObject* val)
+ {
+! if (PyLong_Check(idx)) {
+ long n = PyLong_AsLong(idx);
+ return RBAsItem((BufferObject *)(self), n, val, 1,
+ (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count,
+ NULL);
+! } else if (PySlice_Check(idx)) {
+ Py_ssize_t start, stop, step, slicelen;
+
+ if (PySlice_GetIndicesEx((PyObject *)idx,
+ (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count+1,
+ &start, &stop,
+! &step, &slicelen) < 0) {
+ return -1;
+ }
+ return RBAsSlice((BufferObject *)(self), start, stop, val, 1,
+ (PyInt)((BufferObject *)(self))->buf->b_ml.ml_line_count,
+ NULL);
+! } else {
+ PyErr_SetString(PyExc_IndexError, "Index must be int or slice");
+ return -1;
+ }
+--- 1181,1209 ----
+ static Py_ssize_t
+ BufferAsSubscript(PyObject *self, PyObject* idx, PyObject* val)
+ {
+! if (PyLong_Check(idx))
+! {
+ long n = PyLong_AsLong(idx);
+ return RBAsItem((BufferObject *)(self), n, val, 1,
+ (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count,
+ NULL);
+! } else if (PySlice_Check(idx))
+! {
+ Py_ssize_t start, stop, step, slicelen;
+
+ if (PySlice_GetIndicesEx((PyObject *)idx,
+ (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count+1,
+ &start, &stop,
+! &step, &slicelen) < 0)
+! {
+ return -1;
+ }
+ return RBAsSlice((BufferObject *)(self), start, stop, val, 1,
+ (PyInt)((BufferObject *)(self))->buf->b_ml.ml_line_count,
+ NULL);
+! }
+! else
+! {
+ PyErr_SetString(PyExc_IndexError, "Index must be int or slice");
+ return -1;
+ }
+***************
+*** 1142,1161 ****
+ static PyObject *
+ RangeSubscript(PyObject *self, PyObject* idx)
+ {
+! if (PyLong_Check(idx)) {
+ long _idx = PyLong_AsLong(idx);
+ return RangeItem(self,_idx);
+! } else if (PySlice_Check(idx)) {
+ Py_ssize_t start, stop, step, slicelen;
+
+ if (PySlice_GetIndicesEx((PyObject *)idx,
+ ((RangeObject *)(self))->end-((RangeObject *)(self))->start+1,
+ &start, &stop,
+! &step, &slicelen) < 0) {
+ return NULL;
+ }
+ return RangeSlice(self, start, stop);
+! } else {
+ PyErr_SetString(PyExc_IndexError, "Index must be int or slice");
+ return NULL;
+ }
+--- 1276,1300 ----
+ static PyObject *
+ RangeSubscript(PyObject *self, PyObject* idx)
+ {
+! if (PyLong_Check(idx))
+! {
+ long _idx = PyLong_AsLong(idx);
+ return RangeItem(self,_idx);
+! } else if (PySlice_Check(idx))
+! {
+ Py_ssize_t start, stop, step, slicelen;
+
+ if (PySlice_GetIndicesEx((PyObject *)idx,
+ ((RangeObject *)(self))->end-((RangeObject *)(self))->start+1,
+ &start, &stop,
+! &step, &slicelen) < 0)
+! {
+ return NULL;
+ }
+ return RangeSlice(self, start, stop);
+! }
+! else
+! {
+ PyErr_SetString(PyExc_IndexError, "Index must be int or slice");
+ return NULL;
+ }
+***************
+*** 1164,1183 ****
+ static Py_ssize_t
+ RangeAsSubscript(PyObject *self, PyObject *idx, PyObject *val)
+ {
+! if (PyLong_Check(idx)) {
+ long n = PyLong_AsLong(idx);
+ return RangeAsItem(self, n, val);
+! } else if (PySlice_Check(idx)) {
+ Py_ssize_t start, stop, step, slicelen;
+
+ if (PySlice_GetIndicesEx((PyObject *)idx,
+ ((RangeObject *)(self))->end-((RangeObject *)(self))->start+1,
+ &start, &stop,
+! &step, &slicelen) < 0) {
+ return -1;
+ }
+ return RangeAsSlice(self, start, stop, val);
+! } else {
+ PyErr_SetString(PyExc_IndexError, "Index must be int or slice");
+ return -1;
+ }
+--- 1303,1327 ----
+ static Py_ssize_t
+ RangeAsSubscript(PyObject *self, PyObject *idx, PyObject *val)
+ {
+! if (PyLong_Check(idx))
+! {
+ long n = PyLong_AsLong(idx);
+ return RangeAsItem(self, n, val);
+! } else if (PySlice_Check(idx))
+! {
+ Py_ssize_t start, stop, step, slicelen;
+
+ if (PySlice_GetIndicesEx((PyObject *)idx,
+ ((RangeObject *)(self))->end-((RangeObject *)(self))->start+1,
+ &start, &stop,
+! &step, &slicelen) < 0)
+! {
+ return -1;
+ }
+ return RangeAsSlice(self, start, stop, val);
+! }
+! else
+! {
+ PyErr_SetString(PyExc_IndexError, "Index must be int or slice");
+ return -1;
+ }
+***************
+*** 1390,1395 ****
+--- 1534,1680 ----
+ }
+ }
+
++ /* Dictionary object - Definitions
++ */
++
++ static PyInt DictionaryLength(PyObject *);
++
++ static PyMappingMethods DictionaryAsMapping = {
++ /* mp_length */ (lenfunc) DictionaryLength,
++ /* mp_subscript */ (binaryfunc) DictionaryItem,
++ /* mp_ass_subscript */ (objobjargproc) DictionaryAssItem,
++ };
++
++ static PyTypeObject DictionaryType;
++
++ static void
++ DictionaryDestructor(PyObject *self)
++ {
++ DictionaryObject *this = (DictionaryObject *)(self);
++
++ pyll_remove(&this->ref, &lastdict);
++ dict_unref(this->dict);
++
++ Py_TYPE(self)->tp_free((PyObject*)self);
++ }
++
++ /* List object - Definitions
++ */
++
++ static PyInt ListLength(PyObject *);
++ static PyObject *ListItem(PyObject *, Py_ssize_t);
++
++ static PySequenceMethods ListAsSeq = {
++ (lenfunc) ListLength, /* sq_length, len(x) */
++ (binaryfunc) 0, /* RangeConcat, sq_concat, x+y */
++ (ssizeargfunc) 0, /* RangeRepeat, sq_repeat, x*n */
++ (ssizeargfunc) ListItem, /* sq_item, x[i] */
++ (void *) 0, /* was_sq_slice, x[i:j] */
++ (ssizeobjargproc) ListAssItem, /* sq_as_item, x[i]=v */
++ (void *) 0, /* was_sq_ass_slice, x[i:j]=v */
++ 0, /* sq_contains */
++ (binaryfunc) ListConcatInPlace,/* sq_inplace_concat */
++ 0, /* sq_inplace_repeat */
++ };
++
++ static PyObject *ListSubscript(PyObject *, PyObject *);
++ static Py_ssize_t ListAsSubscript(PyObject *, PyObject *, PyObject *);
++
++ static PyMappingMethods ListAsMapping = {
++ /* mp_length */ (lenfunc) ListLength,
++ /* mp_subscript */ (binaryfunc) ListSubscript,
++ /* mp_ass_subscript */ (objobjargproc) ListAsSubscript,
++ };
++
++ static PyTypeObject ListType;
++
++ static PyObject *
++ ListSubscript(PyObject *self, PyObject* idxObject)
++ {
++ if (PyLong_Check(idxObject))
++ {
++ long idx = PyLong_AsLong(idxObject);
++ return ListItem(self, idx);
++ }
++ else if (PySlice_Check(idxObject))
++ {
++ Py_ssize_t start, stop, step, slicelen;
++
++ if (PySlice_GetIndicesEx(idxObject, ListLength(self), &start, &stop,
++ &step, &slicelen) < 0)
++ return NULL;
++ return ListSlice(self, start, stop);
++ }
++ else
++ {
++ PyErr_SetString(PyExc_IndexError, "Index must be int or slice");
++ return NULL;
++ }
++ }
++
++ static Py_ssize_t
++ ListAsSubscript(PyObject *self, PyObject *idxObject, PyObject *obj)
++ {
++ if (PyLong_Check(idxObject))
++ {
++ long idx = PyLong_AsLong(idxObject);
++ return ListAssItem(self, idx, obj);
++ }
++ else if (PySlice_Check(idxObject))
++ {
++ Py_ssize_t start, stop, step, slicelen;
++
++ if (PySlice_GetIndicesEx(idxObject, ListLength(self), &start, &stop,
++ &step, &slicelen) < 0)
++ return -1;
++ return ListAssSlice(self, start, stop, obj);
++ }
++ else
++ {
++ PyErr_SetString(PyExc_IndexError, "Index must be int or slice");
++ return -1;
++ }
++ }
++
++ static void
++ ListDestructor(PyObject *self)
++ {
++ ListObject *this = (ListObject *)(self);
++
++ pyll_remove(&this->ref, &lastlist);
++ list_unref(this->list);
++
++ Py_TYPE(self)->tp_free((PyObject*)self);
++ }
++
++ /* Function object - Definitions
++ */
++
++ static void
++ FunctionDestructor(PyObject *self)
++ {
++ FunctionObject *this = (FunctionObject *) (self);
++
++ func_unref(this->name);
++ PyMem_Del(this->name);
++
++ Py_TYPE(self)->tp_free((PyObject*)self);
++ }
++
++ static PyObject *
++ FunctionGetattro(PyObject *self, PyObject *nameobj)
++ {
++ FunctionObject *this = (FunctionObject *)(self);
++ char *name = "";
++ if (PyUnicode_Check(nameobj))
++ name = _PyUnicode_AsString(nameobj);
++
++ if (strcmp(name, "name") == 0)
++ return PyUnicode_FromString((char *)(this->name));
++
++ return PyObject_GenericGetAttr(self, nameobj);
++ }
++
+ /* External interface
+ */
+
+***************
+*** 1449,1454 ****
+--- 1734,1742 ----
+ PyType_Ready(&BufListType);
+ PyType_Ready(&WinListType);
+ PyType_Ready(&CurrentType);
++ PyType_Ready(&DictionaryType);
++ PyType_Ready(&ListType);
++ PyType_Ready(&FunctionType);
+
+ /* Set sys.argv[] to avoid a crash in warn(). */
+ PySys_SetArgv(1, argv);
+***************
+*** 1517,1522 ****
+--- 1805,1828 ----
+ return result;
+ }
+
++ void
++ do_py3eval (char_u *str, typval_T *rettv)
++ {
++ DoPy3Command(NULL, (char *) str, rettv);
++ switch(rettv->v_type)
++ {
++ case VAR_DICT: ++rettv->vval.v_dict->dv_refcount; break;
++ case VAR_LIST: ++rettv->vval.v_list->lv_refcount; break;
++ case VAR_FUNC: func_ref(rettv->vval.v_string); break;
++ }
++ }
++
++ void
++ set_ref_in_python3 (int copyID)
++ {
++ set_ref_in_py(copyID);
++ }
++
+ static void
+ init_structs(void)
+ {
+***************
+*** 1598,1603 ****
+--- 1904,1938 ----
+ CurrentType.tp_flags = Py_TPFLAGS_DEFAULT;
+ CurrentType.tp_doc = "vim current object";
+
++ vim_memset(&DictionaryType, 0, sizeof(DictionaryType));
++ DictionaryType.tp_name = "vim.dictionary";
++ DictionaryType.tp_basicsize = sizeof(DictionaryObject);
++ DictionaryType.tp_dealloc = DictionaryDestructor;
++ DictionaryType.tp_as_mapping = &DictionaryAsMapping;
++ DictionaryType.tp_flags = Py_TPFLAGS_DEFAULT;
++ DictionaryType.tp_doc = "dictionary pushing modifications to vim structure";
++ DictionaryType.tp_methods = DictionaryMethods;
++
++ vim_memset(&ListType, 0, sizeof(ListType));
++ ListType.tp_name = "vim.list";
++ ListType.tp_dealloc = ListDestructor;
++ ListType.tp_basicsize = sizeof(ListObject);
++ ListType.tp_as_sequence = &ListAsSeq;
++ ListType.tp_as_mapping = &ListAsMapping;
++ ListType.tp_flags = Py_TPFLAGS_DEFAULT;
++ ListType.tp_doc = "list pushing modifications to vim structure";
++ ListType.tp_methods = ListMethods;
++
++ vim_memset(&FunctionType, 0, sizeof(FunctionType));
++ FunctionType.tp_name = "vim.list";
++ FunctionType.tp_basicsize = sizeof(FunctionObject);
++ FunctionType.tp_getattro = FunctionGetattro;
++ FunctionType.tp_dealloc = FunctionDestructor;
++ FunctionType.tp_call = FunctionCall;
++ FunctionType.tp_flags = Py_TPFLAGS_DEFAULT;
++ FunctionType.tp_doc = "object that calls vim function";
++ FunctionType.tp_methods = FunctionMethods;
++
+ vim_memset(&vimmodule, 0, sizeof(vimmodule));
+ vimmodule.m_name = "vim";
+ vimmodule.m_doc = vim_module_doc;
+*** ../vim-7.3.568/src/proto/eval.pro 2011-09-14 16:52:02.000000000 +0200
+--- src/proto/eval.pro 2012-06-20 18:20:28.000000000 +0200
+***************
+*** 46,57 ****
+--- 46,66 ----
+ list_T *list_alloc __ARGS((void));
+ void list_unref __ARGS((list_T *l));
+ void list_free __ARGS((list_T *l, int recurse));
++ listitem_T *listitem_alloc __ARGS((void));
++ void listitem_remove __ARGS((list_T *l, listitem_T *item));
+ dictitem_T *dict_lookup __ARGS((hashitem_T *hi));
++ listitem_T *list_find __ARGS((list_T *l, long n));
+ char_u *list_find_str __ARGS((list_T *l, long idx));
++ void list_append __ARGS((list_T *l, listitem_T *item));
+ int list_append_tv __ARGS((list_T *l, typval_T *tv));
+ int list_append_dict __ARGS((list_T *list, dict_T *dict));
+ int list_append_string __ARGS((list_T *l, char_u *str, int len));
++ int list_insert_tv __ARGS((list_T *l, typval_T *tv, listitem_T *item));
++ void list_remove __ARGS((list_T *l, listitem_T *item, listitem_T *item2));
+ int garbage_collect __ARGS((void));
++ void set_ref_in_ht __ARGS((hashtab_T *ht, int copyID));
++ void set_ref_in_list __ARGS((list_T *l, int copyID));
++ void set_ref_in_item __ARGS((typval_T *tv, int copyID));
+ dict_T *dict_alloc __ARGS((void));
+ void dict_unref __ARGS((dict_T *d));
+ dictitem_T *dictitem_alloc __ARGS((char_u *key));
+***************
+*** 64,69 ****
+--- 73,79 ----
+ long get_dict_number __ARGS((dict_T *d, char_u *key));
+ char_u *get_function_name __ARGS((expand_T *xp, int idx));
+ char_u *get_expr_name __ARGS((expand_T *xp, int idx));
++ int func_call __ARGS((char_u *name, typval_T *args, dict_T *selfdict, typval_T *rettv));
+ 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));
+ void set_vim_var_nr __ARGS((int idx, long val));
+ long get_vim_var_nr __ARGS((int idx));
+***************
+*** 94,99 ****
+--- 104,111 ----
+ void func_dump_profile __ARGS((FILE *fd));
+ char_u *get_user_func_name __ARGS((expand_T *xp, int idx));
+ void ex_delfunction __ARGS((exarg_T *eap));
++ void func_unref __ARGS((char_u *name));
++ void func_ref __ARGS((char_u *name));
+ void ex_return __ARGS((exarg_T *eap));
+ int do_return __ARGS((exarg_T *eap, int reanimate, int is_cmd, void *rettv));
+ void discard_pending_return __ARGS((void *rettv));
+*** ../vim-7.3.568/src/proto/if_python.pro 2010-08-15 21:57:28.000000000 +0200
+--- src/proto/if_python.pro 2012-06-20 18:23:06.000000000 +0200
+***************
+*** 6,9 ****
+--- 6,11 ----
+ void ex_pyfile __ARGS((exarg_T *eap));
+ void python_buffer_free __ARGS((buf_T *buf));
+ void python_window_free __ARGS((win_T *win));
++ void do_pyeval __ARGS((char_u *str, typval_T *rettv));
++ void set_ref_in_python __ARGS((int copyID));
+ /* vim: set ft=c : */
+*** ../vim-7.3.568/src/proto/if_python3.pro 2010-08-15 21:57:28.000000000 +0200
+--- src/proto/if_python3.pro 2012-06-20 18:34:26.000000000 +0200
+***************
+*** 6,9 ****
+--- 6,11 ----
+ void ex_py3file __ARGS((exarg_T *eap));
+ void python3_buffer_free __ARGS((buf_T *buf));
+ void python3_window_free __ARGS((win_T *win));
++ void do_py3eval __ARGS((char_u *str, typval_T *rettv));
++ void set_ref_in_python3 __ARGS((int copyID));
+ /* vim: set ft=c : */
+*** ../vim-7.3.568/src/testdir/Make_amiga.mak 2012-04-05 16:56:38.000000000 +0200
+--- src/testdir/Make_amiga.mak 2012-06-20 18:43:05.000000000 +0200
+***************
+*** 14,19 ****
+--- 14,20 ----
+ # test27 can't edit file with "*"
+ # test52 only for Win32
+ # test85 no Lua interface
++ # test86, 87 no Python interface
+
+ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
+ test7.out test8.out test9.out \
+*** ../vim-7.3.568/src/testdir/Make_dos.mak 2012-04-13 19:11:16.000000000 +0200
+--- src/testdir/Make_dos.mak 2012-06-20 18:43:45.000000000 +0200
+***************
+*** 30,36 ****
+ test68.out test69.out test71.out test72.out test73.out \
+ test74.out test75.out test76.out test77.out test78.out \
+ test79.out test80.out test81.out test82.out test83.out \
+! test84.out test85.out
+
+ SCRIPTS32 = test50.out test70.out
+
+--- 30,36 ----
+ test68.out test69.out test71.out test72.out test73.out \
+ test74.out test75.out test76.out test77.out test78.out \
+ test79.out test80.out test81.out test82.out test83.out \
+! test84.out test85.out test86.out test87.out
+
+ SCRIPTS32 = test50.out test70.out
+
+*** ../vim-7.3.568/src/testdir/Make_ming.mak 2012-04-13 19:11:16.000000000 +0200
+--- src/testdir/Make_ming.mak 2012-06-20 18:44:12.000000000 +0200
+***************
+*** 50,56 ****
+ test68.out test69.out test71.out test72.out test73.out \
+ test74.out test75.out test76.out test77.out test78.out \
+ test79.out test80.out test81.out test82.out test83.out \
+! test84.out test85.out
+
+ SCRIPTS32 = test50.out test70.out
+
+--- 50,56 ----
+ test68.out test69.out test71.out test72.out test73.out \
+ test74.out test75.out test76.out test77.out test78.out \
+ test79.out test80.out test81.out test82.out test83.out \
+! test84.out test85.out test86.out test87.out
+
+ SCRIPTS32 = test50.out test70.out
+
+*** ../vim-7.3.568/src/testdir/Make_os2.mak 2012-04-05 16:56:38.000000000 +0200
+--- src/testdir/Make_os2.mak 2012-06-20 18:44:32.000000000 +0200
+***************
+*** 14,19 ****
+--- 14,20 ----
+ # test27 can't edit file with "*" in file name
+ # test52 only for Win32
+ # test85 no Lua interface
++ # test86, 87 no Python interface
+
+ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
+ test7.out test8.out test9.out \
+*** ../vim-7.3.568/src/testdir/Makefile 2012-04-05 16:56:38.000000000 +0200
+--- src/testdir/Makefile 2012-06-29 11:56:00.000000000 +0200
+***************
+*** 27,33 ****
+ test69.out test70.out test71.out test72.out test73.out \
+ test74.out test75.out test76.out test77.out test78.out \
+ test79.out test80.out test81.out test82.out test83.out \
+! test84.out test85.out
+
+ SCRIPTS_GUI = test16.out
+
+--- 27,33 ----
+ test69.out test70.out test71.out test72.out test73.out \
+ test74.out test75.out test76.out test77.out test78.out \
+ test79.out test80.out test81.out test82.out test83.out \
+! test84.out test85.out test86.out test87.out
+
+ SCRIPTS_GUI = test16.out
+
+*** ../vim-7.3.568/src/testdir/test86.in 2012-06-20 20:19:31.000000000 +0200
+--- src/testdir/test86.in 2012-06-20 18:01:02.000000000 +0200
+***************
+*** 0 ****
+--- 1,211 ----
++ Tests for various python features. vim: set ft=vim :
++
++ STARTTEST
++ :so small.vim
++ :if !has('python') | e! test.ok | wq! test.out | endif
++ :py import vim
++ :fun Test()
++ :let l = []
++ :py l=vim.bindeval('l')
++ :py f=vim.bindeval('function("strlen")')
++ :" Extending List directly with different types
++ :py l.extend([1, "as'd", [1, 2, f, {'a': 1}]])
++ :$put =string(l)
++ :$put =string(l[-1])
++ :try
++ : $put =string(l[-4])
++ :catch
++ : $put =v:exception[:13]
++ :endtry
++ :" List assignment
++ :py l[0]=0
++ :$put =string(l)
++ :py l[-2]=f
++ :$put =string(l)
++ :"
++ :" Extending Dictionary directly with different types
++ :let d = {}
++ :py d=vim.bindeval('d')
++ :py d['1']='asd'
++ :py d['b']=[1, 2, f]
++ :py d['-1']={'a': 1}
++ :let dkeys = []
++ :py dk=vim.bindeval('dkeys')
++ :py dkeys=d.keys()
++ :py dkeys.sort()
++ :py dk.extend(dkeys)
++ :$put =string(dkeys)
++ :for [key, val] in sort(items(d))
++ : $put =string(key) . ' : ' . string(val)
++ : unlet key val
++ :endfor
++ :"
++ :" removing items with del
++ :py del l[2]
++ :$put =string(l)
++ :let l = range(8)
++ :py l=vim.bindeval('l')
++ :try
++ : py del l[:3]
++ : py del l[1:]
++ :catch
++ : $put =v:exception
++ :endtry
++ :$put =string(l)
++ :"
++ :py del d['-1']
++ :$put =string(d)
++ :"
++ :" removing items out of range: silently skip items that don't exist
++ :let l = [0, 1, 2, 3]
++ :py l=vim.bindeval('l')
++ :" The following two ranges delete nothing as they match empty list:
++ :py del l[2:1]
++ :$put =string(l)
++ :py del l[2:2]
++ :$put =string(l)
++ :py del l[2:3]
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py l=vim.bindeval('l')
++ :py del l[2:4]
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py l=vim.bindeval('l')
++ :py del l[2:5]
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py l=vim.bindeval('l')
++ :py del l[2:6]
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py l=vim.bindeval('l')
++ :" The following two ranges delete nothing as they match empty list:
++ :py del l[-1:2]
++ :$put =string(l)
++ :py del l[-2:2]
++ :$put =string(l)
++ :py del l[-3:2]
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py l=vim.bindeval('l')
++ :py del l[-4:2]
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py l=vim.bindeval('l')
++ :py del l[-5:2]
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py l=vim.bindeval('l')
++ :py del l[-6:2]
++ :$put =string(l)
++ :"
++ :" Slice assignment to a list
++ :let l = [0, 1, 2, 3]
++ :py l=vim.bindeval('l')
++ :py l[0:0]=['a']
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py l=vim.bindeval('l')
++ :py l[1:2]=['b']
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py l=vim.bindeval('l')
++ :py l[2:4]=['c']
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py l=vim.bindeval('l')
++ :py l[4:4]=['d']
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py l=vim.bindeval('l')
++ :py l[-1:2]=['e']
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py l=vim.bindeval('l')
++ :py l[-10:2]=['f']
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py l=vim.bindeval('l')
++ :py l[2:-10]=['g']
++ :$put =string(l)
++ :let l = []
++ :py l=vim.bindeval('l')
++ :py l[0:0]=['h']
++ :$put =string(l)
++ :"
++ :" Locked variables
++ :let l = [0, 1, 2, 3]
++ :py l=vim.bindeval('l')
++ :lockvar! l
++ :py l[2]='i'
++ :$put =string(l)
++ :unlockvar! l
++ :"
++ :" Function calls
++ :function New(...)
++ :return ['NewStart']+a:000+['NewEnd']
++ :endfunction
++ :function DictNew(...) dict
++ :return ['DictNewStart']+a:000+['DictNewEnd', self]
++ :endfunction
++ :let l=[function('New'), function('DictNew')]
++ :py l=vim.bindeval('l')
++ :py l.extend(list(l[0](1, 2, 3)))
++ :$put =string(l)
++ :py l.extend(list(l[1](1, 2, 3, self={'a': 'b'})))
++ :$put =string(l)
++ :py l.extend([l[0].name])
++ :$put =string(l)
++ :try
++ : py l[1](1, 2, 3)
++ :catch
++ : $put =v:exception[:16]
++ :endtry
++ :delfunction New
++ :try
++ : py l[0](1, 2, 3)
++ :catch
++ : $put =v:exception[:16]
++ :endtry
++ :if has('float')
++ : let l=[0.0]
++ : py l=vim.bindeval('l')
++ : py l.extend([0.0])
++ : $put =string(l)
++ :else
++ : $put ='[0.0, 0.0]'
++ :endif
++ :"
++ :" pyeval()
++ :let l=pyeval('range(3)')
++ :$put =string(l)
++ :let d=pyeval('{"a": "b", "c": 1, "d": ["e"]}')
++ :$put =sort(items(d))
++ :try
++ : let undef=pyeval('undefined_name')
++ :catch
++ : $put =v:exception[:13]
++ :endtry
++ :try
++ : let vim=pyeval('vim')
++ :catch
++ : $put =v:exception[:13]
++ :endtry
++ :if has('float')
++ : let f=pyeval('0.0')
++ : $put =string(f)
++ :else
++ : $put ='0.0'
++ :endif
++ :endfun
++ :"
++ :call Test()
++ :"
++ :delfunc Test
++ :call garbagecollect(1)
++ :"
++ :/^start:/,$wq! test.out
++ ENDTEST
++
++ start:
+*** ../vim-7.3.568/src/testdir/test86.ok 2012-06-20 20:19:31.000000000 +0200
+--- src/testdir/test86.ok 2012-06-20 18:01:02.000000000 +0200
+***************
+*** 0 ****
+--- 1,47 ----
++ start:
++ [1, 'as''d', [1, 2, function('strlen'), {'a': 1}]]
++ [1, 2, function('strlen'), {'a': 1}]
++ Vim(put):E684:
++ [0, 'as''d', [1, 2, function('strlen'), {'a': 1}]]
++ [0, function('strlen'), [1, 2, function('strlen'), {'a': 1}]]
++ ['-1', '1', 'b']
++ '-1' : {'a': 1}
++ '1' : 'asd'
++ 'b' : [1, 2, function('strlen')]
++ [0, function('strlen')]
++ [3]
++ {'1': 'asd', 'b': [1, 2, function('strlen')]}
++ [0, 1, 2, 3]
++ [0, 1, 2, 3]
++ [0, 1, 3]
++ [0, 1]
++ [0, 1]
++ [0, 1]
++ [0, 1, 2, 3]
++ [0, 1, 2, 3]
++ [0, 2, 3]
++ [2, 3]
++ [2, 3]
++ [2, 3]
++ ['a', 0, 1, 2, 3]
++ [0, 'b', 2, 3]
++ [0, 1, 'c']
++ [0, 1, 2, 3, 'd']
++ [0, 1, 2, 'e', 3]
++ ['f', 2, 3]
++ [0, 1, 'g', 2, 3]
++ ['h']
++ [0, 1, 2, 3]
++ [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd']
++ [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}]
++ [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}, 'New']
++ Vim(python):E725:
++ Vim(python):E117:
++ [0.0, 0.0]
++ [0, 1, 2]
++ ['a', 'b']
++ ['c', 1]
++ ['d', ['e']]
++ Vim(let):E858:
++ Vim(let):E859:
++ 0.0
+*** ../vim-7.3.568/src/testdir/test87.in 2012-06-20 20:19:31.000000000 +0200
+--- src/testdir/test87.in 2012-06-20 18:01:02.000000000 +0200
+***************
+*** 0 ****
+--- 1,211 ----
++ Tests for various python features. vim: set ft=vim :
++
++ STARTTEST
++ :so small.vim
++ :if !has('python3') | e! test.ok | wq! test.out | endif
++ :py3 import vim
++ :fun Test()
++ :let l = []
++ :py3 l=vim.bindeval('l')
++ :py3 f=vim.bindeval('function("strlen")')
++ :" Extending List directly with different types
++ :py3 l+=[1, "as'd", [1, 2, f, {'a': 1}]]
++ :$put =string(l)
++ :$put =string(l[-1])
++ :try
++ : $put =string(l[-4])
++ :catch
++ : $put =v:exception[:13]
++ :endtry
++ :" List assignment
++ :py3 l[0]=0
++ :$put =string(l)
++ :py3 l[-2]=f
++ :$put =string(l)
++ :"
++ :" Extending Dictionary directly with different types
++ :let d = {}
++ :py3 d=vim.bindeval('d')
++ :py3 d['1']='asd'
++ :py3 d['b']=[1, 2, f]
++ :py3 d['-1']={'a': 1}
++ :let dkeys = []
++ :py3 dk=vim.bindeval('dkeys')
++ :py3 dkeys=d.keys()
++ :py3 dkeys.sort()
++ :py3 dk+=dkeys
++ :$put =string(dkeys)
++ :for [key, val] in sort(items(d))
++ : $put =string(key) . ' : ' . string(val)
++ : unlet key val
++ :endfor
++ :"
++ :" removing items with del
++ :py3 del l[2]
++ :$put =string(l)
++ :let l = range(8)
++ :py3 l=vim.bindeval('l')
++ :try
++ : py3 del l[:3]
++ : py3 del l[1:]
++ :catch
++ : $put =v:exception
++ :endtry
++ :$put =string(l)
++ :"
++ :py3 del d['-1']
++ :$put =string(d)
++ :"
++ :" removing items out of range: silently skip items that don't exist
++ :let l = [0, 1, 2, 3]
++ :py3 l=vim.bindeval('l')
++ :" The following two ranges delete nothing as they match empty list:
++ :py3 del l[2:1]
++ :$put =string(l)
++ :py3 del l[2:2]
++ :$put =string(l)
++ :py3 del l[2:3]
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py3 l=vim.bindeval('l')
++ :py3 del l[2:4]
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py3 l=vim.bindeval('l')
++ :py3 del l[2:5]
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py3 l=vim.bindeval('l')
++ :py3 del l[2:6]
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py3 l=vim.bindeval('l')
++ :" The following two ranges delete nothing as they match empty list:
++ :py3 del l[-1:2]
++ :$put =string(l)
++ :py3 del l[-2:2]
++ :$put =string(l)
++ :py3 del l[-3:2]
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py3 l=vim.bindeval('l')
++ :py3 del l[-4:2]
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py3 l=vim.bindeval('l')
++ :py3 del l[-5:2]
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py3 l=vim.bindeval('l')
++ :py3 del l[-6:2]
++ :$put =string(l)
++ :"
++ :" Slice assignment to a list
++ :let l = [0, 1, 2, 3]
++ :py3 l=vim.bindeval('l')
++ :py3 l[0:0]=['a']
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py3 l=vim.bindeval('l')
++ :py3 l[1:2]=['b']
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py3 l=vim.bindeval('l')
++ :py3 l[2:4]=['c']
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py3 l=vim.bindeval('l')
++ :py3 l[4:4]=['d']
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py3 l=vim.bindeval('l')
++ :py3 l[-1:2]=['e']
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py3 l=vim.bindeval('l')
++ :py3 l[-10:2]=['f']
++ :$put =string(l)
++ :let l = [0, 1, 2, 3]
++ :py3 l=vim.bindeval('l')
++ :py3 l[2:-10]=['g']
++ :$put =string(l)
++ :let l = []
++ :py3 l=vim.bindeval('l')
++ :py3 l[0:0]=['h']
++ :$put =string(l)
++ :"
++ :" Locked variables
++ :let l = [0, 1, 2, 3]
++ :py3 l=vim.bindeval('l')
++ :lockvar! l
++ :py3 l[2]='i'
++ :$put =string(l)
++ :unlockvar! l
++ :"
++ :" Function calls
++ :function New(...)
++ :return ['NewStart']+a:000+['NewEnd']
++ :endfunction
++ :function DictNew(...) dict
++ :return ['DictNewStart']+a:000+['DictNewEnd', self]
++ :endfunction
++ :let l=[function('New'), function('DictNew')]
++ :py3 l=vim.bindeval('l')
++ :py3 l.extend(list(l[0](1, 2, 3)))
++ :$put =string(l)
++ :py3 l.extend(list(l[1](1, 2, 3, self={'a': 'b'})))
++ :$put =string(l)
++ :py3 l+=[l[0].name]
++ :$put =string(l)
++ :try
++ : py3 l[1](1, 2, 3)
++ :catch
++ : $put =v:exception[:13]
++ :endtry
++ :delfunction New
++ :try
++ : py3 l[0](1, 2, 3)
++ :catch
++ : $put =v:exception[:13]
++ :endtry
++ :if has('float')
++ : let l=[0.0]
++ : py3 l=vim.bindeval('l')
++ : py3 l.extend([0.0])
++ : $put =string(l)
++ :else
++ : $put ='[0.0, 0.0]'
++ :endif
++ :"
++ :" py3eval()
++ :let l=py3eval('[0, 1, 2]')
++ :$put =string(l)
++ :let d=py3eval('{"a": "b", "c": 1, "d": ["e"]}')
++ :$put =sort(items(d))
++ :try
++ : let undef=py3eval('undefined_name')
++ :catch
++ : $put =v:exception[:13]
++ :endtry
++ :try
++ : let vim=py3eval('vim')
++ :catch
++ : $put =v:exception[:13]
++ :endtry
++ :if has('float')
++ : let f=py3eval('0.0')
++ : $put =string(f)
++ :else
++ : $put ='0.0'
++ :endif
++ :endfun
++ :"
++ :call Test()
++ :"
++ :delfunc Test
++ :call garbagecollect(1)
++ :"
++ :/^start:/,$wq! test.out
++ ENDTEST
++
++ start:
+*** ../vim-7.3.568/src/testdir/test87.ok 2012-06-20 20:19:31.000000000 +0200
+--- src/testdir/test87.ok 2012-06-20 18:01:02.000000000 +0200
+***************
+*** 0 ****
+--- 1,47 ----
++ start:
++ [1, 'as''d', [1, 2, function('strlen'), {'a': 1}]]
++ [1, 2, function('strlen'), {'a': 1}]
++ Vim(put):E684:
++ [0, 'as''d', [1, 2, function('strlen'), {'a': 1}]]
++ [0, function('strlen'), [1, 2, function('strlen'), {'a': 1}]]
++ ['-1', '1', 'b']
++ '-1' : {'a': 1}
++ '1' : 'asd'
++ 'b' : [1, 2, function('strlen')]
++ [0, function('strlen')]
++ [3]
++ {'1': 'asd', 'b': [1, 2, function('strlen')]}
++ [0, 1, 2, 3]
++ [0, 1, 2, 3]
++ [0, 1, 3]
++ [0, 1]
++ [0, 1]
++ [0, 1]
++ [0, 1, 2, 3]
++ [0, 1, 2, 3]
++ [0, 2, 3]
++ [2, 3]
++ [2, 3]
++ [2, 3]
++ ['a', 0, 1, 2, 3]
++ [0, 'b', 2, 3]
++ [0, 1, 'c']
++ [0, 1, 2, 3, 'd']
++ [0, 1, 2, 'e', 3]
++ ['f', 2, 3]
++ [0, 1, 'g', 2, 3]
++ ['h']
++ [0, 1, 2, 3]
++ [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd']
++ [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}]
++ [function('New'), function('DictNew'), 'NewStart', 1, 2, 3, 'NewEnd', 'DictNewStart', 1, 2, 3, 'DictNewEnd', {'a': 'b'}, 'New']
++ Vim(py3):E725:
++ Vim(py3):E117:
++ [0.0, 0.0]
++ [0, 1, 2]
++ ['a', 'b']
++ ['c', 1]
++ ['d', ['e']]
++ Vim(let):E860:
++ Vim(let):E861:
++ 0.0
+*** ../vim-7.3.568/src/version.c 2012-06-29 12:35:40.000000000 +0200
+--- src/version.c 2012-06-29 12:47:03.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 569,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+69. Yahoo welcomes you with your own start page
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.570
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.570
+Problem: ":vimgrep" does not obey 'wildignore'.
+Solution: Apply 'wildignore' and 'suffixes' to ":vimgrep". (Ingo Karkat)
+Files: src/ex_cmds2.c, src/proto/ex_cmds2.pro, src/quickfix.c, src/spell.c
+
+
+*** ../vim-7.3.569/src/ex_cmds2.c 2012-06-20 15:48:53.000000000 +0200
+--- src/ex_cmds2.c 2012-06-29 12:43:34.000000000 +0200
+***************
+*** 1850,1871 ****
+ #if defined(FEAT_QUICKFIX) || defined(FEAT_SYN_HL) || defined(PROTO)
+ /*
+ * Parse a list of arguments (file names), expand them and return in
+! * "fnames[fcountp]".
+ * Return FAIL or OK.
+ */
+ int
+! get_arglist_exp(str, fcountp, fnamesp)
+ char_u *str;
+ int *fcountp;
+ char_u ***fnamesp;
+ {
+ garray_T ga;
+ int i;
+
+ if (get_arglist(&ga, str) == FAIL)
+ return FAIL;
+! i = gen_expand_wildcards(ga.ga_len, (char_u **)ga.ga_data,
+! fcountp, fnamesp, EW_FILE|EW_NOTFOUND);
+ ga_clear(&ga);
+ return i;
+ }
+--- 1850,1877 ----
+ #if defined(FEAT_QUICKFIX) || defined(FEAT_SYN_HL) || defined(PROTO)
+ /*
+ * Parse a list of arguments (file names), expand them and return in
+! * "fnames[fcountp]". When "wig" is TRUE, removes files matching 'wildignore'.
+ * Return FAIL or OK.
+ */
+ int
+! get_arglist_exp(str, fcountp, fnamesp, wig)
+ char_u *str;
+ int *fcountp;
+ char_u ***fnamesp;
++ int wig;
+ {
+ garray_T ga;
+ int i;
+
+ if (get_arglist(&ga, str) == FAIL)
+ return FAIL;
+! if (wig == TRUE)
+! i = expand_wildcards(ga.ga_len, (char_u **)ga.ga_data,
+! fcountp, fnamesp, EW_FILE|EW_NOTFOUND);
+! else
+! i = gen_expand_wildcards(ga.ga_len, (char_u **)ga.ga_data,
+! fcountp, fnamesp, EW_FILE|EW_NOTFOUND);
+!
+ ga_clear(&ga);
+ return i;
+ }
+*** ../vim-7.3.569/src/proto/ex_cmds2.pro 2011-05-19 18:26:34.000000000 +0200
+--- src/proto/ex_cmds2.pro 2012-06-29 12:43:49.000000000 +0200
+***************
+*** 42,48 ****
+ int check_fname __ARGS((void));
+ int buf_write_all __ARGS((buf_T *buf, int forceit));
+ int get_arglist __ARGS((garray_T *gap, char_u *str));
+! int get_arglist_exp __ARGS((char_u *str, int *fcountp, char_u ***fnamesp));
+ void set_arglist __ARGS((char_u *str));
+ void check_arg_idx __ARGS((win_T *win));
+ void ex_args __ARGS((exarg_T *eap));
+--- 42,48 ----
+ int check_fname __ARGS((void));
+ int buf_write_all __ARGS((buf_T *buf, int forceit));
+ int get_arglist __ARGS((garray_T *gap, char_u *str));
+! int get_arglist_exp __ARGS((char_u *str, int *fcountp, char_u ***fnamesp, int wig));
+ void set_arglist __ARGS((char_u *str));
+ void check_arg_idx __ARGS((win_T *win));
+ void ex_args __ARGS((exarg_T *eap));
+*** ../vim-7.3.569/src/quickfix.c 2012-06-01 18:34:37.000000000 +0200
+--- src/quickfix.c 2012-06-29 12:43:49.000000000 +0200
+***************
+*** 3189,3195 ****
+ ;
+
+ /* parse the list of arguments */
+! if (get_arglist_exp(p, &fcount, &fnames) == FAIL)
+ goto theend;
+ if (fcount == 0)
+ {
+--- 3189,3195 ----
+ ;
+
+ /* parse the list of arguments */
+! if (get_arglist_exp(p, &fcount, &fnames, TRUE) == FAIL)
+ goto theend;
+ if (fcount == 0)
+ {
+*** ../vim-7.3.569/src/spell.c 2012-06-01 17:49:51.000000000 +0200
+--- src/spell.c 2012-06-29 12:43:49.000000000 +0200
+***************
+*** 8553,8559 ****
+ }
+
+ /* Expand all the remaining arguments (e.g., $VIMRUNTIME). */
+! if (get_arglist_exp(arg, &fcount, &fnames) == OK)
+ {
+ mkspell(fcount, fnames, ascii, eap->forceit, FALSE);
+ FreeWild(fcount, fnames);
+--- 8553,8559 ----
+ }
+
+ /* Expand all the remaining arguments (e.g., $VIMRUNTIME). */
+! if (get_arglist_exp(arg, &fcount, &fnames, FALSE) == OK)
+ {
+ mkspell(fcount, fnames, ascii, eap->forceit, FALSE);
+ FreeWild(fcount, fnames);
+*** ../vim-7.3.569/src/version.c 2012-06-29 12:54:32.000000000 +0200
+--- src/version.c 2012-06-29 12:56:12.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 570,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+70. ISDN lines are added to your house on a hourly basis
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.571
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.571
+Problem: Duplicated condition.
+Solution: Remove one. (Dominique Pelle)
+Files: src/os_win32.c
+
+
+*** ../vim-7.3.570/src/os_win32.c 2012-02-29 13:58:43.000000000 +0100
+--- src/os_win32.c 2012-06-29 13:10:54.000000000 +0200
+***************
+*** 308,314 ****
+ # ifndef GETTEXT_DLL
+ # define GETTEXT_DLL "libintl.dll"
+ # endif
+! /* Dummy funcitons */
+ static char *null_libintl_gettext(const char *);
+ static char *null_libintl_textdomain(const char *);
+ static char *null_libintl_bindtextdomain(const char *, const char *);
+--- 308,314 ----
+ # ifndef GETTEXT_DLL
+ # define GETTEXT_DLL "libintl.dll"
+ # endif
+! /* Dummy functions */
+ static char *null_libintl_gettext(const char *);
+ static char *null_libintl_textdomain(const char *);
+ static char *null_libintl_bindtextdomain(const char *, const char *);
+***************
+*** 1409,1415 ****
+
+
+ /*
+! * mch_inchar(): low-level input funcion.
+ * Get one or more characters from the keyboard or the mouse.
+ * If time == 0, do not wait for characters.
+ * If time == n, wait a short time for characters.
+--- 1409,1415 ----
+
+
+ /*
+! * mch_inchar(): low-level input function.
+ * Get one or more characters from the keyboard or the mouse.
+ * If time == 0, do not wait for characters.
+ * If time == n, wait a short time for characters.
+***************
+*** 3451,3464 ****
+ * to avoid to perform a blocking read */
+ ret = PeekNamedPipe(g_hChildStd_OUT_Rd, /* pipe to query */
+ NULL, /* optional buffer */
+! 0, /* buffe size */
+ NULL, /* number of read bytes */
+ &availableBytes, /* available bytes total */
+ NULL); /* byteLeft */
+
+ repeatCount = 0;
+ /* We got real data in the pipe, read it */
+! while (ret != 0 && availableBytes > 0 && availableBytes > 0)
+ {
+ repeatCount++;
+ toRead =
+--- 3451,3464 ----
+ * to avoid to perform a blocking read */
+ ret = PeekNamedPipe(g_hChildStd_OUT_Rd, /* pipe to query */
+ NULL, /* optional buffer */
+! 0, /* buffer size */
+ NULL, /* number of read bytes */
+ &availableBytes, /* available bytes total */
+ NULL); /* byteLeft */
+
+ repeatCount = 0;
+ /* We got real data in the pipe, read it */
+! while (ret != 0 && availableBytes > 0)
+ {
+ repeatCount++;
+ toRead =
+***************
+*** 3638,3644 ****
+ NULL, /* Process security attributes */
+ NULL, /* Thread security attributes */
+
+! // this command can be litigeous, handle inheritence was
+ // deactivated for pending temp file, but, if we deactivate
+ // it, the pipes don't work for some reason.
+ TRUE, /* Inherit handles, first deactivated,
+--- 3638,3644 ----
+ NULL, /* Process security attributes */
+ NULL, /* Thread security attributes */
+
+! // this command can be litigious, handle inheritance was
+ // deactivated for pending temp file, but, if we deactivate
+ // it, the pipes don't work for some reason.
+ TRUE, /* Inherit handles, first deactivated,
+*** ../vim-7.3.570/src/version.c 2012-06-29 12:57:03.000000000 +0200
+--- src/version.c 2012-06-29 13:12:31.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 571,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+71. You wonder how people walk
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.572
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.572
+Problem: Duplicate statement in if and else. (Dominique Pelle)
+Solution: Remove the condition and add a TODO.
+Files: src/gui_xmebw.c
+
+
+*** ../vim-7.3.571/src/gui_xmebw.c 2010-08-15 21:57:29.000000000 +0200
+--- src/gui_xmebw.c 2012-06-29 13:17:15.000000000 +0200
+***************
+*** 375,385 ****
+
+ XGetGeometry(dpy, pix, &root, &x, &y, &width, &height, &border, &depth);
+
+! if (eb->enhancedbutton.label_location == (int)XmTOP
+! || eb->enhancedbutton.label_location == (int)XmBOTTOM)
+! shift = eb->primitive.shadow_thickness / 2;
+! else
+! shift = eb->primitive.shadow_thickness / 2;
+
+ if (shift < 1)
+ shift = 1;
+--- 375,382 ----
+
+ XGetGeometry(dpy, pix, &root, &x, &y, &width, &height, &border, &depth);
+
+! /* TODO: does the shift depend on label_location somehow? */
+! shift = eb->primitive.shadow_thickness / 2;
+
+ if (shift < 1)
+ shift = 1;
+*** ../vim-7.3.571/src/version.c 2012-06-29 13:13:59.000000000 +0200
+--- src/version.c 2012-06-29 13:18:41.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 572,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+72. Somebody at IRC just mentioned a way to obtain full motion video without
+ a PC using a wireless protocol called NTSC, you wonder how you never
+ heard about it
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.573
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.573
+Problem: Using array index before bounds checking.
+Solution: Swap the parts of the condition. (Dominique Pelle)
+Files: src/ops.c
+
+
+*** ../vim-7.3.572/src/ops.c 2012-06-13 17:28:51.000000000 +0200
+--- src/ops.c 2012-06-29 13:27:11.000000000 +0200
+***************
+*** 6458,6464 ****
+ long chars = 0;
+ int is_word = 0;
+
+! for (i = 0; line[i] && i < limit; )
+ {
+ if (is_word)
+ {
+--- 6458,6464 ----
+ long chars = 0;
+ int is_word = 0;
+
+! for (i = 0; i < limit && line[i] != NUL; )
+ {
+ if (is_word)
+ {
+*** ../vim-7.3.572/src/version.c 2012-06-29 13:19:23.000000000 +0200
+--- src/version.c 2012-06-29 13:27:59.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 573,
+ /**/
+
+--
+"Thou shalt not follow the Null Pointer, for at its end Chaos and
+Madness lie."
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.574
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.574
+Problem: When pasting a register in the search command line a CTRL-L
+ character is not pasted. (Dominique Pelle)
+Solution: Escape the CTRL-L. (Christian Brabandt)
+Files: src/ex_getln.c
+
+
+*** ../vim-7.3.573/src/ex_getln.c 2012-06-06 12:02:57.000000000 +0200
+--- src/ex_getln.c 2012-06-29 13:39:03.000000000 +0200
+***************
+*** 3133,3139 ****
+ else
+ #endif
+ c = *s++;
+! if (cv == Ctrl_V || c == ESC || c == Ctrl_C || c == CAR || c == NL
+ #ifdef UNIX
+ || c == intr_char
+ #endif
+--- 3133,3140 ----
+ else
+ #endif
+ c = *s++;
+! if (cv == Ctrl_V || c == ESC || c == Ctrl_C
+! || c == CAR || c == NL || c == Ctrl_L
+ #ifdef UNIX
+ || c == intr_char
+ #endif
+***************
+*** 4692,4698 ****
+ if (tab[i].ic)
+ regmatch.rm_ic = TRUE;
+ ret = ExpandGeneric(xp, ®match, num_file, file,
+! tab[i].func, tab[i].escaped);
+ break;
+ }
+ }
+--- 4693,4699 ----
+ if (tab[i].ic)
+ regmatch.rm_ic = TRUE;
+ ret = ExpandGeneric(xp, ®match, num_file, file,
+! tab[i].func, tab[i].escaped);
+ break;
+ }
+ }
+***************
+*** 5125,5131 ****
+ vim_free(matches);
+ }
+ if (ga.ga_len == 0)
+! return FAIL;
+
+ /* Sort and remove duplicates which can happen when specifying multiple
+ * directories in dirnames. */
+--- 5126,5132 ----
+ vim_free(matches);
+ }
+ if (ga.ga_len == 0)
+! return FAIL;
+
+ /* Sort and remove duplicates which can happen when specifying multiple
+ * directories in dirnames. */
+*** ../vim-7.3.573/src/version.c 2012-06-29 13:34:15.000000000 +0200
+--- src/version.c 2012-06-29 13:38:22.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 574,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+73. You give your dog used motherboards instead of bones
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.575
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.575
+Problem: "ygt" tries to yank instead of giving an error. (Daniel Mueller)
+Solution: Check for a pending operator.
+Files: src/normal.c
+
+
+*** ../vim-7.3.574/src/normal.c 2012-06-06 16:12:54.000000000 +0200
+--- src/normal.c 2012-06-29 13:50:26.000000000 +0200
+***************
+*** 8393,8402 ****
+
+ #ifdef FEAT_WINDOWS
+ case 't':
+! goto_tabpage((int)cap->count0);
+ break;
+ case 'T':
+! goto_tabpage(-(int)cap->count1);
+ break;
+ #endif
+
+--- 8393,8404 ----
+
+ #ifdef FEAT_WINDOWS
+ case 't':
+! if (!checkclearop(oap))
+! goto_tabpage((int)cap->count0);
+ break;
+ case 'T':
+! if (!checkclearop(oap))
+! goto_tabpage(-(int)cap->count1);
+ break;
+ #endif
+
+*** ../vim-7.3.574/src/version.c 2012-06-29 13:44:37.000000000 +0200
+--- src/version.c 2012-06-29 13:52:01.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 575,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+74. Your most erotic dreams are about cybersex
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.576
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.576
+Problem: Formatting of lists inside comments is not right yet.
+Solution: Use another solution and add a test. (Tor Perkins)
+Files: src/edit.c, src/misc1.c, src/testdir/test68.in,
+ src/testdir/test69.ok
+
+
+*** ../vim-7.3.575/src/edit.c 2012-06-20 22:55:56.000000000 +0200
+--- src/edit.c 2012-06-29 14:10:36.000000000 +0200
+***************
+*** 6320,6333 ****
+ if (!(flags & INSCHAR_COM_LIST))
+ {
+ /*
+! * This section is for numeric lists w/o comments. If comment
+! * indents are needed with numeric lists (formatoptions=nq),
+! * then the INSCHAR_COM_LIST flag will cause the corresponding
+! * OPENLINE_COM_LIST flag to be passed through to open_line()
+! * (as seen above)...
+ */
+ if (second_indent < 0 && has_format_option(FO_Q_NUMBER))
+! second_indent = get_number_indent(curwin->w_cursor.lnum -1);
+ if (second_indent >= 0)
+ {
+ #ifdef FEAT_VREPLACE
+--- 6320,6334 ----
+ if (!(flags & INSCHAR_COM_LIST))
+ {
+ /*
+! * This section is for auto-wrap of numeric lists. When not
+! * in insert mode (i.e. format_lines()), the INSCHAR_COM_LIST
+! * flag will be set and open_line() will handle it (as seen
+! * above). The code here (and in get_number_indent()) will
+! * recognize comments if needed...
+ */
+ if (second_indent < 0 && has_format_option(FO_Q_NUMBER))
+! second_indent =
+! get_number_indent(curwin->w_cursor.lnum - 1);
+ if (second_indent >= 0)
+ {
+ #ifdef FEAT_VREPLACE
+***************
+*** 6336,6342 ****
+--- 6337,6367 ----
+ FALSE, NUL, TRUE);
+ else
+ #endif
++ #ifdef FEAT_COMMENTS
++ if (leader_len > 0 && second_indent - leader_len > 0)
++ {
++ int i;
++ int padding = second_indent - leader_len;
++
++ /* We started at the first_line of a numbered list
++ * that has a comment. the open_line() function has
++ * inserted the proper comment leader and positioned
++ * the cursor at the end of the split line. Now we
++ * add the additional whitespace needed after the
++ * comment leader for the numbered list. */
++ for (i = 0; i < padding; i++)
++ {
++ ins_str((char_u *)" ");
++ changed_bytes(curwin->w_cursor.lnum, leader_len);
++ }
++ }
++ else
++ {
++ #endif
+ (void)set_indent(second_indent, SIN_CHANGED);
++ #ifdef FEAT_COMMENTS
++ }
++ #endif
+ }
+ }
+ first_line = FALSE;
+*** ../vim-7.3.575/src/misc1.c 2012-06-20 17:56:06.000000000 +0200
+--- src/misc1.c 2012-06-29 14:10:12.000000000 +0200
+***************
+*** 424,491 ****
+ colnr_T col;
+ pos_T pos;
+
+ if (lnum > curbuf->b_ml.ml_line_count)
+ return -1;
+ pos.lnum = 0;
+
+ #ifdef FEAT_COMMENTS
+! if (has_format_option(FO_Q_COMS) && has_format_option(FO_Q_NUMBER))
+! {
+! regmatch_T regmatch;
+! int lead_len; /* length of comment leader */
+!
+ lead_len = get_leader_len(ml_get(lnum), NULL, FALSE, TRUE);
+- regmatch.regprog = vim_regcomp(curbuf->b_p_flp, RE_MAGIC);
+- if (regmatch.regprog != NULL)
+- {
+- regmatch.rm_ic = FALSE;
+-
+- /* vim_regexec() expects a pointer to a line. This lets us
+- * start matching for the flp beyond any comment leader... */
+- if (vim_regexec(®match, ml_get(lnum) + lead_len, (colnr_T)0))
+- {
+- pos.lnum = lnum;
+- pos.col = (colnr_T)(*regmatch.endp - ml_get(lnum));
+- #ifdef FEAT_VIRTUALEDIT
+- pos.coladd = 0;
+ #endif
+! }
+! }
+! vim_free(regmatch.regprog);
+! }
+! else
+ {
+! /*
+! * What follows is the orig code that is not "comment aware"...
+! *
+! * I'm not sure if regmmatch_T (multi-match) is needed in this case.
+! * It may be true that this section would work properly using the
+! * regmatch_T code above, in which case, these two separate sections
+! * should be consolidated w/ FEAT_COMMENTS making lead_len > 0...
+! */
+! #endif
+! regmmatch_T regmatch;
+
+! regmatch.regprog = vim_regcomp(curbuf->b_p_flp, RE_MAGIC);
+!
+! if (regmatch.regprog != NULL)
+ {
+! regmatch.rmm_ic = FALSE;
+! regmatch.rmm_maxcol = 0;
+! if (vim_regexec_multi(®match, curwin, curbuf,
+! lnum, (colnr_T)0, NULL))
+! {
+! pos.lnum = regmatch.endpos[0].lnum + lnum;
+! pos.col = regmatch.endpos[0].col;
+ #ifdef FEAT_VIRTUALEDIT
+! pos.coladd = 0;
+ #endif
+- }
+- vim_free(regmatch.regprog);
+ }
+- #ifdef FEAT_COMMENTS
+ }
+! #endif
+
+ if (pos.lnum == 0 || *ml_get_pos(&pos) == NUL)
+ return -1;
+--- 424,458 ----
+ colnr_T col;
+ pos_T pos;
+
++ regmatch_T regmatch;
++ int lead_len = 0; /* length of comment leader */
++
+ if (lnum > curbuf->b_ml.ml_line_count)
+ return -1;
+ pos.lnum = 0;
+
+ #ifdef FEAT_COMMENTS
+! /* In format_lines() (i.e. not insert mode), fo+=q is needed too... */
+! if ((State & INSERT) || has_format_option(FO_Q_COMS))
+ lead_len = get_leader_len(ml_get(lnum), NULL, FALSE, TRUE);
+ #endif
+! regmatch.regprog = vim_regcomp(curbuf->b_p_flp, RE_MAGIC);
+! if (regmatch.regprog != NULL)
+ {
+! regmatch.rm_ic = FALSE;
+
+! /* vim_regexec() expects a pointer to a line. This lets us
+! * start matching for the flp beyond any comment leader... */
+! if (vim_regexec(®match, ml_get(lnum) + lead_len, (colnr_T)0))
+ {
+! pos.lnum = lnum;
+! pos.col = (colnr_T)(*regmatch.endp - ml_get(lnum));
+ #ifdef FEAT_VIRTUALEDIT
+! pos.coladd = 0;
+ #endif
+ }
+ }
+! vim_free(regmatch.regprog);
+
+ if (pos.lnum == 0 || *ml_get_pos(&pos) == NUL)
+ return -1;
+*** ../vim-7.3.575/src/testdir/test68.in 2012-06-13 17:28:51.000000000 +0200
+--- src/testdir/test68.in 2012-06-29 14:27:27.000000000 +0200
+***************
+*** 52,57 ****
+--- 52,68 ----
+
+ STARTTEST
+ /^{/+1
++ :set tw=5 fo=tcn comments=:#
++ A b\ejA b\e
++ ENDTEST
++
++ {
++ 1 a
++ # 1 a
++ }
++
++ STARTTEST
++ /^{/+1
+ :set tw=5 fo=qn comments=:#
+ gwap
+ ENDTEST
+***************
+*** 83,88 ****
+--- 94,107 ----
+ }
+
+ STARTTEST
++ /^#/
++ :setl tw=12 fo=tqnc comments=:#
++ A foobar\e
++ ENDTEST
++
++ # 1 xxxxx
++
++ STARTTEST
+ :g/^STARTTEST/.,/^ENDTEST/d
+ :1;/^Results/,$wq! test.out
+ ENDTEST
+*** ../vim-7.3.575/src/version.c 2012-06-29 13:56:01.000000000 +0200
+--- src/version.c 2012-06-29 15:03:10.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 576,
+ /**/
+
+--
+Proof techniques #2: Proof by Oddity.
+ SAMPLE: To prove that horses have an infinite number of legs.
+(1) Horses have an even number of legs.
+(2) They have two legs in back and fore legs in front.
+(3) This makes a total of six legs, which certainly is an odd number of
+ legs for a horse.
+(4) But the only number that is both odd and even is infinity.
+(5) Therefore, horses must have an infinite number of legs.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.577
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.577
+Problem: Size of memory does not fit in 32 bit unsigned.
+Solution: Use Kbyte instead of byte. Call GlobalMemoryStatusEx() instead of
+ GlobalMemoryStatus() when available.
+Files: src/misc2.c, src/option.c, src/os_amiga.c, src/os_msdos.c,
+ src/os_win16.c, src/os_win32.c
+
+
+*** ../vim-7.3.576/src/misc2.c 2012-02-29 13:58:43.000000000 +0100
+--- src/misc2.c 2012-06-29 15:30:54.000000000 +0200
+***************
+*** 815,820 ****
+--- 815,821 ----
+ #else
+ # define KEEP_ROOM (2 * 8192L)
+ #endif
++ #define KEEP_ROOM_KB (KEEP_ROOM / 1024L)
+
+ /*
+ * Note: if unsigned is 16 bits we can only allocate up to 64K with alloc().
+***************
+*** 940,946 ****
+ allocated = 0;
+ # endif
+ /* 3. check for available memory: call mch_avail_mem() */
+! if (mch_avail_mem(TRUE) < KEEP_ROOM && !releasing)
+ {
+ free((char *)p); /* System is low... no go! */
+ p = NULL;
+--- 941,947 ----
+ allocated = 0;
+ # endif
+ /* 3. check for available memory: call mch_avail_mem() */
+! if (mch_avail_mem(TRUE) < KEEP_ROOM_KB && !releasing)
+ {
+ free((char *)p); /* System is low... no go! */
+ p = NULL;
+*** ../vim-7.3.576/src/option.c 2012-03-28 19:58:34.000000000 +0200
+--- src/option.c 2012-06-29 15:31:46.000000000 +0200
+***************
+*** 3154,3160 ****
+ {
+ #ifdef HAVE_AVAIL_MEM
+ /* Use amount of memory available at this moment. */
+! n = (mch_avail_mem(FALSE) >> 11);
+ #else
+ # ifdef HAVE_TOTAL_MEM
+ /* Use amount of memory available to Vim. */
+--- 3154,3160 ----
+ {
+ #ifdef HAVE_AVAIL_MEM
+ /* Use amount of memory available at this moment. */
+! n = (mch_avail_mem(FALSE) >> 1);
+ #else
+ # ifdef HAVE_TOTAL_MEM
+ /* Use amount of memory available to Vim. */
+***************
+*** 6702,6708 ****
+ {
+ for (s = *varp; *s;)
+ {
+! while(*s == ',' || *s == ' ')
+ s++;
+ if (!*s)
+ break;
+--- 6702,6708 ----
+ {
+ for (s = *varp; *s;)
+ {
+! while (*s == ',' || *s == ' ')
+ s++;
+ if (!*s)
+ break;
+***************
+*** 7391,7397 ****
+ new_unnamed |= CLIP_UNNAMED;
+ p += 7;
+ }
+! else if (STRNCMP(p, "unnamedplus", 11) == 0
+ && (p[11] == ',' || p[11] == NUL))
+ {
+ new_unnamed |= CLIP_UNNAMED_PLUS;
+--- 7391,7397 ----
+ new_unnamed |= CLIP_UNNAMED;
+ p += 7;
+ }
+! else if (STRNCMP(p, "unnamedplus", 11) == 0
+ && (p[11] == ',' || p[11] == NUL))
+ {
+ new_unnamed |= CLIP_UNNAMED_PLUS;
+*** ../vim-7.3.576/src/os_amiga.c 2011-10-20 18:24:16.000000000 +0200
+--- src/os_amiga.c 2012-06-29 15:33:59.000000000 +0200
+***************
+*** 191,206 ****
+ }
+
+ /*
+! * Return amount of memory still available.
+ */
+ long_u
+ mch_avail_mem(special)
+ int special;
+ {
+ #ifdef __amigaos4__
+! return (long_u)AvailMem(MEMF_ANY);
+ #else
+! return (long_u)AvailMem(special ? (long)MEMF_CHIP : (long)MEMF_ANY);
+ #endif
+ }
+
+--- 191,206 ----
+ }
+
+ /*
+! * Return amount of memory still available in Kbyte.
+ */
+ long_u
+ mch_avail_mem(special)
+ int special;
+ {
+ #ifdef __amigaos4__
+! return (long_u)AvailMem(MEMF_ANY) >> 10;
+ #else
+! return (long_u)(AvailMem(special ? (long)MEMF_CHIP : (long)MEMF_ANY)) >> 10;
+ #endif
+ }
+
+*** ../vim-7.3.576/src/os_msdos.c 2011-06-19 01:14:22.000000000 +0200
+--- src/os_msdos.c 2012-06-29 15:33:26.000000000 +0200
+***************
+*** 550,564 ****
+ #endif
+
+ /*
+! * Return amount of memory currently available.
+ */
+ long_u
+ mch_avail_mem(int special)
+ {
+ #ifdef DJGPP
+! return _go32_dpmi_remaining_virtual_memory();
+ #else
+! return coreleft();
+ #endif
+ }
+
+--- 550,564 ----
+ #endif
+
+ /*
+! * Return amount of memory currently available in Kbyte.
+ */
+ long_u
+ mch_avail_mem(int special)
+ {
+ #ifdef DJGPP
+! return _go32_dpmi_remaining_virtual_memory() >> 10;
+ #else
+! return coreleft() >> 10;
+ #endif
+ }
+
+*** ../vim-7.3.576/src/os_win16.c 2011-10-20 18:24:16.000000000 +0200
+--- src/os_win16.c 2012-06-29 15:34:18.000000000 +0200
+***************
+*** 379,391 ****
+
+
+ /*
+! * How much memory is available?
+ */
+ long_u
+ mch_avail_mem(
+ int special)
+ {
+! return GetFreeSpace(0);
+ }
+
+
+--- 379,391 ----
+
+
+ /*
+! * How much memory is available in Kbyte?
+ */
+ long_u
+ mch_avail_mem(
+ int special)
+ {
+! return GetFreeSpace(0) >> 10;
+ }
+
+
+*** ../vim-7.3.576/src/os_win32.c 2012-06-29 13:13:59.000000000 +0200
+--- src/os_win32.c 2012-06-29 15:39:52.000000000 +0200
+***************
+*** 4992,5009 ****
+
+
+ /*
+! * How much memory is available?
+ * Return sum of available physical and page file memory.
+ */
+ /*ARGSUSED*/
+ long_u
+ mch_avail_mem(int special)
+ {
+! MEMORYSTATUS ms;
+
+! ms.dwLength = sizeof(MEMORYSTATUS);
+! GlobalMemoryStatus(&ms);
+! return (long_u) (ms.dwAvailPhys + ms.dwAvailPageFile);
+ }
+
+ #ifdef FEAT_MBYTE
+--- 4992,5020 ----
+
+
+ /*
+! * How much memory is available in Kbyte?
+ * Return sum of available physical and page file memory.
+ */
+ /*ARGSUSED*/
+ long_u
+ mch_avail_mem(int special)
+ {
+! if (g_PlatformId != VER_PLATFORM_WIN32_NT)
+! {
+! MEMORYSTATUS ms;
+
+! ms.dwLength = sizeof(MEMORYSTATUS);
+! GlobalMemoryStatus(&ms);
+! return (long_u)((ms.dwAvailPhys + ms.dwAvailPageFile) >> 10);
+! }
+! else
+! {
+! MEMORYSTATUSEX ms;
+!
+! ms.dwLength = sizeof(MEMORYSTATUSEX);
+! GlobalMemoryStatusEx(&ms);
+! return (long_u)((ms.ullAvailPhys + ms.ullAvailPageFile) >> 10);
+! }
+ }
+
+ #ifdef FEAT_MBYTE
+*** ../vim-7.3.576/src/version.c 2012-06-29 15:04:34.000000000 +0200
+--- src/version.c 2012-06-29 15:45:44.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 577,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+75. You start wondering whether you could actually upgrade your brain
+ with a Pentium Pro microprocessor 80. The upgrade works just fine.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.578
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.578
+Problem: Misplaced declaration.
+Solution: Move declaration to start of block.
+Files: src/if_py_both.h
+
+
+*** ../vim-7.3.577/src/if_py_both.h 2012-06-29 12:54:32.000000000 +0200
+--- src/if_py_both.h 2012-06-29 16:15:29.000000000 +0200
+***************
+*** 818,838 ****
+
+ if (valObject == NULL)
+ {
+ if (di == NULL)
+ {
+ PyErr_SetString(PyExc_IndexError, _("no such key in dictionary"));
+ return -1;
+ }
+! hashitem_T *hi = hash_find(&d->dv_hashtab, di->di_key);
+ hash_remove(&d->dv_hashtab, hi);
+ dictitem_free(di);
+ return 0;
+ }
+
+ if (ConvertFromPyObject(valObject, &tv) == -1)
+- {
+ return -1;
+- }
+
+ if (di == NULL)
+ {
+--- 818,838 ----
+
+ if (valObject == NULL)
+ {
++ hashitem_T *hi;
++
+ if (di == NULL)
+ {
+ PyErr_SetString(PyExc_IndexError, _("no such key in dictionary"));
+ return -1;
+ }
+! hi = hash_find(&d->dv_hashtab, di->di_key);
+ hash_remove(&d->dv_hashtab, hi);
+ dictitem_free(di);
+ return 0;
+ }
+
+ if (ConvertFromPyObject(valObject, &tv) == -1)
+ return -1;
+
+ if (di == NULL)
+ {
+*** ../vim-7.3.577/src/version.c 2012-06-29 15:51:26.000000000 +0200
+--- src/version.c 2012-06-29 16:18:10.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 578,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+77. The phone company asks you to test drive their new PBX system
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.579
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.579 (after 7.3.569)
+Problem: Can't compile with Python 2.5.
+Solution: Use PyCObject when Capsules are not available.
+Files: src/if_py_both.h, src/if_python.c, src/if_python3.c
+
+
+*** ../vim-7.3.578/src/if_py_both.h 2012-06-29 16:19:46.000000000 +0200
+--- src/if_py_both.h 2012-06-29 16:15:29.000000000 +0200
+***************
+*** 56,62 ****
+ /* name, function, calling, documentation */
+ {"write", OutputWrite, 1, ""},
+ {"writelines", OutputWritelines, 1, ""},
+! {"flush", OutputFlush, 1, ""},
+ { NULL, NULL, 0, NULL}
+ };
+
+--- 56,62 ----
+ /* name, function, calling, documentation */
+ {"write", OutputWrite, 1, ""},
+ {"writelines", OutputWritelines, 1, ""},
+! {"flush", OutputFlush, 1, ""},
+ { NULL, NULL, 0, NULL}
+ };
+
+***************
+*** 506,513 ****
+ /* name, function, calling, documentation */
+ {"command", VimCommand, 1, "Execute a Vim ex-mode command" },
+ {"eval", VimEval, 1, "Evaluate an expression using Vim evaluator" },
+! {"bindeval", VimEvalPy, 1, "Like eval(), but returns objects attached to vim ones"},
+! {"strwidth", VimStrwidth, 1, "Screen string width, counts <Tab> as having width 1"},
+ { NULL, NULL, 0, NULL }
+ };
+
+--- 506,513 ----
+ /* name, function, calling, documentation */
+ {"command", VimCommand, 1, "Execute a Vim ex-mode command" },
+ {"eval", VimEval, 1, "Evaluate an expression using Vim evaluator" },
+! {"bindeval", VimEvalPy, 1, "Like eval(), but returns objects attached to vim ones"},
+! {"strwidth", VimStrwidth, 1, "Screen string width, counts <Tab> as having width 1"},
+ { NULL, NULL, 0, NULL }
+ };
+
+***************
+*** 2432,2448 ****
+--- 2432,2463 ----
+ convert_dl(PyObject *obj, typval_T *tv,
+ pytotvfunc py_to_tv, PyObject *lookupDict)
+ {
++ # ifdef PY_USE_CAPSULE
+ PyObject *capsule;
++ # else
++ PyCObject *cobject;
++ # endif
+ char hexBuf[sizeof(void *) * 2 + 3];
+
+ sprintf(hexBuf, "%p", obj);
+
++ # ifdef PY_USE_CAPSULE
+ capsule = PyDict_GetItemString(lookupDict, hexBuf);
+ if (capsule == NULL)
++ # else
++ cobject = (PyCObject *)PyDict_GetItemString(lookupDict, hexBuf);
++ if (cobject == NULL)
++ # endif
+ {
++ # ifdef PY_USE_CAPSULE
+ capsule = PyCapsule_New(tv, NULL, NULL);
+ PyDict_SetItemString(lookupDict, hexBuf, capsule);
+ Py_DECREF(capsule);
++ # else
++ cobject = PyCObject_FromVoidPtr(tv, NULL);
++ PyDict_SetItemString(lookupDict, hexBuf, cobject);
++ Py_DECREF(cobject);
++ # endif
+ if (py_to_tv(obj, tv, lookupDict) == -1)
+ {
+ tv->v_type = VAR_UNKNOWN;
+***************
+*** 2458,2464 ****
+ }
+ else
+ {
+! typval_T *v = PyCapsule_GetPointer(capsule, NULL);
+ copy_tv(v, tv);
+ }
+ return 0;
+--- 2473,2485 ----
+ }
+ else
+ {
+! typval_T *v;
+!
+! # ifdef PY_USE_CAPSULE
+! v = PyCapsule_GetPointer(capsule, NULL);
+! # else
+! v = PyCObject_AsVoidPtr(cobject);
+! # endif
+ copy_tv(v, tv);
+ }
+ return 0;
+*** ../vim-7.3.578/src/if_python.c 2012-06-29 12:54:32.000000000 +0200
+--- src/if_python.c 2012-06-29 16:17:44.000000000 +0200
+***************
+*** 71,76 ****
+--- 71,80 ----
+ # define PySequenceMethods Py_ssize_t
+ #endif
+
++ #if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000
++ # define PY_USE_CAPSULE
++ #endif
++
+ #if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000
+ # define PyInt Py_ssize_t
+ # define PyInquiry lenfunc
+***************
+*** 220,227 ****
+ # define PyObject_Malloc dll_PyObject_Malloc
+ # define PyObject_Free dll_PyObject_Free
+ # endif
+! # define PyCapsule_New dll_PyCapsule_New
+! # define PyCapsule_GetPointer dll_PyCapsule_GetPointer
+
+ /*
+ * Pointers for dynamic link
+--- 224,236 ----
+ # define PyObject_Malloc dll_PyObject_Malloc
+ # define PyObject_Free dll_PyObject_Free
+ # endif
+! # ifdef PY_USE_CAPSULE
+! # define PyCapsule_New dll_PyCapsule_New
+! # define PyCapsule_GetPointer dll_PyCapsule_GetPointer
+! # else
+! # define PyCObject_FromVoidPtr dll_PyCObject_FromVoidPtr
+! # define PyCObject_AsVoidPtr dll_PyCObject_AsVoidPtr
+! # endif
+
+ /*
+ * Pointers for dynamic link
+***************
+*** 309,316 ****
+--- 318,330 ----
+ static void* (*dll_PyObject_Malloc)(size_t);
+ static void (*dll_PyObject_Free)(void*);
+ # endif
++ # ifdef PY_USE_CAPSULE
+ static PyObject* (*dll_PyCapsule_New)(void *, char *, PyCapsule_Destructor);
+ static void* (*dll_PyCapsule_GetPointer)(PyObject *, char *);
++ # else
++ static PyCObject* (*dll_PyCObject_FromVoidPtr)(void *cobj, void (*destr)(void *));
++ static void* (*dll_PyCObject_AsVoidPtr)(PyCObject *);
++ # endif
+
+ static HINSTANCE hinstPython = 0; /* Instance of python.dll */
+
+***************
+*** 403,409 ****
+ {"PyType_Ready", (PYTHON_PROC*)&dll_PyType_Ready},
+ {"Py_BuildValue", (PYTHON_PROC*)&dll_Py_BuildValue},
+ {"Py_FindMethod", (PYTHON_PROC*)&dll_Py_FindMethod},
+! # if (PY_VERSION_HEX >= 0x02050000) && SIZEOF_SIZE_T != SIZEOF_INT
+ {"Py_InitModule4_64", (PYTHON_PROC*)&dll_Py_InitModule4},
+ # else
+ {"Py_InitModule4", (PYTHON_PROC*)&dll_Py_InitModule4},
+--- 417,424 ----
+ {"PyType_Ready", (PYTHON_PROC*)&dll_PyType_Ready},
+ {"Py_BuildValue", (PYTHON_PROC*)&dll_Py_BuildValue},
+ {"Py_FindMethod", (PYTHON_PROC*)&dll_Py_FindMethod},
+! # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000 \
+! && SIZEOF_SIZE_T != SIZEOF_INT
+ {"Py_InitModule4_64", (PYTHON_PROC*)&dll_Py_InitModule4},
+ # else
+ {"Py_InitModule4", (PYTHON_PROC*)&dll_Py_InitModule4},
+***************
+*** 424,431 ****
+--- 439,451 ----
+ {"PyObject_Malloc", (PYTHON_PROC*)&dll_PyObject_Malloc},
+ {"PyObject_Free", (PYTHON_PROC*)&dll_PyObject_Free},
+ # endif
++ # ifdef PY_USE_CAPSULE
+ {"PyCapsule_New", (PYTHON_PROC*)&dll_PyCapsule_New},
+ {"PyCapsule_GetPointer", (PYTHON_PROC*)&dll_PyCapsule_GetPointer},
++ # else
++ {"PyCObject_FromVoidPtr", (PYTHON_PROC*)&dll_PyCObject_FromVoidPtr},
++ {"PyCObject_AsVoidPtr", (PYTHON_PROC*)&dll_PyCObject_AsVoidPtr},
++ # endif
+ {"", NULL},
+ };
+
+*** ../vim-7.3.578/src/if_python3.c 2012-06-29 12:54:32.000000000 +0200
+--- src/if_python3.c 2012-06-29 16:16:54.000000000 +0200
+***************
+*** 75,80 ****
+--- 75,83 ----
+ # define CODEC_ERROR_HANDLER NULL
+ #endif
+
++ /* Python 3 does not support CObjects, always use Capsules */
++ #define PY_USE_CAPSULE
++
+ #define PyInt Py_ssize_t
+ #define PyString_Check(obj) PyUnicode_Check(obj)
+ #define PyString_AsBytes(obj) PyUnicode_AsEncodedString(obj, (char *)ENC_OPT, CODEC_ERROR_HANDLER)
+*** ../vim-7.3.578/src/version.c 2012-06-29 16:19:46.000000000 +0200
+--- src/version.c 2012-06-29 16:21:25.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 579,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+78. You find yourself dialing IP numbers on the phone.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.580
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.580
+Problem: Warning on 64 bit MS-Windows.
+Solution: Add type cast. (Mike Williams)
+Files: src/if_py_both.h
+
+
+*** ../vim-7.3.579/src/if_py_both.h 2012-06-29 16:28:23.000000000 +0200
+--- src/if_py_both.h 2012-06-29 17:49:59.000000000 +0200
+***************
+*** 495,501 ****
+ if (!PyArg_ParseTuple(args, "s", &expr))
+ return NULL;
+
+! return PyLong_FromLong(mb_string2cells((char_u *)expr, STRLEN(expr)));
+ }
+
+ /*
+--- 495,501 ----
+ if (!PyArg_ParseTuple(args, "s", &expr))
+ return NULL;
+
+! return PyLong_FromLong(mb_string2cells((char_u *)expr, (int)STRLEN(expr)));
+ }
+
+ /*
+*** ../vim-7.3.579/src/version.c 2012-06-29 16:28:23.000000000 +0200
+--- src/version.c 2012-06-29 17:50:36.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 580,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+79. All of your most erotic dreams have a scrollbar at the right side.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.581
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.581
+Problem: Problems compiling with Python.
+Solution: Pick UCS2 or UCS4 function at runtime. (lilydjwg)
+Files: src/if_python.c
+
+
+*** ../vim-7.3.580/src/if_python.c 2012-06-29 16:28:23.000000000 +0200
+--- src/if_python.c 2012-06-29 19:10:53.000000000 +0200
+***************
+*** 196,202 ****
+ # define PyString_Size dll_PyString_Size
+ # define PyString_Type (*dll_PyString_Type)
+ # define PyUnicode_Type (*dll_PyUnicode_Type)
+! # define PyUnicodeUCS4_AsEncodedString (*dll_PyUnicodeUCS4_AsEncodedString)
+ # define PyFloat_AsDouble dll_PyFloat_AsDouble
+ # define PyFloat_FromDouble dll_PyFloat_FromDouble
+ # define PyFloat_Type (*dll_PyFloat_Type)
+--- 196,203 ----
+ # define PyString_Size dll_PyString_Size
+ # define PyString_Type (*dll_PyString_Type)
+ # define PyUnicode_Type (*dll_PyUnicode_Type)
+! # undef PyUnicode_AsEncodedString
+! # define PyUnicode_AsEncodedString py_PyUnicode_AsEncodedString
+ # define PyFloat_AsDouble dll_PyFloat_AsDouble
+ # define PyFloat_FromDouble dll_PyFloat_FromDouble
+ # define PyFloat_Type (*dll_PyFloat_Type)
+***************
+*** 290,296 ****
+ static PyInt(*dll_PyString_Size)(PyObject *);
+ static PyTypeObject* dll_PyString_Type;
+ static PyTypeObject* dll_PyUnicode_Type;
+! static PyObject *(*PyUnicodeUCS4_AsEncodedString)(PyObject *, char *, char *);
+ static double(*dll_PyFloat_AsDouble)(PyObject *);
+ static PyObject*(*dll_PyFloat_FromDouble)(double);
+ static PyTypeObject* dll_PyFloat_Type;
+--- 291,297 ----
+ static PyInt(*dll_PyString_Size)(PyObject *);
+ static PyTypeObject* dll_PyString_Type;
+ static PyTypeObject* dll_PyUnicode_Type;
+! static PyObject *(*py_PyUnicode_AsEncodedString)(PyObject *, char *, char *);
+ static double(*dll_PyFloat_AsDouble)(PyObject *);
+ static PyObject*(*dll_PyFloat_FromDouble)(double);
+ static PyTypeObject* dll_PyFloat_Type;
+***************
+*** 406,412 ****
+ {"PyString_Size", (PYTHON_PROC*)&dll_PyString_Size},
+ {"PyString_Type", (PYTHON_PROC*)&dll_PyString_Type},
+ {"PyUnicode_Type", (PYTHON_PROC*)&dll_PyUnicode_Type},
+- {"PyUnicodeUCS4_AsEncodedString", (PYTHON_PROC*)&dll_PyUnicodeUCS4_AsEncodedString},
+ {"PyFloat_Type", (PYTHON_PROC*)&dll_PyFloat_Type},
+ {"PyFloat_AsDouble", (PYTHON_PROC*)&dll_PyFloat_AsDouble},
+ {"PyFloat_FromDouble", (PYTHON_PROC*)&dll_PyFloat_FromDouble},
+--- 407,412 ----
+***************
+*** 471,476 ****
+--- 471,477 ----
+ python_runtime_link_init(char *libname, int verbose)
+ {
+ int i;
++ void *ucs_as_encoded_string;
+
+ #if !(defined(PY_NO_RTLD_GLOBAL) && defined(PY3_NO_RTLD_GLOBAL)) && defined(UNIX) && defined(FEAT_PYTHON3)
+ /* Can't have Python and Python3 loaded at the same time.
+***************
+*** 506,511 ****
+--- 507,531 ----
+ return FAIL;
+ }
+ }
++
++ /* Load unicode functions separately as only the ucs2 or the ucs4 functions
++ * will be present in the library. */
++ ucs_as_encoded_string = symbol_from_dll(hinstPython,
++ "PyUnicodeUCS2_AsEncodedString");
++ if (ucs_as_encoded_string == NULL)
++ ucs_as_encoded_string = symbol_from_dll(hinstPython,
++ "PyUnicodeUCS4_AsEncodedString");
++ if (ucs_as_encoded_string != NULL)
++ py_PyUnicode_AsEncodedString = ucs_as_encoded_string;
++ else
++ {
++ close_dll(hinstPython);
++ hinstPython = 0;
++ if (verbose)
++ EMSG2(_(e_loadfunc), "PyUnicode_UCSX_*");
++ return FAIL;
++ }
++
+ return OK;
+ }
+
+*** ../vim-7.3.580/src/version.c 2012-06-29 17:51:58.000000000 +0200
+--- src/version.c 2012-06-29 19:13:47.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 581,
+ /**/
+
+--
+ASCII stupid question, get a stupid ANSI.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.582
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.582 (after 7.3.576)
+Problem: Missing parts of the test OK file.
+Solution: Add the missing parts.
+Files: src/testdir/test68.ok
+
+
+*** ../vim-7.3.581/src/testdir/test68.ok 2012-06-13 17:28:51.000000000 +0200
+--- src/testdir/test68.ok 2012-06-29 15:00:13.000000000 +0200
+***************
+*** 35,40 ****
+--- 35,48 ----
+
+
+ {
++ 1 a
++ b
++ # 1 a
++ # b
++ }
++
++
++ {
+ # 1 a
+ # b
+ }
+***************
+*** 48,50 ****
+--- 56,62 ----
+
+ { 1aa ^^2bb }
+
++
++ # 1 xxxxx
++ # foobar
++
+*** ../vim-7.3.581/src/version.c 2012-06-29 19:14:48.000000000 +0200
+--- src/version.c 2012-06-29 23:57:43.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 582,
+ /**/
+
+--
+If your nose runs, and your feet smell, you might be upside down.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.583
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.583
+Problem: PyObject_NextNotImplemented is not defined before Python 2.7.
+ (Danek Duvall)
+Solution: Add #ifdefs.
+Files: src/if_python.c
+
+
+*** ../vim-7.3.582/src/if_python.c 2012-06-29 19:14:48.000000000 +0200
+--- src/if_python.c 2012-06-30 12:59:38.000000000 +0200
+***************
+*** 214,220 ****
+ # define Py_Finalize dll_Py_Finalize
+ # define Py_IsInitialized dll_Py_IsInitialized
+ # define _PyObject_New dll__PyObject_New
+! # define _PyObject_NextNotImplemented (*dll__PyObject_NextNotImplemented)
+ # define _Py_NoneStruct (*dll__Py_NoneStruct)
+ # define PyObject_Init dll__PyObject_Init
+ # define PyObject_GetIter dll_PyObject_GetIter
+--- 214,222 ----
+ # define Py_Finalize dll_Py_Finalize
+ # define Py_IsInitialized dll_Py_IsInitialized
+ # define _PyObject_New dll__PyObject_New
+! # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000
+! # define _PyObject_NextNotImplemented (*dll__PyObject_NextNotImplemented)
+! # endif
+ # define _Py_NoneStruct (*dll__Py_NoneStruct)
+ # define PyObject_Init dll__PyObject_Init
+ # define PyObject_GetIter dll_PyObject_GetIter
+***************
+*** 310,316 ****
+--- 312,320 ----
+ static PyObject*(*dll__PyObject_New)(PyTypeObject *, PyObject *);
+ static PyObject*(*dll__PyObject_Init)(PyObject *, PyTypeObject *);
+ static PyObject* (*dll_PyObject_GetIter)(PyObject *);
++ # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000
+ static iternextfunc dll__PyObject_NextNotImplemented;
++ # endif
+ static PyObject* dll__Py_NoneStruct;
+ # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000
+ static int (*dll_PyType_IsSubtype)(PyTypeObject *, PyTypeObject *);
+***************
+*** 430,436 ****
+--- 434,442 ----
+ {"_PyObject_New", (PYTHON_PROC*)&dll__PyObject_New},
+ {"PyObject_Init", (PYTHON_PROC*)&dll__PyObject_Init},
+ {"PyObject_GetIter", (PYTHON_PROC*)&dll_PyObject_GetIter},
++ # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000
+ {"_PyObject_NextNotImplemented", (PYTHON_PROC*)&dll__PyObject_NextNotImplemented},
++ # endif
+ {"_Py_NoneStruct", (PYTHON_PROC*)&dll__Py_NoneStruct},
+ # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000
+ {"PyType_IsSubtype", (PYTHON_PROC*)&dll_PyType_IsSubtype},
+*** ../vim-7.3.582/src/version.c 2012-06-29 23:57:50.000000000 +0200
+--- src/version.c 2012-06-30 13:20:46.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 583,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+90. Instead of calling you to dinner, your spouse sends e-mail.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.584
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.584
+Problem: PyCObject is not always defined.
+Solution: Use PyObject instead.
+Files: src/if_py_both.h, src/if_python.c
+
+
+*** ../vim-7.3.583/src/if_py_both.h 2012-06-29 17:51:58.000000000 +0200
+--- src/if_py_both.h 2012-06-30 13:25:24.000000000 +0200
+***************
+*** 2432,2463 ****
+ convert_dl(PyObject *obj, typval_T *tv,
+ pytotvfunc py_to_tv, PyObject *lookupDict)
+ {
+- # ifdef PY_USE_CAPSULE
+ PyObject *capsule;
+- # else
+- PyCObject *cobject;
+- # endif
+ char hexBuf[sizeof(void *) * 2 + 3];
+
+ sprintf(hexBuf, "%p", obj);
+
+ # ifdef PY_USE_CAPSULE
+ capsule = PyDict_GetItemString(lookupDict, hexBuf);
+- if (capsule == NULL)
+ # else
+! cobject = (PyCObject *)PyDict_GetItemString(lookupDict, hexBuf);
+! if (cobject == NULL)
+ # endif
+ {
+ # ifdef PY_USE_CAPSULE
+ capsule = PyCapsule_New(tv, NULL, NULL);
+- PyDict_SetItemString(lookupDict, hexBuf, capsule);
+- Py_DECREF(capsule);
+ # else
+! cobject = PyCObject_FromVoidPtr(tv, NULL);
+! PyDict_SetItemString(lookupDict, hexBuf, cobject);
+! Py_DECREF(cobject);
+ # endif
+ if (py_to_tv(obj, tv, lookupDict) == -1)
+ {
+ tv->v_type = VAR_UNKNOWN;
+--- 2432,2456 ----
+ convert_dl(PyObject *obj, typval_T *tv,
+ pytotvfunc py_to_tv, PyObject *lookupDict)
+ {
+ PyObject *capsule;
+ char hexBuf[sizeof(void *) * 2 + 3];
+
+ sprintf(hexBuf, "%p", obj);
+
+ # ifdef PY_USE_CAPSULE
+ capsule = PyDict_GetItemString(lookupDict, hexBuf);
+ # else
+! capsule = (PyObject *)PyDict_GetItemString(lookupDict, hexBuf);
+ # endif
++ if (capsule == NULL)
+ {
+ # ifdef PY_USE_CAPSULE
+ capsule = PyCapsule_New(tv, NULL, NULL);
+ # else
+! capsule = PyCObject_FromVoidPtr(tv, NULL);
+ # endif
++ PyDict_SetItemString(lookupDict, hexBuf, capsule);
++ Py_DECREF(capsule);
+ if (py_to_tv(obj, tv, lookupDict) == -1)
+ {
+ tv->v_type = VAR_UNKNOWN;
+***************
+*** 2478,2484 ****
+ # ifdef PY_USE_CAPSULE
+ v = PyCapsule_GetPointer(capsule, NULL);
+ # else
+! v = PyCObject_AsVoidPtr(cobject);
+ # endif
+ copy_tv(v, tv);
+ }
+--- 2471,2477 ----
+ # ifdef PY_USE_CAPSULE
+ v = PyCapsule_GetPointer(capsule, NULL);
+ # else
+! v = PyCObject_AsVoidPtr(capsule);
+ # endif
+ copy_tv(v, tv);
+ }
+*** ../vim-7.3.583/src/if_python.c 2012-06-30 13:21:03.000000000 +0200
+--- src/if_python.c 2012-06-30 13:23:22.000000000 +0200
+***************
+*** 327,334 ****
+ static PyObject* (*dll_PyCapsule_New)(void *, char *, PyCapsule_Destructor);
+ static void* (*dll_PyCapsule_GetPointer)(PyObject *, char *);
+ # else
+! static PyCObject* (*dll_PyCObject_FromVoidPtr)(void *cobj, void (*destr)(void *));
+! static void* (*dll_PyCObject_AsVoidPtr)(PyCObject *);
+ # endif
+
+ static HINSTANCE hinstPython = 0; /* Instance of python.dll */
+--- 327,334 ----
+ static PyObject* (*dll_PyCapsule_New)(void *, char *, PyCapsule_Destructor);
+ static void* (*dll_PyCapsule_GetPointer)(PyObject *, char *);
+ # else
+! static PyObject* (*dll_PyCObject_FromVoidPtr)(void *cobj, void (*destr)(void *));
+! static void* (*dll_PyCObject_AsVoidPtr)(PyObject *);
+ # endif
+
+ static HINSTANCE hinstPython = 0; /* Instance of python.dll */
+*** ../vim-7.3.583/src/version.c 2012-06-30 13:21:03.000000000 +0200
+--- src/version.c 2012-06-30 13:33:08.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 584,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+91. It's Saturday afternoon in the middle of May and you
+ are on computer.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.585
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.585
+Problem: Calling changed_bytes() too often.
+Solution: Move changed_bytes() out of a loop. (Tor Perkins)
+Files: src/edit.c
+
+
+*** ../vim-7.3.584/src/edit.c 2012-06-29 15:04:34.000000000 +0200
+--- src/edit.c 2012-07-06 13:29:25.000000000 +0200
+***************
+*** 6350,6359 ****
+ * add the additional whitespace needed after the
+ * comment leader for the numbered list. */
+ for (i = 0; i < padding; i++)
+- {
+ ins_str((char_u *)" ");
+! changed_bytes(curwin->w_cursor.lnum, leader_len);
+! }
+ }
+ else
+ {
+--- 6350,6357 ----
+ * add the additional whitespace needed after the
+ * comment leader for the numbered list. */
+ for (i = 0; i < padding; i++)
+ ins_str((char_u *)" ");
+! changed_bytes(curwin->w_cursor.lnum, leader_len);
+ }
+ else
+ {
+*** ../vim-7.3.584/src/version.c 2012-07-06 13:36:02.000000000 +0200
+--- src/version.c 2012-07-06 13:35:03.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 585,
+ /**/
+
+--
+From "know your smileys":
+ :'-D Laughing so much that they're crying
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.586
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.586
+Problem: When compiling with Cygwin or MingW MEMORYSTATUSEX is not defined.
+Solution: Set the default for WINVER to 0x0500.
+Files: src/Make_ming.mak, src/Make_cyg.mak
+
+
+*** ../vim-7.3.585/src/Make_ming.mak 2012-04-20 16:13:21.000000000 +0200
+--- src/Make_ming.mak 2012-06-30 21:23:55.000000000 +0200
+***************
+*** 52,58 ****
+ OLE=no
+ # Set the default $(WINVER) to make it work with pre-Win2k
+ ifndef WINVER
+! WINVER = 0x0400
+ endif
+ # Set to yes to enable Cscope support
+ CSCOPE=yes
+--- 52,58 ----
+ OLE=no
+ # Set the default $(WINVER) to make it work with pre-Win2k
+ ifndef WINVER
+! WINVER = 0x0500
+ endif
+ # Set to yes to enable Cscope support
+ CSCOPE=yes
+*** ../vim-7.3.585/src/Make_cyg.mak 2011-09-30 16:56:00.000000000 +0200
+--- src/Make_cyg.mak 2012-06-30 21:23:42.000000000 +0200
+***************
+*** 1,6 ****
+ #
+ # Makefile for VIM on Win32, using Cygnus gcc
+! # Last updated by Dan Sharp. Last Change: 2010 Nov 03
+ #
+ # Also read INSTALLpc.txt!
+ #
+--- 1,6 ----
+ #
+ # Makefile for VIM on Win32, using Cygnus gcc
+! # Last updated by Dan Sharp. Last Change: 2012 Jun 30
+ #
+ # Also read INSTALLpc.txt!
+ #
+***************
+*** 48,54 ****
+ # -L/lib/w32api to EXTRA_LIBS.
+ # POSTSCRIPT no or yes: set to yes for PostScript printing (no)
+ # FEATURES TINY, SMALL, NORMAL, BIG or HUGE (BIG)
+! # WINVER Lowest Win32 version to support. (0x0400)
+ # CSCOPE no or yes: to include cscope interface support (yes)
+ # OPTIMIZE SPACE, SPEED, or MAXSPEED: set optimization level (MAXSPEED)
+ # NETBEANS no or yes: to include netbeans interface support (yes when GUI
+--- 48,54 ----
+ # -L/lib/w32api to EXTRA_LIBS.
+ # POSTSCRIPT no or yes: set to yes for PostScript printing (no)
+ # FEATURES TINY, SMALL, NORMAL, BIG or HUGE (BIG)
+! # WINVER Lowest Win32 version to support. (0x0500)
+ # CSCOPE no or yes: to include cscope interface support (yes)
+ # OPTIMIZE SPACE, SPEED, or MAXSPEED: set optimization level (MAXSPEED)
+ # NETBEANS no or yes: to include netbeans interface support (yes when GUI
+***************
+*** 85,91 ****
+ endif
+
+ ifndef WINVER
+! WINVER = 0x0400
+ endif
+
+ ifndef CSCOPE
+--- 85,91 ----
+ endif
+
+ ifndef WINVER
+! WINVER = 0x0500
+ endif
+
+ ifndef CSCOPE
+*** ../vim-7.3.585/src/version.c 2012-07-06 13:36:36.000000000 +0200
+--- src/version.c 2012-07-06 13:39:41.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 586,
+ /**/
+
+--
+From "know your smileys":
+ :-& Eating spaghetti
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.587
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.587
+Problem: Compiler warning for local var shadowing global var.
+Solution: Rename the var and move it to an inner block. (Christian Brabandt)
+Files: src/buffer.c
+
+
+*** ../vim-7.3.586/src/buffer.c 2012-06-20 17:54:34.000000000 +0200
+--- src/buffer.c 2012-07-06 16:19:32.000000000 +0200
+***************
+*** 1363,1371 ****
+ int action;
+ {
+ buf_T *prevbuf;
+- #ifdef FEAT_WINDOWS
+- win_T *prevwin;
+- #endif
+ int unload = (action == DOBUF_UNLOAD || action == DOBUF_DEL
+ || action == DOBUF_WIPE);
+
+--- 1363,1368 ----
+***************
+*** 1406,1412 ****
+ #endif
+ {
+ #ifdef FEAT_WINDOWS
+! prevwin = curwin;
+ #endif
+ if (prevbuf == curbuf)
+ u_sync(FALSE);
+--- 1403,1409 ----
+ #endif
+ {
+ #ifdef FEAT_WINDOWS
+! win_T *previouswin = curwin;
+ #endif
+ if (prevbuf == curbuf)
+ u_sync(FALSE);
+***************
+*** 1415,1423 ****
+ && !P_HID(prevbuf)
+ && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0, FALSE);
+ #ifdef FEAT_WINDOWS
+! if (curwin != prevwin && win_valid(prevwin))
+ /* autocommands changed curwin, Grr! */
+! curwin = prevwin;
+ #endif
+ }
+ }
+--- 1412,1420 ----
+ && !P_HID(prevbuf)
+ && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0, FALSE);
+ #ifdef FEAT_WINDOWS
+! if (curwin != previouswin && win_valid(previouswin))
+ /* autocommands changed curwin, Grr! */
+! curwin = previouswin;
+ #endif
+ }
+ }
+*** ../vim-7.3.586/src/version.c 2012-07-06 13:40:44.000000000 +0200
+--- src/version.c 2012-07-06 16:19:08.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 587,
+ /**/
+
+--
+There's no place like $(HOME)!
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.588
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.588
+Problem: Crash on NULL pointer.
+Solution: Fix the immediate problem by checking for NULL. (Lech Lorens)
+Files: src/window.c
+
+
+*** ../vim-7.3.587/src/window.c 2012-06-13 18:15:13.000000000 +0200
+--- src/window.c 2012-07-06 16:32:59.000000000 +0200
+***************
+*** 2184,2190 ****
+ }
+
+ #ifdef FEAT_AUTOCMD
+! if (win->w_closing || win->w_buffer->b_closing)
+ return; /* window is already being closed */
+ if (win == aucmd_win)
+ {
+--- 2184,2190 ----
+ }
+
+ #ifdef FEAT_AUTOCMD
+! if (win->w_closing || (win->w_buffer != NULL && win->w_buffer->b_closing))
+ return; /* window is already being closed */
+ if (win == aucmd_win)
+ {
+***************
+*** 3723,3729 ****
+ enter_tabpage(tp, old_curbuf, trigger_autocmds)
+ tabpage_T *tp;
+ buf_T *old_curbuf UNUSED;
+! int trigger_autocmds UNUSED;
+ {
+ int old_off = tp->tp_firstwin->w_winrow;
+ win_T *next_prevwin = tp->tp_prevwin;
+--- 3723,3729 ----
+ enter_tabpage(tp, old_curbuf, trigger_autocmds)
+ tabpage_T *tp;
+ buf_T *old_curbuf UNUSED;
+! int trigger_autocmds UNUSED;
+ {
+ int old_off = tp->tp_firstwin->w_winrow;
+ win_T *next_prevwin = tp->tp_prevwin;
+***************
+*** 3868,3874 ****
+ void
+ goto_tabpage_tp(tp, trigger_autocmds)
+ tabpage_T *tp;
+! int trigger_autocmds;
+ {
+ /* Don't repeat a message in another tab page. */
+ set_keep_msg(NULL, 0);
+--- 3868,3874 ----
+ void
+ goto_tabpage_tp(tp, trigger_autocmds)
+ tabpage_T *tp;
+! int trigger_autocmds;
+ {
+ /* Don't repeat a message in another tab page. */
+ set_keep_msg(NULL, 0);
+*** ../vim-7.3.587/src/version.c 2012-07-06 16:21:58.000000000 +0200
+--- src/version.c 2012-07-06 16:37:47.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 588,
+ /**/
+
+--
+Momento mori, ergo carpe diem
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.589
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.589
+Problem: Crash when $HOME is not set.
+Solution: Check for a NULL pointer. (Chris Webb)
+Files: src/misc1.c
+
+
+*** ../vim-7.3.588/src/misc1.c 2012-06-29 15:04:34.000000000 +0200
+--- src/misc1.c 2012-07-06 16:44:39.000000000 +0200
+***************
+*** 4496,4503 ****
+ #else
+ homedir_env_orig = homedir_env = mch_getenv((char_u *)"HOME");
+ #endif
+ #if defined(FEAT_MODIFY_FNAME) || defined(WIN3264)
+! if (vim_strchr(homedir_env, '~') != NULL)
+ {
+ int usedlen = 0;
+ int flen;
+--- 4496,4507 ----
+ #else
+ homedir_env_orig = homedir_env = mch_getenv((char_u *)"HOME");
+ #endif
++ /* Empty is the same as not set. */
++ if (homedir_env != NULL && *homedir_env == NUL)
++ homedir_env = NULL;
++
+ #if defined(FEAT_MODIFY_FNAME) || defined(WIN3264)
+! if (homedir_env != NULL && vim_strchr(homedir_env, '~') != NULL)
+ {
+ int usedlen = 0;
+ int flen;
+***************
+*** 4513,4520 ****
+ }
+ #endif
+
+- if (homedir_env != NULL && *homedir_env == NUL)
+- homedir_env = NULL;
+ if (homedir_env != NULL)
+ envlen = STRLEN(homedir_env);
+
+--- 4517,4522 ----
+*** ../vim-7.3.588/src/version.c 2012-07-06 16:39:43.000000000 +0200
+--- src/version.c 2012-07-06 16:45:18.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 589,
+ /**/
+
+--
+I AM THANKFUL...
+...for the taxes that I pay because it means that I am employed.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.590
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.590
+Problem: The '< and '> marks cannot be set directly.
+Solution: Allow setting '< and '>. (Christian Brabandt)
+Files: src/mark.c
+
+
+*** ../vim-7.3.589/src/mark.c 2011-02-25 15:11:17.000000000 +0100
+--- src/mark.c 2012-07-06 17:47:23.000000000 +0200
+***************
+*** 98,103 ****
+--- 98,116 ----
+ return OK;
+ }
+
++ #ifdef FEAT_VISUAL
++ if (c == '<')
++ {
++ curbuf->b_visual.vi_start = *pos;
++ return OK;
++ }
++ if (c == '>')
++ {
++ curbuf->b_visual.vi_end = *pos;
++ return OK;
++ }
++ #endif
++
+ #ifndef EBCDIC
+ if (c > 'z') /* some islower() and isupper() cannot handle
+ characters above 127 */
+*** ../vim-7.3.589/src/version.c 2012-07-06 16:49:37.000000000 +0200
+--- src/version.c 2012-07-06 17:49:00.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 590,
+ /**/
+
+--
+The primary purpose of the DATA statement is to give names to constants;
+instead of referring to pi as 3.141592653589793 at every appearance, the
+variable PI can be given that value with a DATA statement and used instead
+of the longer form of the constant. This also simplifies modifying the
+program, should the value of pi change.
+ -- FORTRAN manual for Xerox Computers
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.591
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.591
+Problem: Can only move to a tab by absolute number.
+Solution: Move a number of tabs to the left or the right. (Lech Lorens)
+Files: runtime/doc/tabpage.txt, src/ex_cmds.h, src/ex_docmd.c,
+ src/testdir/test62.in, src/testdir/test62.ok, src/window.c
+
+
+*** ../vim-7.3.590/runtime/doc/tabpage.txt 2010-08-15 21:57:17.000000000 +0200
+--- runtime/doc/tabpage.txt 2012-07-06 18:10:06.000000000 +0200
+***************
+*** 173,182 ****
+--- 173,192 ----
+ REORDERING TAB PAGES:
+
+ :tabm[ove] [N] *:tabm* *:tabmove*
++ :[N]tabm[ove]
+ Move the current tab page to after tab page N. Use zero to
+ make the current tab page the first one. Without N the tab
+ page is made the last one.
+
++ :tabm[ove] +[N]
++ :tabm[ove] -[N]
++ Move the current tab page N places to the right (with +) or to
++ the left (with -).
++
++ Note that although it is possible to move a tab behind the N-th one by using
++ :Ntabmove, it is impossible to move it by N places by using :+Ntabmove. For
++ clarification what +N means in this context see |[range]|.
++
+
+ LOOPING OVER TAB PAGES:
+
+*** ../vim-7.3.590/src/ex_cmds.h 2012-05-18 18:47:11.000000000 +0200
+--- src/ex_cmds.h 2012-07-06 18:10:13.000000000 +0200
+***************
+*** 944,950 ****
+ EX(CMD_tabfirst, "tabfirst", ex_tabnext,
+ TRLBAR),
+ EX(CMD_tabmove, "tabmove", ex_tabmove,
+! RANGE|NOTADR|ZEROR|COUNT|TRLBAR|ZEROR),
+ EX(CMD_tablast, "tablast", ex_tabnext,
+ TRLBAR),
+ EX(CMD_tabnext, "tabnext", ex_tabnext,
+--- 944,950 ----
+ EX(CMD_tabfirst, "tabfirst", ex_tabnext,
+ TRLBAR),
+ EX(CMD_tabmove, "tabmove", ex_tabmove,
+! RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR),
+ EX(CMD_tablast, "tablast", ex_tabnext,
+ TRLBAR),
+ EX(CMD_tabnext, "tabnext", ex_tabnext,
+*** ../vim-7.3.590/src/ex_docmd.c 2012-06-06 19:02:40.000000000 +0200
+--- src/ex_docmd.c 2012-07-06 18:16:25.000000000 +0200
+***************
+*** 7478,7484 ****
+ ex_tabmove(eap)
+ exarg_T *eap;
+ {
+! tabpage_move(eap->addr_count == 0 ? 9999 : (int)eap->line2);
+ }
+
+ /*
+--- 7478,7519 ----
+ ex_tabmove(eap)
+ exarg_T *eap;
+ {
+! int tab_number = 9999;
+!
+! if (eap->arg && *eap->arg != NUL)
+! {
+! char_u *p = eap->arg;
+! int relative = 0; /* argument +N/-N means: move N places to the
+! * right/left relative to the current position. */
+!
+! if (*eap->arg == '-')
+! {
+! relative = -1;
+! p = eap->arg + 1;
+! }
+! else if (*eap->arg == '+')
+! {
+! relative = 1;
+! p = eap->arg + 1;
+! }
+! else
+! p = eap->arg;
+!
+! if (p == skipdigits(p))
+! {
+! /* No numbers as argument. */
+! eap->errmsg = e_invarg;
+! return;
+! }
+!
+! tab_number = getdigits(&p);
+! if (relative != 0)
+! tab_number = tab_number * relative + tabpage_index(curtab) - 1;;
+! }
+! else if (eap->addr_count != 0)
+! tab_number = eap->line2;
+!
+! tabpage_move(tab_number);
+ }
+
+ /*
+*** ../vim-7.3.590/src/testdir/test62.in 2012-03-07 22:55:17.000000000 +0100
+--- src/testdir/test62.in 2012-07-06 18:10:13.000000000 +0200
+***************
+*** 93,98 ****
+--- 93,126 ----
+ :endif
+ :"
+ :"
++ :for i in range(9) | tabnew | endfor
++ 1gt
++ Go\12=tabpagenr()\r\r\e
++ :tabmove 5
++ i\12=tabpagenr()\r\r\e
++ :tabmove -2
++ i\12=tabpagenr()\r\r\e
++ :tabmove +4
++ i\12=tabpagenr()\r\r\e
++ :tabmove
++ i\12=tabpagenr()\r\r\e
++ :tabmove -20
++ i\12=tabpagenr()\r\r\e
++ :tabmove +20
++ i\12=tabpagenr()\r\r\e
++ :3tabmove
++ i\12=tabpagenr()\r\r\e
++ :7tabmove 5
++ i\12=tabpagenr()\r\r\e
++ :let a='No error caught.'
++ :try
++ :tabmove foo
++ :catch E474
++ :let a='E474 caught.'
++ :endtry
++ i\12=a\r\e
++ :"
++ :"
+ :/^Results/,$w! test.out
+ :qa!
+ ENDTEST
+*** ../vim-7.3.590/src/testdir/test62.ok 2012-02-22 19:13:00.000000000 +0100
+--- src/testdir/test62.ok 2012-07-06 18:10:13.000000000 +0200
+***************
+*** 8,10 ****
+--- 8,20 ----
+ tab drop 1: pass
+ tab drop 2: pass
+ tab drop 3: pass
++ 1
++ 6
++ 4
++ 8
++ 10
++ 1
++ 10
++ 4
++ 6
++ E474 caught.
+*** ../vim-7.3.590/src/window.c 2012-07-06 16:39:43.000000000 +0200
+--- src/window.c 2012-07-06 18:10:13.000000000 +0200
+***************
+*** 3929,3935 ****
+ }
+
+ /* Re-insert it at the specified position. */
+! if (n == 0)
+ {
+ curtab->tp_next = first_tabpage;
+ first_tabpage = curtab;
+--- 3929,3935 ----
+ }
+
+ /* Re-insert it at the specified position. */
+! if (n <= 0)
+ {
+ curtab->tp_next = first_tabpage;
+ first_tabpage = curtab;
+*** ../vim-7.3.590/src/version.c 2012-07-06 17:51:24.000000000 +0200
+--- src/version.c 2012-07-06 18:11:08.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 591,
+ /**/
+
+--
+Bare feet magnetize sharp metal objects so they point upward from the
+floor -- especially in the dark.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.592
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.592
+Problem: Vim on GTK does not support g:browsefilter.
+Solution: Add a GtkFileFilter to the file chooser. (Christian Brabandt)
+Files: src/gui_gtk.c
+
+
+*** ../vim-7.3.591/src/gui_gtk.c 2012-06-06 16:14:36.000000000 +0200
+--- src/gui_gtk.c 2012-07-10 13:08:06.000000000 +0200
+***************
+*** 840,846 ****
+ char_u *dflt,
+ char_u *ext UNUSED,
+ char_u *initdir,
+! char_u *filter UNUSED)
+ {
+ #ifdef USE_FILE_CHOOSER
+ GtkWidget *fc;
+--- 840,846 ----
+ char_u *dflt,
+ char_u *ext UNUSED,
+ char_u *initdir,
+! char_u *filter)
+ {
+ #ifdef USE_FILE_CHOOSER
+ GtkWidget *fc;
+***************
+*** 848,853 ****
+--- 848,854 ----
+ char_u dirbuf[MAXPATHL];
+ guint log_handler;
+ const gchar *domain = "Gtk";
++ GtkFileFilter *gfilter;
+
+ title = CONVERT_TO_UTF8(title);
+
+***************
+*** 879,884 ****
+--- 880,924 ----
+ NULL);
+ gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(fc),
+ (const gchar *)dirbuf);
++
++ if (filter != NULL && *filter != NUL)
++ {
++ int i = 0;
++ char_u *patt;
++ char_u *p = filter;
++
++ gfilter = gtk_file_filter_new();
++ patt = alloc(STRLEN(filter));
++ while (p != NULL && *p != NUL)
++ {
++ if (*p == '\n' || *p == ';' || *p == '\t')
++ {
++ STRNCPY(patt, filter, i);
++ patt[i] = '\0';
++ if (*p == '\t')
++ gtk_file_filter_set_name(gfilter, (gchar *)patt);
++ else
++ {
++ gtk_file_filter_add_pattern(gfilter, (gchar *)patt);
++ if (*p == '\n')
++ {
++ gtk_file_chooser_add_filter((GtkFileChooser *)fc,
++ gfilter);
++ if (*(p + 1) != NUL)
++ gfilter = gtk_file_filter_new();
++ }
++ }
++ filter = ++p;
++ i = 0;
++ }
++ else
++ {
++ p++;
++ i++;
++ }
++ }
++ vim_free(patt);
++ }
+ if (saving && dflt != NULL && *dflt != NUL)
+ gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(fc), (char *)dflt);
+
+***************
+*** 1304,1310 ****
+ gtk_widget_show(entry);
+
+ /* Make Enter work like pressing OK. */
+! gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE);
+
+ text = CONVERT_TO_UTF8(textfield);
+ gtk_entry_set_text(GTK_ENTRY(entry), (const char *)text);
+--- 1344,1350 ----
+ gtk_widget_show(entry);
+
+ /* Make Enter work like pressing OK. */
+! gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE);
+
+ text = CONVERT_TO_UTF8(textfield);
+ gtk_entry_set_text(GTK_ENTRY(entry), (const char *)text);
+*** ../vim-7.3.591/src/version.c 2012-07-06 18:27:34.000000000 +0200
+--- src/version.c 2012-07-10 13:00:29.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 592,
+ /**/
+
+--
+To be rich is not the end, but only a change of worries.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.593
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.593
+Problem: No easy way to decide if b:browsefilter will work.
+Solution: Add the browsefilter feature.
+Files: src/gui_gtk.c, src/eval.c, src/vim.h
+
+
+*** ../vim-7.3.592/src/gui_gtk.c 2012-07-10 13:12:46.000000000 +0200
+--- src/gui_gtk.c 2012-07-10 13:40:38.000000000 +0200
+***************
+*** 779,787 ****
+ /*
+ * Implementation of the file selector related stuff
+ */
+- #if GTK_CHECK_VERSION(2,4,0)
+- # define USE_FILE_CHOOSER
+- #endif
+
+ #ifndef USE_FILE_CHOOSER
+ static void
+--- 779,784 ----
+*** ../vim-7.3.592/src/eval.c 2012-06-29 12:54:32.000000000 +0200
+--- src/eval.c 2012-07-10 13:34:10.000000000 +0200
+***************
+*** 12044,12049 ****
+--- 12044,12054 ----
+ "all_builtin_terms",
+ # endif
+ #endif
++ #if defined(FEAT_BROWSE) && (defined(USE_FILE_CHOOSER) \
++ || defined(FEAT_GUI_W32) \
++ || defined(FEAT_GUI_MOTIF))
++ "browsefilter",
++ #endif
+ #ifdef FEAT_BYTEOFF
+ "byte_offset",
+ #endif
+*** ../vim-7.3.592/src/vim.h 2012-06-13 17:28:51.000000000 +0200
+--- src/vim.h 2012-07-10 13:30:44.000000000 +0200
+***************
+*** 2125,2130 ****
+--- 2125,2136 ----
+ # endif
+ #endif
+
++ #if defined(FEAT_BROWSE) && defined(GTK_CHECK_VERSION)
++ # if GTK_CHECK_VERSION(2,4,0)
++ # define USE_FILE_CHOOSER
++ # endif
++ #endif
++
+ #ifndef FEAT_NETBEANS_INTG
+ # undef NBDEBUG
+ #endif
+*** ../vim-7.3.592/src/version.c 2012-07-10 13:12:46.000000000 +0200
+--- src/version.c 2012-07-10 13:34:50.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 593,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+102. When filling out your driver's license application, you give
+ your IP address.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.594
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.594
+Problem: The X command server doesn't work perfectly. It sends an empty
+ reply for as-keys requests.
+Solution: Remove duplicate ga_init2(). Do not send a reply for as-keys
+ requests. (Brian Burns)
+Files: src/if_xcmdsrv.c
+
+
+*** ../vim-7.3.593/src/if_xcmdsrv.c 2010-08-15 21:57:27.000000000 +0200
+--- src/if_xcmdsrv.c 2012-07-10 14:15:59.000000000 +0200
+***************
+*** 655,661 ****
+ if (SendInit(dpy) < 0)
+ return NULL;
+ }
+- ga_init2(&ga, 1, 100);
+
+ /*
+ * Read the registry property.
+--- 655,660 ----
+***************
+*** 1198,1206 ****
+ if ((*p == 'c' || *p == 'k') && (p[1] == 0))
+ {
+ Window resWindow;
+! char_u *name, *script, *serial, *end, *res;
+ Bool asKeys = *p == 'k';
+- garray_T reply;
+ char_u *enc;
+
+ /*
+--- 1197,1204 ----
+ if ((*p == 'c' || *p == 'k') && (p[1] == 0))
+ {
+ Window resWindow;
+! char_u *name, *script, *serial, *end;
+ Bool asKeys = *p == 'k';
+ char_u *enc;
+
+ /*
+***************
+*** 1256,1305 ****
+ if (script == NULL || name == NULL)
+ continue;
+
+! /*
+! * Initialize the result property, so that we're ready at any
+! * time if we need to return an error.
+! */
+! if (resWindow != None)
+! {
+! ga_init2(&reply, 1, 100);
+ #ifdef FEAT_MBYTE
+! ga_grow(&reply, 50 + STRLEN(p_enc));
+! sprintf(reply.ga_data, "%cr%c-E %s%c-s %s%c-r ",
+ 0, 0, p_enc, 0, serial, 0);
+! reply.ga_len = 14 + STRLEN(p_enc) + STRLEN(serial);
+ #else
+! ga_grow(&reply, 50);
+! sprintf(reply.ga_data, "%cr%c-s %s%c-r ", 0, 0, serial, 0);
+! reply.ga_len = 10 + STRLEN(serial);
+ #endif
+! }
+! res = NULL;
+! if (serverName != NULL && STRICMP(name, serverName) == 0)
+! {
+! script = serverConvert(enc, script, &tofree);
+! if (asKeys)
+! server_to_input_buf(script);
+! else
+! res = eval_client_expr_to_string(script);
+! vim_free(tofree);
+! }
+! if (resWindow != None)
+! {
+! if (res != NULL)
+! ga_concat(&reply, res);
+! else if (asKeys == 0)
+! {
+! ga_concat(&reply, (char_u *)_(e_invexprmsg));
+! ga_append(&reply, 0);
+! ga_concat(&reply, (char_u *)"-c 1");
+! }
+! ga_append(&reply, NUL);
+! (void)AppendPropCarefully(dpy, resWindow, commProperty,
+! reply.ga_data, reply.ga_len);
+! ga_clear(&reply);
+! }
+! vim_free(res);
+ }
+ else if (*p == 'r' && p[1] == 0)
+ {
+--- 1254,1305 ----
+ if (script == NULL || name == NULL)
+ continue;
+
+! if (serverName != NULL && STRICMP(name, serverName) == 0)
+! {
+! script = serverConvert(enc, script, &tofree);
+! if (asKeys)
+! server_to_input_buf(script);
+! else
+! {
+! char_u *res;
+!
+! res = eval_client_expr_to_string(script);
+! if (resWindow != None)
+! {
+! garray_T reply;
+!
+! /* Initialize the result property. */
+! ga_init2(&reply, 1, 100);
+ #ifdef FEAT_MBYTE
+! ga_grow(&reply, 50 + STRLEN(p_enc));
+! sprintf(reply.ga_data, "%cr%c-E %s%c-s %s%c-r ",
+ 0, 0, p_enc, 0, serial, 0);
+! reply.ga_len = 14 + STRLEN(p_enc) + STRLEN(serial);
+ #else
+! ga_grow(&reply, 50);
+! sprintf(reply.ga_data, "%cr%c-s %s%c-r ",
+! 0, 0, serial, 0);
+! reply.ga_len = 10 + STRLEN(serial);
+ #endif
+!
+! /* Evaluate the expression and return the result. */
+! if (res != NULL)
+! ga_concat(&reply, res);
+! else
+! {
+! ga_concat(&reply, (char_u *)_(e_invexprmsg));
+! ga_append(&reply, 0);
+! ga_concat(&reply, (char_u *)"-c 1");
+! }
+! ga_append(&reply, NUL);
+! (void)AppendPropCarefully(dpy, resWindow, commProperty,
+! reply.ga_data, reply.ga_len);
+! ga_clear(&reply);
+! }
+! vim_free(res);
+! }
+! vim_free(tofree);
+! }
+ }
+ else if (*p == 'r' && p[1] == 0)
+ {
+*** ../vim-7.3.593/src/version.c 2012-07-10 13:41:09.000000000 +0200
+--- src/version.c 2012-07-10 14:17:50.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 594,
+ /**/
+
+--
+A meeting is an event at which the minutes are kept and the hours are lost.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.595
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.595
+Problem: The X command server responds slowly
+Solution: Change the loop that waits for replies. (Brian Burns)
+Files: src/if_xcmdsrv.c
+
+
+*** ../vim-7.3.594/src/if_xcmdsrv.c 2012-07-10 14:25:00.000000000 +0200
+--- src/if_xcmdsrv.c 2012-07-10 14:44:13.000000000 +0200
+***************
+*** 572,632 ****
+ {
+ time_t start;
+ time_t now;
+- time_t lastChk = 0;
+ XEvent event;
+! XPropertyEvent *e = (XPropertyEvent *)&event;
+! # define SEND_MSEC_POLL 50
+
+ time(&start);
+! while (endCond(endData) == 0)
+ {
+ time(&now);
+ if (seconds >= 0 && (now - start) >= seconds)
+ break;
+! if (now != lastChk)
+! {
+! lastChk = now;
+! if (!WindowValid(dpy, w))
+! break;
+! /*
+! * Sometimes the PropertyChange event doesn't come.
+! * This can be seen in eg: vim -c 'echo remote_expr("gvim", "3+2")'
+! */
+! serverEventProc(dpy, NULL);
+! }
+ if (localLoop)
+ {
+- /* Just look out for the answer without calling back into Vim */
+ #ifndef HAVE_SELECT
+- struct pollfd fds;
+-
+- fds.fd = ConnectionNumber(dpy);
+- fds.events = POLLIN;
+ if (poll(&fds, 1, SEND_MSEC_POLL) < 0)
+ break;
+ #else
+! fd_set fds;
+! struct timeval tv;
+!
+! tv.tv_sec = 0;
+! tv.tv_usec = SEND_MSEC_POLL * 1000;
+! FD_ZERO(&fds);
+! FD_SET(ConnectionNumber(dpy), &fds);
+! if (select(ConnectionNumber(dpy) + 1, &fds, NULL, NULL, &tv) < 0)
+ break;
+ #endif
+- while (XEventsQueued(dpy, QueuedAfterReading) > 0)
+- {
+- XNextEvent(dpy, &event);
+- if (event.type == PropertyNotify && e->window == commWindow)
+- serverEventProc(dpy, &event);
+- }
+ }
+ else
+ {
+ if (got_int)
+ break;
+! ui_delay((long)SEND_MSEC_POLL, TRUE);
+ ui_breakcheck();
+ }
+ }
+--- 572,626 ----
+ {
+ time_t start;
+ time_t now;
+ XEvent event;
+!
+! #define UI_MSEC_DELAY 50
+! #define SEND_MSEC_POLL 500
+! #ifndef HAVE_SELECT
+! struct pollfd fds;
+!
+! fds.fd = ConnectionNumber(dpy);
+! fds.events = POLLIN;
+! #else
+! fd_set fds;
+! struct timeval tv;
+!
+! tv.tv_sec = 0;
+! tv.tv_usec = SEND_MSEC_POLL * 1000;
+! FD_ZERO(&fds);
+! FD_SET(ConnectionNumber(dpy), &fds);
+! #endif
+
+ time(&start);
+! while (TRUE)
+ {
++ while (XCheckWindowEvent(dpy, commWindow, PropertyChangeMask, &event))
++ serverEventProc(dpy, &event);
++
++ if (endCond(endData) != 0)
++ break;
++ if (!WindowValid(dpy, w))
++ break;
+ time(&now);
+ if (seconds >= 0 && (now - start) >= seconds)
+ break;
+!
+! /* Just look out for the answer without calling back into Vim */
+ if (localLoop)
+ {
+ #ifndef HAVE_SELECT
+ if (poll(&fds, 1, SEND_MSEC_POLL) < 0)
+ break;
+ #else
+! if (select(FD_SETSIZE, &fds, NULL, NULL, &tv) < 0)
+ break;
+ #endif
+ }
+ else
+ {
+ if (got_int)
+ break;
+! ui_delay((long)UI_MSEC_DELAY, TRUE);
+ ui_breakcheck();
+ }
+ }
+*** ../vim-7.3.594/src/version.c 2012-07-10 14:25:00.000000000 +0200
+--- src/version.c 2012-07-10 14:52:16.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 595,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+104. When people ask about the Presidential Election you ask "Which country?"
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.596
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.596
+Problem: Can't remove all signs for a file or buffer.
+Solution: Support "*" for the sign id. (Christian Brabandt)
+Files: runtime/doc/sign.txt, src/buffer.c, src/ex_cmds.c,
+ src/proto/buffer.pro
+
+
+*** ../vim-7.3.595/runtime/doc/sign.txt 2010-08-15 21:57:17.000000000 +0200
+--- runtime/doc/sign.txt 2012-07-10 15:05:19.000000000 +0200
+***************
+*** 150,157 ****
+ Remove the previously placed sign {id} from file {fname}.
+ See remark above about {fname} |:sign-fname|.
+
+ :sign unplace {id} buffer={nr}
+! Same, but use buffer {nr}.
+
+ :sign unplace {id}
+ Remove the previously placed sign {id} from all files it
+--- 153,166 ----
+ Remove the previously placed sign {id} from file {fname}.
+ See remark above about {fname} |:sign-fname|.
+
++ :sign unplace * file={fname}
++ Remove all placed signs in file {fname}.
++
+ :sign unplace {id} buffer={nr}
+! Remove the previously placed sign {id} from buffer {nr}.
+!
+! :sign unplace * buffer={nr}
+! Remove all placed signs in buffer {nr}.
+
+ :sign unplace {id}
+ Remove the previously placed sign {id} from all files it
+*** ../vim-7.3.595/src/buffer.c 2012-07-06 16:21:58.000000000 +0200
+--- src/buffer.c 2012-07-10 15:06:05.000000000 +0200
+***************
+*** 57,63 ****
+
+ #if defined(FEAT_SIGNS)
+ static void insert_sign __ARGS((buf_T *buf, signlist_T *prev, signlist_T *next, int id, linenr_T lnum, int typenr));
+- static void buf_delete_signs __ARGS((buf_T *buf));
+ #endif
+
+ #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+--- 57,62 ----
+***************
+*** 5537,5543 ****
+ /*
+ * Delete signs in buffer "buf".
+ */
+! static void
+ buf_delete_signs(buf)
+ buf_T *buf;
+ {
+--- 5536,5542 ----
+ /*
+ * Delete signs in buffer "buf".
+ */
+! void
+ buf_delete_signs(buf)
+ buf_T *buf;
+ {
+*** ../vim-7.3.595/src/ex_cmds.c 2012-05-18 16:24:06.000000000 +0200
+--- src/ex_cmds.c 2012-07-10 15:14:22.000000000 +0200
+***************
+*** 6997,7002 ****
+--- 6997,7012 ----
+ lnum = atoi((char *)arg);
+ arg = skiptowhite(arg);
+ }
++ else if (STRNCMP(arg, "*", 1) == 0 && idx == SIGNCMD_UNPLACE)
++ {
++ if (id != -1)
++ {
++ EMSG(_(e_invarg));
++ return;
++ }
++ id = -2;
++ arg = skiptowhite(arg + 1);
++ }
+ else if (STRNCMP(arg, "name=", 5) == 0)
+ {
+ arg += 5;
+***************
+*** 7033,7039 ****
+ {
+ EMSG2(_("E158: Invalid buffer name: %s"), arg);
+ }
+! else if (id <= 0)
+ {
+ if (lnum >= 0 || sign_name != NULL)
+ EMSG(_(e_invarg));
+--- 7043,7049 ----
+ {
+ EMSG2(_("E158: Invalid buffer name: %s"), arg);
+ }
+! else if (id <= 0 && !(idx == SIGNCMD_UNPLACE && id == -2))
+ {
+ if (lnum >= 0 || sign_name != NULL)
+ EMSG(_(e_invarg));
+***************
+*** 7074,7084 ****
+ }
+ else if (idx == SIGNCMD_UNPLACE)
+ {
+- /* ":sign unplace {id} file={fname}" */
+ if (lnum >= 0 || sign_name != NULL)
+ EMSG(_(e_invarg));
+ else
+ {
+ lnum = buf_delsign(buf, id);
+ update_debug_sign(buf, lnum);
+ }
+--- 7084,7100 ----
+ }
+ else if (idx == SIGNCMD_UNPLACE)
+ {
+ if (lnum >= 0 || sign_name != NULL)
+ EMSG(_(e_invarg));
++ else if (id == -2)
++ {
++ /* ":sign unplace * file={fname}" */
++ redraw_buf_later(buf, NOT_VALID);
++ buf_delete_signs(buf);
++ }
+ else
+ {
++ /* ":sign unplace {id} file={fname}" */
+ lnum = buf_delsign(buf, id);
+ update_debug_sign(buf, lnum);
+ }
+*** ../vim-7.3.595/src/proto/buffer.pro 2012-02-22 14:58:24.000000000 +0100
+--- src/proto/buffer.pro 2012-07-10 15:06:10.000000000 +0200
+***************
+*** 60,65 ****
+--- 60,66 ----
+ int buf_findsign_id __ARGS((buf_T *buf, linenr_T lnum));
+ int buf_findsigntype_id __ARGS((buf_T *buf, linenr_T lnum, int typenr));
+ int buf_signcount __ARGS((buf_T *buf, linenr_T lnum));
++ void buf_delete_signs __ARGS((buf_T *buf));
+ void buf_delete_all_signs __ARGS((void));
+ void sign_list_placed __ARGS((buf_T *rbuf));
+ void sign_mark_adjust __ARGS((linenr_T line1, linenr_T line2, long amount, long amount_after));
+*** ../vim-7.3.595/src/version.c 2012-07-10 14:56:42.000000000 +0200
+--- src/version.c 2012-07-10 15:16:40.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 596,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+105. When someone asks you for your address, you tell them your URL.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.597
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.597
+Problem: 'clipboard' "autoselect" only applies to the * register. (Sergey
+ Vakulenko)
+Solution: Make 'autoselect' work for the + register. (Christian Brabant)
+ Add the "autoselectplus" option in 'clipboard' and the "P" flag in
+ 'guioptions'.
+Files: runtime/doc/options.txt, src/normal.c, src/ops.c, src/screen.c,
+ src/ui.c, src/globals.h, src/proto/ui.pro, src/option.h, src/gui.c
+
+
+*** ../vim-7.3.596/runtime/doc/options.txt 2012-02-20 22:18:23.000000000 +0100
+--- runtime/doc/options.txt 2012-07-10 15:40:35.000000000 +0200
+***************
+*** 1437,1442 ****
+--- 1452,1458 ----
+ This option is a list of comma separated names.
+ These names are recognized:
+
++ *clipboard-unnamed*
+ unnamed When included, Vim will use the clipboard register '*'
+ for all yank, delete, change and put operations which
+ would normally go to the unnamed register. When a
+***************
+*** 1446,1460 ****
+ explicitly accessed using the "* notation. Also see
+ |gui-clipboard|.
+
+ unnamedplus A variant of "unnamed" flag which uses the clipboard
+ register '+' (|quoteplus|) instead of register '*' for
+ all operations except yank. Yank shall copy the text
+ into register '+' and also into '*' when "unnamed" is
+ included.
+! Only available with the |+x11| feature.
+ Availability can be checked with: >
+ if has('unnamedplus')
+ <
+ autoselect Works like the 'a' flag in 'guioptions': If present,
+ then whenever Visual mode is started, or the Visual
+ area extended, Vim tries to become the owner of the
+--- 1462,1478 ----
+ explicitly accessed using the "* notation. Also see
+ |gui-clipboard|.
+
++ *clipboard-unnamedplus*
+ unnamedplus A variant of "unnamed" flag which uses the clipboard
+ register '+' (|quoteplus|) instead of register '*' for
+ all operations except yank. Yank shall copy the text
+ into register '+' and also into '*' when "unnamed" is
+ included.
+! Only available with the |+X11| feature.
+ Availability can be checked with: >
+ if has('unnamedplus')
+ <
++ *clipboard-autoselect*
+ autoselect Works like the 'a' flag in 'guioptions': If present,
+ then whenever Visual mode is started, or the Visual
+ area extended, Vim tries to become the owner of the
+***************
+*** 1466,1474 ****
+--- 1484,1499 ----
+ "autoselect" flag is used.
+ Also applies to the modeless selection.
+
++ *clipboard-autoselectplus*
++ autoselectplus Like "autoselect" but using the + register instead of
++ the * register. Compare to the 'P' flag in
++ 'guioptions'.
++
++ *clipboard-autoselectml*
+ autoselectml Like "autoselect", but for the modeless selection
+ only. Compare to the 'A' flag in 'guioptions'.
+
++ *clipboard-html*
+ html When the clipboard contains HTML, use this when
+ pasting. When putting text on the clipboard, mark it
+ as HTML. This works to copy rendered HTML from
+***************
+*** 1479,1484 ****
+--- 1504,1510 ----
+ Only supported for GTK version 2 and later.
+ Only available with the |+multi_byte| feature.
+
++ *clipboard-exclude*
+ exclude:{pattern}
+ Defines a pattern that is matched against the name of
+ the terminal 'term'. If there is a match, no
+***************
+*** 3547,3552 ****
+--- 3600,3608 ----
+ windowing system's global selection unless explicitly told to
+ by a yank or delete operation for the "* register.
+ The same applies to the modeless selection.
++ *'go-P'*
++ 'P' Like autoselect but using the "+ register instead of the "*
++ register.
+ *'go-A'*
+ 'A' Autoselect for the modeless selection. Like 'a', but only
+ applies to the modeless selection.
+*** ../vim-7.3.596/src/normal.c 2012-06-29 13:56:01.000000000 +0200
+--- src/normal.c 2012-07-10 15:44:24.000000000 +0200
+***************
+*** 1451,1457 ****
+ * This could call do_pending_operator() recursively, but that's OK
+ * because gui_yank will be TRUE for the nested call.
+ */
+! if (clip_star.available
+ && oap->op_type != OP_NOP
+ && !gui_yank
+ # ifdef FEAT_VISUAL
+--- 1451,1457 ----
+ * This could call do_pending_operator() recursively, but that's OK
+ * because gui_yank will be TRUE for the nested call.
+ */
+! if ((clip_star.available || clip_plus.available)
+ && oap->op_type != OP_NOP
+ && !gui_yank
+ # ifdef FEAT_VISUAL
+*** ../vim-7.3.596/src/ops.c 2012-06-29 13:34:15.000000000 +0200
+--- src/ops.c 2012-07-10 16:20:29.000000000 +0200
+***************
+*** 962,969 ****
+ * selection too. */
+ if (name == '*' && clip_star.available)
+ {
+! if (clip_isautosel())
+! clip_update_selection();
+ may_get_selection(name);
+ }
+ #endif
+--- 962,975 ----
+ * selection too. */
+ if (name == '*' && clip_star.available)
+ {
+! if (clip_isautosel_star())
+! clip_update_selection(&clip_star);
+! may_get_selection(name);
+! }
+! if (name == '+' && clip_plus.available)
+! {
+! if (clip_isautosel_plus())
+! clip_update_selection(&clip_plus);
+ may_get_selection(name);
+ }
+ #endif
+***************
+*** 3190,3196 ****
+
+ clip_own_selection(&clip_plus);
+ clip_gen_set_selection(&clip_plus);
+! if (!clip_isautosel() && !did_star && curr == &(y_regs[PLUS_REGISTER]))
+ {
+ copy_yank_reg(&(y_regs[STAR_REGISTER]));
+ clip_own_selection(&clip_star);
+--- 3196,3203 ----
+
+ clip_own_selection(&clip_plus);
+ clip_gen_set_selection(&clip_plus);
+! if (!clip_isautosel_star() && !did_star
+! && curr == &(y_regs[PLUS_REGISTER]))
+ {
+ copy_yank_reg(&(y_regs[STAR_REGISTER]));
+ clip_own_selection(&clip_star);
+*** ../vim-7.3.596/src/screen.c 2012-06-13 18:06:32.000000000 +0200
+--- src/screen.c 2012-07-10 16:39:01.000000000 +0200
+***************
+*** 519,526 ****
+ # endif
+ # ifdef FEAT_CLIPBOARD
+ /* When Visual area changed, may have to update selection. */
+! if (clip_star.available && clip_isautosel())
+! clip_update_selection();
+ # endif
+ #ifdef FEAT_GUI
+ /* Remove the cursor before starting to do anything, because
+--- 519,528 ----
+ # endif
+ # ifdef FEAT_CLIPBOARD
+ /* When Visual area changed, may have to update selection. */
+! if (clip_star.available && clip_isautosel_star())
+! clip_update_selection(&clip_star);
+! if (clip_plus.available && clip_isautosel_plus())
+! clip_update_selection(&clip_plus);
+ # endif
+ #ifdef FEAT_GUI
+ /* Remove the cursor before starting to do anything, because
+***************
+*** 814,821 ****
+
+ #ifdef FEAT_CLIPBOARD
+ /* When Visual area changed, may have to update selection. */
+! if (clip_star.available && clip_isautosel())
+! clip_update_selection();
+ #endif
+
+ win_update(wp);
+--- 816,825 ----
+
+ #ifdef FEAT_CLIPBOARD
+ /* When Visual area changed, may have to update selection. */
+! if (clip_star.available && clip_isautosel_star())
+! clip_update_selection(&clip_star);
+! if (clip_plus.available && clip_isautosel_plus())
+! clip_update_selection(&clip_plus);
+ #endif
+
+ win_update(wp);
+***************
+*** 3000,3006 ****
+ area_highlighting = TRUE;
+ attr = hl_attr(HLF_V);
+ #if defined(FEAT_CLIPBOARD) && defined(FEAT_X11)
+! if (clip_star.available && !clip_star.owned && clip_isautosel())
+ attr = hl_attr(HLF_VNC);
+ #endif
+ }
+--- 3004,3013 ----
+ area_highlighting = TRUE;
+ attr = hl_attr(HLF_V);
+ #if defined(FEAT_CLIPBOARD) && defined(FEAT_X11)
+! if ((clip_star.available && !clip_star.owned
+! && clip_isautosel_star())
+! || (clip_plus.available && !clip_plus.owned
+! && clip_isautosel_plus()))
+ attr = hl_attr(HLF_VNC);
+ #endif
+ }
+***************
+*** 9060,9066 ****
+ || (wp != NULL && wp->w_width != Columns)
+ # endif
+ )
+! clip_clear_selection();
+ else
+ clip_scroll_selection(-line_count);
+ #endif
+--- 9067,9073 ----
+ || (wp != NULL && wp->w_width != Columns)
+ # endif
+ )
+! clip_clear_selection(&clip_star);
+ else
+ clip_scroll_selection(-line_count);
+ #endif
+***************
+*** 9281,9287 ****
+ || (wp != NULL && wp->w_width != Columns)
+ # endif
+ )
+! clip_clear_selection();
+ else
+ clip_scroll_selection(line_count);
+ #endif
+--- 9288,9294 ----
+ || (wp != NULL && wp->w_width != Columns)
+ # endif
+ )
+! clip_clear_selection(&clip_star);
+ else
+ clip_scroll_selection(line_count);
+ #endif
+*** ../vim-7.3.596/src/ui.c 2012-02-12 01:35:06.000000000 +0100
+--- src/ui.c 2012-07-10 16:43:17.000000000 +0200
+***************
+*** 381,386 ****
+--- 381,388 ----
+
+ #if defined(FEAT_CLIPBOARD) || defined(PROTO)
+
++ static void clip_copy_selection __ARGS((VimClipboard *clip));
++
+ /*
+ * Selection stuff using Visual mode, for cutting and pasting text to other
+ * windows.
+***************
+*** 423,431 ****
+ * this is called whenever VIsual mode is ended.
+ */
+ void
+! clip_update_selection()
+ {
+! pos_T start, end;
+
+ /* If visual mode is only due to a redo command ("."), then ignore it */
+ if (!redo_VIsual_busy && VIsual_active && (State & NORMAL))
+--- 425,434 ----
+ * this is called whenever VIsual mode is ended.
+ */
+ void
+! clip_update_selection(clip)
+! VimClipboard *clip;
+ {
+! pos_T start, end;
+
+ /* If visual mode is only due to a redo command ("."), then ignore it */
+ if (!redo_VIsual_busy && VIsual_active && (State & NORMAL))
+***************
+*** 444,460 ****
+ start = curwin->w_cursor;
+ end = VIsual;
+ }
+! if (!equalpos(clip_star.start, start)
+! || !equalpos(clip_star.end, end)
+! || clip_star.vmode != VIsual_mode)
+ {
+! clip_clear_selection();
+! clip_star.start = start;
+! clip_star.end = end;
+! clip_star.vmode = VIsual_mode;
+! clip_free_selection(&clip_star);
+! clip_own_selection(&clip_star);
+! clip_gen_set_selection(&clip_star);
+ }
+ }
+ }
+--- 447,463 ----
+ start = curwin->w_cursor;
+ end = VIsual;
+ }
+! if (!equalpos(clip->start, start)
+! || !equalpos(clip->end, end)
+! || clip->vmode != VIsual_mode)
+ {
+! clip_clear_selection(clip);
+! clip->start = start;
+! clip->end = end;
+! clip->vmode = VIsual_mode;
+! clip_free_selection(clip);
+! clip_own_selection(clip);
+! clip_gen_set_selection(clip);
+ }
+ }
+ }
+***************
+*** 475,481 ****
+ int was_owned = cbd->owned;
+
+ cbd->owned = (clip_gen_own_selection(cbd) == OK);
+! if (!was_owned && cbd == &clip_star)
+ {
+ /* May have to show a different kind of highlighting for the
+ * selected area. There is no specific redraw command for this,
+--- 478,484 ----
+ int was_owned = cbd->owned;
+
+ cbd->owned = (clip_gen_own_selection(cbd) == OK);
+! if (!was_owned && (cbd == &clip_star || cbd == &clip_plus))
+ {
+ /* May have to show a different kind of highlighting for the
+ * selected area. There is no specific redraw command for this,
+***************
+*** 483,489 ****
+ if (cbd->owned
+ && (get_real_state() == VISUAL
+ || get_real_state() == SELECTMODE)
+! && clip_isautosel()
+ && hl_attr(HLF_V) != hl_attr(HLF_VNC))
+ redraw_curbuf_later(INVERTED_ALL);
+ }
+--- 486,493 ----
+ if (cbd->owned
+ && (get_real_state() == VISUAL
+ || get_real_state() == SELECTMODE)
+! && (cbd == &clip_star ? clip_isautosel_star()
+! : clip_isautosel_plus())
+ && hl_attr(HLF_V) != hl_attr(HLF_VNC))
+ redraw_curbuf_later(INVERTED_ALL);
+ }
+***************
+*** 502,513 ****
+ #ifdef FEAT_X11
+ int was_owned = cbd->owned;
+ #endif
+! int visual_selection = (cbd == &clip_star);
+
+ clip_free_selection(cbd);
+ cbd->owned = FALSE;
+ if (visual_selection)
+! clip_clear_selection();
+ clip_gen_lose_selection(cbd);
+ #ifdef FEAT_X11
+ if (visual_selection)
+--- 506,520 ----
+ #ifdef FEAT_X11
+ int was_owned = cbd->owned;
+ #endif
+! int visual_selection = FALSE;
+!
+! if (cbd == &clip_star || cbd == &clip_plus)
+! visual_selection = TRUE;
+
+ clip_free_selection(cbd);
+ cbd->owned = FALSE;
+ if (visual_selection)
+! clip_clear_selection(cbd);
+ clip_gen_lose_selection(cbd);
+ #ifdef FEAT_X11
+ if (visual_selection)
+***************
+*** 518,524 ****
+ if (was_owned
+ && (get_real_state() == VISUAL
+ || get_real_state() == SELECTMODE)
+! && clip_isautosel()
+ && hl_attr(HLF_V) != hl_attr(HLF_VNC))
+ {
+ update_curbuf(INVERTED_ALL);
+--- 525,532 ----
+ if (was_owned
+ && (get_real_state() == VISUAL
+ || get_real_state() == SELECTMODE)
+! && (cbd == &clip_star ?
+! clip_isautosel_star() : clip_isautosel_plus())
+ && hl_attr(HLF_V) != hl_attr(HLF_VNC))
+ {
+ update_curbuf(INVERTED_ALL);
+***************
+*** 534,551 ****
+ #endif
+ }
+
+! void
+! clip_copy_selection()
+! {
+! if (VIsual_active && (State & NORMAL) && clip_star.available)
+! {
+! if (clip_isautosel())
+! clip_update_selection();
+! clip_free_selection(&clip_star);
+! clip_own_selection(&clip_star);
+! if (clip_star.owned)
+! clip_get_selection(&clip_star);
+! clip_gen_set_selection(&clip_star);
+ }
+ }
+
+--- 542,559 ----
+ #endif
+ }
+
+! static void
+! clip_copy_selection(clip)
+! VimClipboard *clip;
+! {
+! if (VIsual_active && (State & NORMAL) && clip->available)
+! {
+! clip_update_selection(clip);
+! clip_free_selection(clip);
+! clip_own_selection(clip);
+! if (clip->owned)
+! clip_get_selection(clip);
+! clip_gen_set_selection(clip);
+ }
+ }
+
+***************
+*** 555,575 ****
+ void
+ clip_auto_select()
+ {
+! if (clip_isautosel())
+! clip_copy_selection();
+ }
+
+ /*
+! * Return TRUE if automatic selection of Visual area is desired.
+ */
+ int
+! clip_isautosel()
+ {
+ return (
+ #ifdef FEAT_GUI
+ gui.in_use ? (vim_strchr(p_go, GO_ASEL) != NULL) :
+ #endif
+! clip_autoselect);
+ }
+
+
+--- 563,600 ----
+ void
+ clip_auto_select()
+ {
+! if (clip_isautosel_star())
+! clip_copy_selection(&clip_star);
+! if (clip_isautosel_plus())
+! clip_copy_selection(&clip_plus);
+ }
+
+ /*
+! * Return TRUE if automatic selection of Visual area is desired for the *
+! * register.
+ */
+ int
+! clip_isautosel_star()
+ {
+ return (
+ #ifdef FEAT_GUI
+ gui.in_use ? (vim_strchr(p_go, GO_ASEL) != NULL) :
+ #endif
+! clip_autoselect_star);
+! }
+!
+! /*
+! * Return TRUE if automatic selection of Visual area is desired for the +
+! * register.
+! */
+! int
+! clip_isautosel_plus()
+! {
+! return (
+! #ifdef FEAT_GUI
+! gui.in_use ? (vim_strchr(p_go, GO_ASELPLUS) != NULL) :
+! #endif
+! clip_autoselect_plus);
+ }
+
+
+***************
+*** 657,663 ****
+ VimClipboard *cb = &clip_star;
+
+ if (cb->state == SELECT_DONE)
+! clip_clear_selection();
+
+ row = check_row(row);
+ col = check_col(col);
+--- 682,688 ----
+ VimClipboard *cb = &clip_star;
+
+ if (cb->state == SELECT_DONE)
+! clip_clear_selection(cb);
+
+ row = check_row(row);
+ col = check_col(col);
+***************
+*** 749,755 ****
+ printf("Selection ended: (%u,%u) to (%u,%u)\n", cb->start.lnum,
+ cb->start.col, cb->end.lnum, cb->end.col);
+ #endif
+! if (clip_isautosel()
+ || (
+ #ifdef FEAT_GUI
+ gui.in_use ? (vim_strchr(p_go, GO_ASELML) != NULL) :
+--- 774,780 ----
+ printf("Selection ended: (%u,%u) to (%u,%u)\n", cb->start.lnum,
+ cb->start.col, cb->end.lnum, cb->end.col);
+ #endif
+! if (clip_isautosel_star()
+ || (
+ #ifdef FEAT_GUI
+ gui.in_use ? (vim_strchr(p_go, GO_ASELML) != NULL) :
+***************
+*** 932,947 ****
+ * Called from outside to clear selected region from the display
+ */
+ void
+! clip_clear_selection()
+ {
+- VimClipboard *cb = &clip_star;
+
+! if (cb->state == SELECT_CLEARED)
+ return;
+
+! clip_invert_area((int)cb->start.lnum, cb->start.col, (int)cb->end.lnum,
+! cb->end.col, CLIP_CLEAR);
+! cb->state = SELECT_CLEARED;
+ }
+
+ /*
+--- 957,972 ----
+ * Called from outside to clear selected region from the display
+ */
+ void
+! clip_clear_selection(cbd)
+! VimClipboard *cbd;
+ {
+
+! if (cbd->state == SELECT_CLEARED)
+ return;
+
+! clip_invert_area((int)cbd->start.lnum, cbd->start.col, (int)cbd->end.lnum,
+! cbd->end.col, CLIP_CLEAR);
+! cbd->state = SELECT_CLEARED;
+ }
+
+ /*
+***************
+*** 954,960 ****
+ if (clip_star.state == SELECT_DONE
+ && row2 >= clip_star.start.lnum
+ && row1 <= clip_star.end.lnum)
+! clip_clear_selection();
+ }
+
+ /*
+--- 979,985 ----
+ if (clip_star.state == SELECT_DONE
+ && row2 >= clip_star.start.lnum
+ && row1 <= clip_star.end.lnum)
+! clip_clear_selection(&clip_star);
+ }
+
+ /*
+*** ../vim-7.3.596/src/globals.h 2012-06-29 12:35:40.000000000 +0200
+--- src/globals.h 2012-07-10 16:35:13.000000000 +0200
+***************
+*** 517,523 ****
+ # define CLIP_UNNAMED_PLUS 2
+ EXTERN int clip_unnamed INIT(= 0); /* above two values or'ed */
+
+! EXTERN int clip_autoselect INIT(= FALSE);
+ EXTERN int clip_autoselectml INIT(= FALSE);
+ EXTERN int clip_html INIT(= FALSE);
+ EXTERN regprog_T *clip_exclude_prog INIT(= NULL);
+--- 517,524 ----
+ # define CLIP_UNNAMED_PLUS 2
+ EXTERN int clip_unnamed INIT(= 0); /* above two values or'ed */
+
+! EXTERN int clip_autoselect_star INIT(= FALSE);
+! EXTERN int clip_autoselect_plus INIT(= FALSE);
+ EXTERN int clip_autoselectml INIT(= FALSE);
+ EXTERN int clip_html INIT(= FALSE);
+ EXTERN regprog_T *clip_exclude_prog INIT(= NULL);
+*** ../vim-7.3.596/src/proto/ui.pro 2010-08-15 21:57:28.000000000 +0200
+--- src/proto/ui.pro 2012-07-10 16:37:35.000000000 +0200
+***************
+*** 11,27 ****
+ void ui_new_shellsize __ARGS((void));
+ void ui_breakcheck __ARGS((void));
+ void clip_init __ARGS((int can_use));
+! void clip_update_selection __ARGS((void));
+ void clip_own_selection __ARGS((VimClipboard *cbd));
+ void clip_lose_selection __ARGS((VimClipboard *cbd));
+- void clip_copy_selection __ARGS((void));
+ void clip_auto_select __ARGS((void));
+! int clip_isautosel __ARGS((void));
+ void clip_modeless __ARGS((int button, int is_click, int is_drag));
+ void clip_start_selection __ARGS((int col, int row, int repeated_click));
+ void clip_process_selection __ARGS((int button, int col, int row, int_u repeated_click));
+ void clip_may_redraw_selection __ARGS((int row, int col, int len));
+! void clip_clear_selection __ARGS((void));
+ void clip_may_clear_selection __ARGS((int row1, int row2));
+ void clip_scroll_selection __ARGS((int rows));
+ void clip_copy_modeless_selection __ARGS((int both));
+--- 11,27 ----
+ void ui_new_shellsize __ARGS((void));
+ void ui_breakcheck __ARGS((void));
+ void clip_init __ARGS((int can_use));
+! void clip_update_selection __ARGS((VimClipboard *clip));
+ void clip_own_selection __ARGS((VimClipboard *cbd));
+ void clip_lose_selection __ARGS((VimClipboard *cbd));
+ void clip_auto_select __ARGS((void));
+! int clip_isautosel_star __ARGS((void));
+! int clip_isautosel_plus __ARGS((void));
+ void clip_modeless __ARGS((int button, int is_click, int is_drag));
+ void clip_start_selection __ARGS((int col, int row, int repeated_click));
+ void clip_process_selection __ARGS((int button, int col, int row, int_u repeated_click));
+ void clip_may_redraw_selection __ARGS((int row, int col, int len));
+! void clip_clear_selection __ARGS((VimClipboard *cbd));
+ void clip_may_clear_selection __ARGS((int row1, int row2));
+ void clip_scroll_selection __ARGS((int rows));
+ void clip_copy_modeless_selection __ARGS((int both));
+*** ../vim-7.3.596/src/option.h 2012-06-06 16:12:54.000000000 +0200
+--- src/option.h 2012-07-10 15:54:32.000000000 +0200
+***************
+*** 229,234 ****
+--- 229,235 ----
+ #define GO_MENUS 'm' /* use menu bar */
+ #define GO_NOSYSMENU 'M' /* don't source system menu */
+ #define GO_POINTER 'p' /* pointer enter/leave callbacks */
++ #define GO_ASELPLUS 'P' /* autoselectPlus */
+ #define GO_RIGHT 'r' /* use right scrollbar */
+ #define GO_VRIGHT 'R' /* right scrollbar with vert split */
+ #define GO_TEAROFF 't' /* add tear-off menu items */
+*** ../vim-7.3.596/src/gui.c 2012-05-27 00:37:45.000000000 +0200
+--- src/gui.c 2012-07-10 16:43:34.000000000 +0200
+***************
+*** 3154,3160 ****
+ }
+
+ if (clip_star.state != SELECT_CLEARED && !did_clip)
+! clip_clear_selection();
+ #endif
+
+ /* Don't put events in the input queue now. */
+--- 3154,3160 ----
+ }
+
+ if (clip_star.state != SELECT_CLEARED && !did_clip)
+! clip_clear_selection(&clip_star);
+ #endif
+
+ /* Don't put events in the input queue now. */
+*** ../vim-7.3.596/src/version.c 2012-07-10 15:18:18.000000000 +0200
+--- src/version.c 2012-07-10 16:32:16.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 597,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+106. When told to "go to your room" you inform your parents that you
+ can't...because you were kicked out and banned.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.598
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.598
+Problem: Cannot act upon end of completion. (Taro Muraoka)
+Solution: Add an autocommand event that is triggered when completion has
+ finished. (Idea by Florian Klein)
+Files: src/edit.c, src/fileio.c, src/vim.h
+
+
+*** ../vim-7.3.597/src/edit.c 2012-07-06 13:36:36.000000000 +0200
+--- src/edit.c 2012-07-10 17:02:37.000000000 +0200
+***************
+*** 3824,3829 ****
+--- 3824,3834 ----
+ if (want_cindent && in_cinkeys(KEY_COMPLETE, ' ', inindent(0)))
+ do_c_expr_indent();
+ #endif
++ #ifdef FEAT_AUTOCMD
++ /* Trigger the CompleteDone event to give scripts a chance to act
++ * upon the completion. */
++ apply_autocmds(EVENT_COMPLETEDONE, NULL, NULL, FALSE, curbuf);
++ #endif
+ }
+ }
+
+*** ../vim-7.3.597/src/fileio.c 2012-06-13 14:28:16.000000000 +0200
+--- src/fileio.c 2012-07-10 17:05:51.000000000 +0200
+***************
+*** 7643,7648 ****
+--- 7643,7649 ----
+ {"CmdwinEnter", EVENT_CMDWINENTER},
+ {"CmdwinLeave", EVENT_CMDWINLEAVE},
+ {"ColorScheme", EVENT_COLORSCHEME},
++ {"CompleteDone", EVENT_COMPLETEDONE},
+ {"CursorHold", EVENT_CURSORHOLD},
+ {"CursorHoldI", EVENT_CURSORHOLDI},
+ {"CursorMoved", EVENT_CURSORMOVED},
+*** ../vim-7.3.597/src/vim.h 2012-07-10 13:41:09.000000000 +0200
+--- src/vim.h 2012-07-10 17:06:24.000000000 +0200
+***************
+*** 1241,1246 ****
+--- 1241,1247 ----
+ EVENT_CMDWINENTER, /* after entering the cmdline window */
+ EVENT_CMDWINLEAVE, /* before leaving the cmdline window */
+ EVENT_COLORSCHEME, /* after loading a colorscheme */
++ EVENT_COMPLETEDONE, /* after finishing insert complete */
+ EVENT_FILEAPPENDPOST, /* after appending to a file */
+ EVENT_FILEAPPENDPRE, /* before appending to a file */
+ EVENT_FILEAPPENDCMD, /* append to a file using command */
+*** ../vim-7.3.597/src/version.c 2012-07-10 16:49:08.000000000 +0200
+--- src/version.c 2012-07-10 17:08:41.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 598,
+ /**/
+
+--
+Laughing helps. It's like jogging on the inside.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.599
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.599 (after 7.3.597)
+Problem: Missing change in one file.
+Solution: Patch for changed clip_autoselect().
+Files: src/option.c
+
+
+*** ../vim-7.3.598/src/option.c 2012-06-29 15:51:26.000000000 +0200
+--- src/option.c 2012-07-10 16:35:07.000000000 +0200
+***************
+*** 7377,7383 ****
+ check_clipboard_option()
+ {
+ int new_unnamed = 0;
+! int new_autoselect = FALSE;
+ int new_autoselectml = FALSE;
+ int new_html = FALSE;
+ regprog_T *new_exclude_prog = NULL;
+--- 7377,7384 ----
+ check_clipboard_option()
+ {
+ int new_unnamed = 0;
+! int new_autoselect_star = FALSE;
+! int new_autoselect_plus = FALSE;
+ int new_autoselectml = FALSE;
+ int new_html = FALSE;
+ regprog_T *new_exclude_prog = NULL;
+***************
+*** 7398,7410 ****
+ p += 11;
+ }
+ else if (STRNCMP(p, "autoselect", 10) == 0
+! && (p[10] == ',' || p[10] == NUL))
+ {
+! new_autoselect = TRUE;
+ p += 10;
+ }
+ else if (STRNCMP(p, "autoselectml", 12) == 0
+! && (p[12] == ',' || p[12] == NUL))
+ {
+ new_autoselectml = TRUE;
+ p += 12;
+--- 7399,7417 ----
+ p += 11;
+ }
+ else if (STRNCMP(p, "autoselect", 10) == 0
+! && (p[10] == ',' || p[10] == NUL))
+ {
+! new_autoselect_star = TRUE;
+ p += 10;
+ }
++ else if (STRNCMP(p, "autoselectplus", 14) == 0
++ && (p[14] == ',' || p[14] == NUL))
++ {
++ new_autoselect_plus = TRUE;
++ p += 14;
++ }
+ else if (STRNCMP(p, "autoselectml", 12) == 0
+! && (p[12] == ',' || p[12] == NUL))
+ {
+ new_autoselectml = TRUE;
+ p += 12;
+***************
+*** 7433,7439 ****
+ if (errmsg == NULL)
+ {
+ clip_unnamed = new_unnamed;
+! clip_autoselect = new_autoselect;
+ clip_autoselectml = new_autoselectml;
+ clip_html = new_html;
+ vim_free(clip_exclude_prog);
+--- 7440,7447 ----
+ if (errmsg == NULL)
+ {
+ clip_unnamed = new_unnamed;
+! clip_autoselect_star = new_autoselect_star;
+! clip_autoselect_plus = new_autoselect_plus;
+ clip_autoselectml = new_autoselectml;
+ clip_html = new_html;
+ vim_free(clip_exclude_prog);
+*** ../vim-7.3.598/src/version.c 2012-07-10 17:14:50.000000000 +0200
+--- src/version.c 2012-07-10 18:30:17.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 599,
+ /**/
+
+--
+hundred-and-one symptoms of being an internet addict:
+108. While reading a magazine, you look for the Zoom icon for a better
+ look at a photograph.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--- /dev/null
+To: vim_dev@googlegroups.com
+Subject: Patch 7.3.600
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.3.600
+Problem: <f-args> is not expanded properly with DBCS encoding.
+Solution: Skip over character instead of byte. (Yukihiro Nakadaira)
+Files: src/ex_docmd.c
+
+
+*** ../vim-7.3.599/src/ex_docmd.c 2012-07-06 18:27:34.000000000 +0200
+--- src/ex_docmd.c 2012-07-10 19:20:10.000000000 +0200
+***************
+*** 5845,5852 ****
+--- 5845,5858 ----
+ }
+ else
+ {
++ #ifdef FEAT_MBYTE
++ int charlen = (*mb_ptr2len)(p);
++ len += charlen;
++ p += charlen;
++ #else
+ ++len;
+ ++p;
++ #endif
+ }
+ }
+
+***************
+*** 5889,5895 ****
+ }
+ else
+ {
+! *q++ = *p++;
+ }
+ }
+ *q++ = '"';
+--- 5895,5901 ----
+ }
+ else
+ {
+! MB_COPY_CHAR(p, q);
+ }
+ }
+ *q++ = '"';
+*** ../vim-7.3.599/src/version.c 2012-07-10 18:31:49.000000000 +0200
+--- src/version.c 2012-07-10 19:21:29.000000000 +0200
+***************
+*** 716,717 ****
+--- 716,719 ----
+ { /* Add new patch number below this line */
++ /**/
++ 600,
+ /**/
+
+--
+In a world without walls and borders, who needs windows and gates?
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
ver=$(curl -s $baseurl/MD5SUMS | grep -vF .gz | tail -n1 | awk '{print $2}')
fi
-# cvs up specfile, rename in case of conflicts
-cvs up $specfile || { set -x; mv -b $specfile $specfile.old; }
+# update specfile, fail on conflicts
+#git pull --rebase || exit 1
curpatch=$(awk '/^%define[ ]+patchlevel[ ]+/{print $NF}' $specfile)
curver=$basever.$curpatch
" $specfile
WGET_OPTS="-nv" ../builder -g $specfile
- cvs -Q add $basever.??? || :
+ git add $basever.??? || :
if [ "$build_package" != 0 ]; then
dist=$(rpm -E %{pld_release})
# curl -s ftp://ftp.vim.org/pub/editors/vim/patches/7.3/MD5SUMS | grep -vF .gz | tail -n1 | awk '{print $2}'
%define ver 7.3
-%define patchlevel 515
+%define patchlevel 600
%define rel 1
Summary: Vi IMproved - a Vi clone
Summary(de.UTF-8): VIsual editor iMproved