diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-15 20:28:13 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-15 20:28:13 +0200 |
| commit | 17e319a4455f3135ed3cc759dee8ba5034fde75b (patch) | |
| tree | 6d07c1875ae2736a5f3eb026a243328ab5c73fca /.config/nvim/lua/fs.lua | |
| parent | 346854ff3ea83202de7437f01f1c1c336f4c3edf (diff) | |
Diffstat (limited to '.config/nvim/lua/fs.lua')
| -rw-r--r-- | .config/nvim/lua/fs.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/.config/nvim/lua/fs.lua b/.config/nvim/lua/fs.lua new file mode 100644 index 0000000..2b215ef --- /dev/null +++ b/.config/nvim/lua/fs.lua @@ -0,0 +1,13 @@ +return { + iterdir = function(path) + local dir = vim.uv.fs_opendir(path) + return function() + local next = vim.uv.fs_readdir(dir) + if (next == nil) then + vim.uv.fs_closedir(dir) + return nil + end + return next[1] + end + end +} |