-
-
Notifications
You must be signed in to change notification settings - Fork 22.8k
CodeEditor: Make possible to select and copy error text #77776
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
CodeEditor: Make possible to select and copy error text #77776
Conversation
Very cool, but the reduction of space is concerning me. In this case maybe it's okay, as there won't be another useful thing to add there, but the error preview is becoming too small and I wonder if we can do anything about it. |
We could make the button appear only when hovering over the bottom bar. Or alternatively replace the |
Unfortunately, this is not friendly to touch inputs (for the Android editor).
This would be my preferred alternative, so we can use rich formatting in the long run. This way, we can use a proportional font for the error message and use the code font for text between backticks. |
123b19d
to
56a595e
Compare
Yes, I like it better too. The copy button is more obvious, but I think users will figure it out. Horizontal scrolling can be removed without clipping the text. I have updated the PR and the first post. |
56a595e
to
3af5db4
Compare
For some reason Select All doesn't work. But in the Output Log it works. Looks like it's a assert(false, "Doesn't work.")
assert(false, "It works.\n") |
3af5db4
to
9622b4f
Compare
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.
Tested locally on Linux (rebased on top of master
f5696c3). In the script, shader editors, and debugger stack trace panel:
- The Select All action works correctly (and you can press Ctrl + C afterwards to copy).
- The Copy action does nothing even if I try it several times.
60a7e12
to
559ef9f
Compare
This is especially useful after #82952: |
b6b8f92
to
7fbb8b6
Compare
7fbb8b6
to
377a309
Compare
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.
Tested locally, there's an issue if you resize the editor window to be narrow:
It's better at slightly wider widths:
I would probably make it so it can't wrap over more than 3 lines.
Also, right-clicking the error message and choosing Copy has no effect if no text is selected. (This is why I had the impression the option had no effect for the longest time.) This is an issue with the RichTextLabel context menu, so we should look into addressing it in a separate PR.
Overall, I agree with the decision to use RichTextLabel as it'll allow to use rich formatting in the future (e.g. use a code font for text between backticks, and a regular font otherwise).
377a309
to
c25f40e
Compare
c25f40e
to
51ebcdc
Compare
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.
Works as expected.
51ebcdc
to
db9b8ff
Compare
Thanks! |
Label
withRichTextLabel
, enable selection and context menu._update_text_editor_theme()
.