From 94253980f5abcb74f4d5207066fad4d687563460 Mon Sep 17 00:00:00 2001 From: ElektroKill Date: Sat, 21 Dec 2024 19:23:51 +0100 Subject: [PATCH] Follow up to commit 2fb90738db156d073f1eb635d229fb4520e77e88 --- .../Documents/TreeView/Resources/ResourceElementNode.cs | 4 ++-- .../Text/ITextColorWriterExtensions.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dnSpy/dnSpy.Contracts.DnSpy/Documents/TreeView/Resources/ResourceElementNode.cs b/dnSpy/dnSpy.Contracts.DnSpy/Documents/TreeView/Resources/ResourceElementNode.cs index 0528d28623..618909f1aa 100644 --- a/dnSpy/dnSpy.Contracts.DnSpy/Documents/TreeView/Resources/ResourceElementNode.cs +++ b/dnSpy/dnSpy.Contracts.DnSpy/Documents/TreeView/Resources/ResourceElementNode.cs @@ -49,11 +49,11 @@ public abstract class ResourceElementNode : DocumentTreeNodeData, IResourceNode /// protected sealed override void WriteCore(ITextColorWriter output, IDecompiler decompiler, DocumentNodeWriteOptions options) { - output.WriteFilename(Uri.UnescapeDataString(resourceElement.Name)); + output.WriteFilenameIdentifier(Uri.UnescapeDataString(resourceElement.Name)); if ((options & DocumentNodeWriteOptions.ToolTip) != 0) { if (TreeNode.Parent?.Data is ResourceNode parentNode) { output.WriteLine(); - output.WriteFilename(parentNode.Name); + output.WriteFilenameIdentifier(parentNode.Name); } output.WriteLine(); WriteFilename(output); diff --git a/dnSpy/dnSpy.Contracts.Logic/Text/ITextColorWriterExtensions.cs b/dnSpy/dnSpy.Contracts.Logic/Text/ITextColorWriterExtensions.cs index a0ae606a18..1349b0cce5 100644 --- a/dnSpy/dnSpy.Contracts.Logic/Text/ITextColorWriterExtensions.cs +++ b/dnSpy/dnSpy.Contracts.Logic/Text/ITextColorWriterExtensions.cs @@ -223,7 +223,7 @@ public static T WriteFilenameIdentifier(this T output, string? filename) wher var parts = s.Split('/'); int slashIndex = 0; for (int i = 0; i < parts.Length - 1; i++) { - output.Write(BoxedTextColor.DirectoryPart, IdentifierEscaper.Escape(parts[i])); + output.Write(BoxedTextColor.DirectoryPart, IdentifierEscaper.Escape(parts[i], true)); slashIndex += parts[i].Length; output.Write(BoxedTextColor.Text, filename[slashIndex].ToString()); slashIndex++; @@ -231,11 +231,11 @@ public static T WriteFilenameIdentifier(this T output, string? filename) wher var fn = parts[parts.Length - 1]; int index = fn.LastIndexOf('.'); if (index < 0) - output.Write(BoxedTextColor.FileNameNoExtension, IdentifierEscaper.Escape(fn)); + output.Write(BoxedTextColor.FileNameNoExtension, IdentifierEscaper.Escape(fn, true)); else { string ext = fn.Substring(index + 1); fn = fn.Substring(0, index); - output.Write(BoxedTextColor.FileNameNoExtension, IdentifierEscaper.Escape(fn)); + output.Write(BoxedTextColor.FileNameNoExtension, IdentifierEscaper.Escape(fn, true)); output.Write(BoxedTextColor.Text, "."); output.Write(BoxedTextColor.FileExtension, ext); }