summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'SwifTools/TabComplete.cpp')
-rw-r--r--SwifTools/TabComplete.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/SwifTools/TabComplete.cpp b/SwifTools/TabComplete.cpp
index 2fd0547..1e15595 100644
--- a/SwifTools/TabComplete.cpp
+++ b/SwifTools/TabComplete.cpp
@@ -13,9 +13,10 @@
namespace Swift {
void TabComplete::addWord(const String& word) {
- words_.push_back(word);
+ words_.erase(std::remove(words_.begin(), words_.end(), word), words_.end());
+ words_.insert(words_.begin(), word);
if (word.getLowerCase().beginsWith(lastShort_)) {
- lastCompletionCandidates_.push_back(word);
+ lastCompletionCandidates_.insert(lastCompletionCandidates_.begin(), word);
}
}