diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-09-13 18:18:26 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-09-13 18:18:26 +0900 |
| commit | 95528f5119f0e973bb0ffb41ed4e17564b39676e (patch) | |
| tree | 2aab63e1793e15adc8f986789318dfece947383f /mac/.config/yazi/plugins/confirm-quit.yazi | |
| parent | fa7b259c8011f410632dae255c04015fb5c5a0fa (diff) | |
updates
Diffstat (limited to 'mac/.config/yazi/plugins/confirm-quit.yazi')
| -rw-r--r-- | mac/.config/yazi/plugins/confirm-quit.yazi/main.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mac/.config/yazi/plugins/confirm-quit.yazi/main.lua b/mac/.config/yazi/plugins/confirm-quit.yazi/main.lua new file mode 100644 index 0000000..f171bc0 --- /dev/null +++ b/mac/.config/yazi/plugins/confirm-quit.yazi/main.lua @@ -0,0 +1,20 @@ +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 = 10 }, + title = "Quit?", + content = ui.Text("There are multiple tabs open. Are you sure you want to quit?"):wrap(ui.Wrap.YES), + }) + if yes then + ya.emit("quit", {}) + end +end + +return { entry = entry } |
