mirror of
https://github.com/zoriya/jj.nvim.git
synced 2026-08-05 02:36:07 +00:00
Change the :J describe behaviour to open an editable buffer instead of an input box (#6)
Co-authored-by: fautore <fautore@protonmail.com>
This commit is contained in:
+17
-1
@@ -1,6 +1,7 @@
|
||||
local M = {}
|
||||
local cmd = require("jj.cmd")
|
||||
local picker = require("jj.picker")
|
||||
local utils = require("jj.utils")
|
||||
|
||||
--- Jujutsu plugin configuration
|
||||
--- @class jj.Config
|
||||
@@ -10,6 +11,15 @@ M.config = {
|
||||
picker = {
|
||||
snacks = {},
|
||||
},
|
||||
--- @type jj.utils.highlights Highlight configuration for describe buffer
|
||||
highlights = {
|
||||
added = { fg = "#3fb950", ctermfg = "Green" },
|
||||
modified = { fg = "#56d4dd", ctermfg = "Cyan" },
|
||||
deleted = { fg = "#f85149", ctermfg = "Red" },
|
||||
renamed = { fg = "#d29922", ctermfg = "Yellow" },
|
||||
},
|
||||
--- @type string Editor mode for describe command: "buffer" (Git-style editor) or "input" (simple input prompt)
|
||||
describe_editor = "buffer",
|
||||
}
|
||||
|
||||
--- Setup the plugin
|
||||
@@ -17,7 +27,13 @@ M.config = {
|
||||
function M.setup(opts)
|
||||
M.config = vim.tbl_deep_extend("force", M.config, opts or {})
|
||||
|
||||
picker.setup(opts.picker)
|
||||
picker.setup(opts and opts.picker or {})
|
||||
utils.setup({ highlights = M.config.highlights })
|
||||
|
||||
-- Pass describe_editor config to cmd module
|
||||
if opts and opts.describe_editor then
|
||||
cmd.config.describe_editor = opts.describe_editor
|
||||
end
|
||||
|
||||
cmd.register_command()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user