An update of fzf-lua (slightly) broke my nested fzf-lua custom function #2591
-
|
I have used a keybinding like this for a long time now: vim.keymap.set('n', '<leader>sG', function()
fzf.files({
cwd = '~',
cmd = [[fd --color=never --hidden --type d --type l --follow --exclude .git]],
previewer = nil,
preview = {
type = 'cmd',
fn = function(selected)
local relative_path = fzf.path.entry_to_file(selected[1], {}, false).path
local path = vim.fs.joinpath('~', relative_path)
return string.format('tree -C -L 1 %s', path)
end,
},
prompt = 'Directories❯ ',
actions = {
["enter"] = function(selected)
local relative_path = fzf.path.entry_to_file(selected[1], {}, false).path
local path = vim.fs.joinpath('~', relative_path)
fzf.live_grep({
cwd = path,
})
end,
},
})
end, { desc = '[G]rep in chosen directory' })
(Note: This is just copy pasted from my setup, I don't think This allows me to search for a folder within which I then start grepping. It used to work perfectly other than the This broken behavior hasn't really annoyed me enough to actually look into what broke the script (since it still works - just with some annoyances), but I thought I might as well ask here, if someone has any idea if I can easily update my script to work correctly again? (The biggest annoyance is that it doesn't enter the inner command in insert mode.) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Set
I cannot reproduce in the latest nightly or 0.11.6. |
Beta Was this translation helpful? Give feedback.
Set
previewer=falsecan fix this.I cannot reproduce in the latest nightly or 0.11.6.