mirror of
https://github.com/neovim/neovim.git
synced 2025-12-09 16:12:48 +00:00
API: include invalid buffer/window/tabpage in error message (#11712)
This commit is contained in:
@@ -39,7 +39,7 @@ describe('luaeval(vim.api.…)', function()
|
||||
eq({false, 'Argument "pos" must be a [row, col] array'},
|
||||
funcs.luaeval('{pcall(vim.api.nvim_win_set_cursor, 0, {1, 2, 3})}'))
|
||||
-- Used to produce a memory leak due to a bug in nvim_win_set_cursor
|
||||
eq({false, 'Invalid window id'},
|
||||
eq({false, 'Invalid window id: -1'},
|
||||
funcs.luaeval('{pcall(vim.api.nvim_win_set_cursor, -1, {1, 2, 3})}'))
|
||||
end)
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ describe(':lua command', function()
|
||||
pcall_err(command, 'lua ()'))
|
||||
eq([[Vim(lua):E5108: Error executing lua [string ":lua"]:1: TEST]],
|
||||
exc_exec('lua error("TEST")'))
|
||||
eq([[Vim(lua):E5108: Error executing lua [string ":lua"]:1: Invalid buffer id]],
|
||||
eq([[Vim(lua):E5108: Error executing lua [string ":lua"]:1: Invalid buffer id: -10]],
|
||||
exc_exec('lua vim.api.nvim_buf_set_lines(-10, 1, 1, false, {"TEST"})'))
|
||||
eq({''}, curbufmeths.get_lines(0, 100, false))
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user