Fix flags width handling in FlagLine highlighter

This commit is contained in:
Maxime Coste 2013-03-31 18:55:37 +02:00
parent f4b3510b14
commit 75fae291e1

View File

@ -355,7 +355,9 @@ public:
{ {
int line_num = (int)line.buffer_line() + 1; int line_num = (int)line.buffer_line() + 1;
auto it = find_if(lines, [&](const LineAndFlag& l) { return std::get<0>(l) == line_num; }); auto it = find_if(lines, [&](const LineAndFlag& l) { return std::get<0>(l) == line_num; });
DisplayAtom atom{AtomContent(it != lines.end() ? std::get<2>(*it) : empty)}; String content = it != lines.end() ? std::get<2>(*it) : empty;
content += String(' ', width - content.char_length());
DisplayAtom atom{AtomContent(std::move(content))};
atom.colors = { it != lines.end() ? std::get<1>(*it) : Color::Default , m_bg }; atom.colors = { it != lines.end() ? std::get<1>(*it) : Color::Default , m_bg };
line.insert(line.begin(), std::move(atom)); line.insert(line.begin(), std::move(atom));
} }