Skip to content

Commit

Permalink
Ensure ufo.detach is a function before calling it
Browse files Browse the repository at this point in the history
  • Loading branch information
CKolkey committed Oct 20, 2024
1 parent c41a654 commit 12fdc8c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lua/neogit/lib/buffer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,10 @@ function Buffer:show()
end)

-- Workaround UFO getting folds wrong.
local ufo, _ = pcall(require, "ufo")
if ufo then
require("ufo").detach(self.handle)
local ok, ufo = pcall(require, "ufo")
if ok and type(ufo.detach) == "function" then
logger.debug("[BUFFER:" .. self.handle .. "] Disabling UFO for buffer")
ufo.detach(self.handle)
end

self.win_handle = win
Expand Down

0 comments on commit 12fdc8c

Please sign in to comment.