Implement jj log file

This commit is contained in:
2026-03-06 19:12:03 +01:00
parent 1605483e50
commit c745d61bc8
2 changed files with 14 additions and 2 deletions
+13 -2
View File
@@ -11,9 +11,13 @@ local function jj_cwd(opts, ctx)
return cwd
end
Snacks.picker.jj_log = function()
Snacks.picker.jj_log = function(file)
local title = "jj log"
if file then
title = "jj log file"
end
Snacks.picker.pick({
title = 'jj log',
title = title,
supports_live = false,
finder = function(opts, ctx)
local cwd = jj_cwd(opts, ctx)
@@ -45,6 +49,9 @@ Snacks.picker.jj_log = function()
if opts.reversed then
table.insert(args, '--reversed')
end
if file then
table.insert(args, file)
end
vim.list_extend(args, opts.args or {})
return require('snacks.picker.source.proc').proc(
ctx:opts({
@@ -115,6 +122,10 @@ Snacks.picker.jj_log = function()
})
end
Snacks.picker.jj_log_file = function()
Snacks.picker.jj_log(vim.fn.expand("%:p"))
end
Snacks.picker.jj_show = function(ref)
local title = "jj status"
if ref ~= nil and ref ~= "@" then