fix(win): use sbuffer instead of split for split windows

This commit is contained in:
Folke Lemaitre 2025-10-24 10:55:41 +02:00
parent e6b253944a
commit bbd6d42a97
No known key found for this signature in database
GPG key ID: 9B52594D560070AB

View file

@ -733,9 +733,9 @@ function M:open_win()
end end
local cmd = split_commands[relative][position] local cmd = split_commands[relative][position]
local size = vertical and opts.width or opts.height local size = vertical and opts.width or opts.height
local resize = ("%sresize %s"):format(vertical and "vertical " or "", size)
vim.api.nvim_win_call(parent, function() vim.api.nvim_win_call(parent, function()
vim.cmd("silent noswapfile " .. cmd .. " " .. size .. "split") vim.cmd("silent noswapfile " .. cmd .. " sbuffer " .. self.buf .. " | " .. resize)
vim.api.nvim_win_set_buf(0, self.buf)
self.win = vim.api.nvim_get_current_win() self.win = vim.api.nvim_get_current_win()
end) end)
if enter then if enter then