summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2019-08-13 19:42:42 +0200
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2019-08-13 19:42:42 +0200
commit6a842fbb6de9ac2228aee7de694d574b9612f58c (patch)
treea33fad148af3e2cdf78bf574fdae0f4542aaef92
parent839cc98cb9d65bd80f50a7f981350966fedc54ee (diff)
Fixed freeze on search_prev (missing condition for searching from a previous result, now the same as search_next)
Fixes #31328
-rw-r--r--editor/code_editor.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 89a88dc6e7..a3e0f67614 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -362,12 +362,14 @@ bool FindReplaceBar::search_prev() {
int line, col;
_get_search_from(line, col);
- col -= text.length();
- if (col < 0) {
- line -= 1;
- if (line < 0)
- line = text_edit->get_line_count() - 1;
- col = text_edit->get_line(line).length();
+ if (line == result_line && col == result_col) {
+ col -= text.length();
+ if (col < 0) {
+ line -= 1;
+ if (line < 0)
+ line = text_edit->get_line_count() - 1;
+ col = text_edit->get_line(line).length();
+ }
}
return _search(flags, line, col);