aboutsummaryrefslogtreecommitdiff
path: root/src/Entry.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-05-18 22:05:19 +0200
committerdec05eba <dec05eba@protonmail.com>2021-05-18 22:08:41 +0200
commitd123c41cd3ad4f0d55ae134be69e7ffd144dbb74 (patch)
treef46a8e6daea5b757f4b66363c64aea6269dd83a9 /src/Entry.cpp
parentf6a39afa8bfd869ba661799897ac37e7d1ff7c34 (diff)
Add mention autocomplete
Diffstat (limited to 'src/Entry.cpp')
-rw-r--r--src/Entry.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Entry.cpp b/src/Entry.cpp
index ba9718b..7e1b6d9 100644
--- a/src/Entry.cpp
+++ b/src/Entry.cpp
@@ -95,6 +95,14 @@ namespace QuickMedia {
text.appendText(std::move(str));
}
+ void Entry::replace(size_t start_index, size_t length, const sf::String &insert_str) {
+ text.replace(start_index, length, insert_str);
+ }
+
+ int Entry::get_caret_index() const {
+ return text.getCaretIndex();
+ }
+
void Entry::set_position(const sf::Vector2f &pos) {
background.set_position(pos);
text.setPosition(pos + sf::Vector2f(background_margin_horizontal, background_margin_vertical));