refactor(runtime): always use DIP_START when searching for runtime files

Now remove the addition of "start/*" packages in 'packpath' as
explicit items in 'runtimepath'. This avoids 'runtimepath' from becoming
very long when using a lot of plugins as packages.

To get the effective search path as a list, use |nvim_list_runtime_paths()|
This commit is contained in:
Björn Linse
2021-09-11 16:20:59 +02:00
parent 8ef2b56cac
commit 396280d303
11 changed files with 63 additions and 112 deletions

View File

@@ -1591,7 +1591,10 @@ describe('API', function()
eq({'a', '', 'b'}, meths.list_runtime_paths())
meths.set_option('runtimepath', ',a,b')
eq({'', 'a', 'b'}, meths.list_runtime_paths())
-- trailing , is ignored, use ,, if you really really want $CWD
meths.set_option('runtimepath', 'a,b,')
eq({'a', 'b'}, meths.list_runtime_paths())
meths.set_option('runtimepath', 'a,b,,')
eq({'a', 'b', ''}, meths.list_runtime_paths())
end)
it('truncates too long paths', function()
@@ -2012,8 +2015,13 @@ describe('API', function()
ok(endswith(val[1], p"autoload/remote/define.vim")
or endswith(val[1], p"autoload/remote/host.vim"))
eq({}, meths.get_runtime_file("lua", true))
eq({}, meths.get_runtime_file("lua/vim", true))
val = meths.get_runtime_file("lua", true)
eq(1, #val)
ok(endswith(val[1], p"lua"))
val = meths.get_runtime_file("lua/vim", true)
eq(1, #val)
ok(endswith(val[1], p"lua/vim"))
end)
it('can find directories', function()