summaryrefslogtreecommitdiff
path: root/src/insert_completer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/insert_completer.cc')
-rw-r--r--src/insert_completer.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/insert_completer.cc b/src/insert_completer.cc
index ddc96cbd..d06df6f0 100644
--- a/src/insert_completer.cc
+++ b/src/insert_completer.cc
@@ -474,6 +474,15 @@ void InsertCompleter::update(bool allow_implicit)
auto& get_first(BufferRange& range) { return range.begin; }
auto& get_last(BufferRange& range) { return range.end; }
+void InsertCompleter::try_accept()
+{
+ if (m_completions.is_valid() and m_context.has_client()
+ and m_current_candidate >= 0 and m_current_candidate < m_completions.candidates.size() - 1)
+ {
+ reset();
+ }
+}
+
void InsertCompleter::reset()
{
if (m_explicit_completer or m_completions.is_valid())