Compares current buffer against any git revision (default HEAD), opens result with full diffs.nvim syntax highlighting. Follows fugitive convention: :Gdiff/:Gvdiff open vertical split, :Ghdiff opens horizontal split.
19 lines
305 B
Lua
19 lines
305 B
Lua
local M = {}
|
|
|
|
local enabled = false
|
|
|
|
---@param val boolean
|
|
function M.set_enabled(val)
|
|
enabled = val
|
|
end
|
|
|
|
---@param msg string
|
|
---@param ... any
|
|
function M.dbg(msg, ...)
|
|
if not enabled then
|
|
return
|
|
end
|
|
vim.notify('[diffs.nvim]: ' .. string.format(msg, ...), vim.log.levels.DEBUG)
|
|
end
|
|
|
|
return M
|