From 75fae291e16c9c3b3c22670962fde1530f45e5b4 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 31 Mar 2013 18:55:37 +0200 Subject: [PATCH] Fix flags width handling in FlagLine highlighter --- src/highlighters.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/highlighters.cc b/src/highlighters.cc index 6b55cbb2..8625f288 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -355,7 +355,9 @@ public: { int line_num = (int)line.buffer_line() + 1; 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 }; line.insert(line.begin(), std::move(atom)); }