Skip to content

Commit

Permalink
Fix invalid buffer error when trying to update while not open anymore (
Browse files Browse the repository at this point in the history
  • Loading branch information
bellini666 authored Oct 14, 2022
1 parent ef58661 commit ed09000
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lua/trouble/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ function Trouble.help()
end

local updater = util.debounce(100, function()
-- buff might have been closed during the debounce
if not is_open() then
util.debug("refresh: not open anymore")
return
end

util.debug("refresh: auto")
view:update({ auto = true })
end)
Expand Down

0 comments on commit ed09000

Please sign in to comment.