summaryrefslogtreecommitdiff
path: root/editor/code_editor.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-09-02 18:30:20 +0200
committerGitHub <noreply@github.com>2019-09-02 18:30:20 +0200
commitaa0ed471222738836767ae48f69fd9f21f7a9ae4 (patch)
treed6ba9c590ed7b47c11e86b66fd7b3f2ee9cd400f /editor/code_editor.cpp
parent97d48e04f92d3c901b6b9b162f603090f9feecff (diff)
parent544c39d1e72759d228bce4c5af72744db698d570 (diff)
Merge pull request #31892 from alexey-makarenko/fix/editor_search_back_infinitely
Fix editor infinite loop in search_prev issue #31328
Diffstat (limited to 'editor/code_editor.cpp')
-rw-r--r--editor/code_editor.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 606b619cac..b6cd69c3cd 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -366,14 +366,12 @@ bool FindReplaceBar::search_prev() {
if (text_edit->is_selection_active())
col--; // Skip currently selected word.
- 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();
- }
+ 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);