diff options
-rw-r--r-- | core/file_io.lua | 2 | ||||
-rw-r--r-- | test/test.lua | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/core/file_io.lua b/core/file_io.lua index 71dd5af3..09446139 100644 --- a/core/file_io.lua +++ b/core/file_io.lua @@ -419,7 +419,7 @@ function io.quick_open(paths, filter, opts) local utf8_list = {} for i = 1, #paths do for filename in lfs.walk(paths[i], filter or lfs.default_filter) do - if #utf8_list >= io.quick_open_max then return false end + if #utf8_list >= io.quick_open_max then break end utf8_list[#utf8_list + 1] = filename:iconv('UTF-8', _CHARSET) end end diff --git a/test/test.lua b/test/test.lua index 270aaa7b..7cdbf350 100644 --- a/test/test.lua +++ b/test/test.lua @@ -540,6 +540,12 @@ function test_file_io_quick_open_interactive() assert(buffer.filename:find('%.lua$'), '.lua file filter did not work') buffer:close() end + local quick_open_max = io.quick_open_max + io.quick_open_max = 10 + io.quick_open(_HOME) + assert(#_BUFFERS > num_buffers, 'File limit exceeded notification did not occur') + buffer:close() + io.quick_open_max = quick_open_max -- restore lfs.chdir(cwd) assert_raises(function() io.quick_open(1) end, 'string/table/nil expected, got number') |