Add CSV/TSV/PSV rainbow highlighters (light/dark) support
build / build (push) Has been cancelled
build / publish (push) Has been cancelled

This commit is contained in:
ema
2026-04-17 11:18:49 +08:00
parent ed8c2997f5
commit 0cda83c26d
12 changed files with 436 additions and 5 deletions
@@ -19,6 +19,7 @@ using QuickLook.Common.Commands;
using QuickLook.Common.Controls;
using QuickLook.Common.Helpers;
using QuickLook.Common.Plugin.MoreMenu;
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
@@ -30,14 +31,16 @@ public sealed partial class Plugin
public IEnumerable<IMenuItem> GetMenuItems()
{
string translationFile = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Translations.config");
string extension = "";
string extension = string.Empty;
try
{
// Get the file extension in lowercase for comparison
extension = Path.GetExtension(_currentPath).ToLower();
} catch (System.Exception)
{
}
catch (Exception)
{
}
var reopen = extension switch
{
@@ -58,6 +61,14 @@ public sealed partial class Plugin
Header = TranslationHelper.Get("MW_ReopenAsImagePreview", translationFile),
Command = new RelayCommand(() => PluginHelper.InvokePluginPreview("QuickLook.Plugin.ImageViewer", _currentPath)),
},
// CSV, TSV, PSV <=> CSV viewer
".csv" or ".tsv" or ".psv" => new MoreMenuItem()
{
Icon = FontSymbols.Code,
Header = TranslationHelper.Get("MW_ReopenAsCsvPreview", translationFile),
Command = new RelayCommand(() => PluginHelper.InvokePluginPreview("QuickLook.Plugin.CsvViewer", _currentPath)),
},
_ => null,
};