Fix "task edit" dropping annotation text after newlines.

This commit is contained in:
Wilhelm Schuermann 2015-06-05 22:25:48 +02:00
parent c4ac7dc4c2
commit e4b9c1f01e
2 changed files with 4 additions and 2 deletions

View file

@ -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 ---------------------------

View file

@ -40,6 +40,7 @@
#include <i18n.h>
#include <main.h>
#include <CmdEdit.h>
#include <JSON.h>
extern Context context;
@ -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;
@ -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)));
}
}
}