Skip to content

Commit

Permalink
fix: safely check mini.diff, check if tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
bassamsdata committed Sep 13, 2024
1 parent 77dff08 commit bf1c10e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lua/codecompanion/strategies/inline/miniDiff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ local M = {}
local original_buffer_content = {} -- Store the original buffer content
local codecompanion_buffers = {} -- Store which buffers are using CodeCompanion source
local revert_timers = {} -- Store timers for reverting to Git source
local MiniDiff
local ok, err = pcall(function()
MiniDiff = require("mini.diff")
end)
local log = require("codecompanion.utils.log")
local ok, MiniDiff = pcall(require, "mini.diff")
if not ok then
vim.notify("Failed to load mini.diff: " .. err, vim.log.levels.WARN)
return log:error("Failed to load mini.diff: ", vim.log.levels.WARN)
end
local git_source = MiniDiff.gen_source.git()
local log = require("codecompanion.utils.log")

---@param buf_id number
---@return boolean Whether
Expand Down

0 comments on commit bf1c10e

Please sign in to comment.