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

TextEdit doesn't wrap the first word of a line #74256

Closed
AndreaTerenz opened this issue Mar 2, 2023 · 6 comments · Fixed by #74813
Closed

TextEdit doesn't wrap the first word of a line #74256

AndreaTerenz opened this issue Mar 2, 2023 · 6 comments · Fixed by #74813

Comments

@AndreaTerenz
Copy link

Godot version

4.0 stable

System information

Manjaro Linux, kernel 6.1.1-1-MANJARO, AMD Ryzen 5 3600, AMD RX 580

Issue description

The wrap_mode property of the TextEdit node doesn't seem to really do anything. Setting it to LINE_WRAPPING_BOUNDARY simply means that there won't be an horizontal scrollbar if the text overshoots the boundary, instead of actually forcing the text to the next line so that it stays visible.

Steps to reproduce

Create a TextEdit node and set its wrap_mode property to LINE_WRAPPING_BOUNDARY

Minimal reproduction project

WrapBugDemo.zip

@AndreaTerenz AndreaTerenz changed the title TextEdit wrap mode doesn't actually wrap text TextEdit wrap_mode doesn't actually wrap text Mar 2, 2023
@AndreaTerenz
Copy link
Author

Tried this with 3.5.1, doesn't happen and the text wraps correctly:

image

@AndreaTerenz
Copy link
Author

Tried going as far back as 4.0 alpha 1, bug is still present

@Rindbee
Copy link
Contributor

Rindbee commented Mar 2, 2023

In this example, even though there are many characters, they are treated as a single word. LINE_WRAPPING_BOUNDARY may mean line wrapping between words.

@AThousandShips
Copy link
Member

AThousandShips commented Mar 3, 2023

Doing proper text wrapping is complicated, and language dependent if it is to be done properly

@AndreaTerenz
Copy link
Author

AndreaTerenz commented Mar 4, 2023

@AThousandShips

Doing proper text wrapping is complicated, and language dependent if it is to be done properly

I'm sure it is, but it did use to work
Godot 4 doesn't actually give more options for wrapping, it simply swaps a Boolean for an enum whose choices are basically yes or no. Therefore, I'd imagine the underlying behaviour shouldn't change between the two releases.

@AndreaTerenz
Copy link
Author

AndreaTerenz commented Mar 4, 2023

@Rindbee That was a good suggestion
Yes, it does wrap the next word to the next line if the caret has been pushed beyond the border by the previous one. Furthermore, the real bug seems to be that the first word of a line won't be wrapped if it goes beyond the TextEdit's border, unlike in Godot 3.x where it gets correctly split and wrapped (as shown in the screenshot in my first comment).

This behaviour is not clearly stated in the docs, who simply say (for LINE_WRAPPING_BOUNDARY):
"Line wrapping occurs at the control boundary, beyond what would normally be visible."

E.g.

correct wrapping of second word:

second word wrapped correctly once, but then overflows once it becomes the first of the next line (notice the missing caret):
image

@AndreaTerenz AndreaTerenz changed the title TextEdit wrap_mode doesn't actually wrap text TextEdit doesn't wrap the first word of a line Mar 4, 2023
@akien-mga akien-mga added this to the 4.1 milestone Jun 15, 2023
@akien-mga akien-mga added the bug label Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants