diff --git a/lua/jj_mini_diff/init.lua b/lua/jj_mini_diff/init.lua index ff4e973..fd61f5a 100644 --- a/lua/jj_mini_diff/init.lua +++ b/lua/jj_mini_diff/init.lua @@ -2,6 +2,16 @@ local M = {} +-- Default configuration +local config = { + signs = { + add = { text = "│", texthl = "JjDiffAdd", numhl = "JjDiffAdd" }, + change = { text = "│", texthl = "JjDiffChange", numhl = "JjDiffChange" }, + delete = { text = "─", texthl = "JjDiffDelete", numhl = "JjDiffDelete" }, + }, + autocmd_events = { "BufReadPost", "BufWritePost", "CursorHold" }, +} + -- Helper function to run jj commands local function _run_jj_command(args) local cmd = "jj " .. table.concat(args, " ") @@ -19,9 +29,9 @@ end -- Define Neovim signs for diff local function _define_signs() - vim.fn.sign_define("JjDiffAdd", { text = "│", texthl = "JjDiffAdd", numhl = "JjDiffAdd" }) - vim.fn.sign_define("JjDiffChange", { text = "│", texthl = "JjDiffChange", numhl = "JjDiffChange" }) - vim.fn.sign_define("JjDiffDelete", { text = "─", texthl = "JjDiffDelete", numhl = "JjDiffDelete" }) + vim.fn.sign_define("JjDiffAdd", config.signs.add) + vim.fn.sign_define("JjDiffChange", config.signs.change) + vim.fn.sign_define("JjDiffDelete", config.signs.delete) end -- Get jj diff output for the current buffer