summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2014-05-06 12:30:32 -0300
committerreduz <reduzio@gmail.com>2014-05-06 12:30:32 -0300
commitac39af73b1b987ef8d3b9898e841a420f36a12ac (patch)
tree695acca948bd96903290a15372d09659ce27fad9 /scene
parent5044bead5f344a24f971f0bb0c8d282f1785f06a (diff)
parent0771020c8357eee5ea9c395782089d867db84c05 (diff)
Merge pull request #374 from marynate/PR-code-complete
Add auto code completion (without press Ctrl+Space manually)
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/text_edit.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index bd15e14ccd..2ac9c66771 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1106,7 +1106,7 @@ void TextEdit::_input_event(const InputEvent& p_input_event) {
return;
}
- if (k.scancode==KEY_RETURN) {
+ if (k.scancode==KEY_RETURN || k.scancode==KEY_TAB) {
_confirm_completion();
accept_event();
@@ -2896,6 +2896,7 @@ void TextEdit::_update_completion_candidates() {
completion_current=completion_options[completion_index];
+#if 0 // even there's only one option, user still get the chance to choose using it or not
if (completion_options.size()==1) {
//one option to complete, just complete it automagically
_confirm_completion();
@@ -2904,6 +2905,9 @@ void TextEdit::_update_completion_candidates() {
return;
}
+#endif
+ if (completion_options.size()==1 && s==completion_options[0])
+ _cancel_completion();
completion_enabled=true;