Skip to content

Commit

Permalink
Follow up to commit 2fb9073
Browse files Browse the repository at this point in the history
  • Loading branch information
ElektroKill committed Dec 21, 2024
1 parent 2fb9073 commit 9425398
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ public abstract class ResourceElementNode : DocumentTreeNodeData, IResourceNode

/// <inheritdoc/>
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,19 +223,19 @@ public static T WriteFilenameIdentifier<T>(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++;
}
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);
}
Expand Down

0 comments on commit 9425398

Please sign in to comment.