diff --git a/lua/jj_mini_diff/init.lua b/lua/jj_mini_diff/init.lua index 4b0336a..0a261e8 100644 --- a/lua/jj_mini_diff/init.lua +++ b/lua/jj_mini_diff/init.lua @@ -24,6 +24,21 @@ local function _define_signs() vim.fn.sign_define("JjDiffDelete", { text = "─", texthl = "JjDiffDelete", numhl = "JjDiffDelete" }) end +-- Get jj diff output for the current buffer +local function _get_jj_diff_for_buffer() + local file_path = vim.api.nvim_buf_get_name(0) + if file_path == "" then + return nil, "Current buffer is not associated with a file." + end + + -- Run 'jj diff' for the specific file + local diff_output, err = _run_jj_command({ "diff", "--color=never", file_path }) + if err then + return nil, err + end + return diff_output +end + function M.setup(opts) opts = opts or {} _define_signs() -- Call to define signs