-
-
Notifications
You must be signed in to change notification settings - Fork 795
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
Qt: honor control characters in ScriptingTextBuffer::print #3350
base: master
Are you sure you want to change the base?
Conversation
After some further discussion in Discord, I've decided I don't want to submit this PR as-is -- it fixes the bug, but the strategy for how to fix it is inelegant and leaves bugs pertaining to |
f2bba1b
to
83064ef
Compare
83064ef
to
0ce43e6
Compare
Rewritten -- and added support for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing major looks wrong, but I have a few concerns.
int lineWidth = m_dims.width(); | ||
|
||
for (const QChar& ch : text) { | ||
if (ch == '\t') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to do this with a switch statement? (Can we do this with a switch statement?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It COULD be done with a switch statement but I'm not sure it would make the code look any better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well... After refactoring to fix the performance issue, maybe it would help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think?
058774e
to
10ec5b3
Compare
My previous PR fixed line wrapping for strings with embedded newlines, but in the process it completely broke newline handling.
This PR makes sure that the cursor moves to the next block / a new block after each line.