-
Notifications
You must be signed in to change notification settings - Fork 85
Clear Caches/Watchers upon closing a preview #52
Comments
@leipert The behaviour right now is to simply create a new MarkdownPreviewView whenever a preview is open. Thats the case if a file or editor has never had a preview opened before or previous had. So unless Atom is doing something interesting under the hood the MarkdownPreviewView along with the html for the preview should be tidied up in garbage collection. We could explicitly remove the HTML elements associated with the preview from the DOM when the preview is removed by adding some tidy up code here but I don't believe that's going to do any more than Atom already does. That all said we've got a candidate for fixing #49 in wip #53. As for #24 removing the HTML won't make a difference. Once the macro's are defined neither MPP or MathJax are actively scanning the source markdown for macro's that are no longer defined. We'd have to manually remove them from MathJax's macro list which is buried somewhere in I think the best way to handle #24 would be to encourage people to add macros through #14 and extend the functionality of #14 with something like pathwatcher to mirror the user defined macro list file to MathJax's internal macro list, additions and deletions. #14 obviously add's something really important, persistent macro support without cluttering up your markdown document. To be realistic I would want to implement such an extension to #14 for a Thanks @leipert please let me know if you have any further thoughts on these issues :D |
Thanks for the long and thorough explanation. Okay, we dealt with #49. We just have to have a look for 2.0.0, how we handle #14 in pandoc. We have to add it to each document. Regarding #24. I think we need a proper garbage collection every time we close a preview. Do the pathwatchers get canceled, what html and images reside in some cache, etc. So I am adjusting this issue to be a base issue to look for garbage we create or where we could shrink the memory footprint of MPP. |
If a preview of a file is closed, we should destroy all things we created for it, like caches or pathwatchers.
Original:
Do we discard the html after preview close, so that it forces a re-render if you re-open it?
Would maybe fix #24 and #49 ?
The text was updated successfully, but these errors were encountered: