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

hilinks and potentially other script bugs

Expand Messages
  • Ben Schmidt
    Hi, Chip and other script developers, I have an old Vim 6 lying around I use in emergencies and discovered that it chokes on the hilinks plugin and others.
    Message 1 of 4 , Oct 6, 2008
    • 0 Attachment
      Hi, Chip and other script developers,

      I have an old Vim 6 lying around I use in 'emergencies' and discovered that it
      chokes on the hilinks plugin and others. The problem seems to be the :for command.
      Vim 6, it seems, is unable to even skip over it when it's in an if version>=700 or
      such conditional, but throws up errors such as 'return not in function' or 'endif
      without if'. Perhaps it sees the :endfor as ending some other block since it
      doesn't know about :for. Why it would do this, I don't know, but it seems to do
      something like that.

      I don't know if there's a workaround, i.e. a way you can rewrite the plugin to
      still work on Vim 6 minus a few features. It would be nice if there were. But in
      lieu of that, I think scripts that use :for will need to :finish prematurely for
      Vim < 7, as simply putting the :for in a conditional on the version doesn't work.

      Ben.




      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Andy Wokula
      ... This works with Vim 6.4, but not with Vim 7.1: func! Foo() echo endfor is endfunction endfor call Foo() no error (with Vim6) if :endfor occurs
      Message 2 of 4 , Oct 7, 2008
      • 0 Attachment
        Ben Schmidt schrieb:
        > Hi, Chip and other script developers,
        >
        > I have an old Vim 6 lying around I use in 'emergencies' and discovered that it
        > chokes on the hilinks plugin and others. The problem seems to be the :for command.
        > Vim 6, it seems, is unable to even skip over it when it's in an if version>=700 or
        > such conditional, but throws up errors such as 'return not in function' or 'endif
        > without if'. Perhaps it sees the :endfor as ending some other block since it
        > doesn't know about :for. Why it would do this, I don't know, but it seems to do
        > something like that.
        >
        > I don't know if there's a workaround, i.e. a way you can rewrite the plugin to
        > still work on Vim 6 minus a few features. It would be nice if there were. But in
        > lieu of that, I think scripts that use :for will need to :finish prematurely for
        > Vim < 7, as simply putting the :for in a conditional on the version doesn't work.
        >
        > Ben.

        " This works with Vim 6.4, but not with Vim 7.1:

        func! Foo()
        echo "endfor is endfunction"
        endfor

        call Foo()

        " no error (with Vim6) if :endfor occurs outside a function.

        --
        Andy


        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Charles Campbell
        ... Thank you, Ben! I ve just posted a bunch of updates to my website that issue a warning and does a finish if an attempt is made to use one of my scripts
        Message 3 of 4 , Oct 7, 2008
        • 0 Attachment
          Ben Schmidt wrote:
          > [snip]
          > I don't know if there's a workaround, i.e. a way you can rewrite the plugin to
          > still work on Vim 6 minus a few features. It would be nice if there were. But in
          > lieu of that, I think scripts that use :for will need to :finish prematurely for
          > Vim < 7, as simply putting the :for in a conditional on the version doesn't work.
          >
          Thank you, Ben!

          I've just posted a bunch of updates to my website that issue a warning
          and does a finish if an attempt is made to use one of my scripts that
          use vim's "for" loop construct.

          Regards,
          Chip Campbell


          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_dev" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Charles Campbell
          ... Hmm, I should add that they do that if a vim earlier than vim 7.0 is used. Regards, Chip Campbell --~--~---------~--~----~------------~-------~--~----~ You
          Message 4 of 4 , Oct 7, 2008
          • 0 Attachment
            Charles Campbell wrote:
            > Ben Schmidt wrote:
            >
            >> [snip]
            >> I don't know if there's a workaround, i.e. a way you can rewrite the plugin to
            >> still work on Vim 6 minus a few features. It would be nice if there were. But in
            >> lieu of that, I think scripts that use :for will need to :finish prematurely for
            >> Vim < 7, as simply putting the :for in a conditional on the version doesn't work.
            >>
            >>
            > Thank you, Ben!
            >
            > I've just posted a bunch of updates to my website that issue a warning
            > and does a finish if an attempt is made to use one of my scripts that
            > use vim's "for" loop construct.
            >
            Hmm, I should add that they do that if a vim earlier than vim 7.0 is used.

            Regards,
            Chip Campbell


            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_dev" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          Your message has been successfully submitted and would be delivered to recipients shortly.