summaryrefslogtreecommitdiffstats
path: root/editor/code_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/code_editor.cpp')
-rw-r--r--editor/code_editor.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index d97293329a..88a32b1a6d 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -66,6 +66,8 @@ void GotoLineDialog::ok_pressed() {
text_editor->remove_secondary_carets();
text_editor->unfold_line(line_number);
text_editor->set_caret_line(line_number);
+ text_editor->set_code_hint("");
+ text_editor->cancel_code_completion();
hide();
}
@@ -176,6 +178,8 @@ bool FindReplaceBar::_search(uint32_t p_flags, int p_from_line, int p_from_col)
text_editor->unfold_line(pos.y);
text_editor->select(pos.y, pos.x, pos.y, pos.x + text.length());
text_editor->center_viewport_to_caret(0);
+ text_editor->set_code_hint("");
+ text_editor->cancel_code_completion();
line_col_changed_for_result = true;
}
@@ -640,6 +644,8 @@ void FindReplaceBar::_search_text_submitted(const String &p_text) {
} else {
search_next();
}
+
+ callable_mp(search_text, &LineEdit::edit).call_deferred();
}
void FindReplaceBar::_replace_text_submitted(const String &p_text) {
@@ -1090,6 +1096,9 @@ void CodeTextEditor::update_editor_settings() {
text_editor->set_draw_spaces(EDITOR_GET("text_editor/appearance/whitespace/draw_spaces"));
text_editor->add_theme_constant_override("line_spacing", EDITOR_GET("text_editor/appearance/whitespace/line_spacing"));
+ // Behavior: General
+ text_editor->set_empty_selection_clipboard_enabled(EDITOR_GET("text_editor/behavior/general/empty_selection_clipboard"));
+
// Behavior: Navigation
text_editor->set_scroll_past_end_of_file_enabled(EDITOR_GET("text_editor/behavior/navigation/scroll_past_end_of_file"));
text_editor->set_smooth_scroll_enabled(EDITOR_GET("text_editor/behavior/navigation/smooth_scrolling"));
@@ -1327,6 +1336,8 @@ void CodeTextEditor::goto_line(int p_line, int p_column) {
text_editor->unfold_line(CLAMP(p_line, 0, text_editor->get_line_count() - 1));
text_editor->set_caret_line(p_line, false);
text_editor->set_caret_column(p_column, false);
+ text_editor->set_code_hint("");
+ text_editor->cancel_code_completion();
// Defer in case the CodeEdit was just created and needs to be resized.
callable_mp((TextEdit *)text_editor, &TextEdit::adjust_viewport_to_caret).call_deferred(0);
}
@@ -1335,6 +1346,8 @@ void CodeTextEditor::goto_line_selection(int p_line, int p_begin, int p_end) {
text_editor->remove_secondary_carets();
text_editor->unfold_line(CLAMP(p_line, 0, text_editor->get_line_count() - 1));
text_editor->select(p_line, p_begin, p_line, p_end);
+ text_editor->set_code_hint("");
+ text_editor->cancel_code_completion();
callable_mp((TextEdit *)text_editor, &TextEdit::adjust_viewport_to_caret).call_deferred(0);
}
@@ -1344,6 +1357,8 @@ void CodeTextEditor::goto_line_centered(int p_line, int p_column) {
text_editor->unfold_line(CLAMP(p_line, 0, text_editor->get_line_count() - 1));
text_editor->set_caret_line(p_line, false);
text_editor->set_caret_column(p_column, false);
+ text_editor->set_code_hint("");
+ text_editor->cancel_code_completion();
callable_mp((TextEdit *)text_editor, &TextEdit::center_viewport_to_caret).call_deferred(0);
}