Skip to content

Commit

Permalink
fix: restore ability to have separate trees for each tab (#1056)
Browse files Browse the repository at this point in the history
fixes #1053
  • Loading branch information
cseickel authored Jul 14, 2023
1 parent 78d2616 commit d73859f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lua/neo-tree/ui/windows.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
local locations = {}

local get_location = function(location)
local loc = locations[location]
local tab = vim.api.nvim_get_current_tabpage()
if not locations[tab] then
locations[tab] = {}
end
local loc = locations[tab][location]
if loc then
if loc.winid ~= 0 then
-- verify the window before we return it
Expand All @@ -16,9 +20,8 @@ local get_location = function(location)
name = location,
winid = 0,
}
locations[location] = loc
locations[tab][location] = loc
return loc
end

local M = { get_location = get_location }
return M
return { get_location = get_location }

0 comments on commit d73859f

Please sign in to comment.