Skip to content

Commit c045825

Browse files
eyalz800ibhagwan
authored andcommitted
fix(actions): switch to correct buffer window with nvim_set_current_buf
1 parent e3f8579 commit c045825

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lua/fzf-lua/actions.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,10 @@ M.vimcmd_entry = function(_vimcmd, selected, opts)
215215
then
216216
vim.bo.bufhidden = "wipe"
217217
end
218-
-- NOTE: nvim_win_set_buf will load the buffer if needed
218+
-- NOTE: nvim_set_current_buf will load the buffer if needed
219219
-- calling bufload will mess up `BufReadPost` autocmds
220220
-- vim.fn.bufload(bufnr)
221-
local ok, _ = pcall(vim.api.nvim_win_set_buf, 0, bufnr)
221+
local ok, _ = pcall(vim.api.nvim_set_current_buf, bufnr)
222222
-- When `:set nohidden && set confirm`, neovim will invoke the save dialog
223223
-- and confirm with the user when trying to switch from a dirty buffer, if
224224
-- user cancelles the save dialog pcall will fail with:

0 commit comments

Comments
 (0)