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:
Lewis Russell
2021-12-16 11:40:23 +00:00
parent 238b944e58
commit d512be55a2
2 changed files with 15 additions and 2 deletions

View File

@@ -497,8 +497,12 @@ ArrayOf(String) nvim_get_runtime_file(String name, Boolean all, Error *err)
int flags = DIP_DIRFILE | (all ? DIP_ALL : 0);
do_in_runtimepath((char_u *)(name.size ? name.data : ""),
flags, find_runtime_cb, &rv);
TRY_WRAP({
try_start();
do_in_runtimepath((char_u *)(name.size ? name.data : ""),
flags, find_runtime_cb, &rv);
try_end(err);
});
return rv;
}