Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Prevent error when filenames have braces in them - #2512

Merged
jcansdale merged 3 commits into
github:masterfrom
davidwengier:FixDiffCaptions
Jun 9, 2020
Merged

jcansdale merged 3 commits into
github:masterfrom
davidwengier:FixDiffCaptions

Conversation

@davidwengier

Copy link
Copy Markdown
Contributor

Fixes #2510

As per the documentation the OpenComparisonWindow2 method passes captions and tooltips through string.Format so braces break it.

The caption, tooltip, and label parameters use C#-style string formatting where {0} corresponds to the name of the left file and {1} corresponds to the name of the right file.

The existing captions have more detail than using the inbuilt {0} and {1} can provide, particularly as temporary files are used, so there is no option but to escape the braces. I reasoned that since this code is trigger from a UI gesture by the user the perf wasn't super critical so am just doing some lazy replaces. Let me know if thats an issue.

@jcansdale

Copy link
Copy Markdown
Collaborator

Hey @michael-hawker 👋 Have you had a chance to try this build? 😄

@jcansdale

Copy link
Copy Markdown
Collaborator

Confirmed fix!

image

Thanks @davidwengier 🙏

@jcansdale jcansdale left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks for the fix! 😄

@jcansdale
jcansdale merged commit bb629da into github:master Jun 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants