From 535a454349f4aa647644d8eef99c517c15ddbec8 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 6 Aug 2013 11:35:38 +0200 Subject: [PATCH] Line completion: sort and uniquify lines --- src/input_handler.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/input_handler.cc b/src/input_handler.cc index 2c23af80..c0d7b5ed 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -737,6 +737,8 @@ public: } if (res.empty()) return {}; + std::sort(res.begin(), res.end()); + res.erase(std::unique(res.begin(), res.end()), res.end()); return { cursor_pos.line, cursor_pos, std::move(res), buffer.timestamp() }; }