mirror of
https://github.com/QL-Win/QuickLook.git
synced 2026-01-13 07:05:24 +08:00
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.
This commit is contained in:
@@ -70,6 +70,8 @@ public partial class Plugin : IViewer, IMoreMenu
|
||||
|
||||
public void View(string path, ContextObject context)
|
||||
{
|
||||
_currentPath = path;
|
||||
|
||||
if (path.EndsWith(".rtf", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var rtfBox = new RichTextBox();
|
||||
@@ -86,7 +88,6 @@ public partial class Plugin : IViewer, IMoreMenu
|
||||
else
|
||||
{
|
||||
_tvp = new TextViewerPanel();
|
||||
_currentPath = path;
|
||||
_tvp.LoadFileAsync(path, context);
|
||||
context.ViewerContent = _tvp;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user