From dda6ddb1df4e0ef9c4182cf042cc244995f68b58 Mon Sep 17 00:00:00 2001 From: Hoang Nguyen Date: Mon, 12 Feb 2024 00:00:00 +0700 Subject: [PATCH] fix: hidden entries not showing up in the candidate list `include_hidden` variable was accessed out of scope. --- lua/cmp_async_path/init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/cmp_async_path/init.lua b/lua/cmp_async_path/init.lua index 6c80b1b..370bdb8 100644 --- a/lua/cmp_async_path/init.lua +++ b/lua/cmp_async_path/init.lua @@ -117,13 +117,13 @@ source._candidates = function(_, dirname, include_hidden, option, callback) end local work - work = assert(vim.loop.new_work(function(_entries, _dirname, + work = assert(vim.loop.new_work(function(_entries, _dirname, _include_hidden, label_trailing_slash, trailing_slash, file_kind, folder_kind) local items = {} local function create_item(name, fs_type) - if not (include_hidden or string.sub(name, 1, 1) ~= '.') then + if not (_include_hidden or string.sub(name, 1, 1) ~= '.') then return end @@ -189,7 +189,7 @@ source._candidates = function(_, dirname, include_hidden, option, callback) callback(nil, items) end)) - work:queue(entries, dirname, option.label_trailing_slash, + work:queue(entries, dirname, include_hidden, option.label_trailing_slash, option.trailing_slash, cmp.lsp.CompletionItemKind.File, cmp.lsp.CompletionItemKind.Folder)