From d5bfe352459362c4ffc8426ad00622f0f97ecc97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Wed, 12 Nov 2025 07:12:00 +0100 Subject: [PATCH] core: display an error if parameters are missing or if the buffer is not with "free content" in command `/window scroll_horiz` --- src/core/core-command.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/core/core-command.c b/src/core/core-command.c index d48cbf6ca..061c20e98 100644 --- a/src/core/core-command.c +++ b/src/core/core-command.c @@ -8035,11 +8035,10 @@ COMMAND_CALLBACK(window) /* horizontal scroll in window (for buffers with free content) */ if (string_strcmp (argv[1], "scroll_horiz") == 0) { - if ((argc > win_args) - && (ptr_win->buffer->type == GUI_BUFFER_TYPE_FREE)) - { - gui_window_scroll_horiz (ptr_win, argv[win_args]); - } + COMMAND_MIN_ARGS(win_args + 1, argv[1]); + if (ptr_win->buffer->type != GUI_BUFFER_TYPE_FREE) + COMMAND_ERROR; + gui_window_scroll_horiz (ptr_win, argv[win_args]); return WEECHAT_RC_OK; }