bsegraves / custom-folds

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

Folding indented lines of code #49

Open hvrc opened 5 years ago

hvrc commented 5 years ago

I want to be able to fold elif & else statements in Python. Python uses indented statements to identify the respective blocks of code for each conditional statement. There seems to be no way to add "...end of indented block" as the end of foldable region comment. (Please let me know if I have overlooked something, or if I'm not following certain conventions, I'm a little new to "Issues")

if number > 0:
    print("Number is positive")

elif number < 0:  # start of fold
    print("Number is negative")
# end of fold

else: # start of fold
    print("Number is zero")
# end of fold