From 9b6459184c96e183ca840c9a9855f672056a30da Mon Sep 17 00:00:00 2001 From: Chris Seickel Date: Thu, 3 Mar 2022 00:51:42 +0000 Subject: [PATCH] fix(file): avoid plenary max results in filter, fixes #157 --- lua/neo-tree/sources/filesystem/lib/filter_external.lua | 6 +++++- lua/neo-tree/sources/filesystem/lib/fs_scan.lua | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lua/neo-tree/sources/filesystem/lib/filter_external.lua b/lua/neo-tree/sources/filesystem/lib/filter_external.lua index 5860bed6..59d2f489 100644 --- a/lua/neo-tree/sources/filesystem/lib/filter_external.lua +++ b/lua/neo-tree/sources/filesystem/lib/filter_external.lua @@ -120,13 +120,17 @@ M.find_files = function(opts) end end + local maximum_results = limit or 100 + if fd_supports_max_results then + maximum_results = nil + end Job :new({ command = cmd, cwd = path, args = args, enable_recording = false, - maximum_results = limit or 100, + maximum_results = maximum_results, on_stdout = function(err, line) if opts.on_insert then opts.on_insert(err, line) diff --git a/lua/neo-tree/sources/filesystem/lib/fs_scan.lua b/lua/neo-tree/sources/filesystem/lib/fs_scan.lua index 1aed17ac..8aee4b08 100644 --- a/lua/neo-tree/sources/filesystem/lib/fs_scan.lua +++ b/lua/neo-tree/sources/filesystem/lib/fs_scan.lua @@ -114,8 +114,8 @@ M.get_items_async = function(state, parent_id, path_to_reveal, callback) find_args = state.find_args, find_by_full_path_words = state.find_by_full_path_words, on_insert = function(err, path) - if err and #err > 0 then - log.error(err, path) + if err then + log.debug(err) else file_items.create_item(context, path) end