Work on things
parent
9c61d8e987
commit
98d6f58dd2
|
|
@ -23,13 +23,6 @@ local M = { ---@type Rabbit.Plugin
|
||||||
p.listing.opened = {}
|
p.listing.opened = {}
|
||||||
p.listing.collections = {}
|
p.listing.collections = {}
|
||||||
p.listing.recursive = nil
|
p.listing.recursive = nil
|
||||||
local bufs = vim.api.nvim_list_bufs()
|
|
||||||
for _, b in ipairs(bufs) do
|
|
||||||
local path = vim.api.nvim_buf_get_name(b)
|
|
||||||
vim.notify(path)
|
|
||||||
set.add(p.listing.paths, path)
|
|
||||||
set.add(p.listing[0], path)
|
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
|
|
||||||
---@type Rabbit.Plugin.Buffers.Options
|
---@type Rabbit.Plugin.Buffers.Options
|
||||||
|
|
@ -38,6 +31,15 @@ local M = { ---@type Rabbit.Plugin
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function M.evt.RabbitEnter(_, _)
|
||||||
|
local bufs = vim.api.nvim_list_bufs()
|
||||||
|
for _, b in ipairs(bufs) do
|
||||||
|
local path = vim.api.nvim_buf_get_name(b)
|
||||||
|
vim.notify(path)
|
||||||
|
set.add(M.listing.paths, path)
|
||||||
|
set.add(M.listing[0], path)
|
||||||
|
end
|
||||||
|
end
|
||||||
-- function M.evt.BufEnter(evt, winid)
|
-- function M.evt.BufEnter(evt, winid)
|
||||||
-- local is_listed = vim.api.nvim_get_option_value("buflisted", { buf = evt.buf })
|
-- local is_listed = vim.api.nvim_get_option_value("buflisted", { buf = evt.buf })
|
||||||
-- if M.opts.ignore_unlisted and not is_listed then
|
-- if M.opts.ignore_unlisted and not is_listed then
|
||||||
|
|
@ -52,18 +54,6 @@ local M = { ---@type Rabbit.Plugin
|
||||||
-- set.sub(M.listing.opened, evt.buf)
|
-- set.sub(M.listing.opened, evt.buf)
|
||||||
-- end
|
-- end
|
||||||
|
|
||||||
function M.evt.RabbitEnter(_, winid)
|
|
||||||
M.listing[0] = nil
|
|
||||||
if #M.listing[winid] > 1 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if #M.listing.opened > 1 then
|
|
||||||
M.listing[0] = vim.deepcopy(M.listing.opened)
|
|
||||||
table.insert(M.listing[0], 1, "rabbitmsg://Open all buffers")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function M.evt.WinClosed(_, winid)
|
function M.evt.WinClosed(_, winid)
|
||||||
if M.listing[winid] ~= nil and #M.listing[winid] > 0 then
|
if M.listing[winid] ~= nil and #M.listing[winid] > 0 then
|
||||||
M.listing.last_closed = M.listing[winid]
|
M.listing.last_closed = M.listing[winid]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue