Skip to content

Commit

Permalink
fix: clear saved position when lazy loading folder, fixes #111
Browse files Browse the repository at this point in the history
  • Loading branch information
cseickel committed Mar 1, 2022
1 parent 4882115 commit 0fd7201
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/neo-tree/sources/filesystem/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,10 @@ M.toggle_directory = function(state, node)
end
state.explicitly_opened_directories = state.explicitly_opened_directories or {}
if node.loaded == false then
state.explicitly_opened_directories[node:get_id()] = true
fs_scan.get_items_async(state, node.id, true)
local id = node:get_id()
state.explicitly_opened_directories[id] = true
renderer.position.set(state, nil)
fs_scan.get_items_async(state, id, true)
elseif node:has_children() then
local updated = false
if node:is_expanded() then
Expand Down

0 comments on commit 0fd7201

Please sign in to comment.