Add configuration options to M.setup
This commit is contained in:
parent
497e3bf94a
commit
6e72a16f7b
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user