mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 10:55:40 +00:00
fix(extui): write each message chunk pattern separately (#34188)
Problem: Bulking message lines to write in a single API call is
complicated and still not correct w.r.t. overwriting
highlights.
Solution: Write each chunk pattern separately with it's highlight
such that it will be spliced correctly for message chunks
that contain a carriage return. Go with correctness over
performance until this proves to be too inefficient.
Also add an identifying name to the various extui buffers.
This commit is contained in:
@@ -41,6 +41,7 @@ function M.tab_check_wins()
|
||||
for _, type in ipairs({ 'box', 'cmd', 'more', 'prompt' }) do
|
||||
if not api.nvim_buf_is_valid(M.bufs[type]) then
|
||||
M.bufs[type] = api.nvim_create_buf(false, true)
|
||||
api.nvim_buf_set_name(M.bufs[type], 'vim._extui.' .. type)
|
||||
if type == 'cmd' then
|
||||
-- Attach highlighter to the cmdline buffer.
|
||||
local parser = assert(vim.treesitter.get_parser(M.bufs.cmd, 'vim', {}))
|
||||
|
||||
Reference in New Issue
Block a user