Skip to content

Commit

Permalink
skip save dialog on quit if buffer is shared
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias314 committed Dec 7, 2024
1 parent fb20818 commit 1f1fdeb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions internal/action/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -1900,6 +1900,20 @@ func (h *BufPane) Quit() bool {
h.ForceQuit()
})
} else {
copies := 0
for _, t := range Tabs.List {
for _, p := range t.Panes {
h2, ok := p.(*BufPane)
if ok && h.Buf.SharedBuffer == h2.Buf.SharedBuffer {
copies = copies+1
}
}
}
if copies > 1 {
h.ForceQuit()
return true
}

InfoBar.YNPrompt("Save changes to "+h.Buf.GetName()+" before closing? (y,n,esc)", func(yes, canceled bool) {
if !canceled && !yes {
h.ForceQuit()
Expand Down

0 comments on commit 1f1fdeb

Please sign in to comment.