summaryrefslogtreecommitdiff
path: root/src/fe-common
diff options
context:
space:
mode:
authorEmanuele Giaquinta <exg@irssi.org>2007-06-06 17:49:10 +0000
committerexg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564>2007-06-06 17:49:10 +0000
commit0bfffb33ce259626d7d1087d2600f7f262bd56d5 (patch)
tree0d875bc1e11f73ddebe74308f5f9a7feb8f591d4 /src/fe-common
parent64e6e92f20ac549611e93604d80e553bbedd69f1 (diff)
downloadirssi-0bfffb33ce259626d7d1087d2600f7f262bd56d5.zip
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
Diffstat (limited to 'src/fe-common')
-rw-r--r--src/fe-common/core/completion.c13
1 files 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();
}