summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNong Van Tinh <vannongtinh@gmail.com>2022-09-01 01:26:08 +0700
committerNong Van Tinh <vannongtinh@gmail.com>2022-09-01 01:26:08 +0700
commit97c0b0c74a6bdb3eb6cc74266fad3bf908491529 (patch)
tree2ae73c80fb1fcca369f4f16c85b8bec929b92241
parent736632ee7ed00a3474448cfd227f696f82905ac7 (diff)
Fixes #64962 that cause program run into infinite loop
-rw-r--r--scene/gui/rich_text_label.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index c9a903153d..61d91978a6 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -4622,7 +4622,10 @@ bool RichTextLabel::search(const String &p_string, bool p_from_selection, bool p
queue_redraw();
return true;
}
- p_search_previous ? current_line-- : current_line++;
+
+ if (current_line != ending_line) {
+ p_search_previous ? current_line-- : current_line++;
+ }
}
if (p_from_selection && selection.active) {