chore: simplify get_alt_or_next_buf

This commit is contained in:
kiyan
2022-06-19 09:51:40 +02:00
parent d9aaa2f985
commit 3bc2207f4a

View File

@@ -140,14 +140,11 @@ local function get_alt_or_next_buf()
return alt_buf
end
local next_buf = nil
for _, buf in ipairs(a.nvim_list_bufs()) do
if is_buf_displayed(buf) then
next_buf = next_buf or buf
return buf
end
end
return next_buf
end
local function switch_buf_if_last_buf()