mirror of
https://github.com/weechat/weechat.git
synced 2026-07-04 22:05:42 +02:00
script: add key alt+L to reload script, allow input on script buffer for actions on script, add option script.look.use_keys
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -39,6 +39,7 @@ extern int script_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
|
||||
const char *input_data);
|
||||
extern int script_buffer_close_cb (void *data, struct t_gui_buffer *buffer);
|
||||
extern void script_buffer_set_callbacks ();
|
||||
extern void script_buffer_set_keys ();
|
||||
extern void script_buffer_open ();
|
||||
|
||||
#endif /* __WEECHAT_SCRIPT_BUFFER_H */
|
||||
|
||||
@@ -256,20 +256,22 @@ script_command_init ()
|
||||
" | installed\n"
|
||||
" popular script\n\n"
|
||||
"Keys on script buffer:\n"
|
||||
" alt+i install script\n"
|
||||
" alt+r remove script\n"
|
||||
" alt+l load script\n"
|
||||
" alt+u unload script\n"
|
||||
" alt+h (un)hold script\n\n"
|
||||
" alt+i install script\n"
|
||||
" alt+r remove script\n"
|
||||
" alt+l load script\n"
|
||||
" alt+L reload script\n"
|
||||
" alt+u unload script\n"
|
||||
" alt+h (un)hold script\n\n"
|
||||
"Input allowed on script buffer:\n"
|
||||
" q close buffer\n"
|
||||
" r refresh buffer\n"
|
||||
" s:x,y sort buffer using keys x and y (see /help "
|
||||
" i/r/l/L/u/h action on script (same as keys above)\n"
|
||||
" q close buffer\n"
|
||||
" $ refresh buffer\n"
|
||||
" s:x,y sort buffer using keys x and y (see /help "
|
||||
"script.look.sort)\n"
|
||||
" s: reset sort (use default sort)\n"
|
||||
" word(s) filter scripts: search word(s) in "
|
||||
" s: reset sort (use default sort)\n"
|
||||
" word(s) filter scripts: search word(s) in "
|
||||
"scripts (description, tags, ...)\n"
|
||||
" * remove filter\n\n"
|
||||
" * remove filter\n\n"
|
||||
"Examples:\n"
|
||||
" /script search url\n"
|
||||
" /script install iset.pl buffers.pl\n"
|
||||
|
||||
@@ -42,6 +42,7 @@ struct t_config_section *script_config_section_scripts = NULL;
|
||||
struct t_config_option *script_config_look_columns;
|
||||
struct t_config_option *script_config_look_sort;
|
||||
struct t_config_option *script_config_look_translate_description;
|
||||
struct t_config_option *script_config_look_use_keys;
|
||||
|
||||
/* script config, color section */
|
||||
|
||||
@@ -191,6 +192,22 @@ script_config_reload_scripts_cb (void *data, struct t_config_option *option)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* script_config_change_use_keys_cb: callback called when option "use_keys" is
|
||||
* changed
|
||||
*/
|
||||
|
||||
void
|
||||
script_config_change_use_keys_cb (void *data, struct t_config_option *option)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) option;
|
||||
|
||||
if (script_buffer)
|
||||
script_buffer_set_keys ();
|
||||
}
|
||||
|
||||
/*
|
||||
* script_config_change_hold_cb: callback called when list of scripts to "hold"
|
||||
* is changed
|
||||
@@ -359,6 +376,14 @@ script_config_init ()
|
||||
"your language, otherwise english version is used)"),
|
||||
NULL, 0, 0, "on", NULL, 0,
|
||||
NULL, NULL, &script_config_reload_scripts_cb, NULL, NULL, NULL);
|
||||
script_config_look_use_keys = weechat_config_new_option (
|
||||
script_config_file, ptr_section,
|
||||
"use_keys", "boolean",
|
||||
N_("use keys alt+X in script buffer to do actions on scripts (alt+i = "
|
||||
"install, alt+r = remove, ...); if disabled, only the input is "
|
||||
"allowed: i, r, ..."),
|
||||
NULL, 0, 0, "on", NULL, 0,
|
||||
NULL, NULL, &script_config_change_use_keys_cb, NULL, NULL, NULL);
|
||||
|
||||
/* color */
|
||||
ptr_section = weechat_config_new_section (script_config_file, "color",
|
||||
|
||||
@@ -27,6 +27,7 @@ struct t_repo_script;
|
||||
extern struct t_config_option *script_config_look_columns;
|
||||
extern struct t_config_option *script_config_look_sort;
|
||||
extern struct t_config_option *script_config_look_translate_description;
|
||||
extern struct t_config_option *script_config_look_use_keys;
|
||||
|
||||
extern struct t_config_option *script_config_color_status_popular;
|
||||
extern struct t_config_option *script_config_color_status_installed;
|
||||
|
||||
Reference in New Issue
Block a user