From 233a6ae951fa406bfd94fa40320fa840766b8302 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Mon, 2 Aug 2010 01:00:20 -0400 Subject: [PATCH] Bug - Fixed problem with the 'undo' command not observing the rc.color or the rc._forcecolor settings. --- ChangeLog | 2 ++ src/TDB.cpp | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 756c1a99b..e6f0c4c79 100644 --- a/ChangeLog +++ b/ChangeLog @@ -47,6 +47,8 @@ and overdue. + Fixed problem with command line configuration overrides that had no values. + + Fixed problem with the 'undo' command not observing the rc.color or the + rc._forcecolor settings. ------ old releases ------------------------------ diff --git a/src/TDB.cpp b/src/TDB.cpp index 856a0cbd5..a85dd062f 100644 --- a/src/TDB.cpp +++ b/src/TDB.cpp @@ -702,8 +702,11 @@ void TDB::undo () Date lastChange (atoi (when.c_str ())); // Set the colors. - Color color_red (context.config.get ("color.undo.before")); - Color color_green (context.config.get ("color.undo.after")); + bool useColor = context.config.getBoolean ("color") || + context.config.getBoolean ("_forcecolor") ? true : false; + + Color color_red (useColor ? context.config.get ("color.undo.before") : ""); + Color color_green (useColor ? context.config.get ("color.undo.after") : ""); if (context.config.get ("undo.style") == "side") {