mirror of
https://github.com/LunarVim/LunarVim.git
synced 2024-09-20 10:35:08 +02:00
fix(bufkill): wrap around correctly (#3461)
This commit is contained in:
parent
dd54887bba
commit
ae89f07377
1 changed files with 1 additions and 1 deletions
|
@ -220,7 +220,7 @@ function M.buf_kill(kill_command, bufnr, force)
|
|||
if #buffers > 1 and #windows > 0 then
|
||||
for i, v in ipairs(buffers) do
|
||||
if v == bufnr then
|
||||
local prev_buf_idx = i == 1 and (#buffers - 1) or (i - 1)
|
||||
local prev_buf_idx = i == 1 and #buffers or (i - 1)
|
||||
local prev_buffer = buffers[prev_buf_idx]
|
||||
for _, win in ipairs(windows) do
|
||||
api.nvim_win_set_buf(win, prev_buffer)
|
||||
|
|
Loading…
Reference in a new issue