- Fixed bug #1118, which dropped changes after edits were rejected (thanks to
  Ben Boeckel).
This commit is contained in:
Paul Beckingham 2013-01-12 17:30:28 -05:00
parent dd1f154376
commit 8271e973d8
2 changed files with 4 additions and 1 deletions

View file

@ -772,6 +772,7 @@ bool CmdEdit::editFile (Task& task)
// Format the contents, T -> text, write to a file.
std::string before = formatTask (task, dateformat);
std::string before_orig = before;
File::write (file.str (), before);
// Determine correct editor: .taskrc:editor > $VISUAL > $EDITOR > vi
@ -802,7 +803,7 @@ ARE_THESE_REALLY_HARMFUL:
// Update task based on what can be parsed back out of the file, but only
// if changes were made.
if (before != after)
if (before_orig != after)
{
std::cout << STRING_EDIT_CHANGES << "\n";
std::string problem = "";