How do enable indent folding of plain text?

How do enable indent folding of plain text?

1
NewbieNewbie
1

    Jun 03, 2021#1

    How do I get the following plain text to just fold based on indent?

    Code: Select all

    -+ This is the header
        -+Sub header 1
            text
        -+Sub header 1
            text
        -+Sub header 1
            text  
     Is there any kind of tutorial that explains the basics of folding for plain text? Thanks

    Code folding just works "out of the box" for most popular programming languages. [[[ EXCEPT PLAIN TEXT... *facepalm*....]]]
    Power tip: Fold sections of code and text in UltraEdit/UEStudio

    10211
    Power UserPower User
    10211

      Jun 03, 2021#2

      You need to add the "EnableCFByIndent" keyword to the first line of the wordfile you are using to highlight the text files you are editing.

      Cheers,

      Frank

      6,686587
      Grand MasterGrand Master
      6,686587

        Jun 04, 2021#3

        Code folding cannot work out of the box for plain text as 100 users have at least 100 hundred meanings on how code folding should work for plain text files.

        I suggest to use a syntax highlighting wordfile for folding plain text files, i.e. files with file extension TXT (case-insensitive).

        Code: Select all

        /L20"Plain Text" Noquote EnableCFByIndent File Extensions = TXT
        /Delimiters = -     +
        /Function String = "-^+[^t ]++^(*^)$"
        /Indent Strings = "-+"
        /C1"Plus and Hyphen"
        +
        -
        
        Note: The list of word delimiters consists of the characters hyphen, horizontal tab, space and plus. The tab character is displayed and most likely also copied by the browser as a series of spaces.

        On hitting key RETURN or ENTER at end of a line with -+ the next line is automatically indented if the setting Auto indent new lines is enabled in configuration.

        All plus and hyphen characters are syntax highlighted with the color defined for first color group with name Plus and Hyphen.

        The Function List view lists all headers. The header selected is according to current position of the caret in the text file.
        Best regards from an UC/UE/UES for Windows user from Austria

        1
        NewbieNewbie
        1

          Jan 13, 2022#4

          This is a great post. I like this topic. I found many interesting things from this site. Thanks for posting this again