From 9caa992333cfc1a38c3b0a678fea7fa18e07eca9 Mon Sep 17 00:00:00 2001 From: Eijebong Date: Wed, 3 Dec 2014 13:53:41 +0100 Subject: Add a set_default command. --- src/core/completions.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/core/completions.py') diff --git a/src/core/completions.py b/src/core/completions.py index 7d95321b..a8d695d1 100644 --- a/src/core/completions.py +++ b/src/core/completions.py @@ -336,6 +336,19 @@ def completion_set(self, the_input): return return the_input.new_completion(end_list, n, quotify=True) + +def completion_set_default(self, the_input): + """ Completion for /set_default + """ + args = common.shell_split(the_input.text) + n = the_input.get_argument_position(quoted=True) + if n >= len(args): + args.append('') + if n == 1 or (n == 2 and config.has_section(args[1])): + return self.completion_set(the_input) + return [] + + def completion_toggle(self, the_input): "Completion for /toggle" return the_input.new_completion(config.options('Poezio'), 1, quotify=False) -- cgit v1.2.3