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
+7
View File
@@ -3,6 +3,7 @@ local cmd = require("jj.cmd")
local picker = require("jj.picker")
local editor = require("jj.ui.editor")
local terminal = require("jj.ui.terminal")
local diff = require("jj.diff")
--- Jujutsu plugin configuration
--- @class jj.Config
@@ -10,6 +11,7 @@ local terminal = require("jj.ui.terminal")
--- @field picker? jj.picker.config Options for picker module
--- @field terminal? jj.ui.terminal.opts Options for the terminal
--- @field highlights? jj.highlights Options for the highlights
--- @field diff? jj.diff.config Options for the diff module
--- @class jj.highlights
--- @field editor? jj.ui.editor.highlights Highlight configuration for describe buffer
@@ -29,6 +31,10 @@ M.config = {
targeted = { fg = "#5a9e6f", ctermfg = "Green" },
},
},
diff = {
backend = "native",
backends = {},
},
}
--- Setup the plugin
@@ -41,6 +47,7 @@ function M.setup(opts)
editor.setup({ highlights = M.config.highlights.editor })
cmd.setup(opts and opts.cmd or {})
terminal.setup(opts and opts.terminal or {})
diff.setup(M.config.diff)
cmd.register_command()
end