Uniquify candidates in -shell-candidates mode

This commit is contained in:
Maxime Coste 2016-03-28 14:16:45 +01:00
parent c8490c4e86
commit 75e9bbfa43

View File

@ -866,6 +866,7 @@ void define_command(const ParametersParser& parser, Context& context, const Shel
matches.push_back(match); matches.push_back(match);
} }
std::sort(matches.begin(), matches.end()); std::sort(matches.begin(), matches.end());
matches.erase(std::unique(matches.begin(), matches.end()), matches.end());
CandidateList res; CandidateList res;
for (auto& m : matches) for (auto& m : matches)
res.push_back(m.candidate().str()); res.push_back(m.candidate().str());