mirror of
https://github.com/zoriya/jj.nvim.git
synced 2026-08-15 23:53:18 +00:00
fix(cmd): Parse default commands through a json template to avoid manual parsing through regex (#137)
This commit is contained in:
+2
-2
@@ -1326,13 +1326,13 @@ function M.j(args)
|
||||
local cmd = nil
|
||||
if #args == 0 then
|
||||
local default_cmd_str, success = runner.execute(
|
||||
{ "jj", "config", "list", "ui.default-command" },
|
||||
{ "jj", "config", "list", "ui.default-command", "-T", 'json(value) ++ "\\n"' },
|
||||
"Error getting user's default command",
|
||||
nil,
|
||||
true
|
||||
)
|
||||
if success then
|
||||
cmd = parser.parse_default_cmd(default_cmd_str or "")
|
||||
cmd = parser.parse_json_command(default_cmd_str or "")
|
||||
end
|
||||
-- jj's built-in default command is "log"
|
||||
if cmd == nil then
|
||||
|
||||
Reference in New Issue
Block a user