diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2023-08-22 09:24:06 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2023-08-22 09:24:06 +0200 |
commit | 763e8bd3a0ea6fceb8ecf773f1dbc145cddf1282 (patch) | |
tree | 33a3210c8344b6411c6dd5820a1799dd47e3a5b7 /src/plugins/script | |
parent | 6950c953a1d2c88cfda4ea9966634faf6b7c99c4 (diff) | |
download | weechat-763e8bd3a0ea6fceb8ecf773f1dbc145cddf1282.zip |
script: allow jump to the last script with command `/script go end`
Diffstat (limited to 'src/plugins/script')
-rw-r--r-- | src/plugins/script/script-command.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/plugins/script/script-command.c b/src/plugins/script/script-command.c index ef9804afb..483f92268 100644 --- a/src/plugins/script/script-command.c +++ b/src/plugins/script/script-command.c @@ -206,11 +206,21 @@ script_command_script (const void *pointer, void *data, { if ((argc > 2) && script_buffer && !script_buffer_detail_script) { - error = NULL; - value = strtol (argv[2], &error, 10); - if (error && !error[0]) + line = -1; + if (weechat_strcmp (argv[2], "end") == 0) { - script_buffer_set_current_line (value); + line = script_repo_count_displayed - 1; + } + else + { + error = NULL; + value = strtol (argv[2], &error, 10); + if (error && !error[0]) + line = value; + } + if (line >= 0) + { + script_buffer_set_current_line (line); script_buffer_check_line_outside_window (); } } |