summaryrefslogtreecommitdiff
path: root/tools/editor/code_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/code_editor.cpp')
-rw-r--r--tools/editor/code_editor.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp
index 6de59f184a..84bf7d33f4 100644
--- a/tools/editor/code_editor.cpp
+++ b/tools/editor/code_editor.cpp
@@ -487,6 +487,7 @@ FindReplaceDialog::FindReplaceDialog() {
vb->add_child(error_label);
+
set_hide_on_ok(false);
}
@@ -507,15 +508,19 @@ void CodeTextEditor::_text_changed() {
}
void CodeTextEditor::_code_complete_timer_timeout() {
+ if (!is_visible())
+ return;
if (enable_complete_timer)
text_editor->query_code_comple();
}
-void CodeTextEditor::_complete_request(const String& p_request, int p_line) {
+void CodeTextEditor::_complete_request() {
List<String> entries;
- _code_complete_script(text_editor->get_text(),p_request,p_line,&entries);
+ _code_complete_script(text_editor->get_text_for_completion(),&entries);
// print_line("COMPLETE: "+p_request);
+ if (entries.size()==0)
+ return;
Vector<String> strs;
strs.resize(entries.size());
int i=0;
@@ -555,7 +560,7 @@ void CodeTextEditor::_on_settings_change() {
// AUTO BRACE COMPLETION
text_editor->set_auto_brace_completion(
- EDITOR_DEF("text_editor/auto_brace_complete", false)
+ EDITOR_DEF("text_editor/auto_brace_complete", true)
);
code_complete_timer->set_wait_time(
@@ -632,6 +637,8 @@ CodeTextEditor::CodeTextEditor() {
text_editor->connect("request_completion", this,"_complete_request");
Vector<String> cs;
cs.push_back(".");
+ cs.push_back(",");
+ cs.push_back("(");
text_editor->set_completion(true,cs);
idle->connect("timeout", this,"_text_changed_idle_timeout");