Skip to content

Commit

Permalink
Fix "task edit" dropping annotation text after newlines.
Browse files Browse the repository at this point in the history
  • Loading branch information
wbsch committed Jun 5, 2015
1 parent c4ac7dc commit e4b9c1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Harlan).
- 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.
- Fix "task edit" dropping annotation text after newlines.

------ current release ---------------------------

Expand Down
5 changes: 3 additions & 2 deletions src/commands/CmdEdit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <i18n.h>
#include <main.h>
#include <CmdEdit.h>
#include <JSON.h>

extern Context context;

Expand Down Expand Up @@ -239,7 +240,7 @@ std::string CmdEdit::formatTask (Task task, const std::string& dateformat)
{
Date dt (strtol (anno.first.substr (11).c_str (), NULL, 10));
before << " Annotation: " << dt.toString (dateformat)
<< " -- " << anno.second << "\n";
<< " -- " << json::encode (anno.second) << "\n";
}

Date now;
Expand Down Expand Up @@ -639,7 +640,7 @@ void CmdEdit::parseTask (Task& task, const std::string& after, const std::string
std::stringstream name;
name << "annotation_" << when.toEpoch ();
std::string text = trim (value.substr (gap + 4), "\t ");
annotations.insert (std::make_pair (name.str (), text));
annotations.insert (std::make_pair (name.str (), json::decode (text)));
}
}
}
Expand Down

0 comments on commit e4b9c1f

Please sign in to comment.