From 5697270ecf4d4f23007f1468fcf76ec6e373e8f5 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 6 Jul 2014 00:47:53 -0400 Subject: [PATCH] TW-252 - TW-252 task done - Doesn't stop task before marking complete (thanks to Renato Alves). --- ChangeLog | 2 ++ src/commands/CmdDone.cpp | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 05d5f9567..819a0f9b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -44,6 +44,8 @@ - TW-250 Opening parenthesis in description gets padded in task 2.0.0 bet 2 (thanks to Michelle Crane). - TW-251 extra spaces added after ( and / (thanks to Andy Spiegl). +- TW-252 task done - Doesn't stop task before marking complete (thanks to + Renato Alves). - TW-253 Unrecognized taskwarrior file format. in /Users/user/Dropbox/.task/completed.data at line 1 (thanks to Kosta Harlan). diff --git a/src/commands/CmdDone.cpp b/src/commands/CmdDone.cpp index 03e04eaea..cfd428a1b 100644 --- a/src/commands/CmdDone.cpp +++ b/src/commands/CmdDone.cpp @@ -85,9 +85,12 @@ int CmdDone::execute (std::string& output) task->setEnd (); // Stop the task, if started. - if (task->has ("start") && - context.config.getBoolean ("journal.time")) - task->addAnnotation (context.config.get ("journal.time.stop.annotation")); + if (task->has ("start")) + { + task->remove ("start"); + if (context.config.getBoolean ("journal.time")) + task->addAnnotation (context.config.get ("journal.time.stop.annotation")); + } if (permission (*task, taskDifferences (before, *task) + question, filtered.size ())) {