From 292e2f1b89723e41d32608b60d309bb6b9f7e8ab Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 31 Oct 2015 16:14:14 -0400 Subject: [PATCH] ColDepends: Now uses ::renderStringLeft --- src/columns/ColDepends.cpp | 44 ++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/src/columns/ColDepends.cpp b/src/columns/ColDepends.cpp index 6ad1372ac..d119fa70e 100644 --- a/src/columns/ColDepends.cpp +++ b/src/columns/ColDepends.cpp @@ -122,37 +122,31 @@ void ColumnDepends::render ( if (task.has (_name)) { if (_style == "indicator") + renderStringRight (lines, width, color, context.config.get ("dependency.indicator")); + else { - lines.push_back ( - color.colorize ( - rightJustify (context.config.get ("dependency.indicator"), width))); - return; - } + std::vector blocking; + dependencyGetBlocking (task, blocking); - std::vector blocking; - dependencyGetBlocking (task, blocking); + if (_style == "count") + renderStringRight (lines, width, color, "[" + format (static_cast (blocking.size ())) + "]"); - if (_style == "count") - { - lines.push_back ( - color.colorize ( - rightJustify ("[" + format ((int)blocking.size ()) + "]", width))); - } - else if (_style == "default" || - _style == "list") - { - std::vector blocking_ids; - for (auto& t : blocking) - blocking_ids.push_back (t.id); + else if (_style == "default" || + _style == "list") + { + std::vector blocking_ids; + for (auto& t : blocking) + blocking_ids.push_back (t.id); - std::string combined; - join (combined, " ", blocking_ids); + std::string combined; + join (combined, " ", blocking_ids); - std::vector all; - wrapText (all, combined, width, _hyphenate); + std::vector all; + wrapText (all, combined, width, _hyphenate); - for (auto& i : all) - lines.push_back (color.colorize (leftJustify (i, width))); + for (auto& i : all) + renderStringLeft (lines, width, color, i); + } } } }