From b9b7f2ada7b5263d36b9eeab062923c8e8bab8b5 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:45 +0200 Subject: [PATCH 01/87] - patchlevel 557 --- 7.3.557 | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 7.3.557 diff --git a/7.3.557 b/7.3.557 new file mode 100644 index 00000000..663c0720 --- /dev/null +++ b/7.3.557 @@ -0,0 +1,99 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.557 +Fcc: outbox +From: Bram Moolenaar +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 /// From ea8c32a517b08b8e6b33682fb4e0011ef04dda2b Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:45 +0200 Subject: [PATCH 02/87] - patchlevel 558 --- 7.3.558 | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 7.3.558 diff --git a/7.3.558 b/7.3.558 new file mode 100644 index 00000000..015bc37d --- /dev/null +++ b/7.3.558 @@ -0,0 +1,90 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.558 +Fcc: outbox +From: Bram Moolenaar +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 /// From 483b17cadf607ce02cfceace88ffde69f6c68db1 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:46 +0200 Subject: [PATCH 03/87] - patchlevel 559 --- 7.3.559 | 131 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 7.3.559 diff --git a/7.3.559 b/7.3.559 new file mode 100644 index 00000000..df767372 --- /dev/null +++ b/7.3.559 @@ -0,0 +1,131 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.559 +Fcc: outbox +From: Bram Moolenaar +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 /// From 8dc95434fca396a7a28ab32db84443b39ef53bfb Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:46 +0200 Subject: [PATCH 04/87] - patchlevel 560 --- 7.3.560 | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 7.3.560 diff --git a/7.3.560 b/7.3.560 new file mode 100644 index 00000000..7f464111 --- /dev/null +++ b/7.3.560 @@ -0,0 +1,49 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.560 +Fcc: outbox +From: Bram Moolenaar +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 /// From 1be8c13f3644184ad0519884cf7c80e924ade47a Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:46 +0200 Subject: [PATCH 05/87] - patchlevel 561 --- 7.3.561 | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 7.3.561 diff --git a/7.3.561 b/7.3.561 new file mode 100644 index 00000000..d51030c4 --- /dev/null +++ b/7.3.561 @@ -0,0 +1,52 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.561 +Fcc: outbox +From: Bram Moolenaar +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 /// From 8e9175c4b1fc501dc2a861fb7f9fe5940035a988 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:47 +0200 Subject: [PATCH 06/87] - patchlevel 562 --- 7.3.562 | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 7.3.562 diff --git a/7.3.562 b/7.3.562 new file mode 100644 index 00000000..626de495 --- /dev/null +++ b/7.3.562 @@ -0,0 +1,63 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.562 +Fcc: outbox +From: Bram Moolenaar +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 /// From 15e9ce9c7fabde3ccde4db1ee73fc89a4c41598e Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:47 +0200 Subject: [PATCH 07/87] - patchlevel 563 --- 7.3.563 | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 7.3.563 diff --git a/7.3.563 b/7.3.563 new file mode 100644 index 00000000..c2ebf410 --- /dev/null +++ b/7.3.563 @@ -0,0 +1,97 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.563 +Fcc: outbox +From: Bram Moolenaar +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 /// From ed059f5227691fc136091f07468e54b1d3656fa4 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:47 +0200 Subject: [PATCH 08/87] - patchlevel 564 --- 7.3.564 | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 7.3.564 diff --git a/7.3.564 b/7.3.564 new file mode 100644 index 00000000..e806b8e4 --- /dev/null +++ b/7.3.564 @@ -0,0 +1,53 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.564 +Fcc: outbox +From: Bram Moolenaar +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 /// From 62adabf07cbb953c3f11066922f26679619e129f Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:47 +0200 Subject: [PATCH 09/87] - patchlevel 565 --- 7.3.565 | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 7.3.565 diff --git a/7.3.565 b/7.3.565 new file mode 100644 index 00000000..171520b3 --- /dev/null +++ b/7.3.565 @@ -0,0 +1,52 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.566 +Fcc: outbox +From: Bram Moolenaar +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 /// From a960691f22e0f946ec9fab0d58c8bc2322452157 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:48 +0200 Subject: [PATCH 10/87] - patchlevel 566 --- 7.3.566 | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 7.3.566 diff --git a/7.3.566 b/7.3.566 new file mode 100644 index 00000000..a0600e81 --- /dev/null +++ b/7.3.566 @@ -0,0 +1,83 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.566 +Fcc: outbox +From: Bram Moolenaar +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 /// From ca3f180abf281cd3b9321283f7631d64098a483c Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:48 +0200 Subject: [PATCH 11/87] - patchlevel 567 --- 7.3.567 | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 7.3.567 diff --git a/7.3.567 b/7.3.567 new file mode 100644 index 00000000..62399f18 --- /dev/null +++ b/7.3.567 @@ -0,0 +1,56 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.567 +Fcc: outbox +From: Bram Moolenaar +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 +! # Last Change: 2012 Jun 29 +! # +! # Copyright (C) 2003,12 MURAOKA Taro +! # 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 /// From b5c41828238f8ca70aed913fec9b42440081890b Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:48 +0200 Subject: [PATCH 12/87] - patchlevel 568 --- 7.3.568 | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 7.3.568 diff --git a/7.3.568 b/7.3.568 new file mode 100644 index 00000000..ef4fcfe5 --- /dev/null +++ b/7.3.568 @@ -0,0 +1,138 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.568 +Fcc: outbox +From: Bram Moolenaar +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 /// From c73a339d4a5e1ccc26d15a82879f55dac01b83d2 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:49 +0200 Subject: [PATCH 13/87] - patchlevel 569 --- 7.3.569 | 4762 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 4762 insertions(+) create mode 100644 7.3.569 diff --git a/7.3.569 b/7.3.569 new file mode 100644 index 00000000..435733fe --- /dev/null +++ b/7.3.569 @@ -0,0 +1,4762 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.569 +Fcc: outbox +From: Bram Moolenaar +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 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; ili_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; ilist; +! 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 /// From 9cb502da53e4c38b2a7f21883445cf17ec36ae08 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:49 +0200 Subject: [PATCH 14/87] - patchlevel 570 --- 7.3.570 | 145 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 7.3.570 diff --git a/7.3.570 b/7.3.570 new file mode 100644 index 00000000..c644194d --- /dev/null +++ b/7.3.570 @@ -0,0 +1,145 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.570 +Fcc: outbox +From: Bram Moolenaar +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 /// From c6304a1315bc138477ef0348bedc8e77bd8d037f Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:49 +0200 Subject: [PATCH 15/87] - patchlevel 571 --- 7.3.571 | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 7.3.571 diff --git a/7.3.571 b/7.3.571 new file mode 100644 index 00000000..ad62ffc2 --- /dev/null +++ b/7.3.571 @@ -0,0 +1,117 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.571 +Fcc: outbox +From: Bram Moolenaar +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 /// From e663e54606ffc8a7f95863c2a875b11e82f1ceca Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:50 +0200 Subject: [PATCH 16/87] - patchlevel 572 --- 7.3.572 | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 7.3.572 diff --git a/7.3.572 b/7.3.572 new file mode 100644 index 00000000..14fc127e --- /dev/null +++ b/7.3.572 @@ -0,0 +1,59 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.572 +Fcc: outbox +From: Bram Moolenaar +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 /// From 19a29638fc521467ce1c8e49c4387c35bee9a025 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:50 +0200 Subject: [PATCH 17/87] - patchlevel 573 --- 7.3.573 | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 7.3.573 diff --git a/7.3.573 b/7.3.573 new file mode 100644 index 00000000..7734a76a --- /dev/null +++ b/7.3.573 @@ -0,0 +1,52 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.573 +Fcc: outbox +From: Bram Moolenaar +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 /// From 5b6e205026a5a7132ae92cc2e9339fb142502e96 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:50 +0200 Subject: [PATCH 18/87] - patchlevel 574 --- 7.3.574 | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 7.3.574 diff --git a/7.3.574 b/7.3.574 new file mode 100644 index 00000000..e23d818f --- /dev/null +++ b/7.3.574 @@ -0,0 +1,88 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.574 +Fcc: outbox +From: Bram Moolenaar +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 /// From 245678e68db12dcf19b02afea6b4dab1fdeb711c Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:51 +0200 Subject: [PATCH 19/87] - patchlevel 575 --- 7.3.575 | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 7.3.575 diff --git a/7.3.575 b/7.3.575 new file mode 100644 index 00000000..f5d80d72 --- /dev/null +++ b/7.3.575 @@ -0,0 +1,60 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.575 +Fcc: outbox +From: Bram Moolenaar +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 /// From 2229f14429ab41aabf6267ce376359863dc95dcc Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:51 +0200 Subject: [PATCH 20/87] - patchlevel 576 --- 7.3.576 | 255 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 255 insertions(+) create mode 100644 7.3.576 diff --git a/7.3.576 b/7.3.576 new file mode 100644 index 00000000..bc226d90 --- /dev/null +++ b/7.3.576 @@ -0,0 +1,255 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.576 +Fcc: outbox +From: Bram Moolenaar +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 bjA b ++ 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 ++ 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 /// From 275da1f0fc6c7cbb4d1133d8a84a803ed0dea490 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:51 +0200 Subject: [PATCH 21/87] - patchlevel 577 --- 7.3.577 | 273 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 273 insertions(+) create mode 100644 7.3.577 diff --git a/7.3.577 b/7.3.577 new file mode 100644 index 00000000..2929b22d --- /dev/null +++ b/7.3.577 @@ -0,0 +1,273 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.577 +Fcc: outbox +From: Bram Moolenaar +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 /// From 03c1749a1a07ad0ca79e99de62a5ab01a8760125 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:52 +0200 Subject: [PATCH 22/87] - patchlevel 578 --- 7.3.578 | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 7.3.578 diff --git a/7.3.578 b/7.3.578 new file mode 100644 index 00000000..9b0aedd2 --- /dev/null +++ b/7.3.578 @@ -0,0 +1,80 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.578 +Fcc: outbox +From: Bram Moolenaar +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 /// From cfbb2dadc54e0be0f09c3635b13f9a15035494d0 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:52 +0200 Subject: [PATCH 23/87] - patchlevel 579 --- 7.3.579 | 232 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 7.3.579 diff --git a/7.3.579 b/7.3.579 new file mode 100644 index 00000000..ed618fe7 --- /dev/null +++ b/7.3.579 @@ -0,0 +1,232 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.579 +Fcc: outbox +From: Bram Moolenaar +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 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 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 /// From 6db1a8bceb19f33985b6c78c909fb93da66606c5 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:52 +0200 Subject: [PATCH 24/87] - patchlevel 580 --- 7.3.580 | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 7.3.580 diff --git a/7.3.580 b/7.3.580 new file mode 100644 index 00000000..c2c2a537 --- /dev/null +++ b/7.3.580 @@ -0,0 +1,52 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.580 +Fcc: outbox +From: Bram Moolenaar +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 /// From f1fbcb2587a721e36085dc4b3e818d6bd2309b99 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:53 +0200 Subject: [PATCH 25/87] - patchlevel 581 --- 7.3.581 | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 7.3.581 diff --git a/7.3.581 b/7.3.581 new file mode 100644 index 00000000..55300303 --- /dev/null +++ b/7.3.581 @@ -0,0 +1,117 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.581 +Fcc: outbox +From: Bram Moolenaar +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 /// From 15dc315c15222b010279c946cb06c4e9be4420c9 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:53 +0200 Subject: [PATCH 26/87] - patchlevel 582 --- 7.3.582 | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 7.3.582 diff --git a/7.3.582 b/7.3.582 new file mode 100644 index 00000000..4e118a7d --- /dev/null +++ b/7.3.582 @@ -0,0 +1,61 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.582 +Fcc: outbox +From: Bram Moolenaar +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 /// From 1cdf84aa302c87dbe224f71b369eef64f93d37da Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:53 +0200 Subject: [PATCH 27/87] - patchlevel 583 --- 7.3.583 | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 7.3.583 diff --git a/7.3.583 b/7.3.583 new file mode 100644 index 00000000..2ea7f9d2 --- /dev/null +++ b/7.3.583 @@ -0,0 +1,79 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.583 +Fcc: outbox +From: Bram Moolenaar +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 /// From 6d6458a13a7f9795769d3376cbdc57598775abac Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:54 +0200 Subject: [PATCH 28/87] - patchlevel 584 --- 7.3.584 | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 7.3.584 diff --git a/7.3.584 b/7.3.584 new file mode 100644 index 00000000..d7f1bdeb --- /dev/null +++ b/7.3.584 @@ -0,0 +1,134 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.584 +Fcc: outbox +From: Bram Moolenaar +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 /// From bf7002c416b3402cea987009b8409d4f7e32e9fe Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:54 +0200 Subject: [PATCH 29/87] - patchlevel 585 --- 7.3.585 | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 7.3.585 diff --git a/7.3.585 b/7.3.585 new file mode 100644 index 00000000..6509780c --- /dev/null +++ b/7.3.585 @@ -0,0 +1,56 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.585 +Fcc: outbox +From: Bram Moolenaar +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 /// From 7f05cd09dc3ecd98110d7c37e45edbd632fcfce3 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:54 +0200 Subject: [PATCH 30/87] - patchlevel 586 --- 7.3.586 | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 7.3.586 diff --git a/7.3.586 b/7.3.586 new file mode 100644 index 00000000..889ebd13 --- /dev/null +++ b/7.3.586 @@ -0,0 +1,103 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.586 +Fcc: outbox +From: Bram Moolenaar +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 /// From f6516a73f3ea52511d5ce2c29824f9b9b9c7b5ab Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:54 +0200 Subject: [PATCH 31/87] - patchlevel 587 --- 7.3.587 | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 7.3.587 diff --git a/7.3.587 b/7.3.587 new file mode 100644 index 00000000..22252318 --- /dev/null +++ b/7.3.587 @@ -0,0 +1,84 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.587 +Fcc: outbox +From: Bram Moolenaar +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 /// From 0830ea5af2e4133dd4a5b61b6005b3b123b23948 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:55 +0200 Subject: [PATCH 32/87] - patchlevel 588 --- 7.3.588 | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 7.3.588 diff --git a/7.3.588 b/7.3.588 new file mode 100644 index 00000000..6dfabd07 --- /dev/null +++ b/7.3.588 @@ -0,0 +1,85 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.588 +Fcc: outbox +From: Bram Moolenaar +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 /// From 5e4b4c991327ade288c7bd7b58691e168a51a586 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:55 +0200 Subject: [PATCH 33/87] - patchlevel 589 --- 7.3.589 | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 7.3.589 diff --git a/7.3.589 b/7.3.589 new file mode 100644 index 00000000..fdda2b95 --- /dev/null +++ b/7.3.589 @@ -0,0 +1,69 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.589 +Fcc: outbox +From: Bram Moolenaar +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 /// From 53ee8b2ebc099d9956730d5268d8ab7b81afdeb4 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:55 +0200 Subject: [PATCH 34/87] - patchlevel 590 --- 7.3.590 | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 7.3.590 diff --git a/7.3.590 b/7.3.590 new file mode 100644 index 00000000..4e524f79 --- /dev/null +++ b/7.3.590 @@ -0,0 +1,61 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.590 +Fcc: outbox +From: Bram Moolenaar +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 /// From 899dbbe57b91f6648602712a702ee3f8f5ff26ee Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:56 +0200 Subject: [PATCH 35/87] - patchlevel 591 --- 7.3.591 | 208 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 208 insertions(+) create mode 100644 7.3.591 diff --git a/7.3.591 b/7.3.591 new file mode 100644 index 00000000..180fe608 --- /dev/null +++ b/7.3.591 @@ -0,0 +1,208 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.591 +Fcc: outbox +From: Bram Moolenaar +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=tabpagenr()  ++ :tabmove 5 ++ i=tabpagenr()  ++ :tabmove -2 ++ i=tabpagenr()  ++ :tabmove +4 ++ i=tabpagenr()  ++ :tabmove ++ i=tabpagenr()  ++ :tabmove -20 ++ i=tabpagenr()  ++ :tabmove +20 ++ i=tabpagenr()  ++ :3tabmove ++ i=tabpagenr()  ++ :7tabmove 5 ++ i=tabpagenr()  ++ :let a='No error caught.' ++ :try ++ :tabmove foo ++ :catch E474 ++ :let a='E474 caught.' ++ :endtry ++ i=a  ++ :" ++ :" + :/^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 /// From 423a92dbe6fbb1b0a522f2c038d680f3ef31d967 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:56 +0200 Subject: [PATCH 36/87] - patchlevel 592 --- 7.3.592 | 126 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 7.3.592 diff --git a/7.3.592 b/7.3.592 new file mode 100644 index 00000000..be13ef74 --- /dev/null +++ b/7.3.592 @@ -0,0 +1,126 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.592 +Fcc: outbox +From: Bram Moolenaar +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 /// From 57ffee393b2154f13f28c003ee6b7bfc25210042 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:56 +0200 Subject: [PATCH 37/87] - patchlevel 593 --- 7.3.593 | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 7.3.593 diff --git a/7.3.593 b/7.3.593 new file mode 100644 index 00000000..b8f26748 --- /dev/null +++ b/7.3.593 @@ -0,0 +1,81 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.593 +Fcc: outbox +From: Bram Moolenaar +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 /// From efc1cb1a3a4c65642e7fee2e17277c877f6e25f7 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:57 +0200 Subject: [PATCH 38/87] - patchlevel 594 --- 7.3.594 | 171 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 7.3.594 diff --git a/7.3.594 b/7.3.594 new file mode 100644 index 00000000..3f7d3b26 --- /dev/null +++ b/7.3.594 @@ -0,0 +1,171 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.594 +Fcc: outbox +From: Bram Moolenaar +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 /// From ffb01521d78eed238ca22fbb8161121afcfd08fc Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:57 +0200 Subject: [PATCH 39/87] - patchlevel 595 --- 7.3.595 | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 7.3.595 diff --git a/7.3.595 b/7.3.595 new file mode 100644 index 00000000..0fc9b522 --- /dev/null +++ b/7.3.595 @@ -0,0 +1,154 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.595 +Fcc: outbox +From: Bram Moolenaar +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 /// From 4d084147605919a017826bb1500a77541a3a130d Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:57 +0200 Subject: [PATCH 40/87] - patchlevel 596 --- 7.3.596 | 171 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 7.3.596 diff --git a/7.3.596 b/7.3.596 new file mode 100644 index 00000000..59513b2b --- /dev/null +++ b/7.3.596 @@ -0,0 +1,171 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.596 +Fcc: outbox +From: Bram Moolenaar +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 /// From 77fefb6645eafacfc70be15443361c9cc0948f65 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:58 +0200 Subject: [PATCH 41/87] - patchlevel 597 --- 7.3.597 | 720 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 720 insertions(+) create mode 100644 7.3.597 diff --git a/7.3.597 b/7.3.597 new file mode 100644 index 00000000..2a4f0b3d --- /dev/null +++ b/7.3.597 @@ -0,0 +1,720 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.597 +Fcc: outbox +From: Bram Moolenaar +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 /// From 019b29ff5384727d33d424088f386ce970e453a3 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:58 +0200 Subject: [PATCH 42/87] - patchlevel 598 --- 7.3.598 | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 7.3.598 diff --git a/7.3.598 b/7.3.598 new file mode 100644 index 00000000..3a38b4a7 --- /dev/null +++ b/7.3.598 @@ -0,0 +1,73 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.598 +Fcc: outbox +From: Bram Moolenaar +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 /// From b35e8f3fecd66f93f7b5a8aeb70ae31913a6b379 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:58 +0200 Subject: [PATCH 43/87] - patchlevel 599 --- 7.3.599 | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 7.3.599 diff --git a/7.3.599 b/7.3.599 new file mode 100644 index 00000000..adfe6f99 --- /dev/null +++ b/7.3.599 @@ -0,0 +1,107 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.599 +Fcc: outbox +From: Bram Moolenaar +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 /// From b1748bbd9361d3fd894c0ae8f515dec657387f05 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:58 +0200 Subject: [PATCH 44/87] - patchlevel 600 --- 7.3.600 | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 7.3.600 diff --git a/7.3.600 b/7.3.600 new file mode 100644 index 00000000..6504da01 --- /dev/null +++ b/7.3.600 @@ -0,0 +1,68 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.600 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.600 +Problem: 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 /// From 3f5cce6d270022218dc409ad34605694d9f77234 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:59 +0200 Subject: [PATCH 45/87] - patchlevel 601 --- 7.3.601 | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 7.3.601 diff --git a/7.3.601 b/7.3.601 new file mode 100644 index 00000000..b61a9331 --- /dev/null +++ b/7.3.601 @@ -0,0 +1,51 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.601 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.601 +Problem: Bad code style. +Solution: Insert space, remove parens. +Files: src/farsi.c + + +*** ../vim-7.3.600/src/farsi.c 2010-08-15 21:57:28.000000000 +0200 +--- src/farsi.c 2012-07-12 21:59:15.000000000 +0200 +*************** +*** 1813,1819 **** + ptr[i] = toF_leading(ptr[i]); + ++i; + +! while(canF_Rjoin(ptr[i]) && (i < llen)) + { + ptr[i] = toF_Rjoin(ptr[i]); + if (F_isterm(ptr[i]) || !F_isalpha(ptr[i])) +--- 1813,1819 ---- + ptr[i] = toF_leading(ptr[i]); + ++i; + +! while (canF_Rjoin(ptr[i]) && i < llen) + { + ptr[i] = toF_Rjoin(ptr[i]); + if (F_isterm(ptr[i]) || !F_isalpha(ptr[i])) +*** ../vim-7.3.600/src/version.c 2012-07-10 19:25:06.000000000 +0200 +--- src/version.c 2012-07-16 17:25:48.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 601, + /**/ + +-- +There are three kinds of persons: Those who can count and those who can't. + + /// 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 /// From 40f992febd5bbfc86c97da74540f9ca1d70b58b7 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:53:59 +0200 Subject: [PATCH 46/87] - patchlevel 602 --- 7.3.602 | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 7.3.602 diff --git a/7.3.602 b/7.3.602 new file mode 100644 index 00000000..fd5f3cf4 --- /dev/null +++ b/7.3.602 @@ -0,0 +1,55 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.602 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.602 +Problem: Missing files in distribution. +Solution: Update the list of files. +Files: Filelist + + +*** ../vim-7.3.601/Filelist 2011-10-20 16:35:25.000000000 +0200 +--- Filelist 2012-06-20 12:06:41.000000000 +0200 +*************** +*** 463,468 **** +--- 463,469 ---- + runtime/macros/hanoi/hanoi.vim \ + runtime/macros/hanoi/poster \ + runtime/macros/justify.vim \ ++ runtime/macros/less.bat \ + runtime/macros/less.sh \ + runtime/macros/less.vim \ + runtime/macros/life/click.me \ +*************** +*** 666,671 **** +--- 667,674 ---- + + # generic language files + LANG_GEN = \ ++ runtime/doc/*-de.1 \ ++ runtime/doc/*-de.UTF-8.1 \ + runtime/doc/*-fr.1 \ + runtime/doc/*-fr.UTF-8.1 \ + runtime/doc/*-it.1 \ +*** ../vim-7.3.601/src/version.c 2012-07-16 17:26:18.000000000 +0200 +--- src/version.c 2012-07-16 17:27:31.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 602, + /**/ + +-- +Never eat yellow snow. + + /// 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 /// From 37f315b1ebf5004f7633960d6e938526a0d7e2a2 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:00 +0200 Subject: [PATCH 47/87] - patchlevel 603 --- 7.3.603 | 370 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 370 insertions(+) create mode 100644 7.3.603 diff --git a/7.3.603 b/7.3.603 new file mode 100644 index 00000000..00a024b0 --- /dev/null +++ b/7.3.603 @@ -0,0 +1,370 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.603 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.603 +Problem: It is possible to add replace builtin functions by calling + extend() on g:. +Solution: Add a flag to a dict to indicate it is a scope. Check for + existing functions. (ZyX) +Files: src/buffer.c, src/eval.c, src/proto/eval.pro, src/structs.h, + src/testdir/test34.in, src/testdir/test34.ok, src/window.c + + +*** ../vim-7.3.602/src/buffer.c 2012-07-10 15:18:18.000000000 +0200 +--- src/buffer.c 2012-07-16 16:52:58.000000000 +0200 +*************** +*** 1747,1753 **** + buf->b_wininfo->wi_win = curwin; + + #ifdef FEAT_EVAL +! init_var_dict(&buf->b_vars, &buf->b_bufvar); /* init b: variables */ + #endif + #ifdef FEAT_SYN_HL + hash_init(&buf->b_s.b_keywtab); +--- 1747,1754 ---- + buf->b_wininfo->wi_win = curwin; + + #ifdef FEAT_EVAL +! /* init b: variables */ +! init_var_dict(&buf->b_vars, &buf->b_bufvar, VAR_SCOPE); + #endif + #ifdef FEAT_SYN_HL + hash_init(&buf->b_s.b_keywtab); +*** ../vim-7.3.602/src/eval.c 2012-07-10 13:41:09.000000000 +0200 +--- src/eval.c 2012-07-16 17:18:11.000000000 +0200 +*************** +*** 850,857 **** + int i; + struct vimvar *p; + +! init_var_dict(&globvardict, &globvars_var); +! init_var_dict(&vimvardict, &vimvars_var); + vimvardict.dv_lock = VAR_FIXED; + hash_init(&compat_hashtab); + hash_init(&func_hashtab); +--- 850,857 ---- + int i; + struct vimvar *p; + +! init_var_dict(&globvardict, &globvars_var, VAR_DEF_SCOPE); +! init_var_dict(&vimvardict, &vimvars_var, VAR_SCOPE); + vimvardict.dv_lock = VAR_FIXED; + hash_init(&compat_hashtab); + hash_init(&func_hashtab); +*************** +*** 2725,2738 **** + lp->ll_dict = lp->ll_tv->vval.v_dict; + lp->ll_di = dict_find(lp->ll_dict, key, len); + +! /* When assigning to g: check that a function and variable name is +! * valid. */ +! if (rettv != NULL && lp->ll_dict == &globvardict) + { +! if (rettv->v_type == VAR_FUNC + && var_check_func_name(key, lp->ll_di == NULL)) +! return NULL; +! if (!valid_varname(key)) + return NULL; + } + +--- 2725,2750 ---- + lp->ll_dict = lp->ll_tv->vval.v_dict; + lp->ll_di = dict_find(lp->ll_dict, key, len); + +! /* When assigning to a scope dictionary check that a function and +! * variable name is valid (only variable name unless it is l: or +! * g: dictionary). Disallow overwriting a builtin function. */ +! if (rettv != NULL && lp->ll_dict->dv_scope != 0) + { +! int prevval; +! int wrong; +! +! if (len != -1) +! { +! prevval = key[len]; +! key[len] = NUL; +! } +! wrong = (lp->ll_dict->dv_scope == VAR_DEF_SCOPE +! && rettv->v_type == VAR_FUNC + && var_check_func_name(key, lp->ll_di == NULL)) +! || !valid_varname(key); +! if (len != -1) +! key[len] = prevval; +! if (wrong) + return NULL; + } + +*************** +*** 6951,6957 **** + d = (dict_T *)alloc(sizeof(dict_T)); + if (d != NULL) + { +! /* Add the list to the list of dicts for garbage collection. */ + if (first_dict != NULL) + first_dict->dv_used_prev = d; + d->dv_used_next = first_dict; +--- 6963,6969 ---- + d = (dict_T *)alloc(sizeof(dict_T)); + if (d != NULL) + { +! /* Add the dict to the list of dicts for garbage collection. */ + if (first_dict != NULL) + first_dict->dv_used_prev = d; + d->dv_used_next = first_dict; +*************** +*** 6960,6965 **** +--- 6972,6978 ---- + + hash_init(&d->dv_hashtab); + d->dv_lock = 0; ++ d->dv_scope = 0; + d->dv_refcount = 0; + d->dv_copyID = 0; + } +*************** +*** 10203,10208 **** +--- 10216,10234 ---- + { + --todo; + di1 = dict_find(d1, hi2->hi_key, -1); ++ if (d1->dv_scope != 0) ++ { ++ /* Disallow replacing a builtin function in l: and g:. ++ * Check the key to be valid when adding to any ++ * scope. */ ++ if (d1->dv_scope == VAR_DEF_SCOPE ++ && HI2DI(hi2)->di_tv.v_type == VAR_FUNC ++ && var_check_func_name(hi2->hi_key, ++ di1 == NULL)) ++ break; ++ if (!valid_varname(hi2->hi_key)) ++ break; ++ } + if (di1 == NULL) + { + di1 = dictitem_copy(HI2DI(hi2)); +*************** +*** 20027,20033 **** + { + sv = SCRIPT_SV(ga_scripts.ga_len + 1) = + (scriptvar_T *)alloc_clear(sizeof(scriptvar_T)); +! init_var_dict(&sv->sv_dict, &sv->sv_var); + ++ga_scripts.ga_len; + } + } +--- 20053,20059 ---- + { + sv = SCRIPT_SV(ga_scripts.ga_len + 1) = + (scriptvar_T *)alloc_clear(sizeof(scriptvar_T)); +! init_var_dict(&sv->sv_dict, &sv->sv_var, VAR_SCOPE); + ++ga_scripts.ga_len; + } + } +*************** +*** 20038,20049 **** + * point to it. + */ + void +! init_var_dict(dict, dict_var) + dict_T *dict; + 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; +--- 20064,20077 ---- + * point to it. + */ + void +! init_var_dict(dict, dict_var, scope) + dict_T *dict; + dictitem_T *dict_var; ++ int scope; + { + hash_init(&dict->dv_hashtab); + dict->dv_lock = 0; ++ dict->dv_scope = scope; + dict->dv_refcount = DO_NOT_FREE_CNT; + dict->dv_copyID = 0; + dict_var->di_tv.vval.v_dict = dict; +*************** +*** 22304,22310 **** + /* + * Init l: variables. + */ +! init_var_dict(&fc->l_vars, &fc->l_vars_var); + if (selfdict != NULL) + { + /* Set l:self to "selfdict". Use "name" to avoid a warning from +--- 22332,22338 ---- + /* + * Init l: variables. + */ +! init_var_dict(&fc->l_vars, &fc->l_vars_var, VAR_DEF_SCOPE); + if (selfdict != NULL) + { + /* Set l:self to "selfdict". Use "name" to avoid a warning from +*************** +*** 22325,22331 **** + * Set a:0 to "argcount". + * Set a:000 to a list with room for the "..." arguments. + */ +! init_var_dict(&fc->l_avars, &fc->l_avars_var); + add_nr_var(&fc->l_avars, &fc->fixvar[fixvar_idx++].var, "0", + (varnumber_T)(argcount - fp->uf_args.ga_len)); + /* Use "name" to avoid a warning from some compiler that checks the +--- 22353,22359 ---- + * Set a:0 to "argcount". + * Set a:000 to a list with room for the "..." arguments. + */ +! init_var_dict(&fc->l_avars, &fc->l_avars_var, VAR_SCOPE); + add_nr_var(&fc->l_avars, &fc->fixvar[fixvar_idx++].var, "0", + (varnumber_T)(argcount - fp->uf_args.ga_len)); + /* Use "name" to avoid a warning from some compiler that checks the +*** ../vim-7.3.602/src/proto/eval.pro 2012-06-29 12:54:32.000000000 +0200 +--- src/proto/eval.pro 2012-07-16 16:55:16.000000000 +0200 +*************** +*** 93,99 **** + char_u *get_tv_string_chk __ARGS((typval_T *varp)); + char_u *get_var_value __ARGS((char_u *name)); + void new_script_vars __ARGS((scid_T id)); +! void init_var_dict __ARGS((dict_T *dict, dictitem_T *dict_var)); + void vars_clear __ARGS((hashtab_T *ht)); + void copy_tv __ARGS((typval_T *from, typval_T *to)); + void ex_echo __ARGS((exarg_T *eap)); +--- 93,99 ---- + char_u *get_tv_string_chk __ARGS((typval_T *varp)); + char_u *get_var_value __ARGS((char_u *name)); + void new_script_vars __ARGS((scid_T id)); +! void init_var_dict __ARGS((dict_T *dict, dictitem_T *dict_var, int scope)); + void vars_clear __ARGS((hashtab_T *ht)); + void copy_tv __ARGS((typval_T *from, typval_T *to)); + void ex_echo __ARGS((exarg_T *eap)); +*** ../vim-7.3.602/src/structs.h 2012-06-06 19:02:40.000000000 +0200 +--- src/structs.h 2012-07-16 16:56:43.000000000 +0200 +*************** +*** 1106,1111 **** +--- 1106,1116 ---- + #define VAR_DICT 5 /* "v_dict" is used */ + #define VAR_FLOAT 6 /* "v_float" is used */ + ++ /* Values for "dv_scope". */ ++ #define VAR_SCOPE 1 /* a:, v:, s:, etc. scope dictionaries */ ++ #define VAR_DEF_SCOPE 2 /* l:, g: scope dictionaries: here funcrefs are not ++ allowed to mask existing functions */ ++ + /* Values for "v_lock". */ + #define VAR_LOCKED 1 /* locked with lock(), can use unlock() */ + #define VAR_FIXED 2 /* locked forever */ +*************** +*** 1181,1186 **** +--- 1186,1192 ---- + int dv_copyID; /* ID used by deepcopy() */ + dict_T *dv_copydict; /* copied dict used by deepcopy() */ + char dv_lock; /* zero, VAR_LOCKED, VAR_FIXED */ ++ char dv_scope; /* zero, VAR_SCOPE, VAR_DEF_SCOPE */ + dict_T *dv_used_next; /* next dict in used dicts list */ + dict_T *dv_used_prev; /* previous dict in used dicts list */ + }; +*** ../vim-7.3.602/src/testdir/test34.in 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/test34.in 2012-07-16 16:51:29.000000000 +0200 +*************** +*** 1,5 **** +--- 1,6 ---- + Test for user functions. + Also test an mapping calling a function. ++ Also test that a builtin function cannot be replaced. + + STARTTEST + :so small.vim +*************** +*** 58,64 **** + ---*--- + (one + (two +! [(one again:$-5,$w! test.out + :delfunc Table + :delfunc Compute + :delfunc Expr1 +--- 59,68 ---- + ---*--- + (one + (two +! [(one again:call append(line('$'), max([1, 2, 3])) +! :call extend(g:, {'max': function('min')}) +! :call append(line('$'), max([1, 2, 3])) +! :$-7,$w! test.out + :delfunc Table + :delfunc Compute + :delfunc Expr1 +*** ../vim-7.3.602/src/testdir/test34.ok 2011-10-12 22:02:07.000000000 +0200 +--- src/testdir/test34.ok 2012-07-16 16:43:15.000000000 +0200 +*************** +*** 4,6 **** +--- 4,8 ---- + 1. one + 2. two + 1. one again ++ 3 ++ 3 +*** ../vim-7.3.602/src/window.c 2012-07-06 18:27:34.000000000 +0200 +--- src/window.c 2012-07-16 16:53:45.000000000 +0200 +*************** +*** 3468,3474 **** + # endif + #ifdef FEAT_EVAL + /* init t: variables */ +! init_var_dict(&tp->tp_vars, &tp->tp_winvar); + #endif + tp->tp_ch_used = p_ch; + } +--- 3468,3474 ---- + # endif + #ifdef FEAT_EVAL + /* init t: variables */ +! init_var_dict(&tp->tp_vars, &tp->tp_winvar, VAR_SCOPE); + #endif + tp->tp_ch_used = p_ch; + } +*************** +*** 4410,4416 **** + #endif + #ifdef FEAT_EVAL + /* init w: variables */ +! init_var_dict(&new_wp->w_vars, &new_wp->w_winvar); + #endif + #ifdef FEAT_FOLDING + foldInitWin(new_wp); +--- 4410,4416 ---- + #endif + #ifdef FEAT_EVAL + /* init w: variables */ +! init_var_dict(&new_wp->w_vars, &new_wp->w_winvar, VAR_SCOPE); + #endif + #ifdef FEAT_FOLDING + foldInitWin(new_wp); +*** ../vim-7.3.602/src/version.c 2012-07-16 17:27:57.000000000 +0200 +--- src/version.c 2012-07-16 17:29:06.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 603, + /**/ + +-- +Birthdays are healthy. The more you have them, the longer you live. + + /// 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 /// From f9641862c0011698bcc90ca0f3ee572f17c9a47b Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:00 +0200 Subject: [PATCH 48/87] - patchlevel 604 --- 7.3.604 | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 7.3.604 diff --git a/7.3.604 b/7.3.604 new file mode 100644 index 00000000..f7e63bd0 --- /dev/null +++ b/7.3.604 @@ -0,0 +1,60 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.604 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.604 +Problem: inputdialog() doesn't use the cancel argument in the console. + (David Fishburn) +Solution: Use the third argument. (Christian Brabant) +Files: src/eval.c + + +*** ../vim-7.3.603/src/eval.c 2012-07-16 17:31:48.000000000 +0200 +--- src/eval.c 2012-07-16 19:20:47.000000000 +0200 +*************** +*** 12940,12945 **** +--- 12940,12946 ---- + int xp_namelen; + long argt; + ++ /* input() with a third argument: completion */ + rettv->vval.v_string = NULL; + + xp_name = get_tv_string_buf_chk(&argvars[2], buf); +*************** +*** 12958,12963 **** +--- 12959,12969 ---- + rettv->vval.v_string = + getcmdline_prompt(inputsecret_flag ? NUL : '@', p, echo_attr, + xp_type, xp_arg); ++ if (rettv->vval.v_string == NULL ++ && argvars[1].v_type != VAR_UNKNOWN ++ && argvars[2].v_type != VAR_UNKNOWN) ++ rettv->vval.v_string = vim_strsave(get_tv_string_buf( ++ &argvars[2], buf)); + + vim_free(xp_arg); + +*** ../vim-7.3.603/src/version.c 2012-07-16 17:31:48.000000000 +0200 +--- src/version.c 2012-07-16 19:23:11.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 604, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +135. You cut classes or miss work so you can stay home and browse the web. + + /// 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 /// From fe5e7bf2d66733bf978f0b4ea94ef63480293ca1 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:00 +0200 Subject: [PATCH 49/87] - patchlevel 605 --- 7.3.605 | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 7.3.605 diff --git a/7.3.605 b/7.3.605 new file mode 100644 index 00000000..70338251 --- /dev/null +++ b/7.3.605 @@ -0,0 +1,86 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.605 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.605 (after 7.3.577) +Problem: MS-Windows: Can't compile with older compilers. (Titov Anatoly) +Solution: Add #ifdef for MEMORYSTATUSEX. +Files: src/os_win32.c + + +*** ../vim-7.3.604/src/os_win32.c 2012-06-29 15:51:26.000000000 +0200 +--- src/os_win32.c 2012-07-19 11:35:00.000000000 +0200 +*************** +*** 4999,5020 **** + 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 +--- 4999,5025 ---- + long_u + mch_avail_mem(int special) + { +! #ifdef MEMORYSTATUSEX +! PlatformId(); +! if (g_PlatformId == VER_PLATFORM_WIN32_NT) + { + MEMORYSTATUSEX ms; + ++ /* Need to use GlobalMemoryStatusEx() when there is more memory than ++ * what fits in 32 bits. But it's not always available. */ + ms.dwLength = sizeof(MEMORYSTATUSEX); + GlobalMemoryStatusEx(&ms); + return (long_u)((ms.ullAvailPhys + ms.ullAvailPageFile) >> 10); + } ++ else ++ #endif ++ { ++ MEMORYSTATUS ms; ++ ++ ms.dwLength = sizeof(MEMORYSTATUS); ++ GlobalMemoryStatus(&ms); ++ return (long_u)((ms.dwAvailPhys + ms.dwAvailPageFile) >> 10); ++ } + } + + #ifdef FEAT_MBYTE +*** ../vim-7.3.604/src/version.c 2012-07-16 19:27:25.000000000 +0200 +--- src/version.c 2012-07-19 11:36:12.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 605, + /**/ + +-- +Fingers not found - Pound head on keyboard to continue. + + /// 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 /// From 4fd8e176f9acebdbb44031bcaa7d5803913e450d Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:00 +0200 Subject: [PATCH 50/87] - patchlevel 606 --- 7.3.606 | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 7.3.606 diff --git a/7.3.606 b/7.3.606 new file mode 100644 index 00000000..2296653c --- /dev/null +++ b/7.3.606 @@ -0,0 +1,76 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.606 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.606 +Problem: CTRL-P completion has a problem with multi-byte characters. +Solution: Check for next character being NUL properly. (Yasuhiro Matsumoto) +Files: src/search.c, src/macros.h + + +*** ../vim-7.3.605/src/search.c 2012-06-06 16:12:54.000000000 +0200 +--- src/search.c 2012-07-19 17:09:20.000000000 +0200 +*************** +*** 5141,5147 **** + && !(compl_cont_status & CONT_SOL) + #endif + && *startp != NUL +! && *(p = startp + 1) != NUL) + goto search_line; + } + line_breakcheck(); +--- 5141,5147 ---- + && !(compl_cont_status & CONT_SOL) + #endif + && *startp != NUL +! && *(p = startp + MB_PTR2LEN(startp)) != NUL) + goto search_line; + } + line_breakcheck(); +*** ../vim-7.3.605/src/macros.h 2010-09-21 16:56:29.000000000 +0200 +--- src/macros.h 2012-07-19 17:08:38.000000000 +0200 +*************** +*** 259,264 **** +--- 259,266 ---- + * PTR2CHAR(): get character from pointer. + */ + #ifdef FEAT_MBYTE ++ /* Get the length of the character p points to */ ++ # define MB_PTR2LEN(p) (has_mbyte ? (*mb_ptr2len)(p) : 1) + /* Advance multi-byte pointer, skip over composing chars. */ + # define mb_ptr_adv(p) p += has_mbyte ? (*mb_ptr2len)(p) : 1 + /* Advance multi-byte pointer, do not skip over composing chars. */ +*************** +*** 272,277 **** +--- 274,280 ---- + # define MB_CHARLEN(p) (has_mbyte ? mb_charlen(p) : (int)STRLEN(p)) + # define PTR2CHAR(p) (has_mbyte ? mb_ptr2char(p) : (int)*(p)) + #else ++ # define MB_PTR2LEN(p) 1 + # define mb_ptr_adv(p) ++p + # define mb_cptr_adv(p) ++p + # define mb_ptr_back(s, p) --p +*** ../vim-7.3.605/src/version.c 2012-07-19 11:37:22.000000000 +0200 +--- src/version.c 2012-07-19 17:13:53.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 606, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +151. You find yourself engaged to someone you've never actually met, + except through 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 /// From 662b6670ea7f747d135c63b5f75d0b4b49591adf Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:01 +0200 Subject: [PATCH 51/87] - patchlevel 607 --- 7.3.607 | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 7.3.607 diff --git a/7.3.607 b/7.3.607 new file mode 100644 index 00000000..4dbf559d --- /dev/null +++ b/7.3.607 @@ -0,0 +1,56 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.607 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.607 +Problem: With an 8 color terminal the selected menu item is black on black, + because darkGrey as bg is the same as black. +Solution: Swap fg and bg colors. (James McCoy) +Files: src/syntax.c + + +*** ../vim-7.3.606/src/syntax.c 2012-06-01 13:18:48.000000000 +0200 +--- src/syntax.c 2012-07-19 17:34:42.000000000 +0200 +*************** +*** 6653,6660 **** + "PmenuThumb ctermbg=White guibg=White"), + CENT("Pmenu ctermbg=Magenta ctermfg=Black", + "Pmenu ctermbg=Magenta ctermfg=Black guibg=Magenta"), +! CENT("PmenuSel ctermbg=DarkGrey ctermfg=Black", +! "PmenuSel ctermbg=DarkGrey ctermfg=Black guibg=DarkGrey"), + #endif + CENT("Title term=bold ctermfg=LightMagenta", + "Title term=bold ctermfg=LightMagenta gui=bold guifg=Magenta"), +--- 6653,6660 ---- + "PmenuThumb ctermbg=White guibg=White"), + CENT("Pmenu ctermbg=Magenta ctermfg=Black", + "Pmenu ctermbg=Magenta ctermfg=Black guibg=Magenta"), +! CENT("PmenuSel ctermbg=Black ctermfg=DarkGrey", +! "PmenuSel ctermbg=Black ctermfg=DarkGrey guibg=DarkGrey"), + #endif + CENT("Title term=bold ctermfg=LightMagenta", + "Title term=bold ctermfg=LightMagenta gui=bold guifg=Magenta"), +*** ../vim-7.3.606/src/version.c 2012-07-19 17:18:21.000000000 +0200 +--- src/version.c 2012-07-19 17:38:05.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 607, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +152. You find yourself falling for someone you've never seen or hardly + know, but, boy can he/she TYPE!!!!!! + + /// 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 /// From d46efc300963a83ad8d50831fd2cd59da5ee8ddc Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:01 +0200 Subject: [PATCH 52/87] - patchlevel 608 --- 7.3.608 | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 7.3.608 diff --git a/7.3.608 b/7.3.608 new file mode 100644 index 00000000..148bc494 --- /dev/null +++ b/7.3.608 @@ -0,0 +1,119 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.608 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.608 +Problem: winrestview() does not always restore the view correctly. +Solution: Call win_new_height() and win_new_width(). (Lech Lorens) +Files: src/eval.c, src/proto/window.pro, src/window.c + + +*** ../vim-7.3.607/src/eval.c 2012-07-16 19:27:25.000000000 +0200 +--- src/eval.c 2012-07-19 17:50:16.000000000 +0200 +*************** +*** 18601,18606 **** +--- 18601,18610 ---- + curwin->w_skipcol = get_dict_number(dict, (char_u *)"skipcol"); + + check_cursor(); ++ win_new_height(curwin, curwin->w_height); ++ # ifdef FEAT_VERTSPLIT ++ win_new_width(curwin, W_WIDTH(curwin)); ++ # endif + changed_window_setting(); + + if (curwin->w_topline == 0) +*** ../vim-7.3.607/src/proto/window.pro 2012-06-13 14:28:16.000000000 +0200 +--- src/proto/window.pro 2012-07-19 18:05:10.000000000 +0200 +*************** +*** 51,56 **** +--- 51,58 ---- + void win_setminheight __ARGS((void)); + void win_drag_status_line __ARGS((win_T *dragwin, int offset)); + void win_drag_vsep_line __ARGS((win_T *dragwin, int offset)); ++ void win_new_height __ARGS((win_T *wp, int height)); ++ void win_new_width __ARGS((win_T *wp, int width)); + void win_comp_scroll __ARGS((win_T *wp)); + void command_height __ARGS((void)); + void last_status __ARGS((int morewin)); +*** ../vim-7.3.607/src/window.c 2012-07-16 17:31:48.000000000 +0200 +--- src/window.c 2012-07-19 18:05:18.000000000 +0200 +*************** +*** 54,60 **** + static void frame_insert __ARGS((frame_T *before, frame_T *frp)); + static void frame_remove __ARGS((frame_T *frp)); + #ifdef FEAT_VERTSPLIT +- static void win_new_width __ARGS((win_T *wp, int width)); + static void win_goto_ver __ARGS((int up, long count)); + static void win_goto_hor __ARGS((int left, long count)); + #endif +--- 54,59 ---- +*************** +*** 71,77 **** + + static win_T *win_alloc __ARGS((win_T *after, int hidden)); + static void set_fraction __ARGS((win_T *wp)); +- static void win_new_height __ARGS((win_T *wp, int height)); + + #define URL_SLASH 1 /* path_is_url() has found "://" */ + #define URL_BACKSLASH 2 /* path_is_url() has found ":\\" */ +--- 70,75 ---- +*************** +*** 5557,5563 **** + * This takes care of the things inside the window, not what happens to the + * window position, the frame or to other windows. + */ +! static void + win_new_height(wp, height) + win_T *wp; + int height; +--- 5555,5561 ---- + * This takes care of the things inside the window, not what happens to the + * window position, the frame or to other windows. + */ +! void + win_new_height(wp, height) + win_T *wp; + int height; +*************** +*** 5697,5703 **** + /* + * Set the width of a window. + */ +! static void + win_new_width(wp, width) + win_T *wp; + int width; +--- 5695,5701 ---- + /* + * Set the width of a window. + */ +! void + win_new_width(wp, width) + win_T *wp; + int width; +*** ../vim-7.3.607/src/version.c 2012-07-19 17:39:01.000000000 +0200 +--- src/version.c 2012-07-19 17:53:37.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 608, + /**/ + +-- +Although the scythe isn't pre-eminent among the weapons of war, anyone who +has been on the wrong end of, say, a peasants' revolt will know that in +skilled hands it is fearsome. + -- (Terry Pratchett, Mort) + + /// 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 /// From a2a199005acc3bcb57ea4cd62079c044da0f9a81 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:01 +0200 Subject: [PATCH 53/87] - patchlevel 609 --- 7.3.609 | 251 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 251 insertions(+) create mode 100644 7.3.609 diff --git a/7.3.609 b/7.3.609 new file mode 100644 index 00000000..ed731f50 --- /dev/null +++ b/7.3.609 @@ -0,0 +1,251 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.609 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.609 +Problem: File names in :checkpath! output are garbled. +Solution: Check for \zs in the pattern. (Lech Lorens) +Files: src/search.c, src/testdir/test17.in, src/testdir/test17.ok + + +*** ../vim-7.3.608/src/search.c 2012-07-19 17:18:21.000000000 +0200 +--- src/search.c 2012-07-25 13:33:08.000000000 +0200 +*************** +*** 4740,4756 **** + * Isolate the file name. + * Include the surrounding "" or <> if present. + */ +! for (p = incl_regmatch.endp[0]; !vim_isfilec(*p); p++) +! ; +! for (i = 0; vim_isfilec(p[i]); i++) +! ; + if (i == 0) + { + /* Nothing found, use the rest of the line. */ + p = incl_regmatch.endp[0]; + i = (int)STRLEN(p); + } +! else + { + if (p[-1] == '"' || p[-1] == '<') + { +--- 4740,4772 ---- + * Isolate the file name. + * Include the surrounding "" or <> if present. + */ +! if (inc_opt != NULL +! && strstr((char *)inc_opt, "\\zs") != NULL) +! { +! /* pattern contains \zs, use the match */ +! p = incl_regmatch.startp[0]; +! i = (int)(incl_regmatch.endp[0] +! - incl_regmatch.startp[0]); +! } +! else +! { +! /* find the file name after the end of the match */ +! for (p = incl_regmatch.endp[0]; +! *p && !vim_isfilec(*p); p++) +! ; +! for (i = 0; vim_isfilec(p[i]); i++) +! ; +! } +! + if (i == 0) + { + /* Nothing found, use the rest of the line. */ + p = incl_regmatch.endp[0]; + i = (int)STRLEN(p); + } +! /* Avoid checking before the start of the line, can +! * happen if \zs appears in the regexp. */ +! else if (p > line) + { + if (p[-1] == '"' || p[-1] == '<') + { +*** ../vim-7.3.608/src/testdir/test17.in 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/test17.in 2012-07-25 13:41:43.000000000 +0200 +*************** +*** 1,4 **** +! Tests for "gf" on ${VAR} + + STARTTEST + :so small.vim +--- 1,6 ---- +! Tests for: +! - "gf" on ${VAR}, +! - ":checkpath!" with various 'include' settings. + + STARTTEST + :so small.vim +*************** +*** 20,27 **** + :endif + gf + :w! test.out +! :qa! + ENDTEST + + ${CDIR}/test17a.in + $TDIR/test17a.in +--- 22,120 ---- + :endif + gf + :w! test.out +! :brewind + ENDTEST + + ${CDIR}/test17a.in + $TDIR/test17a.in ++ ++ STARTTEST ++ :" check for 'include' without \zs or \ze ++ :lang C ++ :!rm -f ./Xbase.a ++ :!rm -rf ./Xdir1 ++ :!mkdir -p Xdir1/dir2 ++ :e Xdir1/dir2/foo.a ++ i#include "bar.a" ++ :w ++ :e Xdir1/dir2/bar.a ++ i#include "baz.a" ++ :w ++ :e Xdir1/dir2/baz.a ++ i#include "foo.a" ++ :w ++ :e Xbase.a ++ :set path=Xdir1/dir2 ++ i#include  ++ :w ++ :redir! >>test.out ++ :checkpath! ++ :redir END ++ :brewind ++ ENDTEST ++ ++ STARTTEST ++ :" check for 'include' with \zs and \ze ++ :!rm -f ./Xbase.b ++ :!rm -rf ./Xdir1 ++ :!mkdir -p Xdir1/dir2 ++ :let &include='^\s*%inc\s*/\zs[^/]\+\ze' ++ :function! DotsToSlashes() ++ : return substitute(v:fname, '\.', '/', 'g') . '.b' ++ :endfunction ++ :let &includeexpr='DotsToSlashes()' ++ :e Xdir1/dir2/foo.b ++ i%inc /bar/ ++ :w ++ :e Xdir1/dir2/bar.b ++ i%inc /baz/ ++ :w ++ :e Xdir1/dir2/baz.b ++ i%inc /foo/ ++ :w ++ :e Xbase.b ++ :set path=Xdir1/dir2 ++ i%inc /foo/ ++ :w ++ :redir! >>test.out ++ :checkpath! ++ :redir END ++ :brewind ++ ENDTEST ++ ++ STARTTEST ++ :" check for 'include' with \zs and no \ze ++ :!rm -f ./Xbase.c ++ :!rm -rf ./Xdir1 ++ :!mkdir -p Xdir1/dir2 ++ :let &include='^\s*%inc\s*\%([[:upper:]][^[:space:]]*\s\+\)\?\zs\S\+\ze' ++ :function! StripNewlineChar() ++ : if v:fname =~ '\n$' ++ : return v:fname[:-2] ++ : endif ++ : return v:fname ++ :endfunction ++ :let &includeexpr='StripNewlineChar()' ++ :e Xdir1/dir2/foo.c ++ i%inc bar.c ++ :w ++ :e Xdir1/dir2/bar.c ++ i%inc baz.c ++ :w ++ :e Xdir1/dir2/baz.c ++ i%inc foo.c ++ :w ++ :e Xdir1/dir2/FALSE.c ++ i%inc foo.c ++ :w ++ :e Xbase.c ++ :set path=Xdir1/dir2 ++ i%inc FALSE.c foo.c ++ :w ++ :redir! >>test.out ++ :checkpath! ++ :redir END ++ :brewind ++ :q ++ ENDTEST ++ +*** ../vim-7.3.608/src/testdir/test17.ok 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/test17.ok 2012-07-25 13:45:37.000000000 +0200 +*************** +*** 1,3 **** +--- 1,33 ---- + This file is just to test "gf" in test 17. + The contents is not important. + Just testing! ++ ++ ++ --- Included files in path --- ++ Xdir1/dir2/foo.a ++ Xdir1/dir2/foo.a --> ++ Xdir1/dir2/bar.a ++ Xdir1/dir2/bar.a --> ++ Xdir1/dir2/baz.a ++ Xdir1/dir2/baz.a --> ++ "foo.a" (Already listed) ++ ++ ++ --- Included files in path --- ++ Xdir1/dir2/foo.b ++ Xdir1/dir2/foo.b --> ++ Xdir1/dir2/bar.b ++ Xdir1/dir2/bar.b --> ++ Xdir1/dir2/baz.b ++ Xdir1/dir2/baz.b --> ++ foo (Already listed) ++ ++ ++ --- Included files in path --- ++ Xdir1/dir2/foo.c ++ Xdir1/dir2/foo.c --> ++ Xdir1/dir2/bar.c ++ Xdir1/dir2/bar.c --> ++ Xdir1/dir2/baz.c ++ Xdir1/dir2/baz.c --> ++ foo.c^@ (Already listed) +*** ../vim-7.3.608/src/version.c 2012-07-19 18:05:40.000000000 +0200 +--- src/version.c 2012-07-25 13:38:54.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 609, + /**/ + +-- +"The question of whether computers can think is just like the question +of whether submarines can swim." -- Edsger W. Dijkstra + + /// 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 /// From 1dbb48c0811cdf460129a7488e0e53bbb73766db Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:02 +0200 Subject: [PATCH 54/87] - patchlevel 610 --- 7.3.610 | 400 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 400 insertions(+) create mode 100644 7.3.610 diff --git a/7.3.610 b/7.3.610 new file mode 100644 index 00000000..5e48837f --- /dev/null +++ b/7.3.610 @@ -0,0 +1,400 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.610 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.610 +Problem: Cannot operate on the text that a search pattern matches. +Solution: Add the "gn" and "gN" commands. (Christian Brabandt) +Files: runtime/doc/index.txt, runtime/doc/visual.txt, src/normal.c, + src/proto/search.pro, src/search.c, src/testdir/test53.in, + src/testdir/test53.ok + + +*** ../vim-7.3.609/runtime/doc/index.txt 2010-08-15 21:57:18.000000000 +0200 +--- runtime/doc/index.txt 2012-07-25 14:27:20.000000000 +0200 +*************** +*** 719,726 **** +--- 719,729 ---- + |gH| gH start Select line mode + |gI| gI 2 like "I", but always start in column 1 + |gJ| gJ 2 join lines without inserting space ++ |gN| gN 1,2 find the previous match with the last used ++ search pattern and Visually select it + |gP| ["x]gP 2 put the text [from register x] before the + cursor N times, leave the cursor after it ++ |gQ| gQ switch to "Ex" mode with Vim editing + |gR| gR 2 enter Virtual Replace mode + |gU| gU{motion} 2 make Nmove text uppercase + |gV| gV don't reselect the previous Visual area +*************** +*** 750,755 **** +--- 753,760 ---- + lines down + |gk| gk 1 like "k", but when 'wrap' on go N screen + lines up ++ |gn| gn 1,2 find the next match with the last used ++ search pattern and Visually select it + |gm| gm 1 go to character at middle of the screenline + |go| go 1 cursor to byte N in the buffer + |gp| ["x]gp 2 put the text [from register x] after the +*** ../vim-7.3.609/runtime/doc/visual.txt 2010-08-15 21:57:16.000000000 +0200 +--- runtime/doc/visual.txt 2012-07-25 14:42:22.000000000 +0200 +*************** +*** 94,99 **** +--- 99,116 ---- + After using "p" or "P" in Visual mode the text that + was put will be selected. + ++ *gn* *v_gn* ++ gn Search forward for the last used search pattern, like ++ with `n`, and start Visual mode to select the match. ++ If the cursor is on the match, visually selects it. ++ If an operator is pending, operates on the match. ++ E.g., "dgn" deletes the text of the next match. ++ If Visual mode is active, extends the selection ++ until the end of the next match. ++ ++ *gN* *v_gN* ++ gN Like |gn| but searches backward, like with `N`. ++ + ** + Set the current cursor position. If Visual mode is + active it is stopped. Only when 'mouse' option is +*** ../vim-7.3.609/src/normal.c 2012-07-10 16:49:08.000000000 +0200 +--- src/normal.c 2012-07-25 14:31:40.000000000 +0200 +*************** +*** 1780,1789 **** + { + /* Prepare for redoing. Only use the nchar field for "r", + * otherwise it might be the second char of the operator. */ +! prep_redo(oap->regname, 0L, NUL, 'v', +! get_op_char(oap->op_type), +! get_extra_op_char(oap->op_type), +! oap->op_type == OP_REPLACE ? cap->nchar : NUL); + if (!redo_VIsual_busy) + { + redo_VIsual_mode = resel_VIsual_mode; +--- 1780,1797 ---- + { + /* Prepare for redoing. Only use the nchar field for "r", + * otherwise it might be the second char of the operator. */ +! if (cap->cmdchar == 'g' && (cap->nchar == 'n' +! || cap->nchar == 'N')) +! /* "gn" and "gN" are a bit different */ +! prep_redo(oap->regname, 0L, NUL, cap->cmdchar, cap->nchar, +! get_op_char(oap->op_type), +! get_extra_op_char(oap->op_type)); +! else +! prep_redo(oap->regname, 0L, NUL, 'v', +! get_op_char(oap->op_type), +! get_extra_op_char(oap->op_type), +! oap->op_type == OP_REPLACE +! ? cap->nchar : NUL); + if (!redo_VIsual_busy) + { + redo_VIsual_mode = resel_VIsual_mode; +*************** +*** 7987,7992 **** +--- 7995,8011 ---- + cap->arg = TRUE; + nv_visual(cap); + break; ++ ++ /* "gn", "gN" visually select next/previous search match ++ * "gn" selects next match ++ * "gN" selects previous match ++ */ ++ case 'N': ++ case 'n': ++ if (!current_search(cap->count1, cap->nchar == 'n')) ++ beep_flush(); ++ ++ break; + #endif /* FEAT_VISUAL */ + + /* +*** ../vim-7.3.609/src/proto/search.pro 2010-08-15 21:57:28.000000000 +0200 +--- src/proto/search.pro 2012-07-25 14:24:01.000000000 +0200 +*************** +*** 27,32 **** +--- 27,33 ---- + int end_word __ARGS((long count, int bigword, int stop, int empty)); + int bckend_word __ARGS((long count, int bigword, int eol)); + int current_word __ARGS((oparg_T *oap, long count, int include, int bigword)); ++ int current_search __ARGS((long count, int forward)); + int current_sent __ARGS((oparg_T *oap, long count, int include)); + int current_block __ARGS((oparg_T *oap, long count, int include, int what, int other)); + int current_tagblock __ARGS((oparg_T *oap, long count_arg, int include)); +*** ../vim-7.3.609/src/search.c 2012-07-25 13:46:25.000000000 +0200 +--- src/search.c 2012-07-25 14:54:28.000000000 +0200 +*************** +*** 3397,3402 **** +--- 3397,3547 ---- + return OK; + } + ++ #if defined(FEAT_VISUAL) || defined(PROTO) ++ /* ++ * Find next search match under cursor, cursor at end. ++ * Used while an operator is pending, and in Visual mode. ++ * TODO: redo only works when used in operator pending mode ++ */ ++ int ++ current_search(count, forward) ++ long count; ++ int forward; /* move forward or backwards */ ++ { ++ pos_T start_pos; /* position before the pattern */ ++ pos_T orig_pos; /* position of the cursor at beginning */ ++ pos_T pos; /* position after the pattern */ ++ int i; ++ int dir; ++ int result; /* result of various function calls */ ++ char_u old_p_ws = p_ws; ++ int visual_active = FALSE; ++ int flags = 0; ++ pos_T save_VIsual; ++ ++ ++ /* wrapping should not occur */ ++ p_ws = FALSE; ++ ++ /* Correct cursor when 'selection' is exclusive */ ++ if (VIsual_active && *p_sel == 'e' && lt(VIsual, curwin->w_cursor)) ++ dec_cursor(); ++ ++ if (VIsual_active) ++ { ++ orig_pos = curwin->w_cursor; ++ save_VIsual = VIsual; ++ visual_active = TRUE; ++ ++ /* just started visual selection, only one character */ ++ if (equalpos(VIsual, curwin->w_cursor)) ++ visual_active = FALSE; ++ ++ pos = curwin->w_cursor; ++ start_pos = VIsual; ++ ++ /* make sure, searching further will extend the match */ ++ if (VIsual_active) ++ { ++ if (forward) ++ incl(&pos); ++ else ++ decl(&pos); ++ } ++ } ++ else ++ orig_pos = pos = start_pos = curwin->w_cursor; ++ ++ /* ++ * The trick is to first search backwards and then search forward again, ++ * so that a match at the current cursor position will be correctly ++ * captured. ++ */ ++ for (i = 0; i < 2; i++) ++ { ++ if (i && count == 1) ++ flags = SEARCH_START; ++ ++ if (forward) ++ dir = i; ++ else ++ dir = !i; ++ result = searchit(curwin, curbuf, &pos, (dir ? FORWARD : BACKWARD), ++ spats[last_idx].pat, (long) (i ? count : 1), ++ SEARCH_KEEP | flags | (dir ? 0 : SEARCH_END), ++ RE_SEARCH, 0, NULL); ++ ++ /* First search may fail, but then start searching from the ++ * beginning of the file (cursor might be on the search match) ++ * except when Visual mode is active, so that extending the visual ++ * selection works. */ ++ if (!result && i) /* not found, abort */ ++ { ++ curwin->w_cursor = orig_pos; ++ if (VIsual_active) ++ VIsual = save_VIsual; ++ p_ws = old_p_ws; ++ return FAIL; ++ } ++ else if (!i && !result && !visual_active) ++ { ++ if (forward) /* try again from start of buffer */ ++ { ++ clearpos(&pos); ++ } ++ else /* try again from end of buffer */ ++ { ++ /* searching backwards, so set pos to last line and col */ ++ pos.lnum = curwin->w_buffer->b_ml.ml_line_count; ++ pos.col = STRLEN(ml_get(curwin->w_buffer->b_ml.ml_line_count)); ++ } ++ } ++ ++ } ++ ++ start_pos = pos; ++ flags = (forward ? SEARCH_END : 0); ++ ++ /* move to match */ ++ result = searchit(curwin, curbuf, &pos, (forward ? FORWARD : BACKWARD), ++ spats[last_idx].pat, 0L, flags | SEARCH_KEEP, RE_SEARCH, 0, NULL); ++ ++ if (!VIsual_active) ++ VIsual = start_pos; ++ ++ p_ws = old_p_ws; ++ curwin->w_cursor = pos; ++ VIsual_active = TRUE; ++ VIsual_mode = 'v'; ++ ++ if (VIsual_active) ++ { ++ redraw_curbuf_later(INVERTED); /* update the inversion */ ++ if (*p_sel == 'e' && ltoreq(VIsual, curwin->w_cursor)) ++ inc_cursor(); ++ } ++ ++ #ifdef FEAT_FOLDING ++ if (fdo_flags & FDO_SEARCH && KeyTyped) ++ foldOpenCursor(); ++ #endif ++ ++ may_start_select('c'); ++ #ifdef FEAT_MOUSE ++ setmouse(); ++ #endif ++ #ifdef FEAT_CLIPBOARD ++ /* Make sure the clipboard gets updated. Needed because start and ++ * end are still the same, and the selection needs to be owned */ ++ clip_star.vmode = NUL; ++ #endif ++ redraw_curbuf_later(INVERTED); ++ showmode(); ++ ++ return OK; ++ } ++ #endif /* FEAT_VISUAL */ ++ + /* + * Find sentence(s) under the cursor, cursor at end. + * When Visual active, extend it by one or more sentences. +*************** +*** 3420,3426 **** + + #ifdef FEAT_VISUAL + /* +! * When visual area is bigger than one character: Extend it. + */ + if (VIsual_active && !equalpos(start_pos, VIsual)) + { +--- 3565,3571 ---- + + #ifdef FEAT_VISUAL + /* +! * When the Visual area is bigger than one character: Extend it. + */ + if (VIsual_active && !equalpos(start_pos, VIsual)) + { +*************** +*** 3508,3515 **** + #endif + + /* +! * If cursor started on blank, check if it is just before the start of the +! * next sentence. + */ + while (c = gchar_pos(&pos), vim_iswhite(c)) /* vim_iswhite() is a macro */ + incl(&pos); +--- 3653,3660 ---- + #endif + + /* +! * If the cursor started on a blank, check if it is just before the start +! * of the next sentence. + */ + while (c = gchar_pos(&pos), vim_iswhite(c)) /* vim_iswhite() is a macro */ + incl(&pos); +*************** +*** 3558,3564 **** + #ifdef FEAT_VISUAL + if (VIsual_active) + { +! /* avoid getting stuck with "is" on a single space before a sent. */ + if (equalpos(start_pos, curwin->w_cursor)) + goto extend; + if (*p_sel == 'e') +--- 3703,3709 ---- + #ifdef FEAT_VISUAL + if (VIsual_active) + { +! /* Avoid getting stuck with "is" on a single space before a sentence. */ + if (equalpos(start_pos, curwin->w_cursor)) + goto extend; + if (*p_sel == 'e') +*** ../vim-7.3.609/src/testdir/test53.in 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/test53.in 2012-07-25 15:01:34.000000000 +0200 +*************** +*** 28,33 **** +--- 28,40 ---- + :put =matchstr(\"abcd\", \".\", 0, -1) " a + :put =match(\"abcd\", \".\", 0, 5) " -1 + :put =match(\"abcd\", \".\", 0, -1) " 0 ++ /^foobar ++ gncsearchmatch/one\_s*two\_s ++ :1 ++ gnd ++ /[a]bcdx ++ :1 ++ 2gnd + :/^start:/,/^end:/wq! test.out + ENDTEST + +*************** +*** 45,48 **** +--- 52,60 ---- + -asdfXasdfasdf- + -asdXasdfasdf- + ++ SEARCH: ++ foobar ++ one ++ two ++ abcdx | abcdx | abcdx + end: +*** ../vim-7.3.609/src/testdir/test53.ok 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/test53.ok 2012-07-25 14:24:01.000000000 +0200 +*************** +*** 18,21 **** +--- 18,24 ---- + a + -1 + 0 ++ SEARCH: ++ searchmatch ++ abcdx | | abcdx + end: +*** ../vim-7.3.609/src/version.c 2012-07-25 13:46:25.000000000 +0200 +--- src/version.c 2012-07-25 15:03:43.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 610, + /**/ + +-- +Did you ever see a "Hit any key to continue" message in a music piece? + + /// 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 /// From 40e011c429ab0ef16106dbb6468137826686806b Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:02 +0200 Subject: [PATCH 55/87] - patchlevel 611 --- 7.3.611 | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 7.3.611 diff --git a/7.3.611 b/7.3.611 new file mode 100644 index 00000000..5e366a78 --- /dev/null +++ b/7.3.611 @@ -0,0 +1,58 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.611 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.611 +Problem: Can't use Vim dictionary as self argument in Python. +Solution: Fix the check for the "self" argument. (ZyX) +Files: src/if_py_both.h + + +*** ../vim-7.3.610/src/if_py_both.h 2012-06-30 13:34:29.000000000 +0200 +--- src/if_py_both.h 2012-07-25 15:32:10.000000000 +0200 +*************** +*** 1284,1292 **** + 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; + } +--- 1284,1293 ---- + selfdictObject = PyDict_GetItemString(kwargs, "self"); + if (selfdictObject != NULL) + { +! if (!PyMapping_Check(selfdictObject)) + { +! PyErr_SetString(PyExc_TypeError, +! _("'self' argument must be a dictionary")); + clear_tv(&args); + return NULL; + } +*** ../vim-7.3.610/src/version.c 2012-07-25 15:06:20.000000000 +0200 +--- src/version.c 2012-07-25 15:32:24.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 611, + /**/ + +-- +In Joseph Heller's novel "Catch-22", the main character tries to get out of a +war by proving he is crazy. But the mere fact he wants to get out of the war +only shows he isn't crazy -- creating the original "Catch-22". + + /// 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 /// From 675724fbab92a1e80de5090449a6f31947bd81b2 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:02 +0200 Subject: [PATCH 56/87] - patchlevel 612 --- 7.3.612 | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 7.3.612 diff --git a/7.3.612 b/7.3.612 new file mode 100644 index 00000000..7b2207ed --- /dev/null +++ b/7.3.612 @@ -0,0 +1,83 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.612 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.612 +Problem: Auto formatting messes up text when 'fo' contains "2". (ZyX) +Solution: Decrement "less_cols". (Tor Perkins) +Files: src/misc1.c, src/testdir/test68.in, src/testdir/test68.ok + + +*** ../vim-7.3.611/src/misc1.c 2012-07-06 16:49:37.000000000 +0200 +--- src/misc1.c 2012-07-25 16:03:58.000000000 +0200 +*************** +*** 1329,1334 **** +--- 1329,1335 ---- + for (i = 0; i < padding; i++) + { + STRCAT(leader, " "); ++ less_cols--; + newcol++; + } + } +*** ../vim-7.3.611/src/testdir/test68.in 2012-06-29 15:04:34.000000000 +0200 +--- src/testdir/test68.in 2012-07-25 15:57:06.000000000 +0200 +*************** +*** 94,99 **** +--- 94,109 ---- + } + + STARTTEST ++ /mno pqr/ ++ :setl tw=20 fo=an12wcq comments=s1:/*,mb:*,ex:*/ ++ A vwx yz ++ ENDTEST ++ ++ /* abc def ghi jkl ++ * mno pqr stu ++ */ ++ ++ STARTTEST + /^#/ + :setl tw=12 fo=tqnc comments=:# + A foobar +*** ../vim-7.3.611/src/testdir/test68.ok 2012-06-29 23:57:50.000000000 +0200 +--- src/testdir/test68.ok 2012-07-25 16:03:05.000000000 +0200 +*************** +*** 57,62 **** +--- 57,68 ---- + { 1aa ^^2bb } + + ++ /* abc def ghi jkl ++ * mno pqr stu ++ * vwx yz ++ */ ++ ++ + # 1 xxxxx + # foobar + +*** ../vim-7.3.611/src/version.c 2012-07-25 15:36:00.000000000 +0200 +--- src/version.c 2012-07-25 16:08:02.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 612, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +169. You hire a housekeeper for your home 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 /// From 89ade8c0932fe4ccfa6eb4b4a44c84a64d2ab81d Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:03 +0200 Subject: [PATCH 57/87] - patchlevel 613 --- 7.3.613 | 149 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 7.3.613 diff --git a/7.3.613 b/7.3.613 new file mode 100644 index 00000000..520e87c3 --- /dev/null +++ b/7.3.613 @@ -0,0 +1,149 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.613 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.613 +Problem: Including Python's config.c in the build causes trouble. It is + not clear why it was there. +Solution: Omit the config file. (James McCoy) +Files: src/Makefile, src/auto/configure, src/configure.in + + +*** ../vim-7.3.612/src/Makefile 2012-06-20 18:39:12.000000000 +0200 +--- src/Makefile 2012-07-25 16:22:57.000000000 +0200 +*************** +*** 2559,2577 **** + objects/if_perlsfio.o: if_perlsfio.c + $(CCC) $(PERL_CFLAGS) -o $@ if_perlsfio.c + +- objects/py_config.o: $(PYTHON_CONFDIR)/config.c +- $(CCC) $(PYTHON_CFLAGS) -o $@ $(PYTHON_CONFDIR)/config.c \ +- -I$(PYTHON_CONFDIR) -DHAVE_CONFIG_H -DNO_MAIN +- + objects/py_getpath.o: $(PYTHON_CONFDIR)/getpath.c + $(CCC) $(PYTHON_CFLAGS) -o $@ $(PYTHON_CONFDIR)/getpath.c \ + -I$(PYTHON_CONFDIR) -DHAVE_CONFIG_H -DNO_MAIN \ + $(PYTHON_GETPATH_CFLAGS) + +- objects/py3_config.o: $(PYTHON3_CONFDIR)/config.c +- $(CCC) $(PYTHON3_CFLAGS) -o $@ $(PYTHON3_CONFDIR)/config.c \ +- -I$(PYTHON3_CONFDIR) -DHAVE_CONFIG_H -DNO_MAIN +- + objects/if_python.o: if_python.c if_py_both.h + $(CCC) $(PYTHON_CFLAGS) $(PYTHON_CFLAGS_EXTRA) -o $@ if_python.c + +--- 2559,2569 ---- +*** ../vim-7.3.612/src/auto/configure 2012-06-13 19:19:36.000000000 +0200 +--- src/auto/configure 2012-07-25 16:23:49.000000000 +0200 +*************** +*** 5357,5367 **** + PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\"" + fi + PYTHON_SRC="if_python.c" +! if test "x$MACOSX" = "xyes"; then +! PYTHON_OBJ="objects/if_python.o" +! else +! PYTHON_OBJ="objects/if_python.o objects/py_config.o" +! fi + if test "${vi_cv_var_python_version}" = "1.4"; then + PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o" + fi +--- 5357,5363 ---- + PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\"" + fi + PYTHON_SRC="if_python.c" +! PYTHON_OBJ="objects/if_python.o" + if test "${vi_cv_var_python_version}" = "1.4"; then + PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o" + fi +*************** +*** 5656,5666 **** + PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\"" + fi + PYTHON3_SRC="if_python3.c" +! if test "x$MACOSX" = "xyes"; then +! PYTHON3_OBJ="objects/if_python3.o" +! else +! PYTHON3_OBJ="objects/if_python3.o objects/py3_config.o" +! fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -pthread should be used" >&5 + $as_echo_n "checking if -pthread should be used... " >&6; } +--- 5652,5658 ---- + PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\"" + fi + PYTHON3_SRC="if_python3.c" +! PYTHON3_OBJ="objects/if_python3.o" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -pthread should be used" >&5 + $as_echo_n "checking if -pthread should be used... " >&6; } +*** ../vim-7.3.612/src/configure.in 2012-06-13 19:19:36.000000000 +0200 +--- src/configure.in 2012-07-25 16:23:41.000000000 +0200 +*************** +*** 916,927 **** + PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\"" + fi + PYTHON_SRC="if_python.c" +! dnl For Mac OSX 10.2 config.o is included in the Python library. +! if test "x$MACOSX" = "xyes"; then +! PYTHON_OBJ="objects/if_python.o" +! else +! PYTHON_OBJ="objects/if_python.o objects/py_config.o" +! fi + if test "${vi_cv_var_python_version}" = "1.4"; then + PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o" + fi +--- 916,922 ---- + PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\"" + fi + PYTHON_SRC="if_python.c" +! PYTHON_OBJ="objects/if_python.o" + if test "${vi_cv_var_python_version}" = "1.4"; then + PYTHON_OBJ="$PYTHON_OBJ objects/py_getpath.o" + fi +*************** +*** 1106,1117 **** + PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\"" + fi + PYTHON3_SRC="if_python3.c" +! dnl For Mac OSX 10.2 config.o is included in the Python library. +! if test "x$MACOSX" = "xyes"; then +! PYTHON3_OBJ="objects/if_python3.o" +! else +! PYTHON3_OBJ="objects/if_python3.o objects/py3_config.o" +! fi + + dnl On FreeBSD linking with "-pthread" is required to use threads. + dnl _THREAD_SAFE must be used for compiling then. +--- 1101,1107 ---- + PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\"" + fi + PYTHON3_SRC="if_python3.c" +! PYTHON3_OBJ="objects/if_python3.o" + + dnl On FreeBSD linking with "-pthread" is required to use threads. + dnl _THREAD_SAFE must be used for compiling then. +*** ../vim-7.3.612/src/version.c 2012-07-25 16:09:59.000000000 +0200 +--- src/version.c 2012-07-25 16:29:52.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 613, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +170. You introduce your wife as "my_lady@home.wife" and refer to your + children as "forked processes." + + /// 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 /// From abe28fd6ba728cbcc6eeb0f6593e6efb1b8e096f Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:03 +0200 Subject: [PATCH 58/87] - patchlevel 614 --- 7.3.614 | 176 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 7.3.614 diff --git a/7.3.614 b/7.3.614 new file mode 100644 index 00000000..87d7a451 --- /dev/null +++ b/7.3.614 @@ -0,0 +1,176 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.614 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.614 +Problem: Number argument gets turned into a number while it should be a + string. +Solution: Add flag to the call_vim_function() call. (Yasuhiro Matsumoto) +Files: src/edit.c, src/eval.c, src/proto/eval.pro + + +*** ../vim-7.3.613/src/edit.c 2012-07-10 17:14:50.000000000 +0200 +--- src/edit.c 2012-07-25 16:40:07.000000000 +0200 +*************** +*** 3959,3965 **** + curbuf_save = curbuf; + + /* Call a function, which returns a list or dict. */ +! if (call_vim_function(funcname, 2, args, FALSE, &rettv) == OK) + { + switch (rettv.v_type) + { +--- 3959,3965 ---- + curbuf_save = curbuf; + + /* Call a function, which returns a list or dict. */ +! if (call_vim_function(funcname, 2, args, FALSE, FALSE, &rettv) == OK) + { + switch (rettv.v_type) + { +*** ../vim-7.3.613/src/eval.c 2012-07-19 18:05:40.000000000 +0200 +--- src/eval.c 2012-07-25 16:42:41.000000000 +0200 +*************** +*** 1564,1574 **** + * Returns OK or FAIL. + */ + int +! call_vim_function(func, argc, argv, safe, rettv) + char_u *func; + int argc; + char_u **argv; + int safe; /* use the sandbox */ + typval_T *rettv; + { + typval_T *argvars; +--- 1564,1575 ---- + * Returns OK or FAIL. + */ + int +! call_vim_function(func, argc, argv, safe, str_arg_only, rettv) + char_u *func; + int argc; + char_u **argv; + int safe; /* use the sandbox */ ++ int str_arg_only; /* all arguments are strings */ + typval_T *rettv; + { + typval_T *argvars; +*************** +*** 1593,1600 **** + continue; + } + +! /* Recognize a number argument, the others must be strings. */ +! vim_str2nr(argv[i], NULL, &len, TRUE, TRUE, &n, NULL); + if (len != 0 && len == (int)STRLEN(argv[i])) + { + argvars[i].v_type = VAR_NUMBER; +--- 1594,1604 ---- + continue; + } + +! if (str_arg_only) +! len = 0; +! else +! /* Recognize a number argument, the others must be strings. */ +! vim_str2nr(argv[i], NULL, &len, TRUE, TRUE, &n, NULL); + if (len != 0 && len == (int)STRLEN(argv[i])) + { + argvars[i].v_type = VAR_NUMBER; +*************** +*** 1646,1652 **** + typval_T rettv; + char_u *retval; + +! if (call_vim_function(func, argc, argv, safe, &rettv) == FAIL) + return NULL; + + retval = vim_strsave(get_tv_string(&rettv)); +--- 1650,1657 ---- + typval_T rettv; + char_u *retval; + +! /* All arguments are passed as strings, no conversion to number. */ +! if (call_vim_function(func, argc, argv, safe, TRUE, &rettv) == FAIL) + return NULL; + + retval = vim_strsave(get_tv_string(&rettv)); +*************** +*** 1671,1677 **** + typval_T rettv; + long retval; + +! if (call_vim_function(func, argc, argv, safe, &rettv) == FAIL) + return -1; + + retval = get_tv_number_chk(&rettv, NULL); +--- 1676,1683 ---- + typval_T rettv; + long retval; + +! /* All arguments are passed as strings, no conversion to number. */ +! if (call_vim_function(func, argc, argv, safe, TRUE, &rettv) == FAIL) + return -1; + + retval = get_tv_number_chk(&rettv, NULL); +*************** +*** 1694,1700 **** + { + typval_T rettv; + +! if (call_vim_function(func, argc, argv, safe, &rettv) == FAIL) + return NULL; + + if (rettv.v_type != VAR_LIST) +--- 1700,1707 ---- + { + typval_T rettv; + +! /* All arguments are passed as strings, no conversion to number. */ +! if (call_vim_function(func, argc, argv, safe, TRUE, &rettv) == FAIL) + return NULL; + + if (rettv.v_type != VAR_LIST) +*** ../vim-7.3.613/src/proto/eval.pro 2012-07-16 17:31:48.000000000 +0200 +--- src/proto/eval.pro 2012-07-25 16:42:59.000000000 +0200 +*************** +*** 23,29 **** + list_T *eval_spell_expr __ARGS((char_u *badword, char_u *expr)); + int get_spellword __ARGS((list_T *list, char_u **pp)); + typval_T *eval_expr __ARGS((char_u *arg, char_u **nextcmd)); +! int call_vim_function __ARGS((char_u *func, int argc, char_u **argv, int safe, typval_T *rettv)); + void *call_func_retstr __ARGS((char_u *func, int argc, char_u **argv, int safe)); + long call_func_retnr __ARGS((char_u *func, int argc, char_u **argv, int safe)); + void *call_func_retlist __ARGS((char_u *func, int argc, char_u **argv, int safe)); +--- 23,29 ---- + list_T *eval_spell_expr __ARGS((char_u *badword, char_u *expr)); + int get_spellword __ARGS((list_T *list, char_u **pp)); + typval_T *eval_expr __ARGS((char_u *arg, char_u **nextcmd)); +! int call_vim_function __ARGS((char_u *func, int argc, char_u **argv, int safe, int str_arg_only, typval_T *rettv)); + void *call_func_retstr __ARGS((char_u *func, int argc, char_u **argv, int safe)); + long call_func_retnr __ARGS((char_u *func, int argc, char_u **argv, int safe)); + void *call_func_retlist __ARGS((char_u *func, int argc, char_u **argv, int safe)); +*** ../vim-7.3.613/src/version.c 2012-07-25 16:32:03.000000000 +0200 +--- src/version.c 2012-07-25 16:46:11.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 614, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +171. You invent another person and chat with yourself in empty chat rooms. + + /// 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 /// From 9041a7506fd45a80cfb3e3e5fa59633d2c43c32f Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:03 +0200 Subject: [PATCH 59/87] - patchlevel 615 --- 7.3.615 | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 7.3.615 diff --git a/7.3.615 b/7.3.615 new file mode 100644 index 00000000..96f6885f --- /dev/null +++ b/7.3.615 @@ -0,0 +1,107 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.615 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.615 +Problem: Completion for a user command does not recognize backslash before + a space. +Solution: Recognize escaped characters. (Yasuhiro Matsumoto) +Files: src/ex_docmd.c + + +*** ../vim-7.3.614/src/ex_docmd.c 2012-07-10 19:25:06.000000000 +0200 +--- src/ex_docmd.c 2012-07-25 17:10:16.000000000 +0200 +*************** +*** 3390,3401 **** + return NULL; + + /* Find start of last argument (argument just before cursor): */ +! p = buff + STRLEN(buff); +! while (p != arg && *p != ' ' && *p != TAB) +! p--; +! if (*p == ' ' || *p == TAB) +! p++; + xp->xp_pattern = p; + + if (ea.argt & XFILE) + { +--- 3390,3412 ---- + return NULL; + + /* Find start of last argument (argument just before cursor): */ +! p = buff; + xp->xp_pattern = p; ++ len = STRLEN(buff); ++ while (*p && p < buff + len) ++ { ++ if (*p == ' ' || *p == TAB) ++ { ++ /* argument starts after a space */ ++ xp->xp_pattern = ++p; ++ } ++ else ++ { ++ if (*p == '\\' && *(p + 1) != NUL) ++ ++p; /* skip over escaped character */ ++ mb_ptr_adv(p); ++ } ++ } + + if (ea.argt & XFILE) + { +*************** +*** 3821,3828 **** + if (compl == EXPAND_MAPPINGS) + return set_context_in_map_cmd(xp, (char_u *)"map", + arg, forceit, FALSE, FALSE, CMD_map); +! while ((xp->xp_pattern = vim_strchr(arg, ' ')) != NULL) +! arg = xp->xp_pattern + 1; + xp->xp_pattern = arg; + } + xp->xp_context = compl; +--- 3832,3853 ---- + if (compl == EXPAND_MAPPINGS) + return set_context_in_map_cmd(xp, (char_u *)"map", + arg, forceit, FALSE, FALSE, CMD_map); +! /* Find start of last argument. */ +! p = arg; +! while (*p) +! { +! if (*p == ' ') +! { +! /* argument starts after a space */ +! arg = p + 1; +! } +! else +! { +! if (*p == '\\' && *(p + 1) != NUL) +! ++p; /* skip over escaped character */ +! mb_ptr_adv(p); +! } +! } + xp->xp_pattern = arg; + } + xp->xp_context = compl; +*** ../vim-7.3.614/src/version.c 2012-07-25 16:46:59.000000000 +0200 +--- src/version.c 2012-07-25 17:17:05.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 615, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +172. You join listservers just for the extra 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 /// From 6de293c6c89bb2e02d6bf2018556c44eadae0067 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:04 +0200 Subject: [PATCH 60/87] - patchlevel 616 --- 7.3.616 | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 7.3.616 diff --git a/7.3.616 b/7.3.616 new file mode 100644 index 00000000..5898eafe --- /dev/null +++ b/7.3.616 @@ -0,0 +1,46 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.616 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.616 (after 7.3.610) +Problem: Can't compile without +visual. +Solution: Add #ifdef. +Files: src/normal.c + + +*** ../vim-7.3.615/src/normal.c 2012-07-25 15:06:20.000000000 +0200 +--- src/normal.c 2012-07-27 20:52:01.000000000 +0200 +*************** +*** 8002,8008 **** +--- 8002,8010 ---- + */ + case 'N': + case 'n': ++ #ifdef FEAT_VISUAL + if (!current_search(cap->count1, cap->nchar == 'n')) ++ #endif + beep_flush(); + + break; +*** ../vim-7.3.615/src/version.c 2012-07-25 17:22:17.000000000 +0200 +--- src/version.c 2012-07-27 20:52:58.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 616, + /**/ + +-- +The CIA drives around in cars with the "Intel inside" logo. + + /// 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 /// From a777fa1a07bbec34f67dd951c6a9e40d4a6d0d3e Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:04 +0200 Subject: [PATCH 61/87] - patchlevel 617 --- 7.3.617 | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 7.3.617 diff --git a/7.3.617 b/7.3.617 new file mode 100644 index 00000000..48062cd2 --- /dev/null +++ b/7.3.617 @@ -0,0 +1,65 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.617 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.617 (after 7.3.615) +Problem: Hang on completion. +Solution: Skip over the space. (Yasuhiro Matsumoto) +Files: src/ex_docmd.c + + +*** ../vim-7.3.616/src/ex_docmd.c 2012-07-25 17:22:17.000000000 +0200 +--- src/ex_docmd.c 2012-07-27 21:07:42.000000000 +0200 +*************** +*** 3837,3852 **** + while (*p) + { + if (*p == ' ') +- { + /* argument starts after a space */ + arg = p + 1; +! } +! else +! { +! if (*p == '\\' && *(p + 1) != NUL) +! ++p; /* skip over escaped character */ +! mb_ptr_adv(p); +! } + } + xp->xp_pattern = arg; + } +--- 3837,3847 ---- + while (*p) + { + if (*p == ' ') + /* argument starts after a space */ + arg = p + 1; +! else if (*p == '\\' && *(p + 1) != NUL) +! ++p; /* skip over escaped character */ +! mb_ptr_adv(p); + } + xp->xp_pattern = arg; + } +*** ../vim-7.3.616/src/version.c 2012-07-27 21:05:51.000000000 +0200 +--- src/version.c 2012-07-27 21:08:31.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 617, + /**/ + +-- +If Microsoft would build a car... +... You'd have to press the "Start" button to turn the engine off. + + /// 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 /// From 30f24ce2a7e537c9cf55f91e7b1f17101a88d53d Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:04 +0200 Subject: [PATCH 62/87] - patchlevel 618 --- 7.3.618 | 367 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 367 insertions(+) create mode 100644 7.3.618 diff --git a/7.3.618 b/7.3.618 new file mode 100644 index 00000000..d0cc9c68 --- /dev/null +++ b/7.3.618 @@ -0,0 +1,367 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.618 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.618 (after 7.3.616) +Problem: Still doesn't compile with small features. +Solution: Move current_search() out of #ifdef. (Dominique Pelle) +Files: src/normal.c, src/search.c + + +*** ../vim-7.3.617/src/normal.c 2012-07-27 21:05:51.000000000 +0200 +--- src/normal.c 2012-07-28 13:34:13.000000000 +0200 +*************** +*** 7995,8000 **** +--- 7995,8001 ---- + cap->arg = TRUE; + nv_visual(cap); + break; ++ #endif /* FEAT_VISUAL */ + + /* "gn", "gN" visually select next/previous search match + * "gn" selects next match +*************** +*** 8006,8014 **** + if (!current_search(cap->count1, cap->nchar == 'n')) + #endif + beep_flush(); +- + break; +- #endif /* FEAT_VISUAL */ + + /* + * "gj" and "gk" two new funny movement keys -- up and down +--- 8007,8013 ---- +*** ../vim-7.3.617/src/search.c 2012-07-25 15:06:20.000000000 +0200 +--- src/search.c 2012-07-28 13:37:19.000000000 +0200 +*************** +*** 3397,3547 **** + return OK; + } + +- #if defined(FEAT_VISUAL) || defined(PROTO) +- /* +- * Find next search match under cursor, cursor at end. +- * Used while an operator is pending, and in Visual mode. +- * TODO: redo only works when used in operator pending mode +- */ +- int +- current_search(count, forward) +- long count; +- int forward; /* move forward or backwards */ +- { +- pos_T start_pos; /* position before the pattern */ +- pos_T orig_pos; /* position of the cursor at beginning */ +- pos_T pos; /* position after the pattern */ +- int i; +- int dir; +- int result; /* result of various function calls */ +- char_u old_p_ws = p_ws; +- int visual_active = FALSE; +- int flags = 0; +- pos_T save_VIsual; +- +- +- /* wrapping should not occur */ +- p_ws = FALSE; +- +- /* Correct cursor when 'selection' is exclusive */ +- if (VIsual_active && *p_sel == 'e' && lt(VIsual, curwin->w_cursor)) +- dec_cursor(); +- +- if (VIsual_active) +- { +- orig_pos = curwin->w_cursor; +- save_VIsual = VIsual; +- visual_active = TRUE; +- +- /* just started visual selection, only one character */ +- if (equalpos(VIsual, curwin->w_cursor)) +- visual_active = FALSE; +- +- pos = curwin->w_cursor; +- start_pos = VIsual; +- +- /* make sure, searching further will extend the match */ +- if (VIsual_active) +- { +- if (forward) +- incl(&pos); +- else +- decl(&pos); +- } +- } +- else +- orig_pos = pos = start_pos = curwin->w_cursor; +- +- /* +- * The trick is to first search backwards and then search forward again, +- * so that a match at the current cursor position will be correctly +- * captured. +- */ +- for (i = 0; i < 2; i++) +- { +- if (i && count == 1) +- flags = SEARCH_START; +- +- if (forward) +- dir = i; +- else +- dir = !i; +- result = searchit(curwin, curbuf, &pos, (dir ? FORWARD : BACKWARD), +- spats[last_idx].pat, (long) (i ? count : 1), +- SEARCH_KEEP | flags | (dir ? 0 : SEARCH_END), +- RE_SEARCH, 0, NULL); +- +- /* First search may fail, but then start searching from the +- * beginning of the file (cursor might be on the search match) +- * except when Visual mode is active, so that extending the visual +- * selection works. */ +- if (!result && i) /* not found, abort */ +- { +- curwin->w_cursor = orig_pos; +- if (VIsual_active) +- VIsual = save_VIsual; +- p_ws = old_p_ws; +- return FAIL; +- } +- else if (!i && !result && !visual_active) +- { +- if (forward) /* try again from start of buffer */ +- { +- clearpos(&pos); +- } +- else /* try again from end of buffer */ +- { +- /* searching backwards, so set pos to last line and col */ +- pos.lnum = curwin->w_buffer->b_ml.ml_line_count; +- pos.col = STRLEN(ml_get(curwin->w_buffer->b_ml.ml_line_count)); +- } +- } +- +- } +- +- start_pos = pos; +- flags = (forward ? SEARCH_END : 0); +- +- /* move to match */ +- result = searchit(curwin, curbuf, &pos, (forward ? FORWARD : BACKWARD), +- spats[last_idx].pat, 0L, flags | SEARCH_KEEP, RE_SEARCH, 0, NULL); +- +- if (!VIsual_active) +- VIsual = start_pos; +- +- p_ws = old_p_ws; +- curwin->w_cursor = pos; +- VIsual_active = TRUE; +- VIsual_mode = 'v'; +- +- if (VIsual_active) +- { +- redraw_curbuf_later(INVERTED); /* update the inversion */ +- if (*p_sel == 'e' && ltoreq(VIsual, curwin->w_cursor)) +- inc_cursor(); +- } +- +- #ifdef FEAT_FOLDING +- if (fdo_flags & FDO_SEARCH && KeyTyped) +- foldOpenCursor(); +- #endif +- +- may_start_select('c'); +- #ifdef FEAT_MOUSE +- setmouse(); +- #endif +- #ifdef FEAT_CLIPBOARD +- /* Make sure the clipboard gets updated. Needed because start and +- * end are still the same, and the selection needs to be owned */ +- clip_star.vmode = NUL; +- #endif +- redraw_curbuf_later(INVERTED); +- showmode(); +- +- return OK; +- } +- #endif /* FEAT_VISUAL */ +- + /* + * Find sentence(s) under the cursor, cursor at end. + * When Visual active, extend it by one or more sentences. +--- 3397,3402 ---- +*************** +*** 4670,4675 **** +--- 4525,4675 ---- + + #endif /* FEAT_TEXTOBJ */ + ++ #if defined(FEAT_VISUAL) || defined(PROTO) ++ /* ++ * Find next search match under cursor, cursor at end. ++ * Used while an operator is pending, and in Visual mode. ++ * TODO: redo only works when used in operator pending mode ++ */ ++ int ++ current_search(count, forward) ++ long count; ++ int forward; /* move forward or backwards */ ++ { ++ pos_T start_pos; /* position before the pattern */ ++ pos_T orig_pos; /* position of the cursor at beginning */ ++ pos_T pos; /* position after the pattern */ ++ int i; ++ int dir; ++ int result; /* result of various function calls */ ++ char_u old_p_ws = p_ws; ++ int visual_active = FALSE; ++ int flags = 0; ++ pos_T save_VIsual; ++ ++ ++ /* wrapping should not occur */ ++ p_ws = FALSE; ++ ++ /* Correct cursor when 'selection' is exclusive */ ++ if (VIsual_active && *p_sel == 'e' && lt(VIsual, curwin->w_cursor)) ++ dec_cursor(); ++ ++ if (VIsual_active) ++ { ++ orig_pos = curwin->w_cursor; ++ save_VIsual = VIsual; ++ visual_active = TRUE; ++ ++ /* just started visual selection, only one character */ ++ if (equalpos(VIsual, curwin->w_cursor)) ++ visual_active = FALSE; ++ ++ pos = curwin->w_cursor; ++ start_pos = VIsual; ++ ++ /* make sure, searching further will extend the match */ ++ if (VIsual_active) ++ { ++ if (forward) ++ incl(&pos); ++ else ++ decl(&pos); ++ } ++ } ++ else ++ orig_pos = pos = start_pos = curwin->w_cursor; ++ ++ /* ++ * The trick is to first search backwards and then search forward again, ++ * so that a match at the current cursor position will be correctly ++ * captured. ++ */ ++ for (i = 0; i < 2; i++) ++ { ++ if (i && count == 1) ++ flags = SEARCH_START; ++ ++ if (forward) ++ dir = i; ++ else ++ dir = !i; ++ result = searchit(curwin, curbuf, &pos, (dir ? FORWARD : BACKWARD), ++ spats[last_idx].pat, (long) (i ? count : 1), ++ SEARCH_KEEP | flags | (dir ? 0 : SEARCH_END), ++ RE_SEARCH, 0, NULL); ++ ++ /* First search may fail, but then start searching from the ++ * beginning of the file (cursor might be on the search match) ++ * except when Visual mode is active, so that extending the visual ++ * selection works. */ ++ if (!result && i) /* not found, abort */ ++ { ++ curwin->w_cursor = orig_pos; ++ if (VIsual_active) ++ VIsual = save_VIsual; ++ p_ws = old_p_ws; ++ return FAIL; ++ } ++ else if (!i && !result && !visual_active) ++ { ++ if (forward) /* try again from start of buffer */ ++ { ++ clearpos(&pos); ++ } ++ else /* try again from end of buffer */ ++ { ++ /* searching backwards, so set pos to last line and col */ ++ pos.lnum = curwin->w_buffer->b_ml.ml_line_count; ++ pos.col = STRLEN(ml_get(curwin->w_buffer->b_ml.ml_line_count)); ++ } ++ } ++ ++ } ++ ++ start_pos = pos; ++ flags = (forward ? SEARCH_END : 0); ++ ++ /* move to match */ ++ result = searchit(curwin, curbuf, &pos, (forward ? FORWARD : BACKWARD), ++ spats[last_idx].pat, 0L, flags | SEARCH_KEEP, RE_SEARCH, 0, NULL); ++ ++ if (!VIsual_active) ++ VIsual = start_pos; ++ ++ p_ws = old_p_ws; ++ curwin->w_cursor = pos; ++ VIsual_active = TRUE; ++ VIsual_mode = 'v'; ++ ++ if (VIsual_active) ++ { ++ redraw_curbuf_later(INVERTED); /* update the inversion */ ++ if (*p_sel == 'e' && ltoreq(VIsual, curwin->w_cursor)) ++ inc_cursor(); ++ } ++ ++ #ifdef FEAT_FOLDING ++ if (fdo_flags & FDO_SEARCH && KeyTyped) ++ foldOpenCursor(); ++ #endif ++ ++ may_start_select('c'); ++ #ifdef FEAT_MOUSE ++ setmouse(); ++ #endif ++ #ifdef FEAT_CLIPBOARD ++ /* Make sure the clipboard gets updated. Needed because start and ++ * end are still the same, and the selection needs to be owned */ ++ clip_star.vmode = NUL; ++ #endif ++ redraw_curbuf_later(INVERTED); ++ showmode(); ++ ++ return OK; ++ } ++ #endif /* FEAT_VISUAL */ ++ + #if defined(FEAT_LISP) || defined(FEAT_CINDENT) || defined(FEAT_TEXTOBJ) \ + || defined(PROTO) + /* +*** ../vim-7.3.617/src/version.c 2012-07-27 21:12:03.000000000 +0200 +--- src/version.c 2012-07-29 12:54:29.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 618, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +185. You order fast food over the Internet + + /// 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 /// From f5c8f33187c459bf990af96902d4c1f4294e1bb5 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:05 +0200 Subject: [PATCH 63/87] - patchlevel 619 --- 7.3.619 | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 7.3.619 diff --git a/7.3.619 b/7.3.619 new file mode 100644 index 00000000..1fedcc78 --- /dev/null +++ b/7.3.619 @@ -0,0 +1,50 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.619 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.619 +Problem: When executing a shell command Vim may become slow to respond. +Solution: Don't wait after every processed message. (idea by Yasuhiro + Matsumoto) +Files: src/os_win32.c + + +*** ../vim-7.3.618/src/os_win32.c 2012-07-19 11:37:22.000000000 +0200 +--- src/os_win32.c 2012-08-02 12:30:52.000000000 +0200 +*************** +*** 3319,3324 **** +--- 3319,3326 ---- + { + TranslateMessage(&msg); + pDispatchMessage(&msg); ++ delay = 1; ++ continue; + } + if (WaitForSingleObject(pi.hProcess, delay) != WAIT_TIMEOUT) + break; +*** ../vim-7.3.618/src/version.c 2012-07-29 12:55:21.000000000 +0200 +--- src/version.c 2012-08-02 12:29:08.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 619, + /**/ + +-- +Some of the well know MS-Windows errors: + EMULTI Multitasking attempted, system confused + EKEYBOARD Keyboard locked, try getting out of this one! + EXPLAIN Unexplained error, please tell us what happened + EFUTURE Reserved for our future mistakes + + /// 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 /// From de19434fbcf72591f0b8386d5d9d65cae12d9f90 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:05 +0200 Subject: [PATCH 64/87] - patchlevel 620 --- 7.3.620 | 163 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 7.3.620 diff --git a/7.3.620 b/7.3.620 new file mode 100644 index 00000000..5890f15f --- /dev/null +++ b/7.3.620 @@ -0,0 +1,163 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.620 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.620 +Problem: Building with recent Ruby on Win32 doesn't work. +Solution: Add a separate argument for the API version. (Yasuhiro Matsumoto) +Files: src/Make_ming.mak, src/Make_mvc.mak + + +*** ../vim-7.3.619/src/Make_ming.mak 2012-07-06 13:40:44.000000000 +0200 +--- src/Make_ming.mak 2012-08-02 17:02:34.000000000 +0200 +*************** +*** 260,266 **** + # DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically) + # RUBY_VER=[Ruby version, eg 16, 17] (default is 16) + # RUBY_VER_LONG=[Ruby version, eg 1.6, 1.7] (default is 1.6) +! # You must set RUBY_VER_LONG when change RUBY_VER. + #RUBY=c:/ruby + ifdef RUBY + ifndef DYNAMIC_RUBY +--- 260,268 ---- + # DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically) + # RUBY_VER=[Ruby version, eg 16, 17] (default is 16) + # RUBY_VER_LONG=[Ruby version, eg 1.6, 1.7] (default is 1.6) +! # You must set RUBY_VER_LONG when changing RUBY_VER. +! # You must set RUBY_API_VER version to RUBY_VER_LONG. +! # Don't set ruby API version to RUBY_VER like 191. + #RUBY=c:/ruby + ifdef RUBY + ifndef DYNAMIC_RUBY +*************** +*** 273,278 **** +--- 275,283 ---- + ifndef RUBY_VER_LONG + RUBY_VER_LONG = 1.6 + endif ++ ifndef RUBY_API_VER ++ RUBY_API_VER = $(subst .,,$(RUBY_VER_LONG)) ++ endif + + ifndef RUBY_PLATFORM + ifeq ($(RUBY_VER), 16) +*************** +*** 288,296 **** + + ifndef RUBY_INSTALL_NAME + ifeq ($(RUBY_VER), 16) +! RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER) + else +! RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER) + endif + endif + +--- 293,301 ---- + + ifndef RUBY_INSTALL_NAME + ifeq ($(RUBY_VER), 16) +! RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER) + else +! RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_API_VER) + endif + endif + +*** ../vim-7.3.619/src/Make_mvc.mak 2012-02-22 16:01:53.000000000 +0100 +--- src/Make_mvc.mak 2012-08-02 17:42:31.000000000 +0200 +*************** +*** 63,68 **** +--- 63,70 ---- + # RUBY_VER=[Ruby version, eg 16, 17] (default is 18) + # RUBY_VER_LONG=[Ruby version, eg 1.6, 1.7] (default is 1.8) + # You must set RUBY_VER_LONG when change RUBY_VER. ++ # You must set RUBY_API_VER to RUBY_VER_LONG. ++ # Don't set ruby API version to RUBY_VER like 191. + # + # Tcl interface: + # TCL=[Path to Tcl directory] +*************** +*** 807,834 **** + !ifndef RUBY_VER_LONG + RUBY_VER_LONG = 1.8 + !endif + + !if $(RUBY_VER) >= 18 + !ifndef RUBY_PLATFORM + RUBY_PLATFORM = i386-mswin32 + !endif + !ifndef RUBY_INSTALL_NAME +! RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_VER) + !endif + !else + !ifndef RUBY_PLATFORM + RUBY_PLATFORM = i586-mswin32 + !endif + !ifndef RUBY_INSTALL_NAME +! RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_VER) + !endif + !endif # $(RUBY_VER) >= 18 + + !message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)" + CFLAGS = $(CFLAGS) -DFEAT_RUBY + RUBY_OBJ = $(OUTDIR)\if_ruby.obj +! !if $(RUBY_VER) >= 190 +! RUBY_INC = /I "$(RUBY)\include\ruby-$(RUBY_VER_LONG)\$(RUBY_PLATFORM)" /I "$(RUBY)\include\ruby-$(RUBY_VER_LONG)" + !else + RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)" + !endif +--- 813,843 ---- + !ifndef RUBY_VER_LONG + RUBY_VER_LONG = 1.8 + !endif ++ !ifndef RUBY_API_VER ++ RUBY_API_VER = $(RUBY_VER_LONG:.=) ++ !endif + + !if $(RUBY_VER) >= 18 + !ifndef RUBY_PLATFORM + RUBY_PLATFORM = i386-mswin32 + !endif + !ifndef RUBY_INSTALL_NAME +! RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_API_VER) + !endif + !else + !ifndef RUBY_PLATFORM + RUBY_PLATFORM = i586-mswin32 + !endif + !ifndef RUBY_INSTALL_NAME +! RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER) + !endif + !endif # $(RUBY_VER) >= 18 + + !message Ruby requested (version $(RUBY_VER)) - root dir is "$(RUBY)" + CFLAGS = $(CFLAGS) -DFEAT_RUBY + RUBY_OBJ = $(OUTDIR)\if_ruby.obj +! !if $(RUBY_VER) >= 19 +! RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)" /I "$(RUBY)\include\ruby-$(RUBY_VER_LONG)" /I "$(RUBY)\include\ruby-$(RUBY_VER_LONG)\$(RUBY_PLATFORM)" + !else + RUBY_INC = /I "$(RUBY)\lib\ruby\$(RUBY_VER_LONG)\$(RUBY_PLATFORM)" + !endif +*** ../vim-7.3.619/src/version.c 2012-08-02 12:31:40.000000000 +0200 +--- src/version.c 2012-08-02 21:20:28.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 620, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +199. You read this entire list of symptoms, looking for something + that doesn't describe you. + + /// 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 /// From 70b8457282cf704a2788cc05dbcdc8c14d814fcc Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:05 +0200 Subject: [PATCH 65/87] - patchlevel 621 --- 7.3.621 | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 7.3.621 diff --git a/7.3.621 b/7.3.621 new file mode 100644 index 00000000..7e3fe2a5 --- /dev/null +++ b/7.3.621 @@ -0,0 +1,72 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.621 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.621 +Problem: Compiler warnings on 64 bit windows. +Solution: Add type casts. (Mike Williams) +Files: src/ex_docmd.c, src/search.c + + +*** ../vim-7.3.620/src/ex_docmd.c 2012-07-27 21:12:03.000000000 +0200 +--- src/ex_docmd.c 2012-08-02 21:19:22.000000000 +0200 +*************** +*** 3392,3398 **** + /* Find start of last argument (argument just before cursor): */ + p = buff; + xp->xp_pattern = p; +! len = STRLEN(buff); + while (*p && p < buff + len) + { + if (*p == ' ' || *p == TAB) +--- 3392,3398 ---- + /* Find start of last argument (argument just before cursor): */ + p = buff; + xp->xp_pattern = p; +! len = (int)STRLEN(buff); + while (*p && p < buff + len) + { + if (*p == ' ' || *p == TAB) +*** ../vim-7.3.620/src/search.c 2012-07-29 12:55:21.000000000 +0200 +--- src/search.c 2012-08-02 21:20:02.000000000 +0200 +*************** +*** 4621,4627 **** + { + /* searching backwards, so set pos to last line and col */ + pos.lnum = curwin->w_buffer->b_ml.ml_line_count; +! pos.col = STRLEN(ml_get(curwin->w_buffer->b_ml.ml_line_count)); + } + } + +--- 4621,4628 ---- + { + /* searching backwards, so set pos to last line and col */ + pos.lnum = curwin->w_buffer->b_ml.ml_line_count; +! pos.col = (colnr_T)STRLEN( +! ml_get(curwin->w_buffer->b_ml.ml_line_count)); + } + } + +*** ../vim-7.3.620/src/version.c 2012-08-02 21:21:43.000000000 +0200 +--- src/version.c 2012-08-02 21:23:13.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 621, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +200. You really believe in the concept of a "paperless" office. + + /// 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 /// From 3caf57bc247c09afdecddc1b905955db074ce514 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:06 +0200 Subject: [PATCH 66/87] - patchlevel 622 --- 7.3.622 | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 7.3.622 diff --git a/7.3.622 b/7.3.622 new file mode 100644 index 00000000..a2c26014 --- /dev/null +++ b/7.3.622 @@ -0,0 +1,56 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.622 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.622 +Problem: XPM library for Win32 can't be found. +Solution: Suggest using the one from the Vim ftp site. +Files: src/Make_mvc.mak + + +*** ../vim-7.3.621/src/Make_mvc.mak 2012-08-02 21:21:43.000000000 +0200 +--- src/Make_mvc.mak 2012-08-02 21:45:52.000000000 +0200 +*************** +*** 281,287 **** + + !ifdef XPM + # XPM - Include support for XPM signs +! # you can get xpm.lib from http://iamphet.nm.ru/xpm or create it yourself + XPM_OBJ = $(OBJDIR)/xpm_w32.obj + XPM_DEFS = -DFEAT_XPM_W32 + XPM_LIB = $(XPM)\lib\libXpm.lib +--- 281,291 ---- + + !ifdef XPM + # XPM - Include support for XPM signs +! # You need to download or build xpm.lib somehow. +! # You can get the most recent version of libXpm-*.zip from +! # http://cgit.freedesktop.org/xorg/lib/libXpm +! # from which you must build xpm.lib yourself +! # OR get and unpack: ftp://ftp.vim.org/pub/vim/pcextra/xpm.zip + XPM_OBJ = $(OBJDIR)/xpm_w32.obj + XPM_DEFS = -DFEAT_XPM_W32 + XPM_LIB = $(XPM)\lib\libXpm.lib +*** ../vim-7.3.621/src/version.c 2012-08-02 21:24:38.000000000 +0200 +--- src/version.c 2012-08-02 21:46:43.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 622, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +202. You're amazed to find out Spam is a food. + + /// 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 /// From 43b081ac954ae1f274a6902e98f4d47440d52b4f Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:06 +0200 Subject: [PATCH 67/87] - patchlevel 623 --- 7.3.623 | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 7.3.623 diff --git a/7.3.623 b/7.3.623 new file mode 100644 index 00000000..72aea71f --- /dev/null +++ b/7.3.623 @@ -0,0 +1,92 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.623 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.623 +Problem: Perl 5.14 commands crash Vim on MS-Windows. +Solution: Use perl_get_sv() instead of GvSV(). (Raymond Ko) +Files: src/if_perl.xs + + +*** ../vim-7.3.622/src/if_perl.xs 2012-03-16 19:34:43.000000000 +0100 +--- src/if_perl.xs 2012-08-08 13:15:29.000000000 +0200 +*************** +*** 76,81 **** +--- 76,87 ---- + # define EXTERN_C + #endif + ++ #if (PERL_REVISION == 5) && (PERL_VERSION >= 14) && defined(_MSC_VER) ++ /* Using PL_errgv to get the error message after perl_eval_sv() causes a crash ++ * with MSVC and Perl version 5.14. */ ++ # define AVOID_PL_ERRGV ++ #endif ++ + /* Compatibility hacks over */ + + static PerlInterpreter *perl_interp = NULL; +*************** +*** 796,802 **** +--- 802,812 ---- + + SvREFCNT_dec(sv); + ++ #ifdef AVOID_PL_ERRGV ++ err = SvPV(perl_get_sv("@", GV_ADD), length); ++ #else + err = SvPV(GvSV(PL_errgv), length); ++ #endif + + FREETMPS; + LEAVE; +*************** +*** 866,872 **** +--- 876,886 ---- + sv_catpvn(sv, "}", 1); + perl_eval_sv(sv, G_DISCARD | G_NOARGS); + SvREFCNT_dec(sv); ++ #ifdef AVOID_PL_ERRGV ++ str = SvPV(perl_get_sv("@", GV_ADD), length); ++ #else + str = SvPV(GvSV(PL_errgv), length); ++ #endif + if (length) + goto err; + +*************** +*** 880,886 **** +--- 894,904 ---- + sv_setpv(GvSV(PL_defgv), (char *)ml_get(i)); + PUSHMARK(sp); + perl_call_pv("VIM::perldo", G_SCALAR | G_EVAL); ++ #ifdef AVOID_PL_ERRGV ++ str = SvPV(perl_get_sv("@", GV_ADD), length); ++ #else + str = SvPV(GvSV(PL_errgv), length); ++ #endif + if (length) + break; + SPAGAIN; +*** ../vim-7.3.622/src/version.c 2012-08-02 21:48:20.000000000 +0200 +--- src/version.c 2012-08-08 13:08:10.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 623, + /**/ + +-- +Don't be humble ... you're not that great. + -- Golda Meir + + /// 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 /// From b4d2b52e62bb7a266ce3c0e3ef1ffcee3275ec6e Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:06 +0200 Subject: [PATCH 68/87] - patchlevel 624 --- 7.3.624 | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 7.3.624 diff --git a/7.3.624 b/7.3.624 new file mode 100644 index 00000000..f1150b63 --- /dev/null +++ b/7.3.624 @@ -0,0 +1,52 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.624 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.624 +Problem: When cancelling input() it returns the third argument. That should + only happen for inputdialog(). +Solution: Check if inputdialog() was used. (Hirohito Higashi) +Files: src/eval.c + + +*** ../vim-7.3.623/src/eval.c 2012-07-25 16:46:59.000000000 +0200 +--- src/eval.c 2012-08-08 14:31:48.000000000 +0200 +*************** +*** 12966,12972 **** + rettv->vval.v_string = + getcmdline_prompt(inputsecret_flag ? NUL : '@', p, echo_attr, + xp_type, xp_arg); +! if (rettv->vval.v_string == NULL + && argvars[1].v_type != VAR_UNKNOWN + && argvars[2].v_type != VAR_UNKNOWN) + rettv->vval.v_string = vim_strsave(get_tv_string_buf( +--- 12966,12972 ---- + rettv->vval.v_string = + getcmdline_prompt(inputsecret_flag ? NUL : '@', p, echo_attr, + xp_type, xp_arg); +! if (inputdialog && rettv->vval.v_string == NULL + && argvars[1].v_type != VAR_UNKNOWN + && argvars[2].v_type != VAR_UNKNOWN) + rettv->vval.v_string = vim_strsave(get_tv_string_buf( +*** ../vim-7.3.623/src/version.c 2012-08-08 13:17:26.000000000 +0200 +--- src/version.c 2012-08-08 14:28:46.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 624, + /**/ + +-- +Your fault: core dumped + + /// 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 /// From 3c319db2bca36c14e7c772d494899393677f30cb Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:07 +0200 Subject: [PATCH 69/87] - patchlevel 625 --- 7.3.625 | 140 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 7.3.625 diff --git a/7.3.625 b/7.3.625 new file mode 100644 index 00000000..5334bc8f --- /dev/null +++ b/7.3.625 @@ -0,0 +1,140 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.625 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.625 +Problem: "gn" does not handle zero-width matches correctly. +Solution: Handle zero-width patterns specially. (Christian Brabandt) +Files: src/search.c + + +*** ../vim-7.3.624/src/search.c 2012-08-02 21:24:38.000000000 +0200 +--- src/search.c 2012-08-08 15:25:12.000000000 +0200 +*************** +*** 4546,4551 **** +--- 4546,4554 ---- + int visual_active = FALSE; + int flags = 0; + pos_T save_VIsual; ++ regmmatch_T regmatch; ++ int nmatched = 0; ++ int zerowidth = FALSE; + + + /* wrapping should not occur */ +*************** +*** 4581,4603 **** + orig_pos = pos = start_pos = curwin->w_cursor; + + /* + * The trick is to first search backwards and then search forward again, + * so that a match at the current cursor position will be correctly + * captured. + */ + for (i = 0; i < 2; i++) + { +- if (i && count == 1) +- flags = SEARCH_START; +- + if (forward) + dir = i; + else + dir = !i; + result = searchit(curwin, curbuf, &pos, (dir ? FORWARD : BACKWARD), + spats[last_idx].pat, (long) (i ? count : 1), +! SEARCH_KEEP | flags | (dir ? 0 : SEARCH_END), +! RE_SEARCH, 0, NULL); + + /* First search may fail, but then start searching from the + * beginning of the file (cursor might be on the search match) +--- 4584,4625 ---- + orig_pos = pos = start_pos = curwin->w_cursor; + + /* ++ * Check for zero-width pattern. ++ */ ++ if (search_regcomp(spats[last_idx].pat, RE_SEARCH, RE_SEARCH, ++ ((SEARCH_HIS + SEARCH_KEEP)), ®match) == FAIL) ++ return FAIL; ++ ++ /* Zero-width pattern should match somewhere, then we can check if start ++ * and end are in the same position. */ ++ nmatched = vim_regexec_multi(®match, curwin, curbuf, ++ curwin->w_cursor.lnum, (colnr_T)0, NULL); ++ if (called_emsg) ++ return FAIL; ++ if (nmatched && regmatch.startpos[0].lnum == regmatch.endpos[0].lnum ++ && regmatch.endpos[0].col == regmatch.startpos[0].col) ++ zerowidth = TRUE; ++ vim_free(regmatch.regprog); ++ ++ /* + * The trick is to first search backwards and then search forward again, + * so that a match at the current cursor position will be correctly + * captured. + */ + for (i = 0; i < 2; i++) + { + if (forward) + dir = i; + else + dir = !i; ++ ++ flags = 0; ++ if (!dir && !zerowidth) ++ flags = SEARCH_END; ++ + result = searchit(curwin, curbuf, &pos, (dir ? FORWARD : BACKWARD), + spats[last_idx].pat, (long) (i ? count : 1), +! SEARCH_KEEP | flags, RE_SEARCH, 0, NULL); + + /* First search may fail, but then start searching from the + * beginning of the file (cursor might be on the search match) +*************** +*** 4629,4638 **** + } + + start_pos = pos; +! flags = (forward ? SEARCH_END : 0); + +! /* move to match */ +! result = searchit(curwin, curbuf, &pos, (forward ? FORWARD : BACKWARD), + spats[last_idx].pat, 0L, flags | SEARCH_KEEP, RE_SEARCH, 0, NULL); + + if (!VIsual_active) +--- 4651,4662 ---- + } + + start_pos = pos; +! flags = forward ? SEARCH_END : 0; + +! /* move to match, except for zero-width matches, in which case, we are +! * already on the next match */ +! if (!zerowidth) +! result = searchit(curwin, curbuf, &pos, (forward ? FORWARD : BACKWARD), + spats[last_idx].pat, 0L, flags | SEARCH_KEEP, RE_SEARCH, 0, NULL); + + if (!VIsual_active) +*** ../vim-7.3.624/src/version.c 2012-08-08 14:33:16.000000000 +0200 +--- src/version.c 2012-08-08 15:21:53.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 625, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +222. You send more than 20 personal e-mails a day. + + /// 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 /// From 7643fc95949d2e7c6c4fde9d9921bfcb7962a470 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:07 +0200 Subject: [PATCH 70/87] - patchlevel 626 --- 7.3.626 | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 7.3.626 diff --git a/7.3.626 b/7.3.626 new file mode 100644 index 00000000..33b15456 --- /dev/null +++ b/7.3.626 @@ -0,0 +1,49 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.626 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.626 +Problem: Python interface doesn't build with Python 2.4 or older. +Solution: Define Py_ssize_t. (Benjamin Bannier) +Files: src/if_py_both.h + + +*** ../vim-7.3.625/src/if_py_both.h 2012-07-25 15:36:00.000000000 +0200 +--- src/if_py_both.h 2012-08-08 15:53:24.000000000 +0200 +*************** +*** 12,17 **** +--- 12,21 ---- + * Common code for if_python.c and if_python3.c. + */ + ++ #if PY_VERSION_HEX < 0x02050000 ++ typedef int Py_ssize_t; /* Python 2.4 and earlier don't have this type. */ ++ #endif ++ + #ifdef FEAT_MBYTE + # define ENC_OPT p_enc + #else +*** ../vim-7.3.625/src/version.c 2012-08-08 15:27:54.000000000 +0200 +--- src/version.c 2012-08-08 15:52:07.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 626, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +224. You set up your own Web page. You set up a Web page for each + of your kids... and your pets. + + /// 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 /// From 1a294534394eb3f5926b60e0eef5a0fa8ec57842 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:07 +0200 Subject: [PATCH 71/87] - patchlevel 627 --- 7.3.627 | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 7.3.627 diff --git a/7.3.627 b/7.3.627 new file mode 100644 index 00000000..97a0298d --- /dev/null +++ b/7.3.627 @@ -0,0 +1,102 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.627 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.627 +Problem: When using the "n" flag with the ":s" command a \= substitution + will not be evaluated. +Solution: Do perform the evaluation, so that a function can be invoked at + every matching position without changing the text. (Christian + Brabandt) +Files: src/ex_cmds.c + + +*** ../vim-7.3.626/src/ex_cmds.c 2012-07-10 15:18:18.000000000 +0200 +--- src/ex_cmds.c 2012-08-08 16:44:16.000000000 +0200 +*************** +*** 4264,4269 **** +--- 4264,4272 ---- + int endcolumn = FALSE; /* cursor in last column when done */ + pos_T old_cursor = curwin->w_cursor; + int start_nsubs; ++ #ifdef FEAT_EVAL ++ int save_ma = 0; ++ #endif + + cmd = eap->arg; + if (!global_busy) +*************** +*** 4668,4674 **** + } + sub_nsubs++; + did_sub = TRUE; +! goto skip; + } + + if (do_ask) +--- 4671,4682 ---- + } + sub_nsubs++; + did_sub = TRUE; +! #ifdef FEAT_EVAL +! /* Skip the substitution, unless an expression is used, +! * then it is evaluated in the sandbox. */ +! if (!(sub[0] == '\\' && sub[1] == '=')) +! #endif +! goto skip; + } + + if (do_ask) +*************** +*** 4840,4849 **** +--- 4848,4874 ---- + /* + * 3. substitute the string. + */ ++ #ifdef FEAT_EVAL ++ if (do_count) ++ { ++ /* prevent accidently changing the buffer by a function */ ++ save_ma = curbuf->b_p_ma; ++ curbuf->b_p_ma = FALSE; ++ sandbox++; ++ } ++ #endif + /* get length of substitution part */ + sublen = vim_regsub_multi(®match, + sub_firstlnum - regmatch.startpos[0].lnum, + sub, sub_firstline, FALSE, p_magic, TRUE); ++ #ifdef FEAT_EVAL ++ if (do_count) ++ { ++ curbuf->b_p_ma = save_ma; ++ sandbox--; ++ goto skip; ++ } ++ #endif + + /* When the match included the "$" of the last line it may + * go beyond the last line of the buffer. */ +*** ../vim-7.3.626/src/version.c 2012-08-08 16:05:03.000000000 +0200 +--- src/version.c 2012-08-08 16:48:45.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 627, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +225. You sign up for free subscriptions for all the computer magazines + + /// 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 /// From a02917d843437bbe6084375f1258029a6bbbe644 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:08 +0200 Subject: [PATCH 72/87] - patchlevel 628 --- 7.3.628 | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 7.3.628 diff --git a/7.3.628 b/7.3.628 new file mode 100644 index 00000000..bab31479 --- /dev/null +++ b/7.3.628 @@ -0,0 +1,54 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.628 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.628 +Problem: ":open" does not allow for a !, which results in a confusing error + message. (Shawn Wilson) +Solution: Allow ! on ":open". (Christian Brabandt) +Files: src/ex_cmds.h + + +*** ../vim-7.3.627/src/ex_cmds.h 2012-07-06 18:27:34.000000000 +0200 +--- src/ex_cmds.h 2012-08-08 17:15:45.000000000 +0200 +*************** +*** 662,668 **** + EX(CMD_nunmenu, "nunmenu", ex_menu, + EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN), + EX(CMD_open, "open", ex_open, +! RANGE|EXTRA), + EX(CMD_oldfiles, "oldfiles", ex_oldfiles, + BANG|TRLBAR|SBOXOK|CMDWIN), + EX(CMD_omap, "omap", ex_map, +--- 662,668 ---- + EX(CMD_nunmenu, "nunmenu", ex_menu, + EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN), + EX(CMD_open, "open", ex_open, +! RANGE|BANG|EXTRA), + EX(CMD_oldfiles, "oldfiles", ex_oldfiles, + BANG|TRLBAR|SBOXOK|CMDWIN), + EX(CMD_omap, "omap", ex_map, +*** ../vim-7.3.627/src/version.c 2012-08-08 16:50:40.000000000 +0200 +--- src/version.c 2012-08-08 17:30:14.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 628, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +226. You sit down at the computer right after dinner and your spouse + says "See you in the morning." + + /// 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 /// From d62601a4b2f2af03e27843248beac64ceda22523 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:08 +0200 Subject: [PATCH 73/87] - patchlevel 629 --- 7.3.629 | 437 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 437 insertions(+) create mode 100644 7.3.629 diff --git a/7.3.629 b/7.3.629 new file mode 100644 index 00000000..8e26dd49 --- /dev/null +++ b/7.3.629 @@ -0,0 +1,437 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.629 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.629 +Problem: There is no way to make 'shiftwidth' follow 'tabstop'. +Solution: When 'shiftwidth' is zero use the value of 'tabstop'. (Christian + Brabandt) +Files: src/edit.c, src/ex_getln.c, src/fold.c, src/misc1.c, src/ops.c, + src/option.c, src/proto/option.pro + + +*** ../vim-7.3.628/src/edit.c 2012-07-25 16:46:59.000000000 +0200 +--- src/edit.c 2012-08-08 17:55:37.000000000 +0200 +*************** +*** 8899,8907 **** + + *inserted_space_p = FALSE; + if (p_sta && in_indent) +! ts = curbuf->b_p_sw; + else +! ts = curbuf->b_p_sts; + /* Compute the virtual column where we want to be. Since + * 'showbreak' may get in the way, need to get the last column of + * the previous character. */ +--- 8899,8907 ---- + + *inserted_space_p = FALSE; + if (p_sta && in_indent) +! ts = (int)get_sw_value(); + else +! ts = (int)curbuf->b_p_sts; + /* Compute the virtual column where we want to be. Since + * 'showbreak' may get in the way, need to get the last column of + * the previous character. */ +*************** +*** 9589,9595 **** + * When nothing special, insert TAB like a normal character + */ + if (!curbuf->b_p_et +! && !(p_sta && ind && curbuf->b_p_ts != curbuf->b_p_sw) + && curbuf->b_p_sts == 0) + return TRUE; + +--- 9589,9595 ---- + * When nothing special, insert TAB like a normal character + */ + if (!curbuf->b_p_et +! && !(p_sta && ind && curbuf->b_p_ts != get_sw_value()) + && curbuf->b_p_sts == 0) + return TRUE; + +*************** +*** 9605,9611 **** + AppendToRedobuff((char_u *)"\t"); + + if (p_sta && ind) /* insert tab in indent, use 'shiftwidth' */ +! temp = (int)curbuf->b_p_sw; + else if (curbuf->b_p_sts > 0) /* use 'softtabstop' when set */ + temp = (int)curbuf->b_p_sts; + else /* otherwise use 'tabstop' */ +--- 9605,9611 ---- + AppendToRedobuff((char_u *)"\t"); + + if (p_sta && ind) /* insert tab in indent, use 'shiftwidth' */ +! temp = (int)get_sw_value(); + else if (curbuf->b_p_sts > 0) /* use 'softtabstop' when set */ + temp = (int)curbuf->b_p_sts; + else /* otherwise use 'tabstop' */ +*** ../vim-7.3.628/src/ex_getln.c 2012-06-29 13:44:37.000000000 +0200 +--- src/ex_getln.c 2012-08-08 17:39:40.000000000 +0200 +*************** +*** 2268,2277 **** + + if (c1 == Ctrl_T) + { + p = (char_u *)line_ga.ga_data; + p[line_ga.ga_len] = NUL; + indent = get_indent_str(p, 8); +! indent += curbuf->b_p_sw - indent % curbuf->b_p_sw; + add_indent: + while (get_indent_str(p, 8) < indent) + { +--- 2268,2279 ---- + + if (c1 == Ctrl_T) + { ++ long sw = get_sw_value(); ++ + p = (char_u *)line_ga.ga_data; + p[line_ga.ga_len] = NUL; + indent = get_indent_str(p, 8); +! indent += sw - indent % sw; + add_indent: + while (get_indent_str(p, 8) < indent) + { +*************** +*** 2323,2329 **** + p[line_ga.ga_len] = NUL; + indent = get_indent_str(p, 8); + --indent; +! indent -= indent % curbuf->b_p_sw; + } + while (get_indent_str(p, 8) > indent) + { +--- 2325,2331 ---- + p[line_ga.ga_len] = NUL; + indent = get_indent_str(p, 8); + --indent; +! indent -= indent % get_sw_value(); + } + while (get_indent_str(p, 8) > indent) + { +*** ../vim-7.3.628/src/fold.c 2012-02-29 19:19:57.000000000 +0100 +--- src/fold.c 2012-08-08 17:40:11.000000000 +0200 +*************** +*** 3025,3031 **** + flp->lvl = -1; + } + else +! flp->lvl = get_indent_buf(buf, lnum) / buf->b_p_sw; + if (flp->lvl > flp->wp->w_p_fdn) + { + flp->lvl = flp->wp->w_p_fdn; +--- 3025,3031 ---- + flp->lvl = -1; + } + else +! flp->lvl = get_indent_buf(buf, lnum) / get_sw_value(); + if (flp->lvl > flp->wp->w_p_fdn) + { + flp->lvl = flp->wp->w_p_fdn; +*** ../vim-7.3.628/src/misc1.c 2012-07-25 16:09:59.000000000 +0200 +--- src/misc1.c 2012-08-08 17:43:07.000000000 +0200 +*************** +*** 1389,1397 **** + #ifdef FEAT_SMARTINDENT + if (did_si) + { + if (p_sr) +! newindent -= newindent % (int)curbuf->b_p_sw; +! newindent += (int)curbuf->b_p_sw; + } + #endif + /* Copy the indent */ +--- 1389,1399 ---- + #ifdef FEAT_SMARTINDENT + if (did_si) + { ++ int sw = (int)get_sw_value(); ++ + if (p_sr) +! newindent -= newindent % sw; +! newindent += sw; + } + #endif + /* Copy the indent */ +*************** +*** 6461,6471 **** + int + get_c_indent() + { + /* + * spaces from a block's opening brace the prevailing indent for that + * block should be + */ +! int ind_level = curbuf->b_p_sw; + + /* + * spaces from the edge of the line an open brace that's at the end of a +--- 6463,6476 ---- + int + get_c_indent() + { ++ int sw = (int)get_sw_value(); ++ + /* + * spaces from a block's opening brace the prevailing indent for that + * block should be + */ +! +! int ind_level = sw; + + /* + * spaces from the edge of the line an open brace that's at the end of a +*************** +*** 6512,6523 **** + /* + * spaces from the switch() indent a "case xx" label should be located + */ +! int ind_case = curbuf->b_p_sw; + + /* + * spaces from the "case xx:" code after a switch() should be located + */ +! int ind_case_code = curbuf->b_p_sw; + + /* + * lineup break at end of case in switch() with case label +--- 6517,6528 ---- + /* + * spaces from the switch() indent a "case xx" label should be located + */ +! int ind_case = sw; + + /* + * spaces from the "case xx:" code after a switch() should be located + */ +! int ind_case_code = sw; + + /* + * lineup break at end of case in switch() with case label +*************** +*** 6528,6572 **** + * spaces from the class declaration indent a scope declaration label + * should be located + */ +! int ind_scopedecl = curbuf->b_p_sw; + + /* + * spaces from the scope declaration label code should be located + */ +! int ind_scopedecl_code = curbuf->b_p_sw; + + /* + * amount K&R-style parameters should be indented + */ +! int ind_param = curbuf->b_p_sw; + + /* + * amount a function type spec should be indented + */ +! int ind_func_type = curbuf->b_p_sw; + + /* + * amount a cpp base class declaration or constructor initialization + * should be indented + */ +! int ind_cpp_baseclass = curbuf->b_p_sw; + + /* + * additional spaces beyond the prevailing indent a continuation line + * should be located + */ +! int ind_continuation = curbuf->b_p_sw; + + /* + * spaces from the indent of the line with an unclosed parentheses + */ +! int ind_unclosed = curbuf->b_p_sw * 2; + + /* + * spaces from the indent of the line with an unclosed parentheses, which + * itself is also unclosed + */ +! int ind_unclosed2 = curbuf->b_p_sw; + + /* + * suppress ignoring spaces from the indent of a line starting with an +--- 6533,6577 ---- + * spaces from the class declaration indent a scope declaration label + * should be located + */ +! int ind_scopedecl = sw; + + /* + * spaces from the scope declaration label code should be located + */ +! int ind_scopedecl_code = sw; + + /* + * amount K&R-style parameters should be indented + */ +! int ind_param = sw; + + /* + * amount a function type spec should be indented + */ +! int ind_func_type = sw; + + /* + * amount a cpp base class declaration or constructor initialization + * should be indented + */ +! int ind_cpp_baseclass = sw; + + /* + * additional spaces beyond the prevailing indent a continuation line + * should be located + */ +! int ind_continuation = sw; + + /* + * spaces from the indent of the line with an unclosed parentheses + */ +! int ind_unclosed = sw * 2; + + /* + * spaces from the indent of the line with an unclosed parentheses, which + * itself is also unclosed + */ +! int ind_unclosed2 = sw; + + /* + * suppress ignoring spaces from the indent of a line starting with an +*************** +*** 6719,6730 **** + if (*options == 's') /* "2s" means two times 'shiftwidth' */ + { + if (options == digits) +! n = curbuf->b_p_sw; /* just "s" is one 'shiftwidth' */ + else + { +! n *= curbuf->b_p_sw; + if (divider) +! n += (curbuf->b_p_sw * fraction + divider / 2) / divider; + } + ++options; + } +--- 6724,6735 ---- + if (*options == 's') /* "2s" means two times 'shiftwidth' */ + { + if (options == digits) +! n = sw; /* just "s" is one 'shiftwidth' */ + else + { +! n *= sw; + if (divider) +! n += (sw * fraction + divider / 2) / divider; + } + ++options; + } +*** ../vim-7.3.628/src/ops.c 2012-07-10 16:49:08.000000000 +0200 +--- src/ops.c 2012-08-08 17:34:28.000000000 +0200 +*************** +*** 332,338 **** + { + int count; + int i, j; +! int p_sw = (int)curbuf->b_p_sw; + + count = get_indent(); /* get current indent */ + +--- 332,338 ---- + { + int count; + int i, j; +! int p_sw = (int)get_sw_value(); + + count = get_indent(); /* get current indent */ + +*************** +*** 388,394 **** + int total; + char_u *newp, *oldp; + int oldcol = curwin->w_cursor.col; +! int p_sw = (int)curbuf->b_p_sw; + int p_ts = (int)curbuf->b_p_ts; + struct block_def bd; + int incr; +--- 388,394 ---- + int total; + char_u *newp, *oldp; + int oldcol = curwin->w_cursor.col; +! int p_sw = (int)get_sw_value(); + int p_ts = (int)curbuf->b_p_ts; + struct block_def bd; + int incr; +*** ../vim-7.3.628/src/option.c 2012-07-10 18:31:49.000000000 +0200 +--- src/option.c 2012-08-08 17:45:01.000000000 +0200 +*************** +*** 8125,8131 **** + need_mouse_correct = TRUE; + #endif + +! if (curbuf->b_p_sw <= 0) + { + errmsg = e_positive; + curbuf->b_p_sw = curbuf->b_p_ts; +--- 8125,8131 ---- + need_mouse_correct = TRUE; + #endif + +! if (curbuf->b_p_sw < 0) + { + errmsg = e_positive; + curbuf->b_p_sw = curbuf->b_p_ts; +*************** +*** 11419,11421 **** +--- 11419,11431 ---- + { + return check_opt_strings(p, p_ff_values, FALSE); + } ++ ++ /* ++ * Return the effective shiftwidth value for current buffer, using the ++ * 'tabstop' value when 'shiftwidth' is zero. ++ */ ++ long ++ get_sw_value() ++ { ++ return curbuf->b_p_sw ? curbuf->b_p_sw : curbuf->b_p_ts; ++ } +*** ../vim-7.3.628/src/proto/option.pro 2011-01-22 00:11:42.000000000 +0100 +--- src/proto/option.pro 2012-08-08 17:34:33.000000000 +0200 +*************** +*** 56,59 **** +--- 56,60 ---- + void save_file_ff __ARGS((buf_T *buf)); + int file_ff_differs __ARGS((buf_T *buf, int ignore_empty)); + int check_ff_value __ARGS((char_u *p)); ++ long get_sw_value __ARGS((void)); + /* vim: set ft=c : */ +*** ../vim-7.3.628/src/version.c 2012-08-08 17:31:36.000000000 +0200 +--- src/version.c 2012-08-08 17:57:48.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 629, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +228. You spend Saturday night making the counter on your home page + pass that 2000 mark. + + /// 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 /// From 57f7ff88b01e8dc2d6bebea1f1d4d58aac354789 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:08 +0200 Subject: [PATCH 74/87] - patchlevel 630 --- 7.3.630 | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 7.3.630 diff --git a/7.3.630 b/7.3.630 new file mode 100644 index 00000000..d89cfbfe --- /dev/null +++ b/7.3.630 @@ -0,0 +1,48 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.630 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.630 +Problem: "|" does not behave correctly when 'virtualedit' is set. +Solution: Call validate_virtcol(). (David Bürgin) +Files: src/normal.c + + +*** ../vim-7.3.629/src/normal.c 2012-07-29 12:55:21.000000000 +0200 +--- src/normal.c 2012-08-15 13:20:13.000000000 +0200 +*************** +*** 7786,7792 **** +--- 7786,7795 ---- + * virtualedit. Recalculate curwin->w_cursor to avoid bad hilighting. + */ + if (c == Ctrl_V && (ve_flags & VE_BLOCK) && gchar_cursor() == TAB) ++ { ++ validate_virtcol(); + coladvance(curwin->w_virtcol); ++ } + #endif + VIsual = curwin->w_cursor; + +*** ../vim-7.3.629/src/version.c 2012-08-08 18:01:00.000000000 +0200 +--- src/version.c 2012-08-15 13:30:30.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 630, + /**/ + +-- +"Marriage is when a man and woman become as one; the trouble starts +when they try to decide which one" + + /// 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 /// From 82ff66e6320902e8f7e3cd65d577d89fd6a682bf Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:09 +0200 Subject: [PATCH 75/87] - patchlevel 631 --- 7.3.631 | 322 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 322 insertions(+) create mode 100644 7.3.631 diff --git a/7.3.631 b/7.3.631 new file mode 100644 index 00000000..b7bff4fc --- /dev/null +++ b/7.3.631 @@ -0,0 +1,322 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.631 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.631 +Problem: Cannot complete user names. +Solution: Add user name completion. (Dominique Pelle) +Files: runtime/doc/map.txt, src/auto/configure, src/config.h.in, + src/configure.in, src/ex_docmd.c, src/ex_getln.c, + src/misc1.c, src/misc2.c, src/proto/misc1.pro, src/vim.h + + +*** ../vim-7.3.630/runtime/doc/map.txt 2012-04-30 18:48:38.000000000 +0200 +--- runtime/doc/map.txt 2012-08-15 13:46:34.000000000 +0200 +*************** +*** 1227,1232 **** +--- 1244,1250 ---- + -complete=syntax syntax file names |'syntax'| + -complete=tag tags + -complete=tag_listfiles tags, file names are shown when CTRL-D is hit ++ -complete=user user names + -complete=var user variables + -complete=custom,{func} custom completion, defined via {func} + -complete=customlist,{func} custom completion, defined via {func} +*** ../vim-7.3.630/src/auto/configure 2012-07-25 16:32:03.000000000 +0200 +--- src/auto/configure 2012-08-15 13:48:06.000000000 +0200 +*************** +*** 10631,10637 **** + fi + + for ac_func in bcmp fchdir fchown fsync getcwd getpseudotty \ +! getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \ + memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ + setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ + sigvec strcasecmp strerror strftime stricmp strncasecmp \ +--- 10631,10637 ---- + fi + + for ac_func in bcmp fchdir fchown fsync getcwd getpseudotty \ +! getpwent getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \ + memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ + setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ + sigvec strcasecmp strerror strftime stricmp strncasecmp \ +*** ../vim-7.3.630/src/config.h.in 2012-02-05 22:51:27.000000000 +0100 +--- src/config.h.in 2012-08-15 13:46:35.000000000 +0200 +*************** +*** 161,166 **** +--- 161,167 ---- + #undef HAVE_FSYNC + #undef HAVE_GETCWD + #undef HAVE_GETPSEUDOTTY ++ #undef HAVE_GETPWENT + #undef HAVE_GETPWNAM + #undef HAVE_GETPWUID + #undef HAVE_GETRLIMIT +*** ../vim-7.3.630/src/configure.in 2012-07-25 16:32:03.000000000 +0200 +--- src/configure.in 2012-08-15 13:46:35.000000000 +0200 +*************** +*** 2994,3000 **** + dnl Check for functions in one big call, to reduce the size of configure. + dnl Can only be used for functions that do not require any include. + AC_CHECK_FUNCS(bcmp fchdir fchown fsync getcwd getpseudotty \ +! getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \ + memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ + setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ + sigvec strcasecmp strerror strftime stricmp strncasecmp \ +--- 2994,3000 ---- + dnl Check for functions in one big call, to reduce the size of configure. + dnl Can only be used for functions that do not require any include. + AC_CHECK_FUNCS(bcmp fchdir fchown fsync getcwd getpseudotty \ +! getpwent getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \ + memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \ + setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ + sigvec strcasecmp strerror strftime stricmp strncasecmp \ +*** ../vim-7.3.630/src/ex_docmd.c 2012-08-02 21:24:38.000000000 +0200 +--- src/ex_docmd.c 2012-08-15 13:54:29.000000000 +0200 +*************** +*** 3515,3520 **** +--- 3515,3537 ---- + #endif + } + } ++ #if defined(FEAT_CMDL_COMPL) ++ /* Check for user names */ ++ if (*xp->xp_pattern == '~') ++ { ++ for (p = xp->xp_pattern + 1; *p != NUL && *p != '/'; ++p) ++ ; ++ /* Complete ~user only if it partially matches a user name. ++ * A full match ~user will be replaced by user's home ++ * directory i.e. something like ~user -> /home/user/ */ ++ if (*p == NUL && p > xp->xp_pattern + 1 ++ && match_user(xp->xp_pattern + 1) == 1) ++ { ++ xp->xp_context = EXPAND_USER; ++ ++xp->xp_pattern; ++ } ++ } ++ #endif + } + + /* +*************** +*** 5396,5401 **** +--- 5413,5419 ---- + #endif + {EXPAND_TAGS, "tag"}, + {EXPAND_TAGS_LISTFILES, "tag_listfiles"}, ++ {EXPAND_USER, "user"}, + {EXPAND_USER_VARS, "var"}, + {0, NULL} + }; +*** ../vim-7.3.630/src/ex_getln.c 2012-08-08 18:01:00.000000000 +0200 +--- src/ex_getln.c 2012-08-15 13:46:35.000000000 +0200 +*************** +*** 4336,4341 **** +--- 4336,4342 ---- + * EXPAND_EXPRESSION Complete internal or user defined function/variable + * names in expressions, eg :while s^I + * EXPAND_ENV_VARS Complete environment variable names ++ * EXPAND_USER Complete user names + */ + static void + set_expand_context(xp) +*************** +*** 4681,4686 **** +--- 4682,4688 ---- + {EXPAND_LOCALES, get_locales, TRUE, FALSE}, + #endif + {EXPAND_ENV_VARS, get_env_name, TRUE, TRUE}, ++ {EXPAND_USER, get_users, TRUE, FALSE}, + }; + int i; + +*** ../vim-7.3.630/src/misc1.c 2012-08-08 18:01:00.000000000 +0200 +--- src/misc1.c 2012-08-15 13:57:53.000000000 +0200 +*************** +*** 18,23 **** +--- 18,28 ---- + static char_u *remove_tail __ARGS((char_u *p, char_u *pend, char_u *name)); + static int copy_indent __ARGS((int size, char_u *src)); + ++ /* All user names (for ~user completion as done by shell). */ ++ #if defined(FEAT_CMDL_COMPL) || defined(PROTO) ++ static garray_T ga_users; ++ #endif ++ + /* + * Count the size (in window cells) of the indent in the current line. + */ +*************** +*** 3782,3787 **** +--- 3787,3800 ---- + { + vim_free(homedir); + } ++ ++ # ifdef FEAT_CMDL_COMPL ++ void ++ free_users() ++ { ++ ga_clear_strings(&ga_users); ++ } ++ # endif + #endif + + /* +*************** +*** 4451,4456 **** +--- 4464,4543 ---- + return name; + # endif + } ++ ++ /* ++ * Find all user names for user completion. ++ * Done only once and then cached. ++ */ ++ static void ++ init_users() { ++ static int lazy_init_done = FALSE; ++ ++ if (lazy_init_done) ++ return; ++ ++ lazy_init_done = TRUE; ++ ga_init2(&ga_users, sizeof(char_u *), 20); ++ ++ # if defined(HAVE_GETPWENT) && defined(HAVE_PWD_H) ++ { ++ char_u* user; ++ struct passwd* pw; ++ ++ setpwent(); ++ while ((pw = getpwent()) != NULL) ++ /* pw->pw_name shouldn't be NULL but just in case... */ ++ if (pw->pw_name != NULL) ++ { ++ if (ga_grow(&ga_users, 1) == FAIL) ++ break; ++ user = vim_strsave((char_u*)pw->pw_name); ++ if (user == NULL) ++ break; ++ ((char_u **)(ga_users.ga_data))[ga_users.ga_len++] = user; ++ } ++ endpwent(); ++ } ++ # endif ++ } ++ ++ /* ++ * Function given to ExpandGeneric() to obtain an user names. ++ */ ++ char_u* ++ get_users(xp, idx) ++ expand_T *xp UNUSED; ++ int idx; ++ { ++ init_users(); ++ if (idx < ga_users.ga_len) ++ return ((char_u **)ga_users.ga_data)[idx]; ++ return NULL; ++ } ++ ++ /* ++ * Check whether name matches a user name. Return: ++ * 0 if name does not match any user name. ++ * 1 if name partially matches the beginning of a user name. ++ * 2 is name fully matches a user name. ++ */ ++ int match_user(name) ++ char_u* name; ++ { ++ int i; ++ int n = (int)STRLEN(name); ++ int result = 0; ++ ++ init_users(); ++ for (i = 0; i < ga_users.ga_len; i++) ++ { ++ if (STRCMP(((char_u **)ga_users.ga_data)[i], name) == 0) ++ return 2; /* full match */ ++ if (STRNCMP(((char_u **)ga_users.ga_data)[i], name, n) == 0) ++ result = 1; /* partial match */ ++ } ++ return result; ++ } + #endif + + /* +*** ../vim-7.3.630/src/misc2.c 2012-06-29 15:51:26.000000000 +0200 +--- src/misc2.c 2012-08-15 13:46:35.000000000 +0200 +*************** +*** 1110,1115 **** +--- 1110,1118 ---- + free_all_marks(); + alist_clear(&global_alist); + free_homedir(); ++ # if defined(FEAT_CMDL_COMPL) ++ free_users(); ++ # endif + free_search_patterns(); + free_old_sub(); + free_last_insert(); +*** ../vim-7.3.630/src/proto/misc1.pro 2012-06-06 16:12:54.000000000 +0200 +--- src/proto/misc1.pro 2012-08-15 13:46:35.000000000 +0200 +*************** +*** 50,55 **** +--- 50,56 ---- + void vim_beep __ARGS((void)); + void init_homedir __ARGS((void)); + void free_homedir __ARGS((void)); ++ void free_users __ARGS((void)); + char_u *expand_env_save __ARGS((char_u *src)); + char_u *expand_env_save_opt __ARGS((char_u *src, int one)); + void expand_env __ARGS((char_u *src, char_u *dst, int dstlen)); +*************** +*** 57,62 **** +--- 58,65 ---- + char_u *vim_getenv __ARGS((char_u *name, int *mustfree)); + void vim_setenv __ARGS((char_u *name, char_u *val)); + char_u *get_env_name __ARGS((expand_T *xp, int idx)); ++ char_u *get_users __ARGS((expand_T *xp, int idx)); ++ int match_user __ARGS((char_u* name)); + void home_replace __ARGS((buf_T *buf, char_u *src, char_u *dst, int dstlen, int one)); + char_u *home_replace_save __ARGS((buf_T *buf, char_u *src)); + int fullpathcmp __ARGS((char_u *s1, char_u *s2, int checkname)); +*** ../vim-7.3.630/src/vim.h 2012-07-10 17:14:50.000000000 +0200 +--- src/vim.h 2012-08-15 13:46:35.000000000 +0200 +*************** +*** 782,787 **** +--- 782,788 ---- + #define EXPAND_OWNSYNTAX 39 + #define EXPAND_LOCALES 40 + #define EXPAND_HISTORY 41 ++ #define EXPAND_USER 42 + + /* Values for exmode_active (0 is no exmode) */ + #define EXMODE_NORMAL 1 +*** ../vim-7.3.630/src/version.c 2012-08-15 13:30:55.000000000 +0200 +--- src/version.c 2012-08-15 14:01:12.000000000 +0200 +*************** +*** 716,717 **** +--- 716,719 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 631, + /**/ + +-- +"Marriage is the process of finding out what kind of man your wife +would have preferred" + + /// 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 /// From 76628d32ca28d579aeac57b1568745bd4717e650 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:09 +0200 Subject: [PATCH 76/87] - patchlevel 632 --- 7.3.632 | 537 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 537 insertions(+) create mode 100644 7.3.632 diff --git a/7.3.632 b/7.3.632 new file mode 100644 index 00000000..9e38969e --- /dev/null +++ b/7.3.632 @@ -0,0 +1,537 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.632 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.632 +Problem: Cannot select beyond 222 columns with the mouse in xterm. +Solution: Add support for SGR mouse tracking. (Hayaki Saito) +Files: runtime/doc/options.txt, src/feature.h, src/keymap.h, src/misc2.c, + src/option.h, src/os_unix.c, src/term.c, src/version.c + + +*** ../vim-7.3.631/runtime/doc/options.txt 2012-07-10 16:49:08.000000000 +0200 +--- runtime/doc/options.txt 2012-08-15 16:04:26.000000000 +0200 +*************** +*** 7383,7388 **** +--- 7424,7435 ---- + jsbterm JSB term mouse handling. + *pterm-mouse* + pterm QNX pterm mouse handling. ++ *urxvt-mouse* ++ urxvt Mouse handling for the urxvt (rxvt-unicode) terminal. ++ *sgr-mouse* ++ sgr Mouse handling for the terminal that emits SGR-styled ++ mouse reporting. Works with xterm version 277 or ++ later. + + The mouse handling must be enabled at compile time |+mouse_xterm| + |+mouse_dec| |+mouse_netterm|. +*************** +*** 7395,7400 **** +--- 7442,7448 ---- + or "xterm2" already. The main use of this option is to set it to + "xterm", when the terminal name doesn't start with "xterm", but it can + handle xterm mouse codes. ++ The "sgr" value will be set if the xterm version is 277 or later. + The "xterm2" value will be set if the xterm version is reported to be + 95 or higher. This only works when compiled with the |+termresponse| + feature and if |t_RV| is set to the escape sequence to request the +*** ../vim-7.3.631/src/feature.h 2012-04-25 16:50:44.000000000 +0200 +--- src/feature.h 2012-08-15 15:46:07.000000000 +0200 +*************** +*** 1056,1061 **** +--- 1056,1064 ---- + # ifdef FEAT_BIG + # define FEAT_MOUSE_URXVT + # endif ++ # ifdef FEAT_BIG ++ # define FEAT_MOUSE_SGR ++ # endif + # if defined(FEAT_NORMAL) && (defined(MSDOS) || defined(WIN3264)) + # define DOS_MOUSE + # endif +*************** +*** 1077,1082 **** +--- 1080,1090 ---- + # define FEAT_MOUSE_XTERM + #endif + ++ /* sgr is a small variation of mouse_xterm, and shares its code */ ++ #if defined(FEAT_MOUSE_SGR) && !defined(FEAT_MOUSE_XTERM) ++ # define FEAT_MOUSE_XTERM ++ #endif ++ + /* Define FEAT_MOUSE when any of the above is defined or FEAT_GUI. */ + #if !defined(FEAT_MOUSE_TTY) \ + && (defined(FEAT_MOUSE_XTERM) \ +*************** +*** 1087,1093 **** + || defined(FEAT_MOUSE_JSB) \ + || defined(FEAT_MOUSE_PTERM) \ + || defined(FEAT_SYSMOUSE) \ +! || defined(FEAT_MOUSE_URXVT)) + # define FEAT_MOUSE_TTY /* include non-GUI mouse support */ + #endif + #if !defined(FEAT_MOUSE) && (defined(FEAT_MOUSE_TTY) || defined(FEAT_GUI)) +--- 1095,1102 ---- + || defined(FEAT_MOUSE_JSB) \ + || defined(FEAT_MOUSE_PTERM) \ + || defined(FEAT_SYSMOUSE) \ +! || defined(FEAT_MOUSE_URXVT) \ +! || defined(FEAT_MOUSE_SGR)) + # define FEAT_MOUSE_TTY /* include non-GUI mouse support */ + #endif + #if !defined(FEAT_MOUSE) && (defined(FEAT_MOUSE_TTY) || defined(FEAT_GUI)) +*** ../vim-7.3.631/src/keymap.h 2012-01-20 17:15:47.000000000 +0100 +--- src/keymap.h 2012-08-15 15:46:07.000000000 +0200 +*************** +*** 110,115 **** +--- 110,118 ---- + /* Used for the urxvt mouse. */ + #define KS_URXVT_MOUSE 238 + ++ /* Used for the sgr mouse. */ ++ #define KS_SGR_MOUSE 237 ++ + /* + * Filler used after KS_SPECIAL and others + */ +*************** +*** 412,417 **** +--- 415,421 ---- + #define K_JSBTERM_MOUSE TERMCAP2KEY(KS_JSBTERM_MOUSE, KE_FILLER) + #define K_PTERM_MOUSE TERMCAP2KEY(KS_PTERM_MOUSE, KE_FILLER) + #define K_URXVT_MOUSE TERMCAP2KEY(KS_URXVT_MOUSE, KE_FILLER) ++ #define K_SGR_MOUSE TERMCAP2KEY(KS_SGR_MOUSE, KE_FILLER) + + #define K_SELECT TERMCAP2KEY(KS_SELECT, KE_FILLER) + #define K_TEAROFF TERMCAP2KEY(KS_TEAROFF, KE_FILLER) +*** ../vim-7.3.631/src/misc2.c 2012-08-15 14:04:50.000000000 +0200 +--- src/misc2.c 2012-08-15 15:46:07.000000000 +0200 +*************** +*** 2433,2438 **** +--- 2433,2441 ---- + #ifdef FEAT_MOUSE_URXVT + {K_URXVT_MOUSE, (char_u *)"UrxvtMouse"}, + #endif ++ #ifdef FEAT_MOUSE_SGR ++ {K_SGR_MOUSE, (char_u *)"SgrMouse"}, ++ #endif + {K_LEFTMOUSE, (char_u *)"LeftMouse"}, + {K_LEFTMOUSE_NM, (char_u *)"LeftMouseNM"}, + {K_LEFTDRAG, (char_u *)"LeftDrag"}, +*** ../vim-7.3.631/src/option.h 2012-07-10 16:49:08.000000000 +0200 +--- src/option.h 2012-08-15 15:46:07.000000000 +0200 +*************** +*** 822,828 **** + EXTERN char_u *p_ttym; /* 'ttymouse' */ + EXTERN unsigned ttym_flags; + # ifdef IN_OPTION_C +! static char *(p_ttym_values[]) = {"xterm", "xterm2", "dec", "netterm", "jsbterm", "pterm", "urxvt", NULL}; + # endif + # define TTYM_XTERM 0x01 + # define TTYM_XTERM2 0x02 +--- 822,828 ---- + EXTERN char_u *p_ttym; /* 'ttymouse' */ + EXTERN unsigned ttym_flags; + # ifdef IN_OPTION_C +! static char *(p_ttym_values[]) = {"xterm", "xterm2", "dec", "netterm", "jsbterm", "pterm", "urxvt", "sgr", NULL}; + # endif + # define TTYM_XTERM 0x01 + # define TTYM_XTERM2 0x02 +*************** +*** 831,836 **** +--- 831,837 ---- + # define TTYM_JSBTERM 0x10 + # define TTYM_PTERM 0x20 + # define TTYM_URXVT 0x40 ++ # define TTYM_SGR 0x80 + #endif + EXTERN char_u *p_udir; /* 'undodir' */ + EXTERN long p_ul; /* 'undolevels' */ +*** ../vim-7.3.631/src/os_unix.c 2012-04-20 15:55:10.000000000 +0200 +--- src/os_unix.c 2012-08-15 16:06:54.000000000 +0200 +*************** +*** 2159,2168 **** +--- 2159,2171 ---- + * Return 1 for "xterm". + * Return 2 for "xterm2". + * Return 3 for "urxvt". ++ * Return 4 for "sgr". + */ + int + use_xterm_mouse() + { ++ if (ttym_flags == TTYM_SGR) ++ return 4; + if (ttym_flags == TTYM_URXVT) + return 3; + if (ttym_flags == TTYM_XTERM2) +*************** +*** 3339,3345 **** + xterm_mouse_vers = use_xterm_mouse(); + + # ifdef FEAT_MOUSE_URXVT +! if (ttym_flags == TTYM_URXVT) { + out_str_nf((char_u *) + (on + ? IF_EB("\033[?1015h", ESC_STR "[?1015h") +--- 3342,3349 ---- + xterm_mouse_vers = use_xterm_mouse(); + + # ifdef FEAT_MOUSE_URXVT +! if (ttym_flags == TTYM_URXVT) +! { + out_str_nf((char_u *) + (on + ? IF_EB("\033[?1015h", ESC_STR "[?1015h") +*************** +*** 3348,3353 **** +--- 3352,3368 ---- + } + # endif + ++ # ifdef FEAT_MOUSE_SGR ++ if (ttym_flags == TTYM_SGR) ++ { ++ out_str_nf((char_u *) ++ (on ++ ? IF_EB("\033[?1006h", ESC_STR "[?1006h") ++ : IF_EB("\033[?1006l", ESC_STR "[?1006l"))); ++ ison = on; ++ } ++ # endif ++ + if (xterm_mouse_vers > 0) + { + if (on) /* enable mouse events, use mouse tracking if available */ +*************** +*** 3577,3582 **** +--- 3592,3618 ---- + else + del_mouse_termcode(KS_URXVT_MOUSE); + # endif ++ # ifdef FEAT_MOUSE_SGR ++ /* same as the dec mouse */ ++ if (use_xterm_mouse() == 4 ++ # ifdef FEAT_GUI ++ && !gui.in_use ++ # endif ++ ) ++ { ++ set_mouse_termcode(KS_SGR_MOUSE, (char_u *)(term_is_8bit(T_NAME) ++ ? IF_EB("\233<", CSI_STR "<") ++ : IF_EB("\033[<", ESC_STR "[<"))); ++ ++ if (*p_mouse != NUL) ++ { ++ mch_setmouse(FALSE); ++ setmouse(); ++ } ++ } ++ else ++ del_mouse_termcode(KS_SGR_MOUSE); ++ # endif + } + #endif + +*** ../vim-7.3.631/src/term.c 2012-02-05 22:05:44.000000000 +0100 +--- src/term.c 2012-08-15 16:14:09.000000000 +0200 +*************** +*** 1997,2002 **** +--- 1997,2003 ---- + # define HMT_JSBTERM 8 + # define HMT_PTERM 16 + # define HMT_URXVT 32 ++ # define HMT_SGR 64 + static int has_mouse_termcode = 0; + # endif + +*************** +*** 2037,2042 **** +--- 2038,2048 ---- + has_mouse_termcode |= HMT_URXVT; + else + # endif ++ # ifdef FEAT_MOUSE_SGR ++ if (n == KS_SGR_MOUSE) ++ has_mouse_termcode |= HMT_SGR; ++ else ++ # endif + has_mouse_termcode |= HMT_NORMAL; + # endif + } +*************** +*** 2079,2084 **** +--- 2085,2095 ---- + has_mouse_termcode &= ~HMT_URXVT; + else + # endif ++ # ifdef FEAT_MOUSE_SGR ++ if (n == KS_SGR_MOUSE) ++ has_mouse_termcode &= ~HMT_SGR; ++ else ++ # endif + has_mouse_termcode &= ~HMT_NORMAL; + # endif + } +*************** +*** 4023,4029 **** + #ifdef FEAT_TERMRESPONSE + if (key_name[0] == NUL + /* URXVT mouse uses [#;#;#M, but we are matching [ */ +! || key_name[0] == KS_URXVT_MOUSE) + { + /* Check for xterm version string: "[>{x};{vers};{y}c". Also + * eat other possible responses to t_RV, rxvt returns +--- 4034,4041 ---- + #ifdef FEAT_TERMRESPONSE + if (key_name[0] == NUL + /* URXVT mouse uses [#;#;#M, but we are matching [ */ +! || key_name[0] == KS_URXVT_MOUSE +! || key_name[0] == KS_SGR_MOUSE) + { + /* Check for xterm version string: "[>{x};{vers};{y}c". Also + * eat other possible responses to t_RV, rxvt returns +*************** +*** 4061,4066 **** +--- 4073,4088 ---- + + if (tp[1 + (tp[0] != CSI)] == '>' && j == 2) + { ++ # ifdef TTYM_SGR ++ if (extra >= 277 ++ # ifdef TTYM_URXVT ++ && ttym_flags != TTYM_URXVT ++ # endif ++ ) ++ set_option_value((char_u *)"ttym", 0L, ++ (char_u *)"sgr", 0); ++ else ++ # endif + /* if xterm version >= 95 use mouse dragging */ + if (extra >= 95 + # ifdef TTYM_URXVT +*************** +*** 4147,4167 **** + /* + * If it is a mouse click, get the coordinates. + */ +! if (key_name[0] == (int)KS_MOUSE + # ifdef FEAT_MOUSE_JSB +! || key_name[0] == (int)KS_JSBTERM_MOUSE + # endif + # ifdef FEAT_MOUSE_NET +! || key_name[0] == (int)KS_NETTERM_MOUSE + # endif + # ifdef FEAT_MOUSE_DEC +! || key_name[0] == (int)KS_DEC_MOUSE + # endif + # ifdef FEAT_MOUSE_PTERM +! || key_name[0] == (int)KS_PTERM_MOUSE + # endif + # ifdef FEAT_MOUSE_URXVT +! || key_name[0] == (int)KS_URXVT_MOUSE + # endif + ) + { +--- 4169,4192 ---- + /* + * If it is a mouse click, get the coordinates. + */ +! if (key_name[0] == KS_MOUSE + # ifdef FEAT_MOUSE_JSB +! || key_name[0] == KS_JSBTERM_MOUSE + # endif + # ifdef FEAT_MOUSE_NET +! || key_name[0] == KS_NETTERM_MOUSE + # endif + # ifdef FEAT_MOUSE_DEC +! || key_name[0] == KS_DEC_MOUSE + # endif + # ifdef FEAT_MOUSE_PTERM +! || key_name[0] == KS_PTERM_MOUSE + # endif + # ifdef FEAT_MOUSE_URXVT +! || key_name[0] == KS_URXVT_MOUSE +! # endif +! # ifdef FEAT_MOUSE_SGR +! || key_name[0] == KS_SGR_MOUSE + # endif + ) + { +*************** +*** 4243,4250 **** + } + } + +! # ifdef FEAT_MOUSE_URXVT +! if (key_name[0] == (int)KS_URXVT_MOUSE) + { + for (;;) + { +--- 4268,4276 ---- + } + } + +! # if defined(FEAT_MOUSE_URXVT) || defined(FEAT_MOUSE_SGR) +! if (key_name[0] == KS_URXVT_MOUSE +! || key_name[0] == KS_SGR_MOUSE) + { + for (;;) + { +*************** +*** 4256,4261 **** +--- 4282,4301 ---- + * ^-- row + * ^----- column + * ^-------- code ++ * ++ * SGR 1006 mouse reporting mode: ++ * Almost identical to xterm mouse mode, except the values ++ * are decimal instead of bytes. ++ * ++ * \033[<%d;%d;%dM ++ * ^-- row ++ * ^----- column ++ * ^-------- code ++ * ++ * \033[<%d;%d;%dm : mouse release event ++ * ^-- row ++ * ^----- column ++ * ^-------- code + */ + p = tp + slen; + +*************** +*** 4263,4294 **** + if (*p++ != ';') + return -1; + + mouse_col = getdigits(&p) - 1; + if (*p++ != ';') + return -1; + + mouse_row = getdigits(&p) - 1; +! if (*p++ != 'M') + return -1; + + slen += (int)(p - (tp + slen)); + + /* skip this one if next one has same code (like xterm + * case) */ + j = termcodes[idx].len; +! if (STRNCMP(tp, tp + slen, (size_t)j) == 0) { +! /* check if the command is complete by looking for the +! * M */ + int slen2; + int cmd_complete = 0; +! for (slen2 = slen; slen2 < len; slen2++) { +! if (tp[slen2] == 'M') { + cmd_complete = 1; + break; + } + } + p += j; +! if (cmd_complete && getdigits(&p) == mouse_code) { + slen += j; /* skip the \033[ */ + continue; + } +--- 4303,4348 ---- + if (*p++ != ';') + return -1; + ++ /* when mouse reporting is SGR, add 32 to mouse code */ ++ if (key_name[0] == KS_SGR_MOUSE) ++ mouse_code += 32; ++ + mouse_col = getdigits(&p) - 1; + if (*p++ != ';') + return -1; + + mouse_row = getdigits(&p) - 1; +! if (key_name[0] == KS_SGR_MOUSE && *p == 'm') +! mouse_code |= MOUSE_RELEASE; +! else if (*p != 'M') + return -1; ++ p++; + + slen += (int)(p - (tp + slen)); + + /* skip this one if next one has same code (like xterm + * case) */ + j = termcodes[idx].len; +! if (STRNCMP(tp, tp + slen, (size_t)j) == 0) +! { + int slen2; + int cmd_complete = 0; +! +! /* check if the command is complete by looking for the +! * 'M' */ +! for (slen2 = slen; slen2 < len; slen2++) +! { +! if (tp[slen2] == 'M' +! || (key_name[0] == KS_SGR_MOUSE +! && tp[slen2] == 'm')) +! { + cmd_complete = 1; + break; + } + } + p += j; +! if (cmd_complete && getdigits(&p) == mouse_code) +! { + slen += j; /* skip the \033[ */ + continue; + } +*************** +*** 4302,4307 **** +--- 4356,4364 ---- + #ifdef FEAT_MOUSE_URXVT + || key_name[0] == (int)KS_URXVT_MOUSE + #endif ++ #ifdef FEAT_MOUSE_SGR ++ || key_name[0] == KS_SGR_MOUSE ++ #endif + ) + { + # if !defined(MSWIN) && !defined(MSDOS) +*** ../vim-7.3.631/src/version.c 2012-08-15 14:04:50.000000000 +0200 +--- src/version.c 2012-08-15 15:47:30.000000000 +0200 +*************** +*** 384,389 **** +--- 384,394 ---- + # else + "-mouse_urxvt", + # endif ++ # ifdef FEAT_MOUSE_SGR ++ "+mouse_sgr", ++ # else ++ "-mouse_sgr", ++ # endif + #endif + #ifdef __QNX__ + # ifdef FEAT_MOUSE_PTERM +*** ../vim-7.3.631/src/version.c 2012-08-15 14:04:50.000000000 +0200 +--- src/version.c 2012-08-15 15:47:30.000000000 +0200 +*************** +*** 716,717 **** +--- 721,724 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 632, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +243. You unsuccessfully try to download a pizza from www.dominos.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 /// From 4fb6367dc251f5076a410b1a93ac0a5e635e0abe Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:09 +0200 Subject: [PATCH 77/87] - patchlevel 633 --- 7.3.633 | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 7.3.633 diff --git a/7.3.633 b/7.3.633 new file mode 100644 index 00000000..899ccb38 --- /dev/null +++ b/7.3.633 @@ -0,0 +1,81 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.633 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.633 +Problem: Selection remains displayed as selected after selecting another + text. +Solution: Call xterm_update() before select(). (Andrew Pimlott) +Files: src/os_unix.c + + +*** ../vim-7.3.632/src/os_unix.c 2012-08-15 16:20:59.000000000 +0200 +--- src/os_unix.c 2012-08-15 17:15:58.000000000 +0200 +*************** +*** 5196,5201 **** +--- 5196,5205 ---- + FD_SET(ConnectionNumber(xterm_dpy), &rfds); + if (maxfd < ConnectionNumber(xterm_dpy)) + maxfd = ConnectionNumber(xterm_dpy); ++ ++ /* An event may have already been read but not handled. In ++ * particulary, XFlush may cause this. */ ++ xterm_update(); + } + # endif + # ifdef FEAT_MOUSE_GPM +*************** +*** 5216,5229 **** + maxfd = xsmp_icefd; + } + # endif +! #ifdef FEAT_NETBEANS_INTG + if (nb_fd != -1) + { + FD_SET(nb_fd, &rfds); + if (maxfd < nb_fd) + maxfd = nb_fd; + } +! #endif + + # ifdef OLD_VMS + /* Old VMS as v6.2 and older have broken select(). It waits more than +--- 5220,5233 ---- + maxfd = xsmp_icefd; + } + # endif +! # ifdef FEAT_NETBEANS_INTG + if (nb_fd != -1) + { + FD_SET(nb_fd, &rfds); + if (maxfd < nb_fd) + maxfd = nb_fd; + } +! # endif + + # ifdef OLD_VMS + /* Old VMS as v6.2 and older have broken select(). It waits more than +*** ../vim-7.3.632/src/version.c 2012-08-15 16:20:59.000000000 +0200 +--- src/version.c 2012-08-15 17:22:17.000000000 +0200 +*************** +*** 721,722 **** +--- 721,724 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 633, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +245. You use Real Audio to listen to a radio station from a distant + city rather than turn on your stereo 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 /// From 527e55d16d1424ca989367251470f32e62da99cc Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:10 +0200 Subject: [PATCH 78/87] - patchlevel 634 --- 7.3.634 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 7.3.634 diff --git a/7.3.634 b/7.3.634 new file mode 100644 index 00000000..3262bab3 --- /dev/null +++ b/7.3.634 @@ -0,0 +1,57 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.634 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.634 +Problem: Month/Day format for undo is confusing. (Marcin Szamotulski) +Solution: Always use Year/Month/Day, should work for everybody. +Files: src/undo.c + + +*** ../vim-7.3.633/src/undo.c 2012-06-01 13:46:06.000000000 +0200 +--- src/undo.c 2012-08-23 12:43:24.000000000 +0200 +*************** +*** 2880,2890 **** + if (time(NULL) - tt < (60L * 60L * 12L)) + /* within 12 hours */ + (void)strftime((char *)buf, buflen, "%H:%M:%S", curtime); +- else if (time(NULL) - tt < (60L * 60L * 24L * 180L)) +- /* within 6 months */ +- (void)strftime((char *)buf, buflen, "%m/%d %H:%M:%S", curtime); + else +! /* long ago */ + (void)strftime((char *)buf, buflen, "%Y/%m/%d %H:%M:%S", curtime); + } + else +--- 2880,2887 ---- + if (time(NULL) - tt < (60L * 60L * 12L)) + /* within 12 hours */ + (void)strftime((char *)buf, buflen, "%H:%M:%S", curtime); + else +! /* longer ago */ + (void)strftime((char *)buf, buflen, "%Y/%m/%d %H:%M:%S", curtime); + } + else +*** ../vim-7.3.633/src/version.c 2012-08-15 17:26:53.000000000 +0200 +--- src/version.c 2012-08-23 12:58:36.000000000 +0200 +*************** +*** 721,722 **** +--- 721,724 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 634, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +10E. You start counting in hex. + + /// 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 /// From b23fd3f8f7e4286158d21ba90ad6b40466e78d40 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:10 +0200 Subject: [PATCH 79/87] - patchlevel 635 --- 7.3.635 | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 7.3.635 diff --git a/7.3.635 b/7.3.635 new file mode 100644 index 00000000..4a677025 --- /dev/null +++ b/7.3.635 @@ -0,0 +1,50 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.635 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.635 +Problem: Issue 21: System call during startup sets 'lines' to a wrong + value. (Karl Yngve) +Solution: Don't set the shell size while the GUI is still starting up. + (Christian Brabandt) +Files: src/ui.c + + +*** ../vim-7.3.634/src/ui.c 2012-07-10 16:49:08.000000000 +0200 +--- src/ui.c 2012-08-23 13:25:26.000000000 +0200 +*************** +*** 298,303 **** +--- 298,306 ---- + int retval; + + #ifdef FEAT_GUI ++ if (gui.starting) ++ /* possibly a system call during startup, check later */ ++ return OK; + if (gui.in_use) + retval = gui_get_shellsize(); + else +*** ../vim-7.3.634/src/version.c 2012-08-23 12:58:56.000000000 +0200 +--- src/version.c 2012-08-23 13:27:00.000000000 +0200 +*************** +*** 721,722 **** +--- 721,724 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 635, + /**/ + +-- +ARTHUR: This new learning amazes me, Sir Bedevere. Explain again how sheep's + bladders may be employed to prevent earthquakes. + "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 /// From 2e6f436bf80bad14fe81ba4803f324921b5d0b10 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:10 +0200 Subject: [PATCH 80/87] - patchlevel 636 --- 7.3.636 | 148 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 7.3.636 diff --git a/7.3.636 b/7.3.636 new file mode 100644 index 00000000..453a7fc9 --- /dev/null +++ b/7.3.636 @@ -0,0 +1,148 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.636 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.636 (after 7.3.625) +Problem: Not all zero-width matches handled correctly for "gn". +Solution: Move zero-width detection to a separate function. (Christian + Brabandt) +Files: src/search.c + + +*** ../vim-7.3.635/src/search.c 2012-08-08 15:27:54.000000000 +0200 +--- src/search.c 2012-08-23 15:52:50.000000000 +0200 +*************** +*** 4526,4531 **** +--- 4526,4533 ---- + #endif /* FEAT_TEXTOBJ */ + + #if defined(FEAT_VISUAL) || defined(PROTO) ++ static int is_zerowidth __ARGS((char_u *pattern)); ++ + /* + * Find next search match under cursor, cursor at end. + * Used while an operator is pending, and in Visual mode. +*************** +*** 4546,4556 **** + int visual_active = FALSE; + int flags = 0; + pos_T save_VIsual; +- regmmatch_T regmatch; +- int nmatched = 0; + int zerowidth = FALSE; + +- + /* wrapping should not occur */ + p_ws = FALSE; + +--- 4548,4555 ---- +*************** +*** 4583,4606 **** + else + orig_pos = pos = start_pos = curwin->w_cursor; + +! /* +! * Check for zero-width pattern. +! */ +! if (search_regcomp(spats[last_idx].pat, RE_SEARCH, RE_SEARCH, +! ((SEARCH_HIS + SEARCH_KEEP)), ®match) == FAIL) + return FAIL; + +- /* Zero-width pattern should match somewhere, then we can check if start +- * and end are in the same position. */ +- nmatched = vim_regexec_multi(®match, curwin, curbuf, +- curwin->w_cursor.lnum, (colnr_T)0, NULL); +- if (called_emsg) +- return FAIL; +- if (nmatched && regmatch.startpos[0].lnum == regmatch.endpos[0].lnum +- && regmatch.endpos[0].col == regmatch.startpos[0].col) +- zerowidth = TRUE; +- vim_free(regmatch.regprog); +- + /* + * The trick is to first search backwards and then search forward again, + * so that a match at the current cursor position will be correctly +--- 4582,4592 ---- + else + orig_pos = pos = start_pos = curwin->w_cursor; + +! /* Is the pattern is zero-width? */ +! zerowidth = is_zerowidth(spats[last_idx].pat); +! if (zerowidth == -1) + return FAIL; + + /* + * The trick is to first search backwards and then search forward again, + * so that a match at the current cursor position will be correctly +*************** +*** 4693,4698 **** +--- 4679,4721 ---- + + return OK; + } ++ ++ /* ++ * Check if the pattern is zero-width. ++ * Returns TRUE, FALSE or -1 for failure. ++ */ ++ static int ++ is_zerowidth(pattern) ++ char_u *pattern; ++ { ++ regmmatch_T regmatch; ++ int nmatched = 0; ++ int result = -1; ++ pos_T pos; ++ ++ if (search_regcomp(pattern, RE_SEARCH, RE_SEARCH, ++ SEARCH_KEEP, ®match) == FAIL) ++ return -1; ++ ++ /* move to match */ ++ clearpos(&pos); ++ if (searchit(curwin, curbuf, &pos, FORWARD, spats[last_idx].pat, 1, ++ SEARCH_KEEP, RE_SEARCH, 0, NULL) != FAIL) ++ { ++ /* Zero-width pattern should match somewhere, then we can check if ++ * start and end are in the same position. */ ++ nmatched = vim_regexec_multi(®match, curwin, curbuf, ++ pos.lnum, (colnr_T)0, NULL); ++ ++ if (!called_emsg) ++ result = (nmatched != 0 ++ && regmatch.startpos[0].lnum == regmatch.endpos[0].lnum ++ && regmatch.startpos[0].col == regmatch.endpos[0].col); ++ } ++ ++ vim_free(regmatch.regprog); ++ return result; ++ } + #endif /* FEAT_VISUAL */ + + #if defined(FEAT_LISP) || defined(FEAT_CINDENT) || defined(FEAT_TEXTOBJ) \ +*** ../vim-7.3.635/src/version.c 2012-08-23 13:28:50.000000000 +0200 +--- src/version.c 2012-08-23 15:25:23.000000000 +0200 +*************** +*** 721,722 **** +--- 721,724 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 636, + /**/ + +-- +Edison's greatest achievement came in 1879, when he invented the +electric company. Edison's design was a brilliant adaptation of the +simple electrical circuit: the electric company sends electricity +through a wire to a customer, then immediately gets the electricity +back through another wire + + /// 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 /// From 47f669a6906724c6060c7e1839c8c9b373b3909f Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:11 +0200 Subject: [PATCH 81/87] - patchlevel 637 --- 7.3.637 | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 7.3.637 diff --git a/7.3.637 b/7.3.637 new file mode 100644 index 00000000..f7f1d903 --- /dev/null +++ b/7.3.637 @@ -0,0 +1,94 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.637 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.637 +Problem: Cannot catch the error caused by a foldopen when there is no fold. + (ZyX, Issue 48) +Solution: Do not break out of the loop early when inside try/catch. + (Christian Brabandt) Except when there is a syntax error. +Files: src/ex_docmd.c, src/globals.h + + +*** ../vim-7.3.636/src/ex_docmd.c 2012-08-15 14:04:50.000000000 +0200 +--- src/ex_docmd.c 2012-08-23 18:39:08.000000000 +0200 +*************** +*** 1295,1301 **** + && cstack.cs_trylevel == 0 + #endif + ) +! && !(did_emsg && used_getline + && (getline_equal(fgetline, cookie, getexmodeline) + || getline_equal(fgetline, cookie, getexline))) + && (next_cmdline != NULL +--- 1295,1308 ---- + && cstack.cs_trylevel == 0 + #endif + ) +! && !(did_emsg +! #ifdef FEAT_EVAL +! /* Keep going when inside try/catch, so that the error can be +! * dealth with, except when it is a syntax error, it may cause +! * the :endtry to be missed. */ +! && (cstack.cs_trylevel == 0 || did_emsg_syntax) +! #endif +! && used_getline + && (getline_equal(fgetline, cookie, getexmodeline) + || getline_equal(fgetline, cookie, getexline))) + && (next_cmdline != NULL +*************** +*** 1305,1310 **** +--- 1312,1318 ---- + || (flags & DOCMD_REPEAT))); + + vim_free(cmdline_copy); ++ did_emsg_syntax = FALSE; + #ifdef FEAT_EVAL + free_cmdlines(&lines_ga); + ga_clear(&lines_ga); +*************** +*** 2137,2142 **** +--- 2145,2151 ---- + if (!sourcing) + append_command(*cmdlinep); + errormsg = IObuff; ++ did_emsg_syntax = TRUE; + } + goto doend; + } +*** ../vim-7.3.636/src/globals.h 2012-07-10 16:49:08.000000000 +0200 +--- src/globals.h 2012-08-23 18:29:09.000000000 +0200 +*************** +*** 183,188 **** +--- 183,190 ---- + #endif + EXTERN int did_emsg; /* set by emsg() when the message + is displayed or thrown */ ++ EXTERN int did_emsg_syntax; /* did_emsg set because of a ++ syntax error */ + EXTERN int called_emsg; /* always set by emsg() */ + EXTERN int ex_exitval INIT(= 0); /* exit value for ex mode */ + EXTERN int emsg_on_display INIT(= FALSE); /* there is an error message */ +*** ../vim-7.3.636/src/version.c 2012-08-23 15:53:00.000000000 +0200 +--- src/version.c 2012-08-23 17:59:12.000000000 +0200 +*************** +*** 721,722 **** +--- 721,724 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 637, + /**/ + +-- +GOD: That is your purpose Arthur ... the Quest for the Holy Grail ... + "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 /// From ea042019e92c60a21ce89b7c78352f93b5f9cf81 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:11 +0200 Subject: [PATCH 82/87] - patchlevel 638 --- 7.3.638 | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 7.3.638 diff --git a/7.3.638 b/7.3.638 new file mode 100644 index 00000000..f88a9399 --- /dev/null +++ b/7.3.638 @@ -0,0 +1,55 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.638 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.638 +Problem: Unecessary redraw of the previous character. +Solution: Check if the character is double-width. (Jon Long) +Files: src/screen.c + + +*** ../vim-7.3.637/src/screen.c 2012-07-10 16:49:08.000000000 +0200 +--- src/screen.c 2012-08-23 18:49:33.000000000 +0200 +*************** +*** 5332,5339 **** + && (ScreenLinesUC[off_from] != ScreenLinesUC[off_to] + || (ScreenLinesUC[off_from] != 0 + && comp_char_differs(off_from, off_to)) +! || (cols > 1 && ScreenLines[off_from + 1] +! != ScreenLines[off_to + 1]))) + #endif + )) + return TRUE; +--- 5332,5340 ---- + && (ScreenLinesUC[off_from] != ScreenLinesUC[off_to] + || (ScreenLinesUC[off_from] != 0 + && comp_char_differs(off_from, off_to)) +! || ((*mb_off2cells)(off_from, off_from + cols) > 1 +! && ScreenLines[off_from + 1] +! != ScreenLines[off_to + 1]))) + #endif + )) + return TRUE; +*** ../vim-7.3.637/src/version.c 2012-08-23 18:43:06.000000000 +0200 +--- src/version.c 2012-08-23 18:47:11.000000000 +0200 +*************** +*** 721,722 **** +--- 721,724 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 638, + /**/ + +-- +There is a fine line between courage and foolishness. +Unfortunately, it's not a fence. + + /// 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 /// From 2301591f7131a2efd8fc9d3656e461ecf6a2c0f8 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 11:54:11 +0200 Subject: [PATCH 83/87] - patchlevel 638 --- README.patches | 82 ++++++++++++++++++++++++ vim.spec | 169 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 250 insertions(+), 1 deletion(-) diff --git a/README.patches b/README.patches index c9045377..dfe8b806 100644 --- a/README.patches +++ b/README.patches @@ -587,3 +587,85 @@ Individual patches for Vim 7.3: 1660 7.3.554 compiler warning for unused argument 7968 7.3.555 building on IBM z/OS fails 2194 7.3.556 compiler warnings on 64 bit Windows + 2958 7.3.557 crash when an autocommand wipes out a buffer when it is hidden + 2956 7.3.558 (after 7.3.552) memory access error + 3483 7.3.559 home_replace() does not work with 8.3 filename + 1551 7.3.560 get an error for a locked argument in extend() + 1511 7.3.561 refresh: always in a complete function breaks the "." command + 1659 7.3.562 ":profdel" works when the +profile feature is disabled + 2742 7.3.563 (after 7.3.557) can't build with tiny features + 1785 7.3.564 (after 7.3.559) warning for pointer conversion + 1806 7.3.565 can't generate proto file for Python 3 + 2363 7.3.566 (after 7.3.561) redo works incorrectly without refresh:always + 1739 7.3.567 missing copyright notice + 3890 7.3.568 bad indents for #ifdefs +133265 7.3.569 evaluating Vim expression in Python is insufficient + 4659 7.3.570 ":vimgrep" does not obey 'wildignore' + 3915 7.3.571 duplicated condition + 1915 7.3.572 duplicate statement in if and else + 1419 7.3.573 using array index before bounds checking + 2491 7.3.574 a CTRL-L character is not pasted on the search command line + 1586 7.3.575 "ygt" tries to yank instead of giving an error + 7301 7.3.576 formatting of lists inside comments is not right yet + 6542 7.3.577 size of memory does not fit in 32 bit unsigned + 2025 7.3.578 misplaced declaration. + 7644 7.3.579 (after 7.3.569) can't compile with Python 2.5 + 1517 7.3.580 warning on 64 bit MS-Windows + 4236 7.3.581 problems compiling with Python + 1342 7.3.582 missing pieces in test OK file + 3125 7.3.583 PyObject_NextNotImplemented is not defined before Python 2.7 + 4088 7.3.584 PyCObject is not always defined + 1696 7.3.585 calling changed_bytes() too often + 3055 7.3.586 MEMORYSTATUSEX not defined when compiling with Cygwin or MingW + 2248 7.3.587 compiler warning for local var shadowing global var + 2464 7.3.588 crash on NULL pointer + 1974 7.3.589 crash when $HOME is not set + 1804 7.3.590 the '< and '> marks cannot be set directly + 5247 7.3.591 can only move to a tab by absolute number + 3343 7.3.592 Vim on GTK does not support g:browsefilter + 2237 7.3.593 no easy way to decide if b:browsefilter will work + 4873 7.3.594 the X command server sends an empty reply for as-keys requests + 3921 7.3.595 the X command server responds slowly + 4967 7.3.596 can't remove all signs for a file or buffer + 21669 7.3.597 'clipboard' "autoselect" only applies to the * register + 2635 7.3.598 cannot act upon end of insert mode completion + 3042 7.3.599 (after 7.3.597) missing change in one file + 1572 7.3.600 is not expanded properly with DBCS encoding + 1492 7.3.601 bad code style + 1532 7.3.602 missing files in distribution + 11248 7.3.603 it is possible to add or replace builtin functions + 1861 7.3.604 inputdialog() doesn't use the cancel argument in the console + 2334 7.3.605 MS-Windows: Can't compile with older compilers + 2522 7.3.606 CTRL-P completion has a problem with multi-byte characters + 2139 7.3.607 with 8 color terminal selected menu item is black on black + 3847 7.3.608 winrestview() does not always restore the view correctly + 5843 7.3.609 file names in :checkpath! output are garbled + 12106 7.3.610 cannot operate on the text that a search pattern matches + 1895 7.3.611 can't use Vim dictionary as self argument in Python + 2081 7.3.612 auto formatting messes up text when 'fo' contains "2" + 6886 7.3.613 including Python's config.c in the build causes trouble + 5747 7.3.614 number arg gets turned into number while it should be string + 2915 7.3.615 completion does not recognized escaped spaces + 1289 7.3.616 (after 7.3.610) can't compile without +visual + 1781 7.3.617 (after 7.3.615) hang on completion + 10033 7.3.618 (after 7.3.616) still doesn't compile with small features + 1583 7.3.619 when executing a shell command Vim may become slow to respond + 4897 7.3.620 building with recent Ruby on Win32 doesn't work + 2259 7.3.621 compiler warnings on 64 bit windows + 1867 7.3.622 XPM library for Win32 can't be found + 2426 7.3.623 Perl 5.14 commands crash Vim on MS-Windows + 1800 7.3.624 when cancelling input() it returns the third argument + 4327 7.3.625 "gn" does not handle zero-width matches correctly + 1500 7.3.626 Python interface doesn't build with Python 2.4 or older + 2803 7.3.627 expression not evaluated when using "n" flag with ":s" + 1802 7.3.628 ":open!" results in a confusing error message + 12019 7.3.629 there is no way to make 'shiftwidth' follow 'tabstop' + 1487 7.3.630 "|" does not behave correctly when 'virtualedit' is set + 10100 7.3.631 cannot complete user names + 14770 7.3.632 cannot select beyond 222 columns with the mouse in xterm + 2238 7.3.633 selection remains highlighted after selecting another text + 1884 7.3.634 Month/Day format for undo is confusing + 1586 7.3.635 system call during startup sets 'lines' to a wrong value + 4539 7.3.636 (after 7.3.625) "gn" fails for some zero-width matches + 3117 7.3.637 cannot catch error caused by a foldopen when there is no fold + 1783 7.3.638 unecessary redraw of the previous character diff --git a/vim.spec b/vim.spec index b3b5975c..734689a9 100644 --- a/vim.spec +++ b/vim.spec @@ -18,7 +18,7 @@ #used for pre-releases: %define beta %{nil} %define vimdir vim73%{?beta} -%define patchlevel 556 +%define patchlevel 638 Summary: The VIM editor URL: http://www.vim.org/ @@ -612,6 +612,88 @@ Patch553: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.553 Patch554: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.554 Patch555: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.555 Patch556: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.556 +Patch557: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.557 +Patch558: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.558 +Patch559: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.559 +Patch560: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.560 +Patch561: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.561 +Patch562: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.562 +Patch563: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.563 +Patch564: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.564 +Patch565: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.565 +Patch566: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.566 +Patch567: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.567 +Patch568: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.568 +Patch569: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.569 +Patch570: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.570 +Patch571: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.571 +Patch572: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.572 +Patch573: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.573 +Patch574: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.574 +Patch575: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.575 +Patch576: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.576 +Patch577: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.577 +Patch578: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.578 +Patch579: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.579 +Patch580: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.580 +Patch581: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.581 +Patch582: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.582 +Patch583: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.583 +Patch584: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.584 +Patch585: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.585 +Patch586: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.586 +Patch587: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.587 +Patch588: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.588 +Patch589: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.589 +Patch590: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.590 +Patch591: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.591 +Patch592: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.592 +Patch593: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.593 +Patch594: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.594 +Patch595: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.595 +Patch596: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.596 +Patch597: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.597 +Patch598: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.598 +Patch599: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.599 +Patch600: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.600 +Patch601: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.601 +Patch602: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.602 +Patch603: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.603 +Patch604: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.604 +Patch605: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.605 +Patch606: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.606 +Patch607: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.607 +Patch608: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.608 +Patch609: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.609 +Patch610: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.610 +Patch611: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.611 +Patch612: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.612 +Patch613: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.613 +Patch614: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.614 +Patch615: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.615 +Patch616: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.616 +Patch617: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.617 +Patch618: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.618 +Patch619: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.619 +Patch620: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.620 +Patch621: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.621 +Patch622: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.622 +Patch623: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.623 +Patch624: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.624 +Patch625: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.625 +Patch626: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.626 +Patch627: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.627 +Patch628: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.628 +Patch629: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.629 +Patch630: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.630 +Patch631: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.631 +Patch632: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.632 +Patch633: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.633 +Patch634: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.634 +Patch635: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.635 +Patch636: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.636 +Patch637: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.637 +Patch638: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.638 Patch3000: vim-7.3-syntax.patch Patch3002: vim-7.1-nowarnings.patch @@ -1314,6 +1396,88 @@ perl -pi -e "s,bin/nawk,bin/awk,g" runtime/tools/mve.awk %patch554 -p0 %patch555 -p0 %patch556 -p0 +%patch557 -p0 +%patch558 -p0 +%patch559 -p0 +%patch560 -p0 +%patch561 -p0 +%patch562 -p0 +%patch563 -p0 +%patch564 -p0 +%patch565 -p0 +%patch566 -p0 +%patch567 -p0 +%patch568 -p0 +%patch569 -p0 +%patch570 -p0 +%patch571 -p0 +%patch572 -p0 +%patch573 -p0 +%patch574 -p0 +%patch575 -p0 +%patch576 -p0 +%patch577 -p0 +%patch578 -p0 +%patch579 -p0 +%patch580 -p0 +%patch581 -p0 +%patch582 -p0 +%patch583 -p0 +%patch584 -p0 +%patch585 -p0 +%patch586 -p0 +%patch587 -p0 +%patch588 -p0 +%patch589 -p0 +%patch590 -p0 +%patch591 -p0 +%patch592 -p0 +%patch593 -p0 +%patch594 -p0 +%patch595 -p0 +%patch596 -p0 +%patch597 -p0 +%patch598 -p0 +%patch599 -p0 +%patch600 -p0 +%patch601 -p0 +%patch602 -p0 +%patch603 -p0 +%patch604 -p0 +%patch605 -p0 +%patch606 -p0 +%patch607 -p0 +%patch608 -p0 +%patch609 -p0 +%patch610 -p0 +%patch611 -p0 +%patch612 -p0 +%patch613 -p0 +%patch614 -p0 +%patch615 -p0 +%patch616 -p0 +%patch617 -p0 +%patch618 -p0 +%patch619 -p0 +%patch620 -p0 +%patch621 -p0 +%patch622 -p0 +%patch623 -p0 +%patch624 -p0 +%patch625 -p0 +%patch626 -p0 +%patch627 -p0 +%patch628 -p0 +%patch629 -p0 +%patch630 -p0 +%patch631 -p0 +%patch632 -p0 +%patch633 -p0 +%patch634 -p0 +%patch635 -p0 +%patch636 -p0 +%patch637 -p0 +%patch638 -p0 # install spell files @@ -1770,6 +1934,9 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/icons/hicolor/*/apps/* %changelog +* Tue Aug 28 2012 Karsten Hopp 7.3.638-1 +- patchlevel 638 + * Mon Jun 18 2012 Karsten Hopp 7.3.556-1 - patchlevel 556 From c8d55a4ffc9503371b9738188e056eba33134f47 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 15:34:04 +0200 Subject: [PATCH 84/87] fix some man page typos (#668894, #675480) own usr/share/vim/vimfiles/doc/tags (#845564) add path to csope database (#844843) --- vim-7.3-manpage-typo-668894-675480.patch | 21 +++++++++++++++++++++ vim.spec | 11 ++++++++++- vimrc | 2 +- 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 vim-7.3-manpage-typo-668894-675480.patch diff --git a/vim-7.3-manpage-typo-668894-675480.patch b/vim-7.3-manpage-typo-668894-675480.patch new file mode 100644 index 00000000..cb4ccd13 --- /dev/null +++ b/vim-7.3-manpage-typo-668894-675480.patch @@ -0,0 +1,21 @@ +diff -up vim73/runtime/doc/vim.1.668894 vim73/runtime/doc/vim.1 +--- vim73/runtime/doc/vim.1.668894 2010-05-15 13:04:00.000000000 +0200 ++++ vim73/runtime/doc/vim.1 2012-08-28 12:41:36.000000000 +0200 +@@ -73,7 +73,7 @@ To edit a file that starts with a dash, + .TP + \- + The file to edit is read from stdin. Commands are read from stderr, which +-should be a tty. ++should be a TTY. + .TP + \-t {tag} + The file to edit and the initial cursor position depends on a "tag", a sort +@@ -321,7 +321,7 @@ When N is omitted, open one tab page for + \-R + Read-only mode. + The 'readonly' option will be set. +-You can still edit the buffer, but will be prevented from accidently ++You can still edit the buffer, but will be prevented from accidentally + overwriting a file. + If you do want to overwrite a file, add an exclamation mark to the Ex command, + as in ":w!". diff --git a/vim.spec b/vim.spec index 734689a9..779849f1 100644 --- a/vim.spec +++ b/vim.spec @@ -24,7 +24,7 @@ Summary: The VIM editor URL: http://www.vim.org/ Name: vim Version: %{baseversion}.%{beta}%{patchlevel} -Release: 1%{?dist} +Release: 2%{?dist} License: Vim Group: Applications/Editors Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{baseversion}%{?beta}%{?CVSDATE}.tar.bz2 @@ -706,6 +706,7 @@ Patch3009: vim-7.0-syncolor.patch Patch3010: vim-7.0-specedit.patch Patch3011: vim72-rh514717.patch Patch3012: vim-7.3-bug816848.patch +Patch3013: vim-7.3-manpage-typo-668894-675480.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python-devel ncurses-devel gettext perl-devel @@ -1497,6 +1498,7 @@ perl -pi -e "s,bin/nawk,bin/awk,g" runtime/tools/mve.awk %patch3010 -p1 %patch3011 -p1 %patch3012 -p1 +%patch3013 -p1 %build cp -f %{SOURCE5} . @@ -1732,6 +1734,7 @@ done for i in rvim.1 gvim.1 gvimdiff.1; do echo ".so man1/vim.1" > $RPM_BUILD_ROOT/%{_mandir}/man1/$i done +touch $RPM_BUILD_ROOT/%{_datadir}/%{name}/vimfiles/doc/tags %post X11 touch --no-create %{_datadir}/icons/hicolor @@ -1904,6 +1907,7 @@ rm -rf $RPM_BUILD_ROOT %dir %{_datadir}/%{name}/vimfiles/colors %dir %{_datadir}/%{name}/vimfiles/compiler %dir %{_datadir}/%{name}/vimfiles/doc +%ghost %{_datadir}/%{name}/vimfiles/doc/tags %dir %{_datadir}/%{name}/vimfiles/ftdetect %dir %{_datadir}/%{name}/vimfiles/ftplugin %dir %{_datadir}/%{name}/vimfiles/indent @@ -1934,6 +1938,11 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/icons/hicolor/*/apps/* %changelog +* Tue Aug 28 2012 Karsten Hopp 7.3.638-2 +- fix some man page typos (#668894, #675480) +- own usr/share/vim/vimfiles/doc/tags (#845564) +- add path to csope database (#844843) + * Tue Aug 28 2012 Karsten Hopp 7.3.638-1 - patchlevel 638 diff --git a/vimrc b/vimrc index b02134df..6707ae49 100644 --- a/vimrc +++ b/vimrc @@ -36,7 +36,7 @@ if has("cscope") && filereadable("/usr/bin/cscope") set nocsverb " add any database in current directory if filereadable("cscope.out") - cs add cscope.out + cs add $PWD/cscope.out " else add database pointed to by environment elseif $CSCOPE_DB != "" cs add $CSCOPE_DB From ea9a3fafd36ff315cf259abc4c2b2891af6b437c Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 15:41:54 +0200 Subject: [PATCH 85/87] merge --- README.patches | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.patches b/README.patches index a559c7e3..dfe8b806 100644 --- a/README.patches +++ b/README.patches @@ -653,8 +653,6 @@ Individual patches for Vim 7.3: 4897 7.3.620 building with recent Ruby on Win32 doesn't work 2259 7.3.621 compiler warnings on 64 bit windows 1867 7.3.622 XPM library for Win32 can't be found -<<<<<<< HEAD -======= 2426 7.3.623 Perl 5.14 commands crash Vim on MS-Windows 1800 7.3.624 when cancelling input() it returns the third argument 4327 7.3.625 "gn" does not handle zero-width matches correctly @@ -671,4 +669,3 @@ Individual patches for Vim 7.3: 4539 7.3.636 (after 7.3.625) "gn" fails for some zero-width matches 3117 7.3.637 cannot catch error caused by a foldopen when there is no fold 1783 7.3.638 unecessary redraw of the previous character ->>>>>>> c8d55a4ffc9503371b9738188e056eba33134f47 From b1eab68a30942481addb68ff67a0053e59e99de2 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 15:45:04 +0200 Subject: [PATCH 86/87] drop obsolete patch --- vim.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/vim.spec b/vim.spec index ea4ed683..7fb28618 100644 --- a/vim.spec +++ b/vim.spec @@ -1490,7 +1490,6 @@ perl -pi -e "s,bin/nawk,bin/awk,g" runtime/tools/mve.awk %patch3002 -p1 %patch3003 -p1 %patch3004 -p1 -%patch3005 -p1 %patch3006 -p1 %patch3007 -p1 %patch3008 -p1 From 517e7e4e7369de56a2c72afd605f59dbadc24384 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Tue, 28 Aug 2012 15:58:20 +0200 Subject: [PATCH 87/87] cleanup patches --- vim.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/vim.spec b/vim.spec index 7fb28618..527c445e 100644 --- a/vim.spec +++ b/vim.spec @@ -697,7 +697,6 @@ Patch638: ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.638 Patch3000: vim-7.3-syntax.patch Patch3002: vim-7.1-nowarnings.patch -Patch3003: vim-6.1-rh3.patch Patch3004: vim-7.0-rclocation.patch Patch3006: vim-6.4-checkhl.patch Patch3007: vim-7.3-fstabsyntax.patch @@ -1488,7 +1487,6 @@ perl -pi -e "s,bin/nawk,bin/awk,g" runtime/tools/mve.awk %patch3000 -p1 %patch3002 -p1 -%patch3003 -p1 %patch3004 -p1 %patch3006 -p1 %patch3007 -p1