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

No line breaks show in MultilineEntry #37

Closed
woelper opened this issue Sep 12, 2018 · 6 comments
Closed

No line breaks show in MultilineEntry #37

woelper opened this issue Sep 12, 2018 · 6 comments
Labels
c-bug Bug - some feature is not working as expected p-medium Medium Priority
Milestone

Comments

@woelper
Copy link

woelper commented Sep 12, 2018

MultilineEntry does not display line breaks if those are supplied with set_value, such as

let mut mle = MultilineEntry::new(&ui);
mle.set_value(&ui, "hello\nworld");

The MultilineEntry will show "helloworld".
The text returned from that MultilineEntry will be shown correctly with a line break when displayed with println!("{}", mle.value(&ui));

@NoraCodes
Copy link
Collaborator

This is very problematic, I'll look into it asap

@NoraCodes
Copy link
Collaborator

So, I've not had a lot of time to look at this, but, are you on Windows?

@NoraCodes NoraCodes added c-bug Bug - some feature is not working as expected p-medium Medium Priority labels Oct 17, 2018
@woelper
Copy link
Author

woelper commented Oct 17, 2018

No worries, thanks for your help! Yes, I am on Windows indeed.

@NoraCodes
Copy link
Collaborator

I suspect this is because Windows wants \r\n line endings. Could you try that and let me know if it works?

@woelper
Copy link
Author

woelper commented Oct 19, 2018

I can confirm mle.set_value(&ui, "hello\r\nworld"); works as expected, producing a line break in Windows.

@NoraCodes
Copy link
Collaborator

Possible solution: on Windows, the API can automatically replace \n with \r\n, and on other platforms, we'll do the inverse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-bug Bug - some feature is not working as expected p-medium Medium Priority
Projects
None yet
Development

No branches or pull requests

2 participants