neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit f111c32ff9dc63f4db08a27089b666e8fdce3eaf
parent 081beb3659bd6d8efc3e977a160b1e72becbd8a2
Author: Tomasz N <przepompownia@users.noreply.github.com>
Date:   Wed, 20 Nov 2024 01:06:36 +0100

fix(messages): no message kind for search pattern #31272


Diffstat:
Mruntime/doc/ui.txt | 1+
Msrc/nvim/search.c | 1+
Mtest/functional/ui/messages_spec.lua | 12++++++++++++
3 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/runtime/doc/ui.txt b/runtime/doc/ui.txt @@ -800,6 +800,7 @@ must handle. "rpc_error" Error response from |rpcrequest()| "return_prompt" |press-enter| prompt after a multiple messages "quickfix" Quickfix navigation message + "search_cmd" Entered search command "search_count" Search count message ("S" flag of 'shortmess') "wmsg" Warning ("search hit BOTTOM", |W10|, …) New kinds may be added in the future; clients should treat unknown diff --git a/src/nvim/search.c b/src/nvim/search.c @@ -1203,6 +1203,7 @@ int do_search(oparg_T *oap, int dirc, int search_delim, char *pat, size_t patlen // Compute msg_row early. msg_start(); + msg_ext_set_kind("search_cmd"); // Get the offset, so we know how long it is. if (!cmd_silent diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua @@ -1140,6 +1140,18 @@ stack traceback: exec_lua([[vim.print({ foo = "bar" })]]) screen:expect_unchanged() end) + + it('emits single message for normal search)', function() + feed('ax<cr>x<esc>?x<cr>') + screen:expect({ + messages = { + { + content = { { '?x ' } }, + kind = 'search_cmd', + }, + }, + }) + end) end) describe('ui/builtin messages', function()