@done tag not filtered as expected

In this example I’ve applied a filter as such:

Not Done @search(not @done)

Notice how there’s a task marked as @done that still shows up. This seems to be caused by nested sub-items like notes and other tasks. Seems like that’s a bug to me as I’d expect not to see that item or children.

I heavily use nested notes in my task files and am currently facing the same awkward behavior.

Sorry I missed this thread earlier.

First the reason this happens is because when TaskPaper does a search it:

  1. Finds all the matches
  2. Inserts any missing ancestors from the match set

The reason that it does this second step is so that matches have some context. So “Review vent diameter” is shown because “Phone cons with jon” is “not @done”.

The good news is that you can solve this by using search set operations. What we’ll do is take the original search, and then remove the descendants of all items that are marked done. Like this:

not @done except @done///*

Or as a saved search:

Not Done @search(not @done except @done///*)
1 Like

It works like a charm. I have tried the double slashes, but not the triple ones - it seems I haven’t figure out exactly how to use search set operations.

Thanks anyway for the solution!

Actually in this case // (which means descendants) should also work, because @done items are already excluded by the not @done. So we really only need remove the descendants from the results. The ancestors being inserted into the results happens in a separate later step.

The /// is a shortcut for the descendant-or-self axis.