From 9b72f0804268b99b341c0c700cdac5617162216d Mon Sep 17 00:00:00 2001 From: Paulo Gomes Date: Wed, 6 Sep 2017 02:02:51 +0100 Subject: second take at autocomplete logic, using a TextOperation check. --- scene/gui/text_edit.cpp | 4 ++++ scene/gui/text_edit.h | 2 ++ 2 files changed, 6 insertions(+) (limited to 'scene/gui') diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 1738e303aa..4f930c5139 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -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; } diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 68ef559f46..7e61c4e8b1 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -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); -- cgit v1.2.3