File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -38,14 +38,25 @@ local test = function()
3838 })
3939end
4040
41+ local dedup = function (paths )
42+ table.sort (paths , function (a , b ) return # a < # b end )
43+ local res = {}
44+ for _ , path in ipairs (paths ) do
45+ if not vim .iter (res ):any (function (p ) return vim .fs .relpath (p , path ) end ) then
46+ res [# res + 1 ] = path
47+ end
48+ end
49+ return res
50+ end
51+
4152--- @return string[]
4253local get_rtp = function ()
4354 --- @type string[]
4455 local rtp = vim .opt .runtimepath :get ()
4556 -- If using lazy.nvim, get all the lazy loaded plugin paths (#1296)
4657 local lazy = package.loaded [' lazy.core.util' ]
4758 if lazy and lazy .get_unloaded_rtp then vim .list_extend (rtp , (lazy .get_unloaded_rtp (' ' ))) end
48- return rtp
59+ return dedup ( rtp )
4960end
5061
5162local _ = {}
You can’t perform that action at this time.
0 commit comments