diff --git a/anki/find.py b/anki/find.py index d6e4727cc..a53a0286b 100644 --- a/anki/find.py +++ b/anki/find.py @@ -107,6 +107,7 @@ class Finder(object): s['q'] += " and " if s['isnot']: s['q'] += " not " + s['isnot'] = False if wrap: txt = "(" + txt + ")" s['q'] += txt diff --git a/tests/test_find.py b/tests/test_find.py index 27578a79c..af8ebbace 100644 --- a/tests/test_find.py +++ b/tests/test_find.py @@ -199,6 +199,7 @@ def test_findCards(): # OR searches and nesting assert len(deck.findCards("tag:monkey or tag:sheep")) == 2 assert len(deck.findCards("(tag:monkey OR tag:sheep)")) == 2 + assert len(deck.findCards("-(tag:monkey OR tag:sheep)")) == 6 assert len(deck.findCards("tag:monkey or (tag:sheep sheep)")) == 2 assert len(deck.findCards("tag:monkey or (tag:sheep octopus)")) == 1