fix(notify): Expected 3 arguments error (#13905)

This commit is contained in:
notomo
2021-02-09 19:41:02 +09:00
committed by GitHub
parent 8becdec391
commit 971e0ca903
2 changed files with 5 additions and 2 deletions

View File

@@ -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

View File

@@ -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>")