KomodoEdit icon indicating copy to clipboard operation
KomodoEdit copied to clipboard

Folding in text files

Open JesperIRL opened this issue 6 years ago • 2 comments

Short Summary

It would be nice to have the ability to fold text in plain text files. It’s really good for note-taking, lists of different kinds et.c.

For example there is an editor called FoldingText that is using markdown to identify blocks to fold and a few other things (it's only the folding I'm looking for here). (https://www.foldingtext.com) Lines starting with a # identifies a block and will fold down to the next line that starts with a #.

This enhancement was previously discussed here: https://community.komodoide.com/t/folding-in-plain-text-txt-files/4855

Platform Information

Komodo Edit

Additional information

Example:

In FoldingText the folded text looks like:

# Series 1 (2005) Ninth Doctor # Series 2 (2006) Tenth Doctor # Series 3 (2007) # Series 4 (2008) # Specials (2008 - 2010) # Series 5 (2010) Eleventh Doctor

And clicking the second and third # will expand it to:

# Series 1 (2005) Ninth Doctor # Series 2 (2006) Tenth Doctor 167 The Christmas Invasion 168 New Earth 169 Tooth and Claw 170 School Reunion 171 The Girl in the Fireplace 172 Rise of the Cybermen a. Rise of the Cybermen b. The Age of Steel 173 The Idiot's Lantern 174 The Impossible Planet a. The Impossible Planet b. The Satan Pit 175 Love & Monsters 176 Fear Her 177 Army of Ghosts a. Army of Ghosts b. Doomsday # Series 3 (2007) 178 The Runaway Bride 179 Smith and Jones 180 The Shakespeare Code 181 Gridlock 182 Daleks in Manhattan a. Daleks in Manhattan b. Evolution of the Daleks 183 The Lazarus Experiment 184 42 185 Human Nature a. Human Nature b. The Family of Blood 186 Blink 187 Utopia a. Utopia b. The Sound of Drums c. Last of the Time Lords # Series 4 (2008) # Specials (2008 - 2010) # Series 5 (2010) Eleventh Doctor

JesperIRL avatar Jan 13 '20 22:01 JesperIRL

This feature would be handy in text files where all of the lines start in the first column (i.e., no leading whitespace on any of the lines).

But folding in text files would be even better if it didn't rely upon the presence of a special symbol (in this case, "#") to indicate a subsuming line into which the subsequent lines of text would be folded, but instead relied upon indentation, similar to Python code, in which blocks of code are indicated using indentation and not braces. For instance, using some of the example text above:

Series 1 (2005) Ninth Doctor
Series 2 (2006) Tenth Doctor
    167 The Christmas Invasion
    172 Rise of the Cybermen
        a. Rise of the Cybermen
        b. The Age of Steel
    173 The Idiot's Lantern
    174 The Impossible Planet
        a. The Impossible Planet
        b. The Satan Pit
Series 3 (2007)
    178 The Runaway Bride
    179 Smith and Jones

mjross avatar Nov 15 '20 21:11 mjross

Yep, that would clearly work as well.

JesperIRL avatar Apr 01 '21 05:04 JesperIRL