Feat: Rewrite diff module to allow for external dependencies as jj.nvim's diff tool (#74)

- Refactor diff into modular architecture (native, diffview, codediff)
- Add the possibility for users to define their own diff backend
- Support external diff tools like diffview.nvim codediff.nvim
- Enable visual mode selection to diff two changes in log buffer
- Add summary tooltip integration with terminal
- Update documentation with new diff workflows
This commit is contained in:
Nicolas GB
2026-01-25 09:39:31 -08:00
committed by GitHub
parent 8ed2aa52aa
commit 335663c3ee
14 changed files with 590 additions and 162 deletions
+4 -5
View File
@@ -378,19 +378,18 @@ function M.diff(opts)
return
end
local cmd = "jj diff"
local diff_module = require("jj.diff")
if opts and opts.current then
local file = vim.fn.expand("%:p")
if file and file ~= "" then
cmd = string.format("%s %s", cmd, vim.fn.fnameescape(file))
diff_module.diff_current({ path = file })
else
utils.notify("Current buffer is not a file", vim.log.levels.ERROR)
return
end
else
diff_module.show_revision({ rev = "@" })
end
terminal.run(cmd, M.terminal_keymaps())
end
-- Jujutsu rebase