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

This commit is contained in:
Tomasz N
2024-11-20 01:06:36 +01:00
committed by GitHub
parent 081beb3659
commit f111c32ff9
3 changed files with 14 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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()