mirror of
https://github.com/zoriya/jj.nvim.git
synced 2026-08-15 15:43:22 +00:00
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:
+4
-5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user