mirror of
https://github.com/zoriya/flake.git
synced 2026-08-15 18:43:42 +00:00
Implement jj log file
This commit is contained in:
+13
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user