- Fixed bug #579, which displayed incorrect counts when using the 'limit:N'
  filter (thanks to Thomas Sattler).
- Changed wording from 'lines' to 'tasks', because the former was inaccurate.
- Adjusted limit.t tests accordingly.
This commit is contained in:
Paul Beckingham 2010-12-22 09:31:00 -05:00
parent bad31d83b1
commit 4840708090
5 changed files with 16 additions and 4 deletions

View file

@ -68,4 +68,5 @@ suggestions:
Itay Perl Itay Perl
Max Muller Max Muller
Sander Marechal Sander Marechal
Thomas Sattler

View file

@ -39,6 +39,8 @@
Michelle Crane). Michelle Crane).
+ Fixed bug #555, which caused a segfault when logging a task with a project + Fixed bug #555, which caused a segfault when logging a task with a project
(thanks to Itay Perl). (thanks to Itay Perl).
+ Fixed bug #579, which displayed incorrect counts when using the 'limit:N'
filter (thanks to Thomas Sattler).
------ old releases ------------------------------ ------ old releases ------------------------------

1
NEWS
View file

@ -11,6 +11,7 @@ New Features in taskwarrior 1.9.4
- The first month in the calendar report can now be changed with an offset - The first month in the calendar report can now be changed with an offset
value. value.
- No more dependency on ncurses. - No more dependency on ncurses.
- Assorted bug fixes.
Please refer to the ChangeLog file for full details. There are too many to Please refer to the ChangeLog file for full details. There are too many to
list here. list here.

View file

@ -635,6 +635,14 @@ int handleCustomReport (const std::string& report, std::string& outs)
table.setTableAlternateColor (alternate); table.setTableAlternateColor (alternate);
} }
// How many lines taken up by table header?
int table_header;
if ((context.config.getBoolean ("color") || context.config.getBoolean ("_forcecolor")) &&
context.config.getBoolean ("fontunderline"))
table_header = 1; // Underlining doesn't use extra line.
else
table_header = 2; // Dashes use an extra line.
// Report output can be limited by rows or lines. // Report output can be limited by rows or lines.
int maxrows = 0; int maxrows = 0;
int maxlines = 0; int maxlines = 0;
@ -643,7 +651,7 @@ int handleCustomReport (const std::string& report, std::string& outs)
// Adjust for fluff in the output. // Adjust for fluff in the output.
if (maxlines) if (maxlines)
maxlines -= (context.config.getBoolean ("blanklines") ? 2 : 0) maxlines -= (context.config.getBoolean ("blanklines") ? 2 : 0)
+ 1 + table_header
+ context.headers.size () + context.headers.size ()
+ context.footnotes.size (); + context.footnotes.size ();
@ -656,11 +664,11 @@ int handleCustomReport (const std::string& report, std::string& outs)
<< table.rowCount () << table.rowCount ()
<< (table.rowCount () == 1 ? " task" : " tasks"); << (table.rowCount () == 1 ? " task" : " tasks");
if (maxrows) if (maxrows && maxrows < table.rowCount ())
out << ", " << maxrows << " shown"; out << ", " << maxrows << " shown";
if (maxlines && maxlines < table.rowCount ()) if (maxlines && maxlines < table.rowCount ())
out << ", truncated to " << maxlines - 1 << " lines"; out << ", truncated to " << maxlines - table_header << " tasks";
out << std::endl; out << std::endl;
} }

View file

@ -80,7 +80,7 @@ $output = qx{../task rc:limit.rc ls limit:3};
like ($output, qr/^30 tasks, 3 shown$/ms, 'limited to 3'); like ($output, qr/^30 tasks, 3 shown$/ms, 'limited to 3');
$output = qx{../task rc:limit.rc ls limit:page}; $output = qx{../task rc:limit.rc ls limit:page};
like ($output, qr/^30 tasks, truncated to 20 lines$/ms, 'limited to page'); like ($output, qr/^30 tasks, truncated to 17 tasks$/ms, 'limited to page');
# Cleanup. # Cleanup.
unlink 'pending.data'; unlink 'pending.data';