Replies: 2 comments 12 replies
-
It's an incompatibility between the 2 addons. Snacks explorer is a floating window and it seems that fzf-lua doesn't focus on the file opened when it is called from a floating window (I'm just guessing here). Snacks picker can handle this (probably because they were created to interact with each other). You can try the following configuration to achieve what you want (not sure if there's a better way) return {
{
"ibhagwan/fzf-lua",
opts = function(_, opts)
opts.files.actions["enter"] = function(selected, fopts)
local path = require("fzf-lua.path")
local entry = path.entry_to_file(selected[1], fopts, false)
require("fzf-lua.actions").file_edit(selected, fopts)
local bufnr = vim.fn.bufnr(entry.path)
local wins = vim.fn.win_findbuf(bufnr)
local winid = wins[1]
if winid then
vim.api.nvim_set_current_win(winid)
end
end
end,
},
} |
Beta Was this translation helpful? Give feedback.
1 reply
-
Most likely the problem is here: snacks.nvim/lua/snacks/win.lua Lines 832 to 839 in bc0630e |
Beta Was this translation helpful? Give feedback.
11 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.
-
Sometimes I have the explorer focused but I use something like fzf-lua to navigate. It will open the file in a new buffer but my cursor will still be in the explorer. I tried a few auto cmds but I can't seem to figure out which event is relevant in this case.
Here's a video of what I mean. After I select the new file in fzf-lua the focused buffer is still the explorer.
WindowsTerminal_dz1KewI7pg.mp4
This also happens sometimes when I use something like
:e path/to/file:row:col
. It will open the file but since the buffer is not selected it won't move to the row/col. Again, only happens when the explorer is the currently focused buffer.I'm usign the LazyVIm distro so I'm not entirely sure if that's an issue with LazyVim or just the snacks explorer.
Beta Was this translation helpful? Give feedback.
All reactions