From f2d65413f5e9fdb56831c633aff70b1ea552b46a Mon Sep 17 00:00:00 2001 From: Patrick Totzke Date: Sat, 6 Oct 2012 11:24:44 +0100 Subject: re-enable toggletags command in search mode ... which has been accidentally removed before --- alot/commands/search.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'alot/commands') diff --git a/alot/commands/search.py b/alot/commands/search.py index f3dc1831..db718807 100644 --- a/alot/commands/search.py +++ b/alot/commands/search.py @@ -210,6 +210,17 @@ class TagCommand(Command): ui.dbman.tag(testquery, tags, remove_rest=True) elif self.action == 'remove': ui.dbman.untag(testquery, tags) + elif self.action == 'toggle': + if not self.allm: + to_remove = [] + to_add = [] + for t in tags: + if t in thread.get_tags(): + to_remove.append(t) + else: + to_add.append(t) + thread.remove_tags(to_remove) + thread.add_tags(to_add, afterwards=refresh) except DatabaseROError: ui.notify('index in read-only mode', priority='error') return -- cgit v1.2.3