Work on select function

master
Bryan 2024-10-19 08:42:10 -06:00
parent e5d5475e32
commit 2164e73951
1 changed files with 5 additions and 6 deletions

View File

@ -31,9 +31,9 @@ local M = { ---@type Rabbit.Plugin
}, },
} }
local get_buffers = function() local get_buffers = function(winid)
M.listing.paths = {} M.listing.paths = {}
M.listing[0] = {} M.listing[winid] = {}
local bufs = vim.fn.getbufinfo({ buflisted = 1 }) local bufs = vim.fn.getbufinfo({ buflisted = 1 })
table.sort(bufs, function(a, b) table.sort(bufs, function(a, b)
@ -42,13 +42,12 @@ local get_buffers = function()
for _, b in ipairs(bufs) do for _, b in ipairs(bufs) do
set.add(M.listing.paths, b.name) set.add(M.listing.paths, b.name)
set.add(M.listing[0], b.name) set.add(M.listing[winid], b.name)
end end
end end
function M.evt.RabbitEnter() function M.evt.RabbitEnter(_, winid)
get_buffers() get_buffers(winid)
vim.print(M.listing)
end end
-- ---@param n integer -- ---@param n integer