mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-13 11:09:06 +00:00
Fix textviewer highlighting
This commit is contained in:
@@ -128,7 +128,7 @@ namespace QuickLook.Plugin.TextViewer
|
||||
if (!Directory.Exists(syntaxPath))
|
||||
return hlm;
|
||||
|
||||
foreach (var file in Directory.EnumerateFiles(syntaxPath, "*.xshd"))
|
||||
foreach (var file in Directory.EnumerateFiles(syntaxPath, "*.xshd").OrderBy(f => f))
|
||||
{
|
||||
Debug.WriteLine(file);
|
||||
var ext = Path.GetFileNameWithoutExtension(file);
|
||||
@@ -146,7 +146,8 @@ namespace QuickLook.Plugin.TextViewer
|
||||
}
|
||||
private void AssignHighlightingManager(TextViewerPanel tvp, ContextObject context)
|
||||
{
|
||||
var isDark = (context.Theme == Themes.Dark) | OSThemeHelper.AppsUseDarkTheme() | false;
|
||||
var darkThemeAllowed = SettingHelper.Get("AllowDarkTheme", false, "QuickLook.Plugin.TextViewer");
|
||||
var isDark = darkThemeAllowed && OSThemeHelper.AppsUseDarkTheme();
|
||||
tvp.HighlightingManager = isDark ? _hlmDark : _hlmLight;
|
||||
}
|
||||
}
|
||||
|
@@ -89,7 +89,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Syntax\**">
|
||||
<CopyToOutputDirectory>None</CopyToOutputDirectory>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
|
@@ -45,8 +45,9 @@ namespace QuickLook.Plugin.TextViewer
|
||||
{
|
||||
_context = context;
|
||||
|
||||
SetResourceReference(Control.ForegroundProperty, "WindowTextForeground");
|
||||
Background = Brushes.Transparent;
|
||||
Background = OSThemeHelper.AppsUseDarkTheme()
|
||||
? new SolidColorBrush(Color.FromArgb(150, 255, 255, 255))
|
||||
: Brushes.Transparent;
|
||||
FontSize = 14;
|
||||
ShowLineNumbers = true;
|
||||
WordWrap = true;
|
||||
|
@@ -24,11 +24,11 @@ if(-not (Test-Path env:CI))
|
||||
Update-Version("..\Build\Appx\AppxManifest.xml")
|
||||
|
||||
# generate resources
|
||||
$priExe = 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86\makepri.exe'
|
||||
$priExe = 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86\makepri.exe'
|
||||
.$priExe new /pr ..\Build\Appx /cf ..\Build\priconfig.xml /of ..\Build\Appx\resources.pri
|
||||
|
||||
# packing
|
||||
$packExe = 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86\makeappx.exe'
|
||||
$packExe = 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86\makeappx.exe'
|
||||
$folder = '..\Build\Appx\'
|
||||
|
||||
.$packExe pack /l /o /d ..\Build\Appx /p ..\Build\QuickLook-$version.appx
|
||||
|
Reference in New Issue
Block a user