From 21eadc9488dec5816f220aab16e6602b0bbe1440 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Tue, 17 Nov 2020 13:43:20 +0100 Subject: [PATCH] core: display an error when the buffer is not found with command /command -buffer --- ChangeLog.adoc | 1 + src/core/wee-command.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 2d77866a4..a907b4696 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -25,6 +25,7 @@ New features:: Bug fixes:: + * core: display an error when the buffer is not found with command /command -buffer * spell: fix refresh of bar item "spell_suggest" when the input becomes empty (issue #1586) [[v3.0]] diff --git a/src/core/wee-command.c b/src/core/wee-command.c index 40d05c94e..1c23062b0 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -1633,7 +1633,12 @@ COMMAND_CALLBACK(command) { ptr_buffer = gui_buffer_search_by_full_name (argv[2]); if (!ptr_buffer) - ptr_buffer = buffer; + { + gui_chat_printf (NULL, + _("%sError: buffer not found"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]); + return WEECHAT_RC_OK; + } index_args = 3; }