From 7df7e9faf142c66ab054cbfb86a34d20db806fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 10 Jun 2017 13:58:32 +0200 Subject: [PATCH] fset: add key ctrl-L and input "<<" and ">>" on fset buffer --- src/plugins/fset/fset-buffer.c | 5 +++- src/plugins/fset/fset-command.c | 53 +++++++++++++++++++-------------- 2 files changed, 35 insertions(+), 23 deletions(-) diff --git a/src/plugins/fset/fset-buffer.c b/src/plugins/fset/fset-buffer.c index 379a65d19..ccf505b08 100644 --- a/src/plugins/fset/fset-buffer.c +++ b/src/plugins/fset/fset-buffer.c @@ -805,7 +805,9 @@ fset_buffer_input_cb (const void *pointer, void *data, struct t_gui_buffer *buffer, const char *input_data) { - char *actions[][2] = { { "<", "left" }, + char *actions[][2] = { { "<<", "go 0" }, + { ">>", "go end" }, + { "<", "left" }, { ">", "right" }, { "t", "toggle" }, { "-", "add -1" }, @@ -948,6 +950,7 @@ fset_buffer_set_keys () { "meta2-a", "mark -1" }, { "meta2-b", "mark 1" }, { "meta-v", "toggle_bar" }, + { "ctrl-L", "refresh" }, { NULL, NULL } }; char str_key[64], str_command[64]; int i; diff --git a/src/plugins/fset/fset-command.c b/src/plugins/fset/fset-command.c index f76d476e7..90670111a 100644 --- a/src/plugins/fset/fset-command.c +++ b/src/plugins/fset/fset-command.c @@ -122,7 +122,9 @@ fset_command_fset (const void *pointer, void *data, if (weechat_strcasecmp (argv[1], "-refresh") == 0) { - fset_bar_item_update (); + fset_option_get_options (); + fset_buffer_refresh (0); + weechat_command (NULL, "/window refresh"); return WEECHAT_RC_OK; } @@ -532,7 +534,8 @@ fset_command_init () " || filter"), N_(" -bar: add the help bar\n" "-toggle_bar: toggle the help bar\n" - " -refresh: force the refresh of the \"fset\" bar item\n" + " -refresh: refresh list of options, then whole screen " + "(command: /window refresh)\n" " -up: move the selected line up by \"number\" lines\n" " -down: move the selected line down by \"number\" lines\n" " -left: scroll the fset buffer by \"percent\" of width " @@ -618,29 +621,35 @@ fset_command_init () " - same names prefixed by two underscores, for example: " "${__name}, ${__type}, ...\n" "\n" - "Keys to move in on fset buffer:\n" - " up/down move one line up/down\n" - " pgup/pgdn move one page up/down\n" - " alt-home/alt-end move to first/last line\n" - " F11/F12 scroll horizontally on the left/right\n" + "Keys and input to move in on fset buffer:\n" + " up move one line up\n" + " down move one line down\n" + " pgup move one page up\n" + " pgdn move one page down\n" + " alt-home << move to first line\n" + " alt-end >> move to last line\n" + " F11 < scroll horizontally on the left\n" + " F12 > scroll horizontally on the right\n" "\n" "Keys and input to set options on fset buffer:\n" - " alt+space t toggle boolean value\n" - " alt+'-' - subtract 1 from value (integer/color)\n" - " alt+'+' + add 1 to value (integer/color)\n" - " alt+f, alt+r r reset value\n" - " alt+f, alt+u u unset value\n" - " alt+enter s set value\n" - " alt+f, alt+a a append to value\n" - " alt+',' , mark/unmark option and move one line down\n" - " shift+down mark/unmark option and move one line down\n" - " shift+up mark/unmark option and move one line up\n" + " alt+space t toggle boolean value\n" + " alt+'-' - subtract 1 from value (integer/color)\n" + " alt+'+' + add 1 to value (integer/color)\n" + " alt+f, alt+r r reset value\n" + " alt+f, alt+u u unset value\n" + " alt+enter s set value\n" + " alt+f, alt+a a append to value\n" + " alt+',' , mark/unmark option and move one line down\n" + " shift+down mark/unmark option and move one line down\n" + " shift+up mark/unmark option and move one line up\n" "\n" - "Other input on fset buffer:\n" - " $ refresh options (keep marked options)\n" - " $$ refresh options (unmark all options)\n" - " v toggle help bar\n" - " q close fset buffer\n" + "Other keys and input on fset buffer:\n" + " ctrl+L refresh options and whole screen " + "(command: /fset -refresh)\n" + " $ refresh options (keep marked options)\n" + " $$ refresh options (unmark all options)\n" + " v toggle help bar\n" + " q close fset buffer\n" "\n" "Mouse actions on fset buffer:\n" " wheel up/down move line up/down\n"