Skip to content

Commit 5caaf74

Browse files
committed
Set _currentPath before file type check in View
Moved assignment of _currentPath to the start of the View method to ensure it is set before any file type-specific logic is executed. This improves consistency and prevents potential issues with path-dependent operations.
1 parent d565537 commit 5caaf74

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • QuickLook.Plugin/QuickLook.Plugin.TextViewer

‎QuickLook.Plugin/QuickLook.Plugin.TextViewer/Plugin.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ public void Prepare(string path, ContextObject context)
7070

7171
public void View(string path, ContextObject context)
7272
{
73+
_currentPath = path;
74+
7375
if (path.EndsWith(".rtf", StringComparison.OrdinalIgnoreCase))
7476
{
7577
var rtfBox = new RichTextBox();
@@ -86,7 +88,6 @@ public void View(string path, ContextObject context)
8688
else
8789
{
8890
_tvp = new TextViewerPanel();
89-
_currentPath = path;
9091
_tvp.LoadFileAsync(path, context);
9192
context.ViewerContent = _tvp;
9293
}

0 commit comments

Comments
 (0)