diff --git a/ChangeLog b/ChangeLog index 338232fa0..8900b5c83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -31,6 +31,7 @@ - TW-168 modification of due date relative to current due date (thanks to Dirk Sarpe). - TW-186 Increase for numerical UDAs (thanks to Steffen Uhlig). +- TW-193 Support listing breaks. - TW-197 New virtual tag READY. - TW-218 Reveal terms of urgency calculation for a given task (thanks to Max Muller). diff --git a/NEWS b/NEWS index f9b69c906..18d1c8ebe 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,7 @@ New Features in taskwarrior 2.4.0 - New 'color.until' color rule. - Using a non-zero 'urgency.inherit.coefficient' value means a task inherits the urgency values of the dependency chain. + - Listing breaks now supported. See 'man taskrc'. New commands in taskwarrior 2.4.0 diff --git a/doc/man/taskrc.5.in b/doc/man/taskrc.5.in index 7969675f1..ba6aa8e69 100644 --- a/doc/man/taskrc.5.in +++ b/doc/man/taskrc.5.in @@ -1183,6 +1183,15 @@ For example: report.list.sort=due+,priority-,start.active-,project+ +Additionally, after the "+" or "-", there can be a solidus "/" which indicates +that there are breaks after the column values change. For example: + + report.minimal.sort=project+/,description+ + +This sort order now specifies that there is a listing break between each +project. A listing break is simply a blank line, which provides a visual +grouping. + .TP .B report.X.filter This adds a filter to the report X so that only tasks matching the filter diff --git a/src/commands/CmdCustom.cpp b/src/commands/CmdCustom.cpp index 6c7ef2440..6124ea8bf 100644 --- a/src/commands/CmdCustom.cpp +++ b/src/commands/CmdCustom.cpp @@ -132,6 +132,19 @@ int CmdCustom::execute (std::string& output) view.colorOdd (alternate); view.intraColorOdd (alternate); + // Add the break columns, if any. + std::vector ::iterator so; + for (so = sortOrder.begin (); so != sortOrder.end (); ++so) + { + std::string name; + bool ascending; + bool breakIndicator; + context.decomposeSortField (*so, name, ascending, breakIndicator); + + if (breakIndicator) + view.addBreak (name); + } + // Add the columns and labels. for (unsigned int i = 0; i < columns.size (); ++i) {