thehogfather / brackets-code-folding

Code folding extension for brackets IDE
134 stars 42 forks source link

code folding persistence #5

Closed wernerglinka closed 11 years ago

wernerglinka commented 11 years ago

This extension is absolutely needed for working with large files. Thank you for developing it. Would it be possible to store the state of the collapsed code sections upon save so when you save/close/reopen the document the elements are still collapsed?

thehogfather commented 11 years ago

This would be a useful feature. I haven't done much with the brackets persistence api and would be willing to explore it to support this feature. But if you are familiar with the persistence api, and have some time to work on the feature then that would be welcome as well. Just send a pull request :). For now I shall explore and keep you posted on this thread.

Cheers

wernerglinka commented 11 years ago

Sorry, I just learned about brackets last week and don't know anything about a persistence API. My initial thought was to use local storage which would maintain state on a computer which would be good enough for me. I looked for but could not find any reference to a persistence API. Any pointers? The author of the bookmarks extension has a todo for making bookmarks persistent, he would probably use the same mechanism. I'll leave him a message and see what he can tell me.

thehogfather commented 11 years ago

Ah no worries dude :). I had a tinker today and have a version working. I will push an update that you can test by the end of the day. And fyi (for future ref), the Persistence api can be found in preferences/* directory.

wernerglinka commented 11 years ago

You are da man! I just came across Brackets and was blown away. I have tried many in the search for a clean looking editor and man has this one hit bulls eye. Thanks again for your work on this critical extension.

thehogfather commented 11 years ago

Please fetch the latest version, test it out and don't forget to report bugs!

wernerglinka commented 11 years ago

Initial test looks good. No problems. Will test more extensively later today.

wernerglinka commented 11 years ago

Btw, did you know that by adding .php to the vars in main.js your extensions seems to work also with php files. I made a local change and it has been working nicely.

Line 50 _braceCollapsibleExtensions = [".js", ".css", ".less", ".json", ".php"], _tagCollapsibleExtensions = [".xml", ".html", ".xhtml", ".htm", ".php"],

thehogfather commented 11 years ago

:+1: good shout. I'd push on next update.

wernerglinka commented 11 years ago

I used Brackets the whole day, typical day developing html/css/javascript. Switched between different projects multiple times... no problems encountered. Thanks again for implementing this so quickly. Time for a beer...