1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Merge branch 'master' into readline

This commit is contained in:
James Booth 2015-02-26 00:50:49 +00:00
commit 2112ddea65
2 changed files with 11 additions and 11 deletions

View File

@ -1025,17 +1025,17 @@ static struct cmd_t command_defs[] =
{ "/theme", { "/theme",
cmd_theme, parse_args, 1, 2, &cons_theme_setting, cmd_theme, parse_args, 1, 2, &cons_theme_setting,
{ "/theme list|set|colours [theme-name]", "Change colour theme.", { "/theme list|load|colours [theme-name]", "Change colour theme.",
{ "/theme list|set|colours [theme-name]", { "/theme list|load|colours [theme-name]",
"------------------------------------", "-------------------------------------",
"Load a theme, includes colours and UI options.", "Load a theme, includes colours and UI options.",
"", "",
"list : List all available themes.", "list : List all available themes.",
"set theme-name : Load the named theme. 'default' will reset to the default theme.", "load theme-name : Load the named theme. 'default' will reset to the default theme.",
"colours : Show the colour values as rendered by the terminal.", "colours : Show the colour values as rendered by the terminal.",
"", "",
"Example: /theme list", "Example: /theme list",
"Example: /theme set mycooltheme", "Example: /theme load mycooltheme",
NULL } } }, NULL } } },
@ -1293,8 +1293,8 @@ cmd_init(void)
autocomplete_add(autoconnect_ac, "off"); autocomplete_add(autoconnect_ac, "off");
theme_ac = autocomplete_new(); theme_ac = autocomplete_new();
autocomplete_add(theme_ac, "load");
autocomplete_add(theme_ac, "list"); autocomplete_add(theme_ac, "list");
autocomplete_add(theme_ac, "set");
autocomplete_add(theme_ac, "colours"); autocomplete_add(theme_ac, "colours");
disco_ac = autocomplete_new(); disco_ac = autocomplete_new();
@ -2512,7 +2512,7 @@ static char *
_theme_autocomplete(const char * const input) _theme_autocomplete(const char * const input)
{ {
char *result = NULL; char *result = NULL;
if ((strncmp(input, "/theme set ", 11) == 0) && (strlen(input) > 11)) { if ((strncmp(input, "/theme load ", 12) == 0) && (strlen(input) > 12)) {
if (theme_load_ac == NULL) { if (theme_load_ac == NULL) {
theme_load_ac = autocomplete_new(); theme_load_ac = autocomplete_new();
GSList *themes = theme_list(); GSList *themes = theme_list();
@ -2524,7 +2524,7 @@ _theme_autocomplete(const char * const input)
g_slist_free_full(themes, g_free); g_slist_free_full(themes, g_free);
autocomplete_add(theme_load_ac, "default"); autocomplete_add(theme_load_ac, "default");
} }
result = autocomplete_param_with_ac(input, "/theme set", theme_load_ac, TRUE); result = autocomplete_param_with_ac(input, "/theme load", theme_load_ac, TRUE);
if (result != NULL) { if (result != NULL) {
return result; return result;
} }

View File

@ -822,7 +822,7 @@ cmd_theme(gchar **args, struct cmd_help_t help)
g_slist_free_full(themes, g_free); g_slist_free_full(themes, g_free);
// load a theme // load a theme
} else if (g_strcmp0(args[0], "set") == 0) { } else if (g_strcmp0(args[0], "load") == 0) {
if (args[1] == NULL) { if (args[1] == NULL) {
cons_show("Usage: %s", help.usage); cons_show("Usage: %s", help.usage);
} else if (theme_load(args[1])) { } else if (theme_load(args[1])) {