Skip to content

Commit

Permalink
fix(nvim-tree): fix crash if winid is nil (#258)
Browse files Browse the repository at this point in the history
winid might be nil if view.float.enable = true inside of nvim-tree

Co-authored-by: Josef Filzmaier <[email protected]>
  • Loading branch information
joseffilzmaier and Josef Filzmaier authored Dec 16, 2024
1 parent c7bfb69 commit fccbdfa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/fidget/integration/nvim-tree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ require("fidget.options").declare(M, "integration.nvim-tree", M.options, functio
local function resize()
if win.options.relative == "editor" then
local winid = api.tree.winid()
if winid == nil then
return
end
local col = vim.api.nvim_win_get_position(winid)[2]
if col > 1 then
local width = vim.api.nvim_win_get_width(winid)
Expand Down

0 comments on commit fccbdfa

Please sign in to comment.