From a984adb5a6bde78c3b3c7681ad529cf22f2452ec Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Sun, 3 Apr 2016 15:21:16 +0100 Subject: [PATCH] Fixed insert mode interaction with auto complete --- scene/gui/text_edit.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 325203580ec..4be8dd850c9 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -1596,7 +1596,22 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { if(auto_brace_completion_enabled && _is_pair_symbol(chr[0])) { _consume_pair_symbol(chr[0]); } else { + + // remove the old character if in insert mode + if (insert_mode) { + _begin_compex_operation(); + + // make sure we don't try and remove empty space + if (cursor.column < get_line(cursor.line).length()) { + _remove_text(cursor.line, cursor.column, cursor.line, cursor.column + 1); + } + } + _insert_text_at_cursor(chr); + + if (insert_mode) { + _end_compex_operation(); + } } }