mirror of
https://github.com/zoriya/jj.nvim.git
synced 2026-08-15 23:53:18 +00:00
fix(describe): Allow for empty descriptions in the editor
This commit is contained in:
@@ -19,11 +19,6 @@ local default_describe_opts = {
|
|||||||
--- @param revset? string The revision to describe
|
--- @param revset? string The revision to describe
|
||||||
--- @param sync? boolean Whether to execute command synchronously
|
--- @param sync? boolean Whether to execute command synchronously
|
||||||
local function execute_describe(description, revset, sync)
|
local function execute_describe(description, revset, sync)
|
||||||
if not description or description == "" then
|
|
||||||
utils.notify("Description cannot be empty", vim.log.levels.ERROR)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local cmd = "jj describe"
|
local cmd = "jj describe"
|
||||||
if revset then
|
if revset then
|
||||||
cmd = cmd .. " -r " .. revset
|
cmd = cmd .. " -r " .. revset
|
||||||
@@ -95,8 +90,7 @@ function M.describe(description, revset, opts, on_close)
|
|||||||
editor.open_editor(text, function(buf_lines)
|
editor.open_editor(text, function(buf_lines)
|
||||||
local trimmed_description = utils.extract_description_from_describe(buf_lines)
|
local trimmed_description = utils.extract_description_from_describe(buf_lines)
|
||||||
if not trimmed_description then
|
if not trimmed_description then
|
||||||
-- If nothing is provide simply exit
|
trimmed_description = ""
|
||||||
return
|
|
||||||
end
|
end
|
||||||
execute_describe(trimmed_description, revset, true)
|
execute_describe(trimmed_description, revset, true)
|
||||||
-- Once editing is done, reopen the log if we came from there
|
-- Once editing is done, reopen the log if we came from there
|
||||||
|
|||||||
Reference in New Issue
Block a user