-
Notifications
You must be signed in to change notification settings - Fork 143
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
#414: slow StyledTextRenderer for unicode and unprintable control cha… #1439
base: master
Are you sure you want to change the base?
#414: slow StyledTextRenderer for unicode and unprintable control cha… #1439
Conversation
return chr >= ' ' | ||
? chr | ||
//: (char)(0x2400 + chr); | ||
: '?'; |
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.
Given that \t\r\n all fall into this category, can this really be correct?
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.
You are right. The bug was not directly visible, but caused weird effects when editing.
af468e0
to
176f48a
Compare
My commit used the correct, approved email address, but I've created the pull request with my GitHub account. Don't know why eclipsefdn/eca complains. |
This commit should only have committers / authors with ECA signed, but you see there two different identities : syntevo@176f48a ECA wants clarity regarding the code origin, so that every contribution is legal. |
…able control characters This test replaces the characters 0x00-0x1F with some alternative character (by default '?') for rendering. This improves the performance significantly.
176f48a
to
c37643d
Compare
I wonder if it has something to do with the "Interpret ASCII control characters" setting I know that setting is only about the Console, but the console is implemented on top of StyledText. |
@@ -2854,6 +2854,14 @@ public boolean isDisposed () { | |||
return device == null; | |||
} | |||
|
|||
private static char replaceBelowSpaceCharacters(char chr) { | |||
if (chr >= 0x20 || chr == '\t' || chr == '\r' || chr == '\n') { |
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.
Should we consider allowing more?
Other characters that are used in CLI applications:
\u0007
: BELL, makes a "beep" sound\u0008
: BS, backspace, moves back one character\u001B
: ESC, used for ANSI escape sequences (changing colors, cursor movement, clear screen, etc). This one is used quite a lot.
Since the Eclipse Console is built on top of the styled text widget not allowing ESC might break quite a lot of things.
(see https://eclipse.dev/eclipse/news/4.25/platform.php#debug-ansi-support)
…racters
This test replaces the characters 0x00-0x1F with some alternative character (by default '?') for rendering. This improves the performance significantly.
The previous pull request (#1425) did not work.
Note, that when changing
replaceBelowSpaceCharacters
to return the commented unicode characters, the snippet will fail with a "No more handles" exception. I reckon, we best should stick to a US-ASCII character from the range 0x20<=..<0x7F.