summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-08-13 20:47:45 +0200
committerGitHub <noreply@github.com>2019-08-13 20:47:45 +0200
commitfcec35884042738e42fb7d7e6455f3890b062ca9 (patch)
tree13b65697cfb50e2b8f41ec527175f47894f7ba84
parent7863ea39dbf3c4ac4395f873de28736a64d75f66 (diff)
parent6a842fbb6de9ac2228aee7de694d574b9612f58c (diff)
Merge pull request #31355 from nekomatata/fix-select-prev-freeze
Fixed freeze on search previous
-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 848a37c1d1..1a529a4764 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -374,12 +374,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);