bsegraves / custom-folds

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

Does not highlight on start #10

Closed marcel0ll closed 8 years ago

marcel0ll commented 8 years ago

When I open atom my files are not highlighted. I have to edit some text so the markers get highlighted.

I tried to debug the problem and found out that on start, this line returns just '' Not sure how to fix

bsegraves commented 8 years ago

I've seen this occur on large files as well but never on small files, which leads me to believe it's a timing issue.

I've tried looking for an event to listen to, like "document fully loaded", but didn't have much luck in the past. I'll try again now that I'm not the only one seeing this issue.

bsegraves commented 8 years ago

Never could find an event in the atom api for this. The only fix I could think of, which is amazingly hacky, is to wait for two animation frames before applying the regions.

I pushed this fix with version 1.8.1.