mirror of
https://github.com/neovim/neovim.git
synced 2025-12-09 16:12:48 +00:00
fix(vim.ui)!: change open() to return pcall-like values #28502
Problem:
`vim.ui.open` unnecessarily invents a different success/failure
convention. Its return type was changed in 57adf8c6e0, so we might as
well change it to have a more conventional form.
Solution:
Change the signature to use the `pcall` convention of `status, result`.
This commit is contained in:
@@ -144,7 +144,7 @@ describe('vim.ui', function()
|
||||
end
|
||||
if not is_os('bsd') then
|
||||
local rv =
|
||||
exec_lua [[local cmd = vim.ui.open('non-existent-file'); return cmd:wait(100).code]]
|
||||
exec_lua [[local _, cmd = vim.ui.open('non-existent-file'); return cmd:wait(100).code]]
|
||||
ok(type(rv) == 'number' and rv ~= 0, 'nonzero exit code', rv)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user