summary refs log tree commit diff
path: root/src/TextInputWidget.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/TextInputWidget.h')
-rw-r--r--src/TextInputWidget.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/TextInputWidget.h b/src/TextInputWidget.h

index e7d5f948..37d73fbb 100644 --- a/src/TextInputWidget.h +++ b/src/TextInputWidget.h
@@ -94,8 +94,23 @@ private: SuggestionsPopup popup_; + enum class AnchorType + { + Tab = 0, + Sigil = 1, + }; + + AnchorType anchorType_ = AnchorType::Sigil; + + int anchorWidth(AnchorType anchor) { return static_cast<int>(anchor); } + void closeSuggestions() { popup_.hide(); } void resetAnchor() { atTriggerPosition_ = -1; } + bool isAnchorValid() { return atTriggerPosition_ != -1; } + bool hasAnchor(int pos, AnchorType anchor) + { + return pos == atTriggerPosition_ + anchorWidth(anchor); + } QString query() {