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

Re: #if 0 syntax folding

Expand Messages
  • benjamin schnitzler
    Hi, ... Christian, thank you for the patch, it nearly worked out right, but there is a problem: If the #if 0 ... has an #else clause, this should not be
    Message 1 of 10 , Aug 26 4:16 AM
    • 0 Attachment
      Hi,

      On Mon, Aug 22, 2011 at 10:35 PM, Christian Brabandt <cblists@...> wrote:
      > Hi Charles!
      >
      > On Mo, 22 Aug 2011, Charles Campbell wrote:
      >
      >> The following short C file illustrates this problem:
      >>
      >> /* abc.c: */
      >> #include <stdio.h>
      >>
      >> #if 0
      >> int main()
      >> {
      >> printf("testing\n");
      >> return 0;
      >> }
      >> #endif
      >>
      >> /* Modelines:
      >> * vim: fdm=syntax
      >> */
      >>
      >> The #if 0 ... #endif region does not fold (and the modeline has set
      >> fdm to syntax). I see this behavior with
      >>
      >> vim -u NONE -N --noplugins abc.c
      >> :syn on
      >>
      >> The modelines comment does fold, thereby indicating that the
      >> syntax-based folding is active.
      >>
      >> Version information:
      >>
      >> VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug 22 2011 12:23:56)
      >> Included patches: 1-285
      >> Compiled by cecampbe@...
      >> Huge version with GTK2 GUI. Features included (+) or not (-):
      >
      > I see. Attached patch fixes it.
      >
      > regards,
      > Christian
      > --

      Christian, thank you for the patch, it nearly worked out right, but
      there is a problem:
      If the #if 0 ... has an #else clause, this should not be folded. I
      think, someone was confused by a doubled negation in the c.vim file (
      !exists("c_no_if0_fold") ). The attached patch should fix it.
      @Bram: I send this mail directly to you, because i don't think, that i
      am subscribed to the dev mailing list.

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