mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 09:12:07 +00:00
feat(api): add err field to nvim_echo() opts
Problem: We want to deprecate `nvim_err_write(ln)()` but there is no obvious replacement (from Lua). Meanwhile we already have `nvim_echo()` with an `opts` argument. Solution: Add `err` argument to `nvim_echo()` that directly maps to `:echoerr`.
This commit is contained in:
@@ -3680,6 +3680,30 @@ describe('API', function()
|
||||
async_meths.nvim_echo({ { 'msg\nmsg' }, { 'msg' } }, false, {})
|
||||
eq('', exec_capture('messages'))
|
||||
end)
|
||||
|
||||
it('can print error message', function()
|
||||
async_meths.nvim_echo({ { 'Error\nMessage' } }, false, { err = true })
|
||||
screen:expect([[
|
||||
|
|
||||
{1:~ }|*3
|
||||
{3: }|
|
||||
{9:Error} |
|
||||
{9:Message} |
|
||||
{6:Press ENTER or type command to continue}^ |
|
||||
]])
|
||||
feed(':messages<CR>')
|
||||
screen:expect([[
|
||||
^ |
|
||||
{1:~ }|*6
|
||||
|
|
||||
]])
|
||||
async_meths.nvim_echo({ { 'Error' }, { 'Message', 'Special' } }, false, { err = true })
|
||||
screen:expect([[
|
||||
^ |
|
||||
{1:~ }|*6
|
||||
{9:Error}{16:Message} |
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('nvim_open_term', function()
|
||||
|
Reference in New Issue
Block a user