VimwikiTask: Refresh task when updating from TW only if forced to

This commit is contained in:
Tomas Babej 2014-12-29 10:42:04 +01:00
parent e43c457d26
commit 3a3f466615

View file

@ -139,11 +139,17 @@ class VimwikiTask(object):
if self.completed and (self.task.pending or self.task.waiting):
self.task.done()
def update_from_tw(self):
def update_from_tw(self, refresh=False):
if not self.task:
return
self.task.refresh()
# We refresh only if specified, since sometimes we
# know that the TW task is up to date (e.g. because we just
# loaded the object)
if refresh:
self.task.refresh()
self.text = self.task['description']
# TODO: update due
self.completed = (self.task['status'] == u'completed')