viewport: Properly handle the situation when non-matching task is represented in the viewport in multiple instances

This commit is contained in:
Tomas Babej 2015-03-21 18:42:43 +01:00
parent d794bfb13b
commit 8089c09101

View file

@ -77,11 +77,14 @@ class ViewPort(object):
# Remove tasks that no longer match the filter
for task in to_del:
# Find matching vimwikitask in the self.tasks set
[vimwikitask] = [t for t in self.tasks
# Find matching vimwikitasks in the self.tasks set
# There might be more if the viewport contained multiple
# representations of the same task
matching_vimwikitasks= [t for t in self.tasks
if t['uuid'] == task['uuid']]
# Remove the task from viewport's set and from buffer
# Remove the tasks from viewport's set and from buffer
for vimwikitask in matching_vimwikitasks:
self.tasks.remove(vimwikitask)
self.cache.remove_line(vimwikitask['line_number'])