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

Multi-line String creates duplicate string #6212

Closed
Tracked by #4778
ghost opened this issue Aug 20, 2016 · 6 comments · Fixed by #7349
Closed
Tracked by #4778

Multi-line String creates duplicate string #6212

ghost opened this issue Aug 20, 2016 · 6 comments · Fixed by #7349

Comments

@ghost
Copy link

ghost commented Aug 20, 2016

Operating system or device - Godot version: 2.1

Issue description (what happened, and what was expected):
Alright folks, this is a pretty fascinating bug:

    get_node("RichTextLabel").set_bbcode("""
    hello
    """)

This is valid GDScript syntax, but, it will actually insert 2x hello strings instead of just one.

If you do it without a initial line break:

    get_node("RichTextLabel").set_bbcode("""hello
    """)

It works fine. I am making some extensive tooltips and need the line breaks but it literally duplicated my text, lol pretty funny tbh. I am not sure if this intended :P

@ghost ghost changed the title Multi-line Strings causes duplicate strings Multi-line String creates duplicate string Aug 20, 2016
@akien-mga akien-mga added this to the 2.2 milestone Aug 26, 2016
@volzhs
Copy link
Contributor

volzhs commented Dec 21, 2016

also can reproduce with set_bbcode("\nhello")

@bojidar-bg
Copy link
Contributor

set_bbcode/append_bbcode both do something funny, as evidenced by #3773 (actually, set_bbcode calls append_bbcode through parse_bbcode internally...)

Anyway, seems like this issue is either in the two calls to add_text on lines 1475 and 1485 (probably no) or in add_text itself, specifically the weirdness it does with newlines and similar.

Can you retest with add_line("\nhello") as well?

@volzhs
Copy link
Contributor

volzhs commented Dec 21, 2016

@bojidar-bg
same result in both set_bbcode and append_bbcode... and so weird result...
image
No pre-entered string with RichTextLabel.

@bojidar-bg
Copy link
Contributor

@volzhs Uh my bad, I meant add_text("\nstuff") (and yeah, append_bbcode is expected to fail in the same way).

@volzhs
Copy link
Contributor

volzhs commented Dec 21, 2016

@bojidar-bg
add_text result is here.

image

@bojidar-bg
Copy link
Contributor

Ok, issue location confirmed and also a duplicate of #3773. @godotengine/bugsquad I'm not sure which of the two to close though, since this got much more attention and debugging...

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.

4 participants