Skip to content

Commit

Permalink
fix(view): check if trouble win is still valid in OptionSet. Fixes #400
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed May 30, 2024
1 parent c0755d5 commit e9fae8c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lua/trouble/view/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,11 @@ function M:on_mount()
if not this then
return true
end
local foldlevel = vim.wo[this.win.win].foldlevel
if foldlevel ~= this.renderer.foldlevel then
this:fold_level({ level = foldlevel })
if this.win:valid() then
local foldlevel = vim.wo[this.win.win].foldlevel
if foldlevel ~= this.renderer.foldlevel then
this:fold_level({ level = foldlevel })
end
end
end, { pattern = "foldlevel", buffer = false })

Expand Down

0 comments on commit e9fae8c

Please sign in to comment.