summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-07-24 19:51:52 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-07-24 19:54:18 (GMT)
commit545f20b9051caad8d0223bd332a094c2ffbe8435 (patch)
tree03e7cff7c353436f44c92b29bd4390288c5242f1 /SwifTools/TabComplete.cpp
parent649b6f713a48e1b65b3032e15326269d7fec3d27 (diff)
downloadswift-545f20b9051caad8d0223bd332a094c2ffbe8435.zip
swift-545f20b9051caad8d0223bd332a094c2ffbe8435.tar.bz2
Improvements and further testing to tab completion.
Resolves: #506 Resolves: #498
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);
}
}