diff options
| author | luukvbaal <luukvbaal@gmail.com> | 2025-05-26 16:25:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-26 16:25:45 +0200 |
| commit | c973c7ae6f5670f00f1054123cae81c6b767a3c8 (patch) | |
| tree | eb0c5c209d04019aa734874470dee78c822b496d /runtime/lua/vim/_extui/shared.lua | |
| parent | a6e2c2234741d25fbff7fc1b6ecca1a2a86bf01c (diff) | |
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.
Diffstat (limited to 'runtime/lua/vim/_extui/shared.lua')
| -rw-r--r-- | runtime/lua/vim/_extui/shared.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/runtime/lua/vim/_extui/shared.lua b/runtime/lua/vim/_extui/shared.lua index b50c9baf5f..9821e761a7 100644 --- a/runtime/lua/vim/_extui/shared.lua +++ b/runtime/lua/vim/_extui/shared.lua @@ -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', {})) |
