On 04/04/09 21:17, Yakov Lerner wrote:
> If vimscript functions had remark "Added in vim7.1.129", it would be useful.
> For example, if you want to know how portable the script is.

The docs are there, it just may be a little esoteric to find them.

        :helpgrep \<foobar(

or maybe, to narrow down the search,

        :vimgrep /\<foobar(/g $VIMRUNTIME/doc/version*.txt

will search, in the former case the text of all help files, or in the 
latter case only that of the version*.txt helpfiles, for any mentioon of 
the  foobar() function. If it was added to Vim not earlier than version 
4.0, you'll find at exactly at which version and patchlevel that happened.

If you find out that it was introduced at version 6.3.87 you can test 
for it by either

        if exists('*foobar')

or

        if version > 603 || (version == 603 && has('patch087'))

The latter is useful if, at some point after introducing the function, 
an important bug in it (that you care about) was fixed.

If some version of Vim 3 already had the function (i.e. it was already 
there as other than a "new feature" in Vim 4.0.000), then I suppose you 
can say by now that it's been there "forever", and the only case when 
you might still be unable to use it is if you use a non-feature-complete 
Vim lacking some optional feature which includes that function. Of 
course, -eval versions include no functions at all.


Best regards,
Tony.
-- 
The only really decent thing to do behind a person's back is pat it.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui