From 6a842fbb6de9ac2228aee7de694d574b9612f58c Mon Sep 17 00:00:00 2001 From: PouleyKetchoupp Date: Tue, 13 Aug 2019 19:42:42 +0200 Subject: Fixed freeze on search_prev (missing condition for searching from a previous result, now the same as search_next) Fixes #31328 --- editor/code_editor.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'editor/code_editor.cpp') 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); -- cgit v1.2.3