summaryrefslogtreecommitdiff
path: root/alot/completion.py
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2012-01-08 20:03:56 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2012-01-08 20:03:56 +0000
commitdb78f4b2e38be4f3a1ee0f593dc6fdc0a84fc3ee (patch)
tree117cf327c5865a3fb4209dd8be2d8195b8a2b7bd /alot/completion.py
parentc9ff40bd2cd165dd068727ab63cf718e0e4ce1d3 (diff)
completion for new tagging commands
For tag,untag,retag and toggletags, both in search and thread modes, the parameter is completed to a comma separated list of tagstrings already present in the index. issue #236
Diffstat (limited to 'alot/completion.py')
-rw-r--r--alot/completion.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/alot/completion.py b/alot/completion.py
index 3d1a1b15..8e474691 100644
--- a/alot/completion.py
+++ b/alot/completion.py
@@ -292,7 +292,8 @@ class CommandLineCompleter(Completer):
# search
elif self.mode == 'search' and cmd == 'refine':
res = self._querycompleter.complete(params, localpos)
- elif self.mode == 'search' and cmd == 'retag':
+ elif self.mode == 'search' and cmd in ['tag', 'retag', 'untag',
+ 'toggletags']:
localcomp = MultipleSelectionCompleter(self._tagcompleter,
separator=',')
res = localcomp.complete(params, localpos)
@@ -338,6 +339,11 @@ class CommandLineCompleter(Completer):
# thread
elif self.mode == 'thread' and cmd == 'save':
res = self._pathcompleter.complete(params, localpos)
+ elif self.mode == 'thread' and cmd in ['tag', 'retag', 'untag',
+ 'toggletags']:
+ localcomp = MultipleSelectionCompleter(self._tagcompleter,
+ separator=',')
+ res = localcomp.complete(params, localpos)
# prepend cmd and correct position
res = [('%s %s' % (cmd, t), p + len(cmd) + 1) for (t, p) in res]