Vasily-X / AutoFoldCode

A Sublime Text package that saves/restores folded code regions in files automatically.
25 stars 5 forks source link

add: startup restoration #2

Closed Flowpy closed 6 years ago

Flowpy commented 6 years ago

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:

acheronfail commented 6 years ago

@RIDE-2DAY any chance we can get this merged into master? Happy to help in anyway I can.

Vasily-X commented 6 years ago

@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.

acheronfail commented 6 years ago

@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 😄).