Skip to content

Commit

Permalink
fix(#2624): open file from docked floating window (#2627)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-courtis authored Jan 14, 2024
1 parent b8c3a23 commit f24afa2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lua/nvim-tree/lib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function M.get_node_at_cursor()
return
end

local cursor = vim.api.nvim_win_get_cursor(view.get_winnr())
local cursor = vim.api.nvim_win_get_cursor(winnr)
local line = cursor[1]

if line == 1 and view.is_root_folder_visible(core.get_cwd()) then
Expand Down
2 changes: 1 addition & 1 deletion lua/nvim-tree/view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ end
function M.get_winnr(tabpage)
tabpage = tabpage or vim.api.nvim_get_current_tabpage()
local tabinfo = M.View.tabpages[tabpage]
if tabinfo ~= nil then
if tabinfo ~= nil and vim.api.nvim_win_is_valid(tabinfo.winnr) then
return tabinfo.winnr
end
end
Expand Down

0 comments on commit f24afa2

Please sign in to comment.