From 0bfffb33ce259626d7d1087d2600f7f262bd56d5 Mon Sep 17 00:00:00 2001 From: Emanuele Giaquinta Date: Wed, 6 Jun 2007 17:49:10 +0000 Subject: [PATCH] Enhance /set completer to complete option names also when a command option is present and to complete option values. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4543 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/core/completion.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/fe-common/core/completion.c b/src/fe-common/core/completion.c index 88e9b029..150af51e 100644 --- a/src/fe-common/core/completion.c +++ b/src/fe-common/core/completion.c @@ -677,9 +677,18 @@ static void sig_complete_set(GList **list, WINDOW_REC *window, g_return_if_fail(word != NULL); g_return_if_fail(line != NULL); - if (*line != '\0') return; + if (*line == '\0' || + !strcmp("-clear", line) || !strcmp("-default", line)) + *list = completion_get_settings(word, -1); + else if (*line != '\0' && *word == '\0') { + SETTINGS_REC *rec = settings_get_record(line); + if (rec != NULL) { + char *value = settings_get_print(rec); + if (value != NULL) + *list = g_list_append(*list, value); + } + } - *list = completion_get_settings(word, -1); if (*list != NULL) signal_stop(); }