mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
fix(notify): Expected 3 arguments error (#13905)
This commit is contained in:
@@ -500,7 +500,7 @@ function vim.notify(msg, log_level, _opts)
|
|||||||
if log_level == vim.log.levels.ERROR then
|
if log_level == vim.log.levels.ERROR then
|
||||||
vim.api.nvim_err_writeln(msg)
|
vim.api.nvim_err_writeln(msg)
|
||||||
else
|
else
|
||||||
vim.api.nvim_echo(msg)
|
vim.api.nvim_echo({{msg}}, true, {})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@ -476,6 +476,10 @@ describe('API', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
describe('nvim_notify', function()
|
describe('nvim_notify', function()
|
||||||
|
it('can notify a info message', function()
|
||||||
|
nvim("notify", "hello world", 2, {})
|
||||||
|
end)
|
||||||
|
|
||||||
it('can be overriden', function()
|
it('can be overriden', function()
|
||||||
command("lua vim.notify = function(...) return 42 end")
|
command("lua vim.notify = function(...) return 42 end")
|
||||||
eq(42, meths.exec_lua("return vim.notify('Hello world')", {}))
|
eq(42, meths.exec_lua("return vim.notify('Hello world')", {}))
|
||||||
@@ -483,7 +487,6 @@ describe('API', function()
|
|||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
describe('nvim_input', function()
|
describe('nvim_input', function()
|
||||||
it("VimL error: does NOT fail, updates v:errmsg", function()
|
it("VimL error: does NOT fail, updates v:errmsg", function()
|
||||||
local status, _ = pcall(nvim, "input", ":call bogus_fn()<CR>")
|
local status, _ = pcall(nvim, "input", ":call bogus_fn()<CR>")
|
||||||
|
Reference in New Issue
Block a user