mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-27 04:41:33 +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;
|
||||
|
Reference in New Issue
Block a user