On Sat, Jan 9, 2016 at 8:08 AM, Tony Mechelynck
<[email protected]> wrote:
> On Sat, Jan 9, 2016 at 12:14 AM, smu johnson <[email protected]> wrote:
>> Dear Vim Mailing List,
>>
>> I wanted to quickly suggest the idea of has('blowfish') support for Vim.  It
>> would make my .vimrc a bit more legible to prevent < 7.3 version errors when
>> trying to execute the command: "set cryptmethod=blowfish" inside of it.
>> Just a thought.
>>
>>
>> --
>> smu johnson <[email protected]>
>>
>
> Another thought: A "user function" to detect the known cryptmethods in
> the current Vim
> (untested)
>
> function GetCryptMethod()
>     if !has('cryptv')
>         return 0        " encryption not compiled-in
>     endif
>     if version < 703
>         return 1        " only zip is available
>     endif
>     if (v:version == 703) || (v:version == 704 && !has('patch399'))
>         return 2        " blowfish, but not blowfish2
>     endif
>     return 3            " even blowfish2 is available
> endfunction
>
> Best regards,
> Tony.

There was a typo in the last return.
Yet another thought:

let cryptmethods = [ "", "zip", "blowfish", "blowfish2" ]
" set the best cryptmethod known by this Vim
if has('cryptv') | let &cm = cryptmethods[GetCryptMethod()] | endif


Best regards,
Tony

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui