Close buffers without disrupting window layout #2144
Replies: 2 comments
-
buffers = {
actions = {
["ctrl-x"] = {
reload = true,
fn = function(selected)
local bufnr = FzfLua.path.entry_to_file(selected[1]).bufnr
-- call snacks.bufdelete or mini.bufdelete with the bufnr
end,
}
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
edmondburnett
-
Ah, thank you! Got it working with: ---@module 'snacks'
for index, _ in ipairs(selected) do
local bufnr = FzfLua.path.entry_to_file(selected[index]).bufnr
Snacks.bufdelete(bufnr)
end |
Beta Was this translation helpful? Give feedback.
0 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.
-
In the fzf-lua Buffers window, I'm trying to prevent changing the current window layout when a buffer is closed with the
ctrl-x
action. For instance, if one of the buffers selected for closing is open in a split pane, I want that split to remain active instead of closing entirely.Ideally, this would replicate the behavior of Snacks.bufdelete (bufdelete.lua) which is a replacement for
:bdelete
.Is there a way to customize the behavior of
actions.buf_del()
to accomplish this? Or perhaps replacebuf_del
withSnacks.bufdelete()
?Beta Was this translation helpful? Give feedback.
All reactions