second take at autocomplete logic, using a TextOperation check.
This commit is contained in:
parent
0b8fa1e010
commit
9b72f08042
@ -1023,8 +1023,10 @@ void CodeTextEditor::_line_col_changed() {
|
||||
|
||||
void CodeTextEditor::_text_changed() {
|
||||
|
||||
code_complete_timer->start();
|
||||
idle->start();
|
||||
if (text_editor->is_insert_text_operation()) {
|
||||
code_complete_timer->start();
|
||||
idle->start();
|
||||
}
|
||||
}
|
||||
|
||||
void CodeTextEditor::_code_complete_timer_timeout() {
|
||||
|
@ -4255,6 +4255,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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user