+15
-2
lines changedFilter options
+15
-2
lines changed Original file line number Diff line number Diff line change
@@ -497,8 +497,12 @@ ArrayOf(String) nvim_get_runtime_file(String name, Boolean all, Error *err)
497
497
498
498
int flags = DIP_DIRFILE | (all ? DIP_ALL : 0);
499
499
500
-
do_in_runtimepath((char_u *)(name.size ? name.data : ""),
501
-
flags, find_runtime_cb, &rv);
500
+
TRY_WRAP({
501
+
try_start();
502
+
do_in_runtimepath((char_u *)(name.size ? name.data : ""),
503
+
flags, find_runtime_cb, &rv);
504
+
try_end(err);
505
+
});
502
506
return rv;
503
507
}
504
508
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ local next_msg = helpers.next_msg
23
23
local tmpname = helpers.tmpname
24
24
local write_file = helpers.write_file
25
25
local exec_lua = helpers.exec_lua
26
+
local exc_exec = helpers.exc_exec
26
27
27
28
local pcall_err = helpers.pcall_err
28
29
local format_string = helpers.format_string
@@ -2240,6 +2241,14 @@ describe('API', function()
2240
2241
2241
2242
eq({}, meths.get_runtime_file("foobarlang/", true))
2242
2243
end)
2244
+
it('can handle bad patterns', function()
2245
+
if helpers.pending_win32(pending) then return end
2246
+
2247
+
eq("Vim:E220: Missing }.", pcall_err(meths.get_runtime_file, "{", false))
2248
+
2249
+
eq('Vim(echo):E5555: API call: Vim:E220: Missing }.',
2250
+
exc_exec("echo nvim_get_runtime_file('{', v:false)"))
2251
+
end)
2243
2252
end)
2244
2253
2245
2254
describe('nvim_get_all_options_info', function()
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4