fix: multiple find-file triggered at the same time duplicates files
This commit is contained in:
@@ -15,8 +15,11 @@ local function get_index_offset()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local running = {}
|
||||||
|
|
||||||
function M.fn(fname)
|
function M.fn(fname)
|
||||||
if not TreeExplorer then return end
|
if running[fname] or not TreeExplorer then return end
|
||||||
|
running[fname] = true
|
||||||
|
|
||||||
local i = get_index_offset()
|
local i = get_index_offset()
|
||||||
local tree_altered = false
|
local tree_altered = false
|
||||||
@@ -61,6 +64,7 @@ function M.fn(fname)
|
|||||||
if index and view.is_visible() then
|
if index and view.is_visible() then
|
||||||
view.set_cursor({index, 0})
|
view.set_cursor({index, 0})
|
||||||
end
|
end
|
||||||
|
running[fname] = false
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|||||||
Reference in New Issue
Block a user