Skip to content

Commit 758ff6a

Browse files
committed
refactor: prefer vim.fs.find over plenary.scandir
1 parent 0d45de8 commit 758ff6a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lua/telescope/builtin/__internal.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,11 @@ internal.symbols = function(opts)
290290
end
291291
end)()
292292
if data_path:exists() then
293-
for _, v in ipairs(require("plenary.scandir").scan_dir(data_path:absolute(), { search_pattern = "%.json$" })) do
293+
for _, v in
294+
ipairs(vim.fs.find(function(name, _)
295+
return name:match "%.json$"
296+
end, { path = data_path:absolute(), limit = math.huge, type = "file" }))
297+
do
294298
table.insert(files, v)
295299
end
296300
end

plugin/telescope.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ vim.keymap.set(
100100
"c",
101101
"<Plug>(TelescopeFuzzyCommandSearch)",
102102
"<C-\\>e \"lua require('telescope.builtin').command_history "
103-
.. '{ default_text = [=[" . escape(getcmdline(), \'"\') . "]=] }"<CR><CR>',
103+
.. '{ default_text = [=[" . escape(getcmdline(), \'"\') . "]=] }"<CR><CR>',
104104
{ silent = true, noremap = true }
105105
)
106106

0 commit comments

Comments
 (0)