From e0d92b9cc20b58179599f53dfa74ca821935a539 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 25 Apr 2024 04:15:58 -0700 Subject: 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 57adf8c6e01d, 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`. --- test/functional/lua/ui_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/lua/ui_spec.lua') diff --git a/test/functional/lua/ui_spec.lua b/test/functional/lua/ui_spec.lua index d69e893c96..3f5c051347 100644 --- a/test/functional/lua/ui_spec.lua +++ b/test/functional/lua/ui_spec.lua @@ -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 -- cgit