Fix "task edit" dropping annotation text after newlines.
This commit is contained in:
@@ -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 ---------------------------
|
||||
|
||||
|
||||
@@ -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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user