diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-10-17 18:35:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-17 18:35:53 +0200 |
commit | 8f9f127274fb5e715645f88fe8e76f4a7ca8ca10 (patch) | |
tree | 7671de084d06fddc7bd8d66f03d369ab85b9a6b7 /src/nvim/api/vim.c | |
parent | a1e8199fff098e158e22e25abc20c512575c1c53 (diff) | |
parent | ea2023f689ad8f368faad6e52c85fbc9762a7296 (diff) | |
download | rneovim-8f9f127274fb5e715645f88fe8e76f4a7ca8ca10.tar.gz rneovim-8f9f127274fb5e715645f88fe8e76f4a7ca8ca10.tar.bz2 rneovim-8f9f127274fb5e715645f88fe8e76f4a7ca8ca10.zip |
Merge pull request #15973 from bfredl/luapath
fix(runtime): don't use regexes inside lua require'mod'
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r-- | src/nvim/api/vim.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 44552bcb26..847e142939 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -756,6 +756,11 @@ ArrayOf(String) nvim_list_runtime_paths(Error *err) return nvim_get_runtime_file(NULL_STRING, true, err); } +Array nvim__runtime_inspect(void) +{ + return runtime_inspect(); +} + /// Find files in runtime directories /// /// 'name' can contain wildcards. For example @@ -794,6 +799,25 @@ String nvim__get_lib_dir(void) return cstr_as_string(get_lib_dir()); } +/// Find files in runtime directories +/// +/// @param pat pattern of files to search for +/// @param all whether to return all matches or only the first +/// @param options +/// is_lua: only search lua subdirs +/// @return list of absolute paths to the found files +ArrayOf(String) nvim__get_runtime(Array pat, Boolean all, Dict(runtime) *opts, Error *err) + FUNC_API_SINCE(8) + FUNC_API_FAST +{ + bool is_lua = api_object_to_bool(opts->is_lua, "is_lua", false, err); + if (ERROR_SET(err)) { + return (Array)ARRAY_DICT_INIT; + } + return runtime_get_named(is_lua, pat, all); +} + + /// Changes the global working directory. /// /// @param dir Directory path |