summaryrefslogtreecommitdiff
path: root/editor/code_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/code_editor.cpp')
-rw-r--r--editor/code_editor.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index ac8bef817b..1c62c3d3e1 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -142,7 +142,7 @@ bool FindReplaceBar::_search(uint32_t p_flags, int p_from_line, int p_from_col)
bool found = text_editor->search(text, p_flags, p_from_line, p_from_col, line, col);
if (found) {
- if (!preserve_cursor) {
+ if (!preserve_cursor && !is_selection_only()) {
text_editor->unfold_line(line);
text_editor->cursor_set_line(line, false);
text_editor->cursor_set_column(col + text.length(), false);
@@ -488,10 +488,10 @@ void FindReplaceBar::_show_search(bool p_focus_replace, bool p_show_only) {
if (!get_search_text().is_empty()) {
if (p_focus_replace) {
replace_text->select_all();
- replace_text->set_cursor_position(replace_text->get_text().length());
+ replace_text->set_caret_column(replace_text->get_text().length());
} else {
search_text->select_all();
- search_text->set_cursor_position(search_text->get_text().length());
+ search_text->set_caret_column(search_text->get_text().length());
}
results_count = -1;