aboutsummaryrefslogtreecommitdiff
path: root/core/file_io.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2020-06-10 11:43:05 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2020-06-10 11:43:05 -0400
commit1db240f243f6263dc2f85b9a65c0f9615e3c7cf9 (patch)
tree6a80d5253f869599c4107d3920182726e6498b28 /core/file_io.lua
parentb846a6fd96739eb87434562175e69c31169c77bc (diff)
downloadtextadept-1db240f243f6263dc2f85b9a65c0f9615e3c7cf9.tar.gz
textadept-1db240f243f6263dc2f85b9a65c0f9615e3c7cf9.zip
Replaced `lfs.dir_foreach()` with `lfs.walk()` generator.
Diffstat (limited to 'core/file_io.lua')
-rw-r--r--core/file_io.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/file_io.lua b/core/file_io.lua
index f90c51ab..99157cb0 100644
--- a/core/file_io.lua
+++ b/core/file_io.lua
@@ -426,10 +426,10 @@ function io.quick_open(paths, filter, opts)
assert_type(opts, 'table/nil', 3)
local utf8_list = {}
for i = 1, #paths do
- lfs.dir_foreach(paths[i], function(filename)
+ for filename in lfs.walk(paths[i], filter or lfs.default_filter) do
if #utf8_list >= io.quick_open_max then return false end
utf8_list[#utf8_list + 1] = filename:iconv('UTF-8', _CHARSET)
- end, filter or lfs.default_filter)
+ end
end
if #utf8_list >= io.quick_open_max then
ui.dialogs.msgbox{