We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 205184a commit fee76c0Copy full SHA for fee76c0
lua/neo-tree/ui/renderer.lua
@@ -881,7 +881,13 @@ create_window = function(state)
881
-- why is this necessary?
882
vim.api.nvim_set_current_win(win.winid)
883
elseif state.current_position == "current" then
884
- local winid = vim.api.nvim_get_current_win()
+ -- state.id is always the window id or tabnr that this state was created for
885
+ -- in the case of a position = current state object, it will be the window id
886
+ local winid = state.id
887
+ if not vim.api.nvim_win_is_valid(winid) then
888
+ log.warn("Window ", winid, " is no longer valid!")
889
+ return
890
+ end
891
local bufnr = vim.fn.bufnr(bufname)
892
if bufnr < 1 then
893
bufnr = vim.api.nvim_create_buf(false, false)
0 commit comments