feat(api): deprecate nvim_out/err_write(ln)

This commit is contained in:
Luuk van Baal
2025-01-07 16:38:29 +01:00
parent ead5683ff9
commit 5c92b40b4b
9 changed files with 98 additions and 133 deletions

View File

@@ -702,14 +702,14 @@ local wait_result_reason = { [-1] = 'timeout', [-2] = 'interrupted', [-3] = 'err
---
--- @param ... string List to write to the buffer
local function err_message(...)
local message = table.concat(vim.iter({ ... }):flatten():totable())
local chunks = { { table.concat({ ... }) } }
if vim.in_fast_event() then
vim.schedule(function()
api.nvim_err_writeln(message)
vim.api.nvim_echo(chunks, true, { err = true })
api.nvim_command('redraw')
end)
else
api.nvim_err_writeln(message)
vim.api.nvim_echo(chunks, true, { err = true })
api.nvim_command('redraw')
end
end