1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-30 06:46:38 +02:00

fset: add key alt-p on fset buffer, rename option fset.look.show_plugin_description to fset.look.show_plugins_desc

This commit is contained in:
Sébastien Helleu
2017-06-13 21:17:35 +02:00
parent cb929bcac1
commit c9460565b8
5 changed files with 34 additions and 39 deletions
+24 -21
View File
@@ -932,26 +932,29 @@ fset_buffer_set_callbacks ()
void
fset_buffer_set_keys ()
{
char *keys[][2] = { { "meta2-A", "up" },
{ "meta2-B", "down" },
{ "meta-meta2-1~", "go 0" },
{ "meta-meta2-4~", "go end" },
{ "meta2-23~", "left" },
{ "meta2-24~", "right" },
{ "meta- ", "toggle" },
{ "meta--", "add -1" },
{ "meta-+", "add 1" },
{ "meta-fmeta-r", "reset" },
{ "meta-fmeta-u", "unset" },
{ "meta-ctrl-J", "set" },
{ "meta-ctrl-M", "set" },
{ "meta-fmeta-a", "append" },
{ "meta-,", "mark 1" },
{ "meta2-a", "mark -1" },
{ "meta2-b", "mark 1" },
{ "meta-v", "toggle_bar" },
{ "ctrl-L", "refresh" },
{ NULL, NULL } };
char *keys[][2] = {
{ "meta2-A", "/fset -up" },
{ "meta2-B", "/fset -down" },
{ "meta-meta2-1~", "/fset -go 0" },
{ "meta-meta2-4~", "/fset -go end" },
{ "meta2-23~", "/fset -left" },
{ "meta2-24~", "/fset -right" },
{ "meta- ", "/fset -toggle" },
{ "meta--", "/fset -add -1" },
{ "meta-+", "/fset -add 1" },
{ "meta-fmeta-r", "/fset -reset" },
{ "meta-fmeta-u", "/fset -unset" },
{ "meta-ctrl-J", "/fset -set" },
{ "meta-ctrl-M", "/fset -set" },
{ "meta-fmeta-a", "/fset -append" },
{ "meta-,", "/fset -mark 1" },
{ "meta2-a", "/fset -mark -1" },
{ "meta2-b", "/fset -mark 1" },
{ "ctrl-L", "/fset -refresh" },
{ "meta-p", "/mute /set fset.look.show_plugins_desc toggle", },
{ "meta-v", "/mute /set fset.look.show_help_bar toggle" },
{ NULL, NULL },
};
char str_key[64], str_command[64];
int i;
@@ -960,7 +963,7 @@ fset_buffer_set_keys ()
if (weechat_config_boolean (fset_config_look_use_keys))
{
snprintf (str_key, sizeof (str_key), "key_bind_%s", keys[i][0]);
snprintf (str_command, sizeof (str_command), "/fset -%s", keys[i][1]);
snprintf (str_command, sizeof (str_command), "%s", keys[i][1]);
weechat_buffer_set (fset_buffer, str_key, str_command);
}
else
-9
View File
@@ -114,12 +114,6 @@ fset_command_fset (const void *pointer, void *data,
return WEECHAT_RC_OK;
}
if (weechat_strcasecmp (argv[1], "-toggle_bar") == 0)
{
weechat_config_option_set (fset_config_look_show_help_bar, "toggle", 1);
return WEECHAT_RC_OK;
}
if (weechat_strcasecmp (argv[1], "-refresh") == 0)
{
fset_option_get_options ();
@@ -519,7 +513,6 @@ fset_command_init ()
"fset",
N_("fast set WeeChat and plugins options"),
N_("-bar"
" || -toggle_bar"
" || -refresh"
" || -up|-down [<number>]"
" || -left|-right [<percent>]"
@@ -533,7 +526,6 @@ fset_command_init ()
" || -mark [<number>]"
" || filter"),
N_(" -bar: add the help bar\n"
"-toggle_bar: toggle the help bar\n"
" -refresh: refresh list of options, then whole screen "
"(command: /window refresh)\n"
" -up: move the selected line up by \"number\" lines\n"
@@ -673,7 +665,6 @@ fset_command_init ()
" show all integer options in irc plugin:\n"
" /fset c:${file} == irc && ${type} == int"),
"-bar"
" || -toggle_bar"
" || -refresh"
" || -up 1|2|3|4|5"
" || -down 1|2|3|4|5"
+8 -7
View File
@@ -39,7 +39,7 @@ struct t_config_option *fset_config_look_condition_catch_set;
struct t_config_option *fset_config_look_marked_string;
struct t_config_option *fset_config_look_scroll_horizontal;
struct t_config_option *fset_config_look_show_help_bar;
struct t_config_option *fset_config_look_show_plugin_description;
struct t_config_option *fset_config_look_show_plugins_desc;
struct t_config_option *fset_config_look_sort;
struct t_config_option *fset_config_look_unmarked_string;
struct t_config_option *fset_config_look_use_color_value;
@@ -109,12 +109,12 @@ fset_config_change_show_help_bar_cb (const void *pointer, void *data,
}
/*
* Callback for changes on option "fset.look.show_plugin_description".
* Callback for changes on option "fset.look.show_plugins_desc".
*/
void
fset_config_change_show_plugin_description_cb (const void *pointer, void *data,
struct t_config_option *option)
fset_config_change_show_plugins_desc_cb (const void *pointer, void *data,
struct t_config_option *option)
{
/* make C compiler happy */
(void) pointer;
@@ -124,6 +124,7 @@ fset_config_change_show_plugin_description_cb (const void *pointer, void *data,
if (fset_buffer)
{
fset_buffer_selected_line = 0;
fset_option_get_options ();
fset_buffer_refresh (1);
}
}
@@ -340,13 +341,13 @@ fset_config_init ()
NULL, NULL, NULL,
&fset_config_change_show_help_bar_cb, NULL, NULL,
NULL, NULL, NULL);
fset_config_look_show_plugin_description = weechat_config_new_option (
fset_config_look_show_plugins_desc = weechat_config_new_option (
fset_config_file, ptr_section,
"show_plugin_description", "boolean",
"show_plugins_desc", "boolean",
N_("show the plugin description options (plugins.desc.*)"),
NULL, 0, 0, "off", NULL, 0,
NULL, NULL, NULL,
&fset_config_change_show_plugin_description_cb, NULL, NULL,
&fset_config_change_show_plugins_desc_cb, NULL, NULL,
NULL, NULL, NULL);
fset_config_look_sort = weechat_config_new_option (
fset_config_file, ptr_section,
+1 -1
View File
@@ -29,7 +29,7 @@ extern struct t_config_option *fset_config_look_condition_catch_set;
extern struct t_config_option *fset_config_look_marked_string;
extern struct t_config_option *fset_config_look_scroll_horizontal;
extern struct t_config_option *fset_config_look_show_help_bar;
extern struct t_config_option *fset_config_look_show_plugin_description;
extern struct t_config_option *fset_config_look_show_plugins_desc;
extern struct t_config_option *fset_config_look_sort;
extern struct t_config_option *fset_config_look_unmarked_string;
extern struct t_config_option *fset_config_look_use_color_value;
+1 -1
View File
@@ -228,7 +228,7 @@ fset_option_match_filters (struct t_fset_option *fset_option)
int match;
char *result;
if (!weechat_config_boolean (fset_config_look_show_plugin_description)
if (!weechat_config_boolean (fset_config_look_show_plugins_desc)
&& (strcmp (fset_option->file, "plugins") == 0)
&& (strcmp (fset_option->section, "desc") == 0))
{