Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support newlines in GUI description field #2818

Merged
merged 1 commit into from
Jun 28, 2019

Conversation

HebaruSan
Copy link
Member

Problem

It was noted in #2796 that line breaks in module descriptions work on Mono but not Windows:

image

Cause

Mono uses "\n" to split lines because it runs on Unix.
Windows uses "\r\n" to split lines because CP/M did in 1974.
The TextBox implementations carry this difference through to 2019.

Changes

Now we will replace both \r\n and \n with Environment.Newline, which contains the string used by the current platform to break lines. This way authors may include either \r\n or \n in descriptions and it will always display correctly.

image

Note that this is not a fix for #2796 because that issue also requests bold and italic.

@HebaruSan HebaruSan added Bug Something is not working as intended Easy This is easy to fix GUI Issues affecting the interactive GUI Pull request Windows Issues specific for Windows labels Jun 28, 2019
Copy link
Member

@DasSkelett DasSkelett left a comment

Choose a reason for hiding this comment

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

I take the freedom to approve this PR without testing it (on Windows) this time.
In case you have doubts that it works on other people's machines too, you will have to wait a few days ;-)

@HebaruSan HebaruSan merged commit cde9f32 into KSP-CKAN:master Jun 28, 2019
@HebaruSan HebaruSan deleted the fix/gui-descr-newlines branch June 28, 2019 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working as intended Easy This is easy to fix GUI Issues affecting the interactive GUI Windows Issues specific for Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants