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

Re: Bug report: Folding C++

Expand Messages
  • Stefan Karlsson
    By the way, this is what I ve put in my ~/.vim/after/syntax/c.vim file (which is :sourced by ~/.vim/after/syntax.cpp): syn region cFold start= { end= }
    Message 1 of 4 , Aug 23, 2005
    • 0 Attachment
      By the way, this is what I've put in my ~/.vim/after/syntax/c.vim file
      (which is :sourced by ~/.vim/after/syntax.cpp):

      syn region cFold start="{" end="}" transparent fold
      syn sync fromstart

      -- Stefan


      Stefan Karlsson wrote:

      > Nope, it doesn't work.
      >
      > -- Stefan
      >
      >
      >>
      >>> Consider the following C++ code:
      >>>
      >>> namespace
      >>> {
      >>> enum {DUMMY = 4};
      >>> }
      >>>
      >>> int main()
      >>> {
      >>> return 0;
      >>> }
      >>>
      >>>
      >>> If I place the cursor on the first { after namespace, or directly on
      >>> the keyword enum, the whole file (including main) is folded.
      >>>
      >>> Can anyone reproduce this behavior?
      >>>
      >>> I use Vim 6.3.85.
      >>>
      >>
      >>
      >> The "enum {DUMMY = 4};" is not recognized. Only { at the start or end
      >> of the line is seen. You may have to rewrite it as:
      >>
      >> enum
      >> {
      >> DUMMY = 4
      >> };
      >>
      >> Does it work OK then?
      >>
      >> C++ is a complicated language (too complicated, in my opinion). Don't
      >> expect everything to be recognized correctly.
      >>
      >>
      >>
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.