diff --git a/ChangeLog b/ChangeLog index 45085fb36..924ca68b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ Harlan). - TW-1432 start/stop can be issued on completed tasks (thanks to Renato Alves). - TW-1572 Better urgency inheritance (thanks to Jens Erat). - Prevent potential task duplication during import for non-pending tasks. +- Show the active context in "context list", if any is active. ------ current release --------------------------- diff --git a/src/commands/CmdContext.cpp b/src/commands/CmdContext.cpp index 4a2d14219..76211b254 100644 --- a/src/commands/CmdContext.cpp +++ b/src/commands/CmdContext.cpp @@ -241,17 +241,26 @@ int CmdContext::listContexts (std::vector & words, std::stringstrea view.width (context.getWidth ()); view.add (Column::factory ("string", "Name")); view.add (Column::factory ("string", "Definition")); + view.add (Column::factory ("string", "Active")); Color label (context.config.get ("color.label")); view.colorHeader (label); + std::string activeContext = context.config.get ("context"); + for (auto& userContext : contexts) { std::string definition = context.config.get ("context." + userContext); + std::string active = "no"; + + if (userContext == activeContext) + active = "yes"; + int row = view.addRow (); view.set (row, 0, userContext); view.set (row, 1, definition); + view.set (row, 2, active); } out << optionalBlankLine ()