Skip to content

Commit 1f1fdeb

Browse files
committed
skip save dialog on quit if buffer is shared
1 parent fb20818 commit 1f1fdeb

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

internal/action/actions.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,6 +1900,20 @@ func (h *BufPane) Quit() bool {
19001900
h.ForceQuit()
19011901
})
19021902
} else {
1903+
copies := 0
1904+
for _, t := range Tabs.List {
1905+
for _, p := range t.Panes {
1906+
h2, ok := p.(*BufPane)
1907+
if ok && h.Buf.SharedBuffer == h2.Buf.SharedBuffer {
1908+
copies = copies+1
1909+
}
1910+
}
1911+
}
1912+
if copies > 1 {
1913+
h.ForceQuit()
1914+
return true
1915+
}
1916+
19031917
InfoBar.YNPrompt("Save changes to "+h.Buf.GetName()+" before closing? (y,n,esc)", func(yes, canceled bool) {
19041918
if !canceled && !yes {
19051919
h.ForceQuit()

0 commit comments

Comments
 (0)