added close on middle mouse

This commit is contained in:
MasterGordon 2022-09-03 02:02:19 +02:00
parent 78eeb18ea6
commit 32958e555b
1 changed files with 6 additions and 2 deletions

View File

@ -586,8 +586,12 @@ local TablineFileNameBlock = {
end end
end, end,
on_click = { on_click = {
callback = function(_, minwid) callback = function(_, minwid, _, button)
vim.api.nvim_win_set_buf(0, minwid) if (button == "m") then -- close on mouse middle click
vim.api.nvim_buf_delete(minwid, {force = true})
else
vim.api.nvim_win_set_buf(0, minwid)
end
end, end,
minwid = function(self) minwid = function(self)
return self.bufnr return self.bufnr