diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2024-04-25 04:15:58 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-25 04:15:58 -0700 |
commit | e0d92b9cc20b58179599f53dfa74ca821935a539 (patch) | |
tree | 29c8f5c83f2c2935c87036f7a57ff806354b4ec4 /test/functional/lua/ui_spec.lua | |
parent | a1c2da56ecef9c7a0e17be02f587d7c7f9eee170 (diff) | |
download | rneovim-e0d92b9cc20b58179599f53dfa74ca821935a539.tar.gz rneovim-e0d92b9cc20b58179599f53dfa74ca821935a539.tar.bz2 rneovim-e0d92b9cc20b58179599f53dfa74ca821935a539.zip |
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`.
Diffstat (limited to 'test/functional/lua/ui_spec.lua')
-rw-r--r-- | test/functional/lua/ui_spec.lua | 2 |
1 files changed, 1 insertions, 1 deletions
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 |