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

Newline and tab ignored in echo #3585

Closed
thehans opened this issue Jan 5, 2021 · 1 comment
Closed

Newline and tab ignored in echo #3585

thehans opened this issue Jan 5, 2021 · 1 comment

Comments

@thehans
Copy link
Member

thehans commented Jan 5, 2021

This used to work to insert a newline and tab in the GUI Console:

echo("Hello\n\tWorld!");

but looks like it got changed by 28d4a934

Previously "ECHO:" messages were specifically added using QPlainTextEdit::appendPlainText so that newline and tab could work, but now all console messages are added with QPlainTextEdit::appendHtml which ignores whitespace.

appendHtml is needed for Warnings etc which use the html to color the text.
But since echo strings get html escaped (so <br> can't be used either), there's no way to print multiple lines from one echo.

@TLC123
Copy link

TLC123 commented Jan 5, 2021

Similar with:
echo( 1 , chr( 9 ) , 1 , chr( 13) , 1 );
-> ECHO: 1, " ", 1, " ", 1

echo(str( " 1 " , chr( 9 ) , 1 , chr( 13) , 1) );
-> ECHO: " 1 1 1"

in version 2020.12.31.ci6564 (git 7618d4d)

@t-paul t-paul closed this as completed in 6cc545b Jan 5, 2021
t-paul added a commit that referenced this issue Jan 5, 2021
Fix formatting of ECHO/NONE as plain text in console (fixes #3585).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants