Closed Flowpy closed 6 years ago
@RIDE-2DAY any chance we can get this merged into master? Happy to help in anyway I can.
@acheronfail I must test on my PC, I'm sorry, I've been a little bit busy these last weeks. As soon as I test it, I'll update this PR. It looks good by the way, thank you.
@RIDE-2DAY I have tested this on macOS, Linux and Windows on Sublime Text build 3143 and 3164, and it works as expected. 👍
Once the plugin loads after startup the folds are restored.
@Flowpy can you update the README to reflect this? You can remove the "Known Issues" section:
When you start Sublime Text for the first time, it opens the last files you have been working with, unfortunately the plugin won't restore the folded regions because there isn't any event for that yet. However, closing and reopening the files (or project) fixes this issue
Since this PR will fix that one. (If you don't want to do that, then you can make me a collaborator on your fork and I'm happy to update it for you 😄).
A way to add folded regions restoration at Sublime startup. I discovered the SublimeText API just an hour ago and I am not a Python guru. So what I have done may be crap:
restore_folds()
function out of the class because I don't know an instance to call it from (maybe could I have made it static instead)plugin_loaded()
function which is called once when the plugin is loaded. According to the API reference: "If a plugin defines a module level function plugin_loaded(), this will be called when the API is ready to use. ". Then call therestore_folds()
function for each view.