-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds +VISIBLE metatag #307
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just had a quick look and added a couple comments/suggestions...
@@ -171,6 +171,8 @@ def get_complement_tag(tag): | |||
for token in taskfilter_args: | |||
if token == '-VISIBLE': | |||
meta['visible'] = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meta['visible'] = False | |
if token == '-VISIBLE' or token == '+VISIBLE': | |
meta['visible'] = token[0] == '+' |
return set( | ||
task for task in self.tw.tasks.filter(*args) | ||
if task in tasks_outside_viewport | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return set(
task for task in self.tw.tasks.filter(*args)
if (task in tasks_outside_viewport) == self.meta['visible']
)
class TestViewportsVisibleMetaTag(MultiSyntaxIntegrationTest): | ||
|
||
viminput = """ | ||
HEADER2(Home tasks | project:Home +VISIBLE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop the project:Home
, as otherwise this isn't testing the +VISIBLE
meta tag at all, the chore task would be there anyway.
Matching taskwarrior tasks: 0 | ||
Displayed tasks: 1 | ||
Tasks to be added: | ||
Tasks to be deleted: tag work task |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intended?
I'd appreciate a comment explaining what this test really tests, as I don't think it's obvious. :-/
Adds a +VISIBLE metatag to display tasks already displayed in the file. This is useful to have different or aggregate sortings of tasks. For instance, you can have 2 projects that track your work under two different viewports. These 2 projects are equally important. On the top of the file, you just use a
<name> | +VISIBLE
viewport and you get all the tasks from both projects ordered by priority, so that you know which one you should work on first.