mirror of
https://github.com/harivansh-afk/forge.nvim.git
synced 2026-04-15 07:04:47 +00:00
ci: format
This commit is contained in:
parent
5fcbcfcf99
commit
c9d271c7a6
3 changed files with 89 additions and 22 deletions
|
|
@ -19,9 +19,26 @@ local DEFAULTS = {
|
|||
},
|
||||
},
|
||||
picker_keys = {
|
||||
pr = { checkout = 'default', diff = 'ctrl-d', worktree = 'ctrl-w', checks = 'ctrl-t', browse = 'ctrl-x', manage = 'ctrl-e', create = 'ctrl-a', toggle = 'ctrl-o', refresh = 'ctrl-r' },
|
||||
pr = {
|
||||
checkout = 'default',
|
||||
diff = 'ctrl-d',
|
||||
worktree = 'ctrl-w',
|
||||
checks = 'ctrl-t',
|
||||
browse = 'ctrl-x',
|
||||
manage = 'ctrl-e',
|
||||
create = 'ctrl-a',
|
||||
toggle = 'ctrl-o',
|
||||
refresh = 'ctrl-r',
|
||||
},
|
||||
issue = { browse = 'default', close_reopen = 'ctrl-s', toggle = 'ctrl-o', refresh = 'ctrl-r' },
|
||||
checks = { log = 'default', browse = 'ctrl-x', failed = 'ctrl-f', passed = 'ctrl-p', running = 'ctrl-n', all = 'ctrl-a' },
|
||||
checks = {
|
||||
log = 'default',
|
||||
browse = 'ctrl-x',
|
||||
failed = 'ctrl-f',
|
||||
passed = 'ctrl-p',
|
||||
running = 'ctrl-n',
|
||||
all = 'ctrl-a',
|
||||
},
|
||||
ci = { log = 'default', browse = 'ctrl-x', refresh = 'ctrl-r' },
|
||||
commits = { checkout = 'default', diff = 'ctrl-d', browse = 'ctrl-x', yank = 'ctrl-y' },
|
||||
branches = { diff = 'ctrl-d', browse = 'ctrl-x' },
|
||||
|
|
@ -547,7 +564,12 @@ function M.format_check(check)
|
|||
end
|
||||
end
|
||||
end
|
||||
return ('%s%s\27[0m %s \27[2m%s\27[0m'):format(color, icon, pad_or_truncate(name, widths.name), elapsed)
|
||||
return ('%s%s\27[0m %s \27[2m%s\27[0m'):format(
|
||||
color,
|
||||
icon,
|
||||
pad_or_truncate(name, widths.name),
|
||||
elapsed
|
||||
)
|
||||
end
|
||||
|
||||
---@param run forge.CIRun
|
||||
|
|
|
|||
|
|
@ -134,16 +134,23 @@ local function pr_actions(f, num)
|
|||
local wt_path = vim.fs.normalize(root .. '/../' .. branch)
|
||||
forge_mod.log_now(('fetching %s #%s into worktree...'):format(kind, num))
|
||||
vim.system(fetch_cmd, { text = true }, function()
|
||||
vim.system({ 'git', 'worktree', 'add', wt_path, branch }, { text = true }, function(result)
|
||||
vim.schedule(function()
|
||||
if result.code == 0 then
|
||||
vim.notify(('[forge]: worktree at %s'):format(wt_path))
|
||||
else
|
||||
vim.notify('[forge]: ' .. cmd_error(result, 'worktree failed'), vim.log.levels.ERROR)
|
||||
end
|
||||
vim.cmd.redraw()
|
||||
end)
|
||||
end)
|
||||
vim.system(
|
||||
{ 'git', 'worktree', 'add', wt_path, branch },
|
||||
{ text = true },
|
||||
function(result)
|
||||
vim.schedule(function()
|
||||
if result.code == 0 then
|
||||
vim.notify(('[forge]: worktree at %s'):format(wt_path))
|
||||
else
|
||||
vim.notify(
|
||||
'[forge]: ' .. cmd_error(result, 'worktree failed'),
|
||||
vim.log.levels.ERROR
|
||||
)
|
||||
end
|
||||
vim.cmd.redraw()
|
||||
end)
|
||||
end
|
||||
)
|
||||
end)
|
||||
end,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue