Skip to content

Commit

Permalink
Merge pull request #79818 from garychia/select_all
Browse files Browse the repository at this point in the history
RichTextLabel: Ensure the `select_all` function selects all items
  • Loading branch information
akien-mga committed Aug 28, 2023
2 parents 6da4ad1 + d66c7a2 commit b00796e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scene/gui/rich_text_label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5310,6 +5310,8 @@ void RichTextLabel::selection_copy() {
}

void RichTextLabel::select_all() {
_validate_line_caches();

if (!selection.enabled) {
return;
}
Expand All @@ -5322,13 +5324,12 @@ void RichTextLabel::select_all() {
if (it->type != ITEM_FRAME) {
if (!from_item) {
from_item = it;
} else {
to_item = it;
}
to_item = it;
}
it = _get_next_item(it, true);
}
if (!from_item || !to_item) {
if (!from_item) {
return;
}

Expand Down

0 comments on commit b00796e

Please sign in to comment.