mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +00:00
fix(api): re-route nvim_get_runtime_file errors
This allows nvim_get_runtime_file to be properly used via pcall
This commit is contained in:
@@ -23,6 +23,7 @@ local next_msg = helpers.next_msg
|
||||
local tmpname = helpers.tmpname
|
||||
local write_file = helpers.write_file
|
||||
local exec_lua = helpers.exec_lua
|
||||
local exc_exec = helpers.exc_exec
|
||||
|
||||
local pcall_err = helpers.pcall_err
|
||||
local format_string = helpers.format_string
|
||||
@@ -2240,6 +2241,14 @@ describe('API', function()
|
||||
|
||||
eq({}, meths.get_runtime_file("foobarlang/", true))
|
||||
end)
|
||||
it('can handle bad patterns', function()
|
||||
if helpers.pending_win32(pending) then return end
|
||||
|
||||
eq("Vim:E220: Missing }.", pcall_err(meths.get_runtime_file, "{", false))
|
||||
|
||||
eq('Vim(echo):E5555: API call: Vim:E220: Missing }.',
|
||||
exc_exec("echo nvim_get_runtime_file('{', v:false)"))
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('nvim_get_all_options_info', function()
|
||||
|
Reference in New Issue
Block a user