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,13 +77,16 @@ class ViewPort(object):
|
||||||
|
|
||||||
# Remove tasks that no longer match the filter
|
# Remove tasks that no longer match the filter
|
||||||
for task in to_del:
|
for task in to_del:
|
||||||
# Find matching vimwikitask in the self.tasks set
|
# Find matching vimwikitasks in the self.tasks set
|
||||||
[vimwikitask] = [t for t in self.tasks
|
# There might be more if the viewport contained multiple
|
||||||
if t['uuid'] == task['uuid']]
|
# 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
|
||||||
self.tasks.remove(vimwikitask)
|
for vimwikitask in matching_vimwikitasks:
|
||||||
self.cache.remove_line(vimwikitask['line_number'])
|
self.tasks.remove(vimwikitask)
|
||||||
|
self.cache.remove_line(vimwikitask['line_number'])
|
||||||
|
|
||||||
# Add the tasks that match the filter and are not listed
|
# Add the tasks that match the filter and are not listed
|
||||||
added_tasks = 0
|
added_tasks = 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue