summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers/StatusCache.cpp')
-rw-r--r--Swift/Controllers/StatusCache.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Swift/Controllers/StatusCache.cpp b/Swift/Controllers/StatusCache.cpp
index ce69440..d3c8be5 100644
--- a/Swift/Controllers/StatusCache.cpp
+++ b/Swift/Controllers/StatusCache.cpp
@@ -22,25 +22,25 @@ StatusCache::StatusCache(ApplicationPathProvider* paths) {
paths_ = paths;
path_ = paths_->getDataDir() / "StatusCache";
loadRecents();
}
StatusCache::~StatusCache() {
}
std::vector<StatusCache::PreviousStatus> StatusCache::getMatches(const std::string& substring, size_t maxCount) const {
std::vector<PreviousStatus> matches;
foreach (const PreviousStatus& status, previousStatuses_) {
- if (substring.empty() || boost::algorithm::ifind_first(status.first, substring)) {
+ if (substring.empty() || (boost::algorithm::ifind_first(status.first, substring) && substring != status.first)) {
matches.push_back(status);
if (matches.size() == maxCount) {
break;
}
}
}
return matches;
}
void StatusCache::addRecent(const std::string& text, StatusShow::Type type) {
if (text.empty()) {
return;