Idea/feature request to expose cursor position in actions' opts
#2438
Closed
nguyenvukhang
started this conversation in
Ideas
Replies: 1 comment 6 replies
-
|
['enter'] = {
fn = function(s, o)
local e = vim.split(io.open(s[1], 'r'):read("*a"), o.fzf_opts['--read0'] and '\0' or '\n')
local fzf_pos = tonumber(s[2])
e[#e] = nil
o.copen = false
fa.file_sel_to_qf(e, o)
fa.file_edit({e[fzf_pos]}, o)
end,
prefix = 'select-all',
field_index = "{+f} $FZF_POS",
}, |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to have an
actionwhere after I type my grep query, upon pressing enter, all the entries that are still shown goes to the quickfix list and I jump to the location that my cursor was on.This snippet gets me 90% of the way there, except that it jumps to the first entry, not the selected entry. Currently, to the best of my knowledge, there is no exposed API to obtain the last selected line (
FZF_POSof sorts), fromselectedandopts. My current solution is to fork with this diff:And I was wondering if this is useful enough to consider (after tidying up to a suitable location) merging to master or if there's a more idiomatic way to go about doing this. Thanks!
Edit Here's my eventual solution for this, one that doesn't involve an extra file io:
Beta Was this translation helpful? Give feedback.
All reactions