On 05/12/12 22:13, lith wrote:
I use vim-gtk 7.3.429-2ubuntu2.1 on ubuntu 12.04. The docs for shellslash state 
that it's only defined only for MSDOS, MS-Windows and OS/2. In vim-gtk,

     echo exists('&shellslash')

prints 1. And the value of &shellslash is 0.

I'd expect the option to be either undefined (that's my understanding of the 
doc) or maybe that the value is 1 since bash uses slashes and not backslashes 
(but I guess I'm missing something here).

Regards


exists('&shellslash') tests only if that option has been defined in the source no later than the code you're currently using. To test if the option is supported (i.e. working) in the current Vim build, you should use

        :echo exists('+shellslash')

instead. This will return 0 on Linux. Similarly,

        :echo &ssl

returns 0, but

        :set ssl?

returns

        E519: Option not supported: ssl?

The difference between exists('&option') and exists('+option') is mentioned (albeit rather summarily) under

        :help exists()


To test, in a script, whether 'shellslash' is both supported and set, you should use

        :if exists('+ssl') && &ssl

Short-circuit evaluation will in this case make sure that the value of 'shellslash' is only tested if the option is supported.


Best regards,
Tony.
--
Join the march to save individuality!

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

Raspunde prin e-mail lui