|
|
3ef2ca |
To: vim_dev@googlegroups.com
|
|
|
3ef2ca |
Subject: Patch 7.4.236
|
|
|
3ef2ca |
Fcc: outbox
|
|
|
3ef2ca |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
|
3ef2ca |
Mime-Version: 1.0
|
|
|
3ef2ca |
Content-Type: text/plain; charset=UTF-8
|
|
|
3ef2ca |
Content-Transfer-Encoding: 8bit
|
|
|
3ef2ca |
------------
|
|
|
3ef2ca |
|
|
|
3ef2ca |
Patch 7.4.236
|
|
|
3ef2ca |
Problem: It's not that easy to check the Vim patch version.
|
|
|
3ef2ca |
Solution: Make has("patch-7.4.123") work. (partly by Marc Weber)
|
|
|
3ef2ca |
Files: runtime/doc/eval.txt, src/eval.c, src/testdir/test60.in,
|
|
|
3ef2ca |
src/testdir/test60.ok
|
|
|
3ef2ca |
|
|
|
3ef2ca |
|
|
|
3ef2ca |
*** ../vim-7.4.235/runtime/doc/eval.txt 2014-04-01 21:00:45.440733663 +0200
|
|
|
3ef2ca |
--- runtime/doc/eval.txt 2014-04-01 21:19:52.232717888 +0200
|
|
|
3ef2ca |
***************
|
|
|
3ef2ca |
*** 6395,6407 ****
|
|
|
3ef2ca |
Example: >
|
|
|
3ef2ca |
:if has("gui_running")
|
|
|
3ef2ca |
< *has-patch*
|
|
|
3ef2ca |
! 3. Included patches. First check |v:version| for the version of Vim.
|
|
|
3ef2ca |
! Then the "patch123" feature means that patch 123 has been included for
|
|
|
3ef2ca |
! this version. Example (checking version 6.2.148 or later): >
|
|
|
3ef2ca |
:if v:version > 602 || v:version == 602 && has("patch148")
|
|
|
3ef2ca |
! < Note that it's possible for patch 147 to be omitted even though 148 is
|
|
|
3ef2ca |
included.
|
|
|
3ef2ca |
|
|
|
3ef2ca |
all_builtin_terms Compiled with all builtin terminals enabled.
|
|
|
3ef2ca |
amiga Amiga version of Vim.
|
|
|
3ef2ca |
arabic Compiled with Arabic support |Arabic|.
|
|
|
3ef2ca |
--- 6408,6430 ----
|
|
|
3ef2ca |
Example: >
|
|
|
3ef2ca |
:if has("gui_running")
|
|
|
3ef2ca |
< *has-patch*
|
|
|
3ef2ca |
! 3. Included patches. The "patch123" feature means that patch 123 has been
|
|
|
3ef2ca |
! included. Note that this form does not check the version of Vim, you need
|
|
|
3ef2ca |
! to inspect |v:version| for that:
|
|
|
3ef2ca |
! Example (checking version 6.2.148 or later): >
|
|
|
3ef2ca |
:if v:version > 602 || v:version == 602 && has("patch148")
|
|
|
3ef2ca |
! < Note that it's possible for patch 147 to be omitted even though 148 is
|
|
|
3ef2ca |
included.
|
|
|
3ef2ca |
|
|
|
3ef2ca |
+ 4. Beyond a certain patch level. The "patch-7.4.123" feature means that
|
|
|
3ef2ca |
+ the Vim version is 7.4 and patch 123 or later was included, or the Vim
|
|
|
3ef2ca |
+ version is later than 7.4.
|
|
|
3ef2ca |
+ The example above can be simplified to: >
|
|
|
3ef2ca |
+ :if has("patch-6.2.148")
|
|
|
3ef2ca |
+ < Note that this does not check if the patch was actually included, some
|
|
|
3ef2ca |
+ patches may have been skipped. That is unusual though.
|
|
|
3ef2ca |
+
|
|
|
3ef2ca |
+ acl Compiled with |ACL| support.
|
|
|
3ef2ca |
all_builtin_terms Compiled with all builtin terminals enabled.
|
|
|
3ef2ca |
amiga Amiga version of Vim.
|
|
|
3ef2ca |
arabic Compiled with Arabic support |Arabic|.
|
|
|
3ef2ca |
*** ../vim-7.4.235/src/eval.c 2014-04-01 21:00:45.428733664 +0200
|
|
|
3ef2ca |
--- src/eval.c 2014-04-01 21:50:59.084692208 +0200
|
|
|
3ef2ca |
***************
|
|
|
3ef2ca |
*** 12638,12644 ****
|
|
|
3ef2ca |
if (n == FALSE)
|
|
|
3ef2ca |
{
|
|
|
3ef2ca |
if (STRNICMP(name, "patch", 5) == 0)
|
|
|
3ef2ca |
! n = has_patch(atoi((char *)name + 5));
|
|
|
3ef2ca |
else if (STRICMP(name, "vim_starting") == 0)
|
|
|
3ef2ca |
n = (starting != 0);
|
|
|
3ef2ca |
#ifdef FEAT_MBYTE
|
|
|
3ef2ca |
--- 12638,12664 ----
|
|
|
3ef2ca |
if (n == FALSE)
|
|
|
3ef2ca |
{
|
|
|
3ef2ca |
if (STRNICMP(name, "patch", 5) == 0)
|
|
|
3ef2ca |
! {
|
|
|
3ef2ca |
! if (name[5] == '-'
|
|
|
3ef2ca |
! && STRLEN(name) > 11
|
|
|
3ef2ca |
! && vim_isdigit(name[6])
|
|
|
3ef2ca |
! && vim_isdigit(name[8])
|
|
|
3ef2ca |
! && vim_isdigit(name[10]))
|
|
|
3ef2ca |
! {
|
|
|
3ef2ca |
! int major = atoi((char *)name + 6);
|
|
|
3ef2ca |
! int minor = atoi((char *)name + 8);
|
|
|
3ef2ca |
! int patch = atoi((char *)name + 10);
|
|
|
3ef2ca |
!
|
|
|
3ef2ca |
! /* Expect "patch-9.9.01234". */
|
|
|
3ef2ca |
! n = (major < VIM_VERSION_MAJOR
|
|
|
3ef2ca |
! || (major == VIM_VERSION_MAJOR
|
|
|
3ef2ca |
! && (minor < VIM_VERSION_MINOR
|
|
|
3ef2ca |
! || (minor == VIM_VERSION_MINOR
|
|
|
3ef2ca |
! && patch <= highest_patch()))));
|
|
|
3ef2ca |
! }
|
|
|
3ef2ca |
! else
|
|
|
3ef2ca |
! n = has_patch(atoi((char *)name + 5));
|
|
|
3ef2ca |
! }
|
|
|
3ef2ca |
else if (STRICMP(name, "vim_starting") == 0)
|
|
|
3ef2ca |
n = (starting != 0);
|
|
|
3ef2ca |
#ifdef FEAT_MBYTE
|
|
|
3ef2ca |
*** ../vim-7.4.235/src/testdir/test60.in 2014-01-14 15:24:24.000000000 +0100
|
|
|
3ef2ca |
--- src/testdir/test60.in 2014-04-01 22:01:40.256683388 +0200
|
|
|
3ef2ca |
***************
|
|
|
3ef2ca |
*** 1,4 ****
|
|
|
3ef2ca |
! Tests for the exists() function. vim: set ft=vim ts=8 :
|
|
|
3ef2ca |
|
|
|
3ef2ca |
STARTTEST
|
|
|
3ef2ca |
:so small.vim
|
|
|
3ef2ca |
--- 1,4 ----
|
|
|
3ef2ca |
! Tests for the exists() and has() functions. vim: set ft=vim ts=8 sw=2 :
|
|
|
3ef2ca |
|
|
|
3ef2ca |
STARTTEST
|
|
|
3ef2ca |
:so small.vim
|
|
|
3ef2ca |
***************
|
|
|
3ef2ca |
*** 588,593 ****
|
|
|
3ef2ca |
--- 588,603 ----
|
|
|
3ef2ca |
redir END
|
|
|
3ef2ca |
endfunction
|
|
|
3ef2ca |
:call TestExists()
|
|
|
3ef2ca |
+ :"
|
|
|
3ef2ca |
+ :function TestHas()
|
|
|
3ef2ca |
+ redir >> test.out
|
|
|
3ef2ca |
+ for pl in ['6.9.999', '7.1.999', '7.4.123', '9.1.0', '9.9.1']
|
|
|
3ef2ca |
+ echo 'has patch ' . pl . ': ' . has('patch-' . pl)
|
|
|
3ef2ca |
+ endfor
|
|
|
3ef2ca |
+ redir END
|
|
|
3ef2ca |
+ endfunc
|
|
|
3ef2ca |
+ :call TestHas()
|
|
|
3ef2ca |
+ :"
|
|
|
3ef2ca |
:delfunc TestExists
|
|
|
3ef2ca |
:delfunc RunTest
|
|
|
3ef2ca |
:delfunc TestFuncArg
|
|
|
3ef2ca |
*** ../vim-7.4.235/src/testdir/test60.ok 2014-01-14 15:24:24.000000000 +0100
|
|
|
3ef2ca |
--- src/testdir/test60.ok 2014-04-01 22:01:46.664683300 +0200
|
|
|
3ef2ca |
***************
|
|
|
3ef2ca |
*** 204,206 ****
|
|
|
3ef2ca |
--- 204,211 ----
|
|
|
3ef2ca |
g:footest#x = 1
|
|
|
3ef2ca |
footest#F() 0
|
|
|
3ef2ca |
UndefFun() 0
|
|
|
3ef2ca |
+ has patch 6.9.999: 1
|
|
|
3ef2ca |
+ has patch 7.1.999: 1
|
|
|
3ef2ca |
+ has patch 7.4.123: 1
|
|
|
3ef2ca |
+ has patch 9.1.0: 0
|
|
|
3ef2ca |
+ has patch 9.9.1: 0
|
|
|
3ef2ca |
*** ../vim-7.4.235/src/version.c 2014-04-01 21:00:45.440733663 +0200
|
|
|
3ef2ca |
--- src/version.c 2014-04-01 21:22:27.964715746 +0200
|
|
|
3ef2ca |
***************
|
|
|
3ef2ca |
*** 736,737 ****
|
|
|
3ef2ca |
--- 736,739 ----
|
|
|
3ef2ca |
{ /* Add new patch number below this line */
|
|
|
3ef2ca |
+ /**/
|
|
|
3ef2ca |
+ 236,
|
|
|
3ef2ca |
/**/
|
|
|
3ef2ca |
|
|
|
3ef2ca |
--
|
|
|
3ef2ca |
When a fly lands on the ceiling, does it do a half roll or
|
|
|
3ef2ca |
a half loop?
|
|
|
3ef2ca |
|
|
|
3ef2ca |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
|
3ef2ca |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
|
3ef2ca |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
|
3ef2ca |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|