#8 Fold { on relevant line


When using code like:

while (foo)

collapsing at the brace yields:

while (foo)
It would be nice if it yielded
+while (foo)



<< < 1 2 (Page 2 of 2)
  • Neil Hodgson

    Neil Hodgson - 2005-11-07

    Logged In: YES

    It seems to work OK although I only did a quick hack and
    haven't looked closely as I'm working on some other things
    like setting the header flag automatically so that the
    folder doesn't have to work out when to do it.
    The whole levelCurrent-levelNext concept is precisely to
    fudge the apparent level of lines (levelCurrent) while
    accurately counting the fold level (levelNext) as needed by
    fold.at.else where the else's levelCurrent is set to the
    minimum level on that line to match the level of the
    corresponding if. If levelCurrent had to be the same as
    levelNext of the previous line then it wouldn't be storing
    any information. The change in levels between lines that is
    used for performing folding is the levelCurrent of one line
    compared to the levelCurrent of the other. If the current
    line is only an operator { and its levelCurrent is set to
    one greater than the levelNext (and levelCurrent) of the
    previous line there is a change in levels and the previous
    line has to have its header flag set to note this.

  • Micah

    Micah - 2005-11-22

    Logged In: YES

    Sorry if I misread, but are you saying you have a fix in the
    CVS? If so I'll stop working on this one, if not I'll keep
    trying to get this figured out.

  • Neil Hodgson

    Neil Hodgson - 2005-11-22

    Logged In: YES

    I was mostly experimenting with ways to decrease the amount
    of work in implementing folding and thought I had something
    really good and was about to announce it when I noticed
    some serious flaws, notably that users folding was being
    expanded too often. For now, I'm giving up on this.

    You may be able to extract something useful from the
    attached FoldNoBoxCppDoc.cxx file which does do what I
    mentioned in the previous message but it is mixed in with
    other changes.

    None of this went into CVS.

<< < 1 2 (Page 2 of 2)

Log in to post a comment.