summaryrefslogblamecommitdiffstats
path: root/patches/source/vim/patches/7.4.236
blob: 927b0436d4731dd103b12428021f23c92270431c (plain) (tree)






























































































































































                                                                                   
To: vim_dev@googlegroups.com
Subject: Patch 7.4.236
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.4.236
Problem:    It's not that easy to check the Vim patch version.
Solution:   Make has("patch-7.4.123") work. (partly by Marc Weber)
Files:	    runtime/doc/eval.txt, src/eval.c, src/testdir/test60.in,
	    src/testdir/test60.ok


*** ../vim-7.4.235/runtime/doc/eval.txt	2014-04-01 21:00:45.440733663 +0200
--- runtime/doc/eval.txt	2014-04-01 21:19:52.232717888 +0200
***************
*** 6395,6407 ****
      Example: >
  	:if has("gui_running")
  <							*has-patch*
! 3.  Included patches.  First check |v:version| for the version of Vim.
!     Then the "patch123" feature means that patch 123 has been included for
!     this version.  Example (checking version 6.2.148 or later): >
  	:if v:version > 602 || v:version == 602 && has("patch148")
! <   Note that it's possible for patch 147 to be omitted even though 148 is
      included.
  
  all_builtin_terms	Compiled with all builtin terminals enabled.
  amiga			Amiga version of Vim.
  arabic			Compiled with Arabic support |Arabic|.
--- 6408,6430 ----
      Example: >
  	:if has("gui_running")
  <							*has-patch*
! 3.  Included patches.  The "patch123" feature means that patch 123 has been
!     included.  Note that this form does not check the version of Vim, you need
!     to inspect |v:version| for that:
!     Example (checking version 6.2.148 or later): >
  	:if v:version > 602 || v:version == 602 && has("patch148")
! <    Note that it's possible for patch 147 to be omitted even though 148 is
      included.
  
+ 4.  Beyond a certain patch level.  The "patch-7.4.123" feature means that
+     the Vim version is 7.4 and patch 123 or later was included, or the Vim
+     version is later than 7.4.
+     The example above can be simplified to: >
+ 	:if has("patch-6.2.148")
+ <    Note that this does not check if the patch was actually included, some
+     patches may have been skipped.  That is unusual though.
+ 
+ acl			Compiled with |ACL| support.
  all_builtin_terms	Compiled with all builtin terminals enabled.
  amiga			Amiga version of Vim.
  arabic			Compiled with Arabic support |Arabic|.
*** ../vim-7.4.235/src/eval.c	2014-04-01 21:00:45.428733664 +0200
--- src/eval.c	2014-04-01 21:50:59.084692208 +0200
***************
*** 12638,12644 ****
      if (n == FALSE)
      {
  	if (STRNICMP(name, "patch", 5) == 0)
! 	    n = has_patch(atoi((char *)name + 5));
  	else if (STRICMP(name, "vim_starting") == 0)
  	    n = (starting != 0);
  #ifdef FEAT_MBYTE
--- 12638,12664 ----
      if (n == FALSE)
      {
  	if (STRNICMP(name, "patch", 5) == 0)
! 	{
! 	    if (name[5] == '-'
! 		    && STRLEN(name) > 11
! 		    && vim_isdigit(name[6])
! 		    && vim_isdigit(name[8])
! 		    && vim_isdigit(name[10]))
! 	    {
! 		int major = atoi((char *)name + 6);
! 		int minor = atoi((char *)name + 8);
! 		int patch = atoi((char *)name + 10);
! 
! 		/* Expect "patch-9.9.01234". */
! 		n = (major < VIM_VERSION_MAJOR
! 		     || (major == VIM_VERSION_MAJOR
! 			 && (minor < VIM_VERSION_MINOR
! 			     || (minor == VIM_VERSION_MINOR
! 				 && patch <= highest_patch()))));
! 	    }
! 	    else
! 		n = has_patch(atoi((char *)name + 5));
! 	}
  	else if (STRICMP(name, "vim_starting") == 0)
  	    n = (starting != 0);
  #ifdef FEAT_MBYTE
*** ../vim-7.4.235/src/testdir/test60.in	2014-01-14 15:24:24.000000000 +0100
--- src/testdir/test60.in	2014-04-01 22:01:40.256683388 +0200
***************
*** 1,4 ****
! Tests for the exists() function.  vim: set ft=vim ts=8 :
  
  STARTTEST
  :so small.vim
--- 1,4 ----
! Tests for the exists() and has() functions.  vim: set ft=vim ts=8 sw=2 :
  
  STARTTEST
  :so small.vim
***************
*** 588,593 ****
--- 588,603 ----
      redir END
  endfunction
  :call TestExists()
+ :"
+ :function TestHas()
+   redir >> test.out
+   for pl in ['6.9.999', '7.1.999', '7.4.123', '9.1.0', '9.9.1']
+     echo 'has patch ' . pl . ': ' . has('patch-' . pl)
+   endfor
+   redir END
+ endfunc
+ :call TestHas()
+ :"
  :delfunc TestExists
  :delfunc RunTest
  :delfunc TestFuncArg
*** ../vim-7.4.235/src/testdir/test60.ok	2014-01-14 15:24:24.000000000 +0100
--- src/testdir/test60.ok	2014-04-01 22:01:46.664683300 +0200
***************
*** 204,206 ****
--- 204,211 ----
   g:footest#x = 1
     footest#F() 0
  UndefFun() 0
+ has patch 6.9.999: 1
+ has patch 7.1.999: 1
+ has patch 7.4.123: 1
+ has patch 9.1.0: 0
+ has patch 9.9.1: 0
*** ../vim-7.4.235/src/version.c	2014-04-01 21:00:45.440733663 +0200
--- src/version.c	2014-04-01 21:22:27.964715746 +0200
***************
*** 736,737 ****
--- 736,739 ----
  {   /* Add new patch number below this line */
+ /**/
+     236,
  /**/

-- 
When a fly lands on the ceiling, does it do a half roll or
a half loop?

 /// 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    ///