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

Can't copy text from editor help #74109

Open
KoBeWi opened this issue Feb 28, 2023 · 9 comments
Open

Can't copy text from editor help #74109

KoBeWi opened this issue Feb 28, 2023 · 9 comments

Comments

@KoBeWi
Copy link
Member

KoBeWi commented Feb 28, 2023

Godot version

4.0 rc6

System information

Windows 10 x64

Issue description

You can select text in editor help, but it can't be copied. Ctrl+C does not change clipboard.

Steps to reproduce

  1. F1
  2. Enter
  3. Select text
  4. Ctrl+C
  5. Ctrl+V somewhere

Minimal reproduction project

N/A

@YuriSizov
Copy link
Contributor

I'm pretty sure there was a recent report that copying worked, but for some reason it included extra bits ignoring the selection.

@dalexeev
Copy link
Member

This works for me in RC 6.

@KoBeWi
Copy link
Member Author

KoBeWi commented Feb 28, 2023

godot_Xd4VAcc84J.mp4

It's random. I can reproduce it in PinJoint3D doc. Couldn't reproduce it in Object. Didn't try other classes.

Seems to depend on selection direction, among some other unknown things.

@YuriSizov
Copy link
Contributor

Perhaps it's that same issue where Ctrl doesn't get triggered sometimes?

@dalexeev
Copy link
Member

It's random. I can reproduce it in PinJoint3D doc.

Yes, this is reproduced in RC 6 for me too, but it is not reproduced in 491ded1 for some reason.

@FlankeR-46
Copy link

FlankeR-46 commented Feb 28, 2023

The problem is somewhere around the first character of the indented line.
If we select a line without indentation, for example Description or Properties (figure 1 in the picture), then everything is copied.
However, there is a peculiarity with indented lines.
If we select an indented line along with the title, everything is copied.
If we select a line and CAREFULLY stop the selection on the first letter (position 2), then everything is copied.
However, if we swipe from the end and swipe the mouse a little further than the first letter (for example, position 3), then nothing gets to the clipboard at this moment.
I found out this back on RC3, but I can't judge why this happens.
image

PS: So I worked out a solution for myself: if I don't want to aim carefully at the first letter, I copy along with the title.

@saierXP
Copy link

saierXP commented Jul 29, 2023

Edit:This is another issue introduced from 4.0.rc2.
Maybe it's related to this cursor position.

richText_select.mp4

@jsjtxietian
Copy link
Contributor

somewhere around the first character of the indented line

Same for me.

Perhaps this is a RichTexLabel issue, not an editor issue

Reading the code looks like it's a RichTexLabel issue, the doc just call the RichTextLabel's get_selected_text method.

String txt;
int to_line = main->first_invalid_line.load();
for (int i = 0; i < to_line; i++) {
	txt += _get_line_text(main, i, selection);
}
return txt;

(Maybe unrelated, the loop starts from 0 looks a little inefficient given that docs are usually long)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants