Small code style tweak in insert_completer.cc

This commit is contained in:
Maxime Coste 2015-09-11 13:03:06 +01:00
parent 6292d451cf
commit 6ac1ae56fb

View File

@ -140,9 +140,10 @@ InsertCompletion complete_word(const Buffer& buffer, ByteCoord cursor_pos)
{
String menu_entry;
if (m.buffer)
menu_entry = m.match.str() +
String{' ', longest + 1 - m.match.char_length()} +
m.buffer->display_name();
{
const auto pad_len = longest + 1 - m.match.char_length();
menu_entry = m.match + String{' ', pad_len} + m.buffer->display_name();
}
candidates.push_back({m.match.str(), "", std::move(menu_entry)});
}