Closed ptn closed 2 months ago
There's a way to invoke actions directly via lua: https://github.com/NeogitOrg/neogit/blob/master/lua/neogit.lua#L118-L169
Just as an example, here's the rhs of a binding to open the current file:
function()
require("neogit").action("log", "log_current", { "--", vim.fn.expand("%") })()
end
That doesn't open the popup though, it gives me the log view. The popup is helpful because it summarizes all options possible, I sometimes want to pass -S, or -G, or disable -g... anything.
Magit offers this. From my todo.org file, pressing <leader>gl
in Emacs gives:
Notice how --
is already provided, and I'm then free to add any switches I fancy. Can this be implemented?
Is your feature request related to a problem? Please describe. I frequently want to do
git log
for the current file only and also pass in the-S
switch. This at the moment requires me to do:l
--
-S
l
again.It'd be much easier to do all that from the file in question, with some switches filled in for me.
Describe the solution you'd like I would like to be able to do
:Neogit log -- %
and the log popup opens with--
pre-populated to the current buffer. If in visual mode, then:Neogit log
opens with-L
(trace line evolution) correctly populated.In general, a way to invoke any popup like so
:Neogit $popup -X -Y -Zvalue
prepopulates the switches passed.Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context Add any other context or screenshots about the feature request here.