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

Re: Weird auto-comment after 72 lines

Expand Messages
  • Efraim Yawitz
    Try :help cinoptions (specifically, the *N value for which the help says: *N Vim searches for unclosed comments at most N lines away. This limits the time
    Message 1 of 5 , Jun 1, 2011
    • 0 Attachment
      Try :help cinoptions (specifically, the *N value for which the help says:

          *N    Vim searches for unclosed comments at most N lines away.  This
                limits the time needed to search for the start of a comment.
                (default 30 lines).

      I think that the help may be out of date, because the code (in get_c_indent(), misc1.c) has

          int ind_maxcomment = 70;

      which would explain the 72-line behavior (it searches back 70 lines for the start of the comment, so line 71 works as expected, and line 72 doesn't.)

      On Tue, May 31, 2011 at 9:44 PM, Gary Johnson <garyjohn@...> wrote:
      On 2011-05-31, Fab wrote:
      > Hi,
      > I'm reporting a very strange behavior I have only noticed today on
      > vim.
      > If you open a C file (vim foo.c) and enter this text:
      > /*
      > then press ENTER
      > vim will automatically align the comment and will insert automatically
      > a space, star, space: ' * ' before every line.
      >
      > Unfortunately after 72 lines, this sort of convenient indentation
      > capability stop working:
      > vim insert only a star (no spaces), and sometimes (if previous text
      > has some sort of indentation, it insert several spaces)
      >



      --
      You received this message from the "vim_use" 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
    • Thilo Six
      Efraim Yawitz wrote the following on 01.06.2011 13:38 ... It seems that the above mentioned helptext already got updated in the mercurial repo: ,----[ :h
      Message 2 of 5 , Jun 1, 2011
      • 0 Attachment
        Efraim Yawitz wrote the following on 01.06.2011 13:38

        > Try :help cinoptions (specifically, the *N value for which the help says:
        >
        > *N Vim searches for unclosed comments at most N lines away. This
        > limits the time needed to search for the start of a comment.
        > (default 30 lines).

        It seems that the above mentioned helptext already got updated in the mercurial
        repo:

        ,----[ :h indent.txt ]------------------------

        *cino-star*
        *N Vim searches for unclosed comments at most N lines away. This
        limits the time needed to search for the start of a comment.
        If your /* */ comments stop indenting afer N lines this is the
        value you will want to change.
        (default 70 lines).
        `---------------------------------------------

        -- <snip> --

        --
        bye Thilo

        4096R/0xC70B1A8F
        721B 1BA0 095C 1ABA 3FC6 7C18 89A4 A2A0 C70B 1A8F


        --
        You received this message from the "vim_use" 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 knew I remembered a discussion of this on the mailing list recently, but I could not find the patch for it. Apparently that s because just the
        Message 3 of 5 , Jun 1, 2011
        • 0 Attachment
          On Jun 1, 8:31 am, Thilo Six <T....@...> wrote:
          > Efraim Yawitz wrote the following on 01.06.2011 13:38
          >
          > > Try :help cinoptions (specifically, the *N value for which the help says:
          >
          > >     *N    Vim searches for unclosed comments at most N lines away.  This
          > >           limits the time needed to search for the start of a comment.
          > >           (default 30 lines).
          >
          > It seems that the above mentioned helptext already got updated in the mercurial
          > repo:
          >
          > ,----[ :h indent.txt ]------------------------
          >
          >                                                         *cino-star*
          > *N    Vim searches for unclosed comments at most N lines away.  This
          >       limits the time needed to search for the start of a comment.
          >       If your /* */ comments stop indenting afer N lines this is the
          >       value you will want to change.
          >       (default 70 lines).
          > `---------------------------------------------
          >
          > -- <snip> --
          >
          > --

          I knew I remembered a discussion of this on the mailing list recently,
          but I could not find the patch for it. Apparently that's because just
          the documentation was updated.

          --
          You received this message from the "vim_use" 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.