From 87e47894e6f00af6bb744ef34837efe3f814b5d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Tue, 22 Aug 2023 09:21:00 +0200 Subject: [PATCH] script: adjust scroll after command `/script go N` --- ChangeLog.adoc | 1 + src/plugins/script/script-command.c | 29 +++++++++++++++-------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 4a191452a..124579317 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -22,6 +22,7 @@ Bug fixes:: * irc: fix wrong time displayed for CTCP messages received from self nick (issue #2000) * logger: remove trailing empty line in display of backlog (issue #2002) * perl: fix display of non-ASCII chars after load of a script with Perl >= 5.38 (issue #1996) + * script: adjust scroll after command `/script go N` * scripts: fix function string_parse_size on 32-bit systems (python and ruby) (issue #1999) * xfer: fix conversion of string to IPv4 on 32-bit systems (issue #1999) diff --git a/src/plugins/script/script-command.c b/src/plugins/script/script-command.c index 98aad22f4..0103d1e79 100644 --- a/src/plugins/script/script-command.c +++ b/src/plugins/script/script-command.c @@ -144,20 +144,6 @@ script_command_script (const void *pointer, void *data, return WEECHAT_RC_OK; } - if (weechat_strcmp (argv[1], "go") == 0) - { - if ((argc > 2) && script_buffer && !script_buffer_detail_script) - { - error = NULL; - value = strtol (argv[2], &error, 10); - if (error && !error[0]) - { - script_buffer_set_current_line (value); - } - } - return WEECHAT_RC_OK; - } - if (weechat_strcmp (argv[1], "search") == 0) { if (scripts_repo) @@ -216,6 +202,21 @@ script_command_script (const void *pointer, void *data, return WEECHAT_RC_OK; } + if (weechat_strcmp (argv[1], "go") == 0) + { + if ((argc > 2) && script_buffer && !script_buffer_detail_script) + { + error = NULL; + value = strtol (argv[2], &error, 10); + if (error && !error[0]) + { + script_buffer_set_current_line (value); + script_buffer_check_line_outside_window (); + } + } + return WEECHAT_RC_OK; + } + if (weechat_strcmp (argv[1], "up") == 0) { if (script_buffer)