bsegraves / custom-folds

Atom plugin for defining custom markers for foldable regions.
MIT License
24 stars 9 forks source link

[Feature request] Automatic foldability (without "<editor-fold") #30

Open probablykasper opened 7 years ago

probablykasper commented 7 years ago

I use comments to divide my code into sections. This is how I would like my foldable comments to look ideally (Exactly equal to how they would look without this package):

// SECTION1
    code...
// SECTION2
    code...
// SECTION3
    code...

It would work basically like folding is in CSS; If the line is foldable or not is determined by wether the next line has extra indentation. This fold would end one line before the extra indentation is removed. In this case, //SECTION1 and //SECTION2 have the same indentation amount, so //SECTION1 would fold all the way to the line before //SECTION2

probablykasper commented 7 years ago

I'm realizing that the name of the package is "custom-folds," so maybe this would not fit that well - But it would be extremely useful if you could make a different package for this, as it doesn't seem to be out there.