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

[3.x] Expose get_selected_text() in RichTextLabel #59926

Merged
merged 1 commit into from
Apr 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions doc/classes/RichTextLabel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@
Returns the total number of newlines in the tag stack's text tags. Considers wrapped text as one line.
</description>
</method>
<method name="get_selected_text">
<return type="String" />
<description>
Returns the current selection text. Does not include BBCodes.
</description>
</method>
<method name="get_total_character_count" qualifiers="const">
<return type="int" />
<description>
Expand Down
1 change: 1 addition & 0 deletions scene/gui/rich_text_label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2815,6 +2815,7 @@ void RichTextLabel::_bind_methods() {
ClassDB::bind_method(D_METHOD("pop"), &RichTextLabel::pop);

ClassDB::bind_method(D_METHOD("clear"), &RichTextLabel::clear);
ClassDB::bind_method(D_METHOD("get_selected_text"), &RichTextLabel::get_selected_text);
ClassDB::bind_method(D_METHOD("deselect"), &RichTextLabel::deselect);

ClassDB::bind_method(D_METHOD("set_meta_underline", "enable"), &RichTextLabel::set_meta_underline);
Expand Down