diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-07-24 19:51:52 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-07-24 19:54:18 (GMT) |
commit | 545f20b9051caad8d0223bd332a094c2ffbe8435 (patch) | |
tree | 03e7cff7c353436f44c92b29bd4390288c5242f1 /SwifTools/TabComplete.cpp | |
parent | 649b6f713a48e1b65b3032e15326269d7fec3d27 (diff) | |
download | swift-contrib-545f20b9051caad8d0223bd332a094c2ffbe8435.zip swift-contrib-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.cpp | 5 |
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); } } |