File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
QuickLook.Plugin/QuickLook.Plugin.MarkdownViewer Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ namespace QuickLook.Plugin.MarkdownViewer;
3131
3232public class Plugin : IViewer
3333{
34+ private bool _isInitialized = false ;
3435 private WebpagePanel ? _panel ;
3536 private string ? _currentHtmlPath ;
3637
@@ -58,6 +59,12 @@ public class Plugin : IViewer
5859 public int Priority => 0 ;
5960
6061 public void Init ( )
62+ {
63+ // Delayed initialization can speed up startup
64+ _isInitialized = false ;
65+ }
66+
67+ public void InitializeResources ( )
6168 {
6269 // Initialize resources and handle versioning
6370 _resourceManager . InitializeResources ( ) ;
@@ -78,6 +85,12 @@ public void Prepare(string path, ContextObject context)
7885
7986 public void View ( string path , ContextObject context )
8087 {
88+ if ( ! _isInitialized )
89+ {
90+ _isInitialized = true ;
91+ InitializeResources ( ) ;
92+ }
93+
8194 _panel = new WebpagePanel ( ) ;
8295 context . ViewerContent = _panel ;
8396 context . Title = Path . GetFileName ( path ) ;
You can’t perform that action at this time.
0 commit comments