mirror of
https://github.com/zoriya/telescope.nvim.git
synced 2026-08-16 02:45:09 +00:00
fix: Reduce memory leaks (#148)
It is not 100% clear that we've gotten ALL the memory leaks, but it seems much much much better and doesn't look like it's going to die immediately or as often anymore :)
This commit is contained in:
@@ -14,8 +14,8 @@ make_entry.types = {
|
||||
|
||||
local transform_devicons
|
||||
if has_devicons then
|
||||
transform_devicons = function(filename, display, opts)
|
||||
if opts.disable_devicons or not filename then
|
||||
transform_devicons = function(filename, display, disable_devicons)
|
||||
if disable_devicons or not filename then
|
||||
return display
|
||||
end
|
||||
|
||||
@@ -43,17 +43,20 @@ function make_entry.gen_from_string()
|
||||
end
|
||||
|
||||
function make_entry.gen_from_file(opts)
|
||||
-- local opts = vim.deepcopy(init_opts or {})
|
||||
opts = opts or {}
|
||||
|
||||
local cwd = vim.fn.expand(opts.cwd or vim.fn.getcwd())
|
||||
local disable_devicons = opts.disable_devicons
|
||||
local shorten_path = opts.shorten_path
|
||||
|
||||
local make_display = function(line)
|
||||
local display = line
|
||||
if opts.shorten_path then
|
||||
if shorten_path then
|
||||
display = utils.path_shorten(line)
|
||||
end
|
||||
|
||||
display = transform_devicons(line, display, opts)
|
||||
display = transform_devicons(line, display, disable_devicons)
|
||||
|
||||
return display
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user