From 3c82ce0d625184a90e6b2dda96e38fcb44f901d2 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Sun, 26 Mar 2023 12:46:24 +0100 Subject: refactor(loader): use vim.fs --- runtime/lua/vim/loader.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'runtime/lua/vim/loader.lua') diff --git a/runtime/lua/vim/loader.lua b/runtime/lua/vim/loader.lua index 41d5579664..bafe766a5d 100644 --- a/runtime/lua/vim/loader.lua +++ b/runtime/lua/vim/loader.lua @@ -450,12 +450,7 @@ function Loader.lsmod(path) if not Loader._indexed[path] then local start = uv.hrtime() Loader._indexed[path] = {} - local handle = vim.loop.fs_scandir(path .. '/lua') - while handle do - local name, t = vim.loop.fs_scandir_next(handle) - if not name then - break - end + for name, t in vim.fs.dir(path .. '/lua') do local modpath = path .. '/lua/' .. name -- HACK: type is not always returned due to a bug in luv t = t or uv.fs_stat(modpath).type -- cgit