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

vim7: reported lines of bugs in Vim scripts

Expand Messages
  • Mikolaj Machowski
    Hello, I have an impression that when reporting lines of bugs in Vim scripts Vim is counting lines by logical lines, not physical (counting script lines which
    Message 1 of 4 , Feb 1, 2006
    • 0 Attachment
      Hello,

      I have an impression that when reporting lines of bugs in Vim scripts
      Vim is counting lines by logical lines, not physical (counting script lines
      which spread across several lines thanks to \ as one line). It makes bug
      hunting extremely hard.

      Huh. I found that bug in my code I couldn't find but... Vim stopped to
      complain about non matching if/elseif/else/endif?

      m.
    • A. J. Mechelynck
      ... Well, at least you know in which script it happened, don t you? Here s what I suggest: - If it is an (unchanged) script from the Vim distribution, just
      Message 2 of 4 , Feb 1, 2006
      • 0 Attachment
        Mikolaj Machowski wrote:
        > Hello,
        >
        > I have an impression that when reporting lines of bugs in Vim scripts
        > Vim is counting lines by logical lines, not physical (counting script lines
        > which spread across several lines thanks to \ as one line). It makes bug
        > hunting extremely hard.
        >
        > Huh. I found that bug in my code I couldn't find but... Vim stopped to
        > complain about non matching if/elseif/else/endif?
        >
        > m.


        Well, at least you know in which script it happened, don't you? Here's
        what I suggest:

        - If it is an (unchanged) script from the Vim distribution, just tell us
        the script name and path ($VIMRUNTIME/...something.../something.vim) and
        the script date and Vim version (e.g., dated 2005 Dec 27, for Vim 7.0aa)
        - If you wrote it, and it is short, append it to a mail.
        - If you wrote it, and it is long, upload it somewhere convenient, and
        post a URL.


        Best regards,
        Tony.
      • Mikolaj Machowski
        ... Here is an example, very short:: function A() let g:a =[1, 2, 3, 4, 5] echo asdf endfunction call A() After sourcing of file with these lines Vim
        Message 3 of 4 , Feb 1, 2006
        • 0 Attachment
          Dnia środa, 1 lutego 2006 18:07, A. J. Mechelynck napisał:
          > - If you wrote it, and it is short, append it to a mail.

          Here is an example, very short::

          function A()
          let g:a =[1,
          \2,
          \3,
          \4,
          \5]
          echo asdf
          endfunction
          call A()

          After sourcing of file with these lines Vim complains about unknown
          variable asdf in second line of function A.

          Note that when expressions are in plain file, not in function report is
          precise, for file with::

          let g:a =[1,
          \2,
          \3,
          \4,
          \5]
          echo asdf

          Vim complains about line 6.

          Vim7 version from 'Jan 29'

          m.
        • A. J. Mechelynck
          ... In your previous post, you spoke about mismatched if/elseif/else/endif clauses. Try installing matchit (if you haven t already done it) then using the
          Message 4 of 4 , Feb 1, 2006
          • 0 Attachment
            Mikolaj Machowski wrote:
            > Dnia środa, 1 lutego 2006 18:07, A. J. Mechelynck napisał:
            >> - If you wrote it, and it is short, append it to a mail.
            >
            > Here is an example, very short::
            >
            > function A()
            > let g:a =[1,
            > \2,
            > \3,
            > \4,
            > \5]
            > echo asdf
            > endfunction
            > call A()
            >
            > After sourcing of file with these lines Vim complains about unknown
            > variable asdf in second line of function A.
            >
            > Note that when expressions are in plain file, not in function report is
            > precise, for file with::
            >
            > let g:a =[1,
            > \2,
            > \3,
            > \4,
            > \5]
            > echo asdf
            >
            > Vim complains about line 6.
            >
            > Vim7 version from 'Jan 29'
            >
            > m.
            >
            >
            >
            >

            In your previous post, you spoke about mismatched if/elseif/else/endif
            clauses. Try installing matchit (if you haven't already done it) then
            using the percent key in Normal mode to check that your conditional
            statements are paired the way you want them to be.


            Best regards,
            Tony.
          Your message has been successfully submitted and would be delivered to recipients shortly.