diff options
author | reduz <reduzio@gmail.com> | 2014-05-07 10:25:13 -0300 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2014-05-07 10:25:13 -0300 |
commit | 2495df4ffce5ed3f9d94e0d10801fa6bb6cfba19 (patch) | |
tree | bebafaf37e1081447b1872df402d54f437b3e757 /scene | |
parent | c69c99f8be157b3cea73751a548dcb4862f3314f (diff) | |
parent | 6c9203fdafc3cbed2bf31d2adfa4d8f82e3e69c7 (diff) |
Merge pull request #379 from jonyrock/auto_brace_complete_open_bug_fix
call during autocompletion
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/text_edit.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 2ac9c66771..c48d8bb1de 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -750,7 +750,6 @@ void TextEdit::_consume_pair_symbol(CharType ch) { CharType ch_single_pair[2] = {_get_right_pair_symbol(ch), 0}; CharType ch_pair[3] = {ch, _get_right_pair_symbol(ch), 0}; - printf("Selectin if active, %d\n", is_selection_active()); if(is_selection_active()) { int new_column,new_line; @@ -1132,11 +1131,17 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { if (cursor.column<text[cursor.line].length() && text[cursor.line][cursor.column]==k.unicode) { //same char, move ahead cursor_set_column(cursor.column+1); + } else { //different char, go back const CharType chr[2] = {k.unicode, 0}; - _insert_text_at_cursor(chr); + if(auto_brace_completion_enabled && _is_pair_symbol(chr[0])) { + _consume_pair_symbol(chr[0]); + } else { + _insert_text_at_cursor(chr); + } } + _update_completion_candidates(); accept_event(); |