Skip to content

Commit 8e7e3e2

Browse files
committed
fix(win): winopts.split=enew on spash screen (#2210)
1 parent 4e38d75 commit 8e7e3e2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lua/fzf-lua/win.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,12 +1070,14 @@ function FzfWin:create()
10701070
vim.cmd(tostring(self.winopts.split))
10711071
end
10721072
local split_bufnr = vim.api.nvim_get_current_buf()
1073-
assert(self.src_bufnr ~= split_bufnr, "split function should create a new buffer")
10741073
self.fzf_winid = vim.api.nvim_get_current_win()
10751074
if tonumber(self.fzf_bufnr) and vim.api.nvim_buf_is_valid(self.fzf_bufnr) then
10761075
-- Set to fzf bufnr set by `:unhide()`, wipe the new split buf
10771076
utils.win_set_buf_noautocmd(self.fzf_winid, self.fzf_bufnr)
10781077
utils.nvim_buf_delete(split_bufnr, { force = true })
1078+
elseif self.src_bufnr == split_bufnr then
1079+
-- "enew" on splash screen doesn't create a new buf
1080+
self.fzf_bufnr = self:set_tmp_buffer(true)
10791081
else
10801082
self.fzf_bufnr = split_bufnr
10811083
end

0 commit comments

Comments
 (0)