Close fold with end of text

Close fold with end of text

6
NewbieNewbie
6

    Sep 05, 2006#1

    Hi,

    Can anyone show me how to set the end of text to close a fold?

    Maybe it's the wrong question but what I'm trying to do is fold by a header eg

    [section1]

    code..1

    [section2]

    code..2

    if i set open fold to "[" and close fold to "[" this works except for the last section? Is there a better way perhaps?

    Thanks,

    Cheers,

    Pete

    6,675585
    Grand MasterGrand Master
    6,675585

      Sep 05, 2006#2

      That's not possible. This is the disadvantage of identical open and close fold strings. The last section is not recognized by the code folding engine as foldable section.

      You have to fold it manually by selecting the whole last section and use View - Hide/Show Lines - Hide/Show Selection. This can be automatically done on file open with a macro if you really need it often and don't save the current folds for the current file on exit.
      Best regards from an UC/UE/UES for Windows user from Austria

      6
      NewbieNewbie
      6

        Sep 05, 2006#3

        Hi Mofi,

        Thanks for reply!

        I can do a macro to select and collapse but as this loses the fold point '-' I guess I need to run the macro each time I want to collapse the code. I might also just have a dummy section at the end..?

        This leads onto related (?) questions -

        Can you use regular expressions in the fold, indent strings and keywords?
        I would like to (for example) apply different meanings to '[' depending on whether it is at the beginning of a line or for ']' whether it has an '=' after or not.

        Is there a priority in the syntax highlighting be it function, indent or fold string?

        Cheers,

        pete

        6,675585
        Grand MasterGrand Master
        6,675585

          Sep 06, 2006#4

          Regular expressions can only be used for function, member and variable strings. Member and variable strings are only supported by UEStudio. For everything else only simple words, not terms/phrases, can be used.

          /Ignore Fold Strings = "..."
          /Open Comment Fold Strings = "..."
          /Close Comment Fold Strings = "..."

          could be helpful too.

          There is no priority. A keyword can be also an indent and a fold string. For C/C++ for example this is true for { } .
          Best regards from an UC/UE/UES for Windows user from Austria

          6
          NewbieNewbie
          6

            Sep 06, 2006#5

            Many thanks Mofi,

            judicious use of a range of ignore fold strings results in exactly what I want.

            Cheers,

            Pete