Fix completion suffix logic
The if inside statement inside Parser::completeCommand was wrong, but
the WhenToAdd::Always wasn't used anywhere, so I didn't catch that
error.
Change-Id: I940238ece641db226fafe44714078058f40df9c3
diff --git a/src/parser.cpp b/src/parser.cpp
index 85793a0..91b00a2 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -69,8 +69,8 @@
auto filtered = filterByPrefix(ctx.m_suggestions, std::string(completionIterator, line.end()));
if (filtered.size() == 1) {
- auto suffix = filtered.begin()->m_whenToAdd == Completion::WhenToAdd::IfFullMatch
- && filtered.begin()->m_value == std::string{completionIterator, line.end()}
+ auto suffix = filtered.begin()->m_whenToAdd == Completion::WhenToAdd::Always
+ || filtered.begin()->m_value == std::string{completionIterator, line.end()}
? filtered.begin()->m_suffix
: "";
return {{filtered.begin()->m_value + suffix}, completionContext};