ColDepends: Now uses ::renderStringLeft

This commit is contained in:
Paul Beckingham 2015-10-31 16:14:14 -04:00
parent 06c50efa63
commit 292e2f1b89

View file

@ -122,37 +122,31 @@ void ColumnDepends::render (
if (task.has (_name)) if (task.has (_name))
{ {
if (_style == "indicator") if (_style == "indicator")
renderStringRight (lines, width, color, context.config.get ("dependency.indicator"));
else
{ {
lines.push_back ( std::vector <Task> blocking;
color.colorize ( dependencyGetBlocking (task, blocking);
rightJustify (context.config.get ("dependency.indicator"), width)));
return;
}
std::vector <Task> blocking; if (_style == "count")
dependencyGetBlocking (task, blocking); renderStringRight (lines, width, color, "[" + format (static_cast <int>(blocking.size ())) + "]");
if (_style == "count") else if (_style == "default" ||
{ _style == "list")
lines.push_back ( {
color.colorize ( std::vector <int> blocking_ids;
rightJustify ("[" + format ((int)blocking.size ()) + "]", width))); for (auto& t : blocking)
} blocking_ids.push_back (t.id);
else if (_style == "default" ||
_style == "list")
{
std::vector <int> blocking_ids;
for (auto& t : blocking)
blocking_ids.push_back (t.id);
std::string combined; std::string combined;
join (combined, " ", blocking_ids); join (combined, " ", blocking_ids);
std::vector <std::string> all; std::vector <std::string> all;
wrapText (all, combined, width, _hyphenate); wrapText (all, combined, width, _hyphenate);
for (auto& i : all) for (auto& i : all)
lines.push_back (color.colorize (leftJustify (i, width))); renderStringLeft (lines, width, color, i);
}
} }
} }
} }