diff options
author | Tomasz N <przepompownia@users.noreply.github.com> | 2024-11-20 01:06:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-19 16:06:36 -0800 |
commit | f111c32ff9dc63f4db08a27089b666e8fdce3eaf (patch) | |
tree | d8da890a1dbce83447378f9f5297edd914566b04 | |
parent | 081beb3659bd6d8efc3e977a160b1e72becbd8a2 (diff) | |
download | rneovim-f111c32ff9dc63f4db08a27089b666e8fdce3eaf.tar.gz rneovim-f111c32ff9dc63f4db08a27089b666e8fdce3eaf.tar.bz2 rneovim-f111c32ff9dc63f4db08a27089b666e8fdce3eaf.zip |
fix(messages): no message kind for search pattern #31272
-rw-r--r-- | runtime/doc/ui.txt | 1 | ||||
-rw-r--r-- | src/nvim/search.c | 1 | ||||
-rw-r--r-- | test/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 index 4e8253c47a..9cbb84a19d 100644 --- 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 index debc5697d1..159ab35f6f 100644 --- 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 index 734877d262..ca936d482e 100644 --- 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() |