diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2020-04-24 22:39:02 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2020-04-24 22:39:44 +0200 |
commit | 916c22a3d03b0060d4c0d764eaaefa3df37785c9 (patch) | |
tree | c51cdee3b8685076539cca71f3d0705c466bb7c0 /src/plugins/buflist | |
parent | 6e18f31cb2285b05b457beba47895e4cba07b78d (diff) | |
download | weechat-916c22a3d03b0060d4c0d764eaaefa3df37785c9.zip |
buflist: add options enable/disable/toggle in command /buflist
Diffstat (limited to 'src/plugins/buflist')
-rw-r--r-- | src/plugins/buflist/buflist-command.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/plugins/buflist/buflist-command.c b/src/plugins/buflist/buflist-command.c index 951e0f76e..3c83fff75 100644 --- a/src/plugins/buflist/buflist-command.c +++ b/src/plugins/buflist/buflist-command.c @@ -25,6 +25,7 @@ #include "buflist.h" #include "buflist-bar-item.h" #include "buflist-command.h" +#include "buflist-config.h" /* @@ -45,6 +46,24 @@ buflist_command_buflist (const void *pointer, void *data, if (argc == 1) return WEECHAT_RC_OK; + if (weechat_strcasecmp (argv[1], "enable") == 0) + { + weechat_config_option_set (buflist_config_look_enabled, "on", 1); + return WEECHAT_RC_OK; + } + + if (weechat_strcasecmp (argv[1], "disable") == 0) + { + weechat_config_option_set (buflist_config_look_enabled, "off", 1); + return WEECHAT_RC_OK; + } + + if (weechat_strcasecmp (argv[1], "toggle") == 0) + { + weechat_config_option_set (buflist_config_look_enabled, "toggle", 1); + return WEECHAT_RC_OK; + } + if (weechat_strcasecmp (argv[1], "bar") == 0) { buflist_add_bar (); @@ -70,8 +89,11 @@ buflist_command_init () weechat_hook_command ( "buflist", N_("bar item with list of buffers"), - "bar || refresh", - N_(" bar: add the \"buflist\" bar\n" + "enable|disable|toggle || bar || refresh", + N_(" enable: enable buflist\n" + "disable: disable buflist\n" + " toggle: toggle buflist\n" + " bar: add the \"buflist\" bar\n" "refresh: force the refresh of the bar items (buflist, buflist2 " "and buflist3)\n" "\n" @@ -147,6 +169,6 @@ buflist_command_init () "\"private\" or \"highlight\"\n" " - ${format_lag}: the lag for an IRC server buffer, empty if " "there's no lag (evaluation of option buflist.format.lag)"), - "bar || refresh", + "enable|disable|toggle || bar || refresh", &buflist_command_buflist, NULL, NULL); } |