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
merged 3 commits into from
Jun 9, 2020

Conversation

davidwengier
Copy link
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
Collaborator

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

@jcansdale
Copy link
Collaborator

Confirmed fix!

image

Thanks @davidwengier 🙏

Copy link
Collaborator

@jcansdale jcansdale left a comment

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't open files containing curly braces
2 participants