From 900ad3c26b33451b3657013dbb7fb2cd3bc32da8 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 16 Dec 2015 14:57:58 -0500 Subject: [PATCH] UDA: indicator column did not properly default to 'U' - Thanks to JDufault. --- AUTHORS | 1 + ChangeLog | 1 + src/columns/ColUDA.cpp | 16 ++++++++++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 21be9189a..cf1e5e81d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -278,3 +278,4 @@ suggestions: Naga Kiran David Badura James Dietrich + JDufault diff --git a/ChangeLog b/ChangeLog index 770b1522d..2d305fe9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -31,6 +31,7 @@ - Fixed broken build for Cygwin and older GCC (thanks to Richard Boß). - The default configuration is now 256-color only. - The 'columns' report now shows whether a column is modifiable or read only. +- UDA indicator column did not properly default to 'U' (thanks to JDufault). - Numerous performance improvements. Taskwarrior 2.5.1 is between X% and Y% faster than 2.5.0 when running various commands. diff --git a/src/columns/ColUDA.cpp b/src/columns/ColUDA.cpp index cef1122c4..d5b3b2e4e 100644 --- a/src/columns/ColUDA.cpp +++ b/src/columns/ColUDA.cpp @@ -116,7 +116,13 @@ void ColumnUDA::measure (Task& task, unsigned int& minimum, unsigned int& maximu else if (_style == "indicator") { if (task.has (_name)) - minimum = maximum = utf8_width (context.config.get ("uda." + _name + ".indicator")); + { + auto indicator = context.config.get ("uda." + _name + ".indicator"); + if (indicator == "") + indicator = "U"; + + minimum = maximum = utf8_width (indicator); + } else minimum = maximum = 0; } @@ -171,7 +177,13 @@ void ColumnUDA::render ( else if (_style == "indicator") { if (task.has (_name)) - renderStringRight (lines, width, color, context.config.get ("uda." + _name + ".indicator")); + { + auto indicator = context.config.get ("uda." + _name + ".indicator"); + if (indicator == "") + indicator = "U"; + + renderStringRight (lines, width, color, indicator); + } } } }