mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-05 03:08:13 +00:00
fix(picker.actions): don't reuse_win in floating windows (like the picker preview)
This commit is contained in:
parent
5e3af693bd
commit
4b9ea98007
1 changed files with 7 additions and 2 deletions
|
@ -90,8 +90,13 @@ function M.jump(picker, _, action)
|
||||||
|
|
||||||
-- use an existing window if possible
|
-- use an existing window if possible
|
||||||
if cmd == "buffer" and #items == 1 and picker.opts.jump.reuse_win and buf ~= current_buf then
|
if cmd == "buffer" and #items == 1 and picker.opts.jump.reuse_win and buf ~= current_buf then
|
||||||
win = vim.fn.win_findbuf(buf)[1] or win
|
for _, w in ipairs(vim.fn.win_findbuf(buf)) do
|
||||||
vim.api.nvim_set_current_win(win)
|
if vim.api.nvim_win_get_config(w).relative == "" then
|
||||||
|
win = w
|
||||||
|
vim.api.nvim_set_current_win(win)
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- open the first buffer
|
-- open the first buffer
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue