Merge pull request #11021 from tuga3d/autocomplete-logic-attempt2

autocomplete logic attempt 2, fixes #10695
This commit is contained in:
Rémi Verschelde 2017-09-18 08:58:18 +02:00 committed by GitHub
commit cc161dcd6f
3 changed files with 10 additions and 2 deletions

View file

@ -1023,9 +1023,11 @@ void CodeTextEditor::_line_col_changed() {
void CodeTextEditor::_text_changed() {
if (text_editor->is_insert_text_operation()) {
code_complete_timer->start();
idle->start();
}
}
void CodeTextEditor::_code_complete_timer_timeout() {
if (!is_visible_in_tree())

View file

@ -4266,6 +4266,10 @@ bool TextEdit::is_insert_mode() const {
return insert_mode;
}
bool TextEdit::is_insert_text_operation() {
return (current_op.type == TextOperation::TYPE_INSERT);
}
uint32_t TextEdit::get_version() const {
return current_op.version;
}

View file

@ -386,6 +386,8 @@ public:
void begin_complex_operation();
void end_complex_operation();
bool is_insert_text_operation();
void set_text(String p_text);
void insert_text_at_cursor(const String &p_text);
void insert_at(const String &p_text, int at);