Fix word completion that replaced the whole current word

Only replace up to the cursor.
This commit is contained in:
Maxime Coste 2014-04-29 23:48:46 +01:00
parent 479c067a40
commit b1ba7fc4d2

View File

@ -72,7 +72,7 @@ InsertCompletion complete_word(const Buffer& buffer, BufferCoord cursor_pos)
std::copy(matches.begin(), matches.end(),
inserter(result, result.begin()));
std::sort(result.begin(), result.end());
return { begin.coord(), end.coord(), std::move(result), buffer.timestamp() };
return { begin.coord(), cursor_pos, std::move(result), buffer.timestamp() };
}
template<bool require_slash>