Try another thing
parent
77e1ea97a3
commit
ddc7c4ac27
|
|
@ -56,40 +56,40 @@ end
|
||||||
-- 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]
|
||||||
end
|
-- end
|
||||||
M.listing[winid] = nil
|
-- M.listing[winid] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param n integer
|
---@param n integer
|
||||||
function M.func.select(n)
|
function M.func.select(n)
|
||||||
local rabbit = require("rabbit")
|
-- local rabbit = require("rabbit")
|
||||||
if M.listing[0] == nil or n ~= 1 then
|
-- if M.listing[0] == nil or n ~= 1 then
|
||||||
return rabbit.func.select(n)
|
-- return rabbit.func.select(n)
|
||||||
end
|
-- end
|
||||||
|
--
|
||||||
M.listing[0] = rabbit.ctx.listing
|
-- M.listing[0] = rabbit.ctx.listing
|
||||||
table.remove(M.listing[0], 1)
|
-- table.remove(M.listing[0], 1)
|
||||||
M.listing[rabbit.user.win] = M.listing[0]
|
-- M.listing[rabbit.user.win] = M.listing[0]
|
||||||
vim.api.nvim_win_set_buf(rabbit.user.win, tonumber(M.listing[0][1]) or 0)
|
-- vim.api.nvim_win_set_buf(rabbit.user.win, tonumber(M.listing[0][1]) or 0)
|
||||||
M.listing[0] = nil
|
-- M.listing[0] = nil
|
||||||
|
--
|
||||||
rabbit.func.close()
|
-- rabbit.func.close()
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param n integer
|
---@param n integer
|
||||||
function M.func.file_del(n)
|
function M.func.file_del(n)
|
||||||
local rabbit = require("rabbit")
|
-- local rabbit = require("rabbit")
|
||||||
M.listing[rabbit.user.win] = rabbit.ctx.listing
|
-- M.listing[rabbit.user.win] = rabbit.ctx.listing
|
||||||
table.remove(M.listing[rabbit.user.win], n)
|
-- table.remove(M.listing[rabbit.user.win], n)
|
||||||
table.insert(M.listing[rabbit.user.win], 1, rabbit.user.buf)
|
-- table.insert(M.listing[rabbit.user.win], 1, rabbit.user.buf)
|
||||||
if M.listing[0] ~= nil then
|
-- if M.listing[0] ~= nil then
|
||||||
table.remove(M.listing[rabbit.user.win], 1)
|
-- table.remove(M.listing[rabbit.user.win], 1)
|
||||||
M.listing[0] = vim.deepcopy(M.listing[rabbit.user.win])
|
-- M.listing[0] = vim.deepcopy(M.listing[rabbit.user.win])
|
||||||
table.insert(M.listing[0], 1, "rabbitmsg://Restore full history")
|
-- table.insert(M.listing[0], 1, "rabbitmsg://Restore full history")
|
||||||
end
|
-- end
|
||||||
require("rabbit").Redraw()
|
-- require("rabbit").Redraw()
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue