mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-19 15:53:07 +02:00
viewport: Properly handle the situation when non-matching task is represented in the viewport in multiple instances
This commit is contained in:
parent
d794bfb13b
commit
8089c09101
1 changed files with 9 additions and 6 deletions
|
@ -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'])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue