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

Jumping between parenthesis with acomment inbetween (a possible bug)

Expand Messages
  • Zroutik
    Dear vim devs, thank you for the great editing tool! Recently I was editing my R scripts (R Project statistical software) and I came across the following
    Message 1 of 3 , May 6, 2012
    • 0 Attachment
      Dear vim devs,

      thank you for the great editing tool!

      Recently I was editing my R scripts (R Project statistical software)
      and I came across the following strange behaviour: Jumping between
      parenthesis is not as expected, if an unpaired closing parenthesis
      appears in-between in comments.

      OS: windows XP,

      vim: VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Apr 30 2012
      14:21:53)
      MS-Windows 32-bit GUI version with OLE support
      Included patches: 1-514
      Compiled by digitectNO@...


      A 2-line minimal example:
      ( #)
      )

      In this example, three parenthesis are present. One opening
      parenthesis, and two closing. But one of the closing is in the
      comment.
      1) When placing the pointer before the text, no text portion is
      highlighted.
      2) When placing the pointer at the first parenthesis, the second one
      within the pair is correctly highlighted. The parenthesis in the
      comment is ignored.
      3) Now, jumping to the paired parenthesis (using a keystroke %) makes
      the pointer jump to the open parenthesis in the comment. And back,
      too, when the keystroke is repeated.
      4) After placing the pointer to the correct paired parenthesis,
      pressing % does not evoke any jump.
      I have a collection of screenshots, that I can supply per email, if
      requested, please.

      I believe this behaviour is not expected. The parenthesis in the
      comments should be ignored by highlighting (correct in the example
      above), and within motion, too (incorrect in the example above).

      Let me know, if I should supply more information, please.

      Kind regards,
      Z

      --
      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
    • Christian Brabandt
      ... The builtin % motion of Vim does not take comments into consideration. If you like this behaviour, activate the bundled matchit-plugin that comes with vim,
      Message 2 of 3 , May 7, 2012
      • 0 Attachment
        On Sun, May 6, 2012 15:22, Zroutik wrote:
        > Dear vim devs,
        >
        > thank you for the great editing tool!
        >
        > Recently I was editing my R scripts (R Project statistical software)
        > and I came across the following strange behaviour: Jumping between
        > parenthesis is not as expected, if an unpaired closing parenthesis
        > appears in-between in comments.
        >
        > OS: windows XP,
        >
        > vim: VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Apr 30 2012
        > 14:21:53)
        > MS-Windows 32-bit GUI version with OLE support
        > Included patches: 1-514
        > Compiled by digitectNO@...
        >
        >
        > A 2-line minimal example:
        > ( #)
        > )
        >
        > In this example, three parenthesis are present. One opening
        > parenthesis, and two closing. But one of the closing is in the
        > comment.
        > 1) When placing the pointer before the text, no text portion is
        > highlighted.
        > 2) When placing the pointer at the first parenthesis, the second one
        > within the pair is correctly highlighted. The parenthesis in the
        > comment is ignored.
        > 3) Now, jumping to the paired parenthesis (using a keystroke %) makes
        > the pointer jump to the open parenthesis in the comment. And back,
        > too, when the keystroke is repeated.
        > 4) After placing the pointer to the correct paired parenthesis,
        > pressing % does not evoke any jump.
        > I have a collection of screenshots, that I can supply per email, if
        > requested, please.
        >
        > I believe this behaviour is not expected. The parenthesis in the
        > comments should be ignored by highlighting (correct in the example
        > above), and within motion, too (incorrect in the example above).
        >
        > Let me know, if I should supply more information, please.

        The builtin % motion of Vim does not take comments into consideration.
        If you like this behaviour, activate the bundled matchit-plugin that comes
        with vim, see :h matchit-activation and :h matchit-install, but you should
        possibly read the whole document (:h matchit.txt)

        regards,
        Christian

        --
        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
      • Ben Fritz
        ... I don t see a R ftplugin file in my Vim installation. Check that yours includes an appropriate setting of the b:match_words variable for use by matchit, or
        Message 3 of 3 , May 8, 2012
        • 0 Attachment
          On Monday, May 7, 2012 4:37:20 AM UTC-5, Christian Brabandt wrote:
          > On Sun, May 6, 2012 15:22, Zroutik wrote:
          > > Dear vim devs,
          > >
          > > thank you for the great editing tool!
          > >
          > > Recently I was editing my R scripts (R Project statistical software)
          > > and I came across the following strange behaviour: Jumping between
          > > parenthesis is not as expected, if an unpaired closing parenthesis
          > > appears in-between in comments.
          > >
          > > OS: windows XP,
          > >
          > > vim: VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Apr 30 2012
          > > 14:21:53)
          > > MS-Windows 32-bit GUI version with OLE support
          > > Included patches: 1-514
          > > Compiled by digitectNO@...
          > >
          > >
          > > A 2-line minimal example:
          > > ( #)
          > > )
          > >
          > > In this example, three parenthesis are present. One opening
          > > parenthesis, and two closing. But one of the closing is in the
          > > comment.
          > > 1) When placing the pointer before the text, no text portion is
          > > highlighted.
          > > 2) When placing the pointer at the first parenthesis, the second one
          > > within the pair is correctly highlighted. The parenthesis in the
          > > comment is ignored.
          > > 3) Now, jumping to the paired parenthesis (using a keystroke %) makes
          > > the pointer jump to the open parenthesis in the comment. And back,
          > > too, when the keystroke is repeated.
          > > 4) After placing the pointer to the correct paired parenthesis,
          > > pressing % does not evoke any jump.
          > > I have a collection of screenshots, that I can supply per email, if
          > > requested, please.
          > >
          > > I believe this behaviour is not expected. The parenthesis in the
          > > comments should be ignored by highlighting (correct in the example
          > > above), and within motion, too (incorrect in the example above).
          > >
          > > Let me know, if I should supply more information, please.
          >
          > The builtin % motion of Vim does not take comments into consideration.
          > If you like this behaviour, activate the bundled matchit-plugin that comes
          > with vim, see :h matchit-activation and :h matchit-install, but you should
          > possibly read the whole document (:h matchit.txt)
          >

          I don't see a R ftplugin file in my Vim installation. Check that yours includes an appropriate setting of the b:match_words variable for use by matchit, or you may see problematic behavior with % still.

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