Loading ...
Sorry, an error occurred while loading the content.
 

Bug? shellslash options exists in vim-gtk for ubuntu

Expand Messages
  • lith
    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
    Message 1 of 3 , Dec 5, 2012
      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

      --
      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
    • Tony Mechelynck
      ... 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
      Message 2 of 3 , Dec 5, 2012
        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
      • lith
        ... Ah, I see. Thanks a lot. Regards, Tom -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text you are
        Message 3 of 3 , Dec 5, 2012
          > you should use
          >
          > :echo exists('+shellslash')

          Ah, I see. Thanks a lot.

          Regards,
          Tom

          --
          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
        Your message has been successfully submitted and would be delivered to recipients shortly.