diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2017-06-01 21:02:33 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2017-06-25 16:35:27 +0200 |
commit | c395bc4aba99908ffe51294f4c29652a41644d6c (patch) | |
tree | f3da7362da76fbb824c02649b465e5095ee7408d /src/plugins | |
parent | b2373ffba7bbc13cc6eb2f365ec5badb6ff74d1a (diff) | |
download | weechat-c395bc4aba99908ffe51294f4c29652a41644d6c.zip |
fset: add keys alt-home and alt-end to go to first/last line
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/fset/fset-buffer.c | 4 | ||||
-rw-r--r-- | src/plugins/fset/fset-command.c | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/plugins/fset/fset-buffer.c b/src/plugins/fset/fset-buffer.c index bc3b92c23..ef1214da9 100644 --- a/src/plugins/fset/fset-buffer.c +++ b/src/plugins/fset/fset-buffer.c @@ -767,7 +767,9 @@ fset_buffer_set_callbacks () void fset_buffer_set_keys () { - char *keys[][2] = { { "meta- ", "toggle" }, + char *keys[][2] = { { "meta-meta2-1~", "go 0" }, + { "meta-meta2-4~", "go end" }, + { "meta- ", "toggle" }, { "meta--", "add -1" }, { "meta-+", "add 1" }, { "meta-fmeta-r", "reset" }, diff --git a/src/plugins/fset/fset-command.c b/src/plugins/fset/fset-command.c index 7bf1aa818..7262bf297 100644 --- a/src/plugins/fset/fset-command.c +++ b/src/plugins/fset/fset-command.c @@ -167,7 +167,10 @@ fset_command_fset (const void *pointer, void *data, { if (argc < 3) WEECHAT_COMMAND_ERROR; - value = fset_command_get_int_arg (argc, argv, 3, -1); + if (weechat_strcasecmp (argv[2], "end") == 0) + value = weechat_arraylist_size (fset_options) - 1; + else + value = fset_command_get_int_arg (argc, argv, 2, -1); if (value < 0) WEECHAT_COMMAND_ERROR; fset_buffer_set_current_line (value); @@ -498,7 +501,7 @@ fset_command_init () N_("-bar" " || -refresh" " || -up|-down [<number>]" - " || -go <line>" + " || -go <line>|end" " || -toggle" " || -add [<value>]" " || -reset" @@ -511,7 +514,8 @@ fset_command_init () "-refresh: force the refresh of the \"fset\" bar item\n" " -up: move the selected line up by \"number\" lines\n" " -down: move the selected line down by \"number\" lines\n" - " -go: select a line by number\n" + " -go: select a line by number, first line number is 0 " + "(\"end\" to select the last line)\n" " -toggle: toggle the boolean value\n" " -add: add \"value\", which can be a negative number " "(only for integers and colors)\n" |