summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-09-23 09:45:34 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-09-23 09:45:34 +0200
commit1928492b41d57bfabb8da69b095aa6b6298c2b12 (patch)
tree7ea3e9c93ede5588a4c99038eca4185c64dc3e97 /scene
parentee95cc0b795ef4fa26de580b911f2ea18cae4167 (diff)
parent97c0b0c74a6bdb3eb6cc74266fad3bf908491529 (diff)
Merge pull request #65158 from nongvantinh/fixed-infinite-loop
Fixes engine runs into an infinite loop when searching using FindBar
Diffstat (limited to 'scene')
-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 ef0172c612..3c45b90612 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -4703,7 +4703,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) {