Files
dotfiles/.config/yazi/plugins/confirm-quit.yazi/main.lua
T

21 lines
385 B
Lua

local count = ya.sync(function()
return #cx.tabs
end)
local function entry()
if count() < 2 then
return ya.emit("quit", {})
end
local yes = ya.confirm({
pos = { "center", w = 60, h = 9 },
title = "Quit?",
body = ui.Text("Multiple tabs are open. Are you sure you want to quit?"):wrap(ui.Wrap.YES),
})
if yes then
ya.emit("quit", {})
end
end
return { entry = entry }