skip save dialog on quit if buffer is shared (#3559)
Some checks failed
Build and Test / test (1.17.x, macos-latest) (push) Has been cancelled
Build and Test / test (1.17.x, ubuntu-latest) (push) Has been cancelled
Build and Test / test (1.17.x, windows-latest) (push) Has been cancelled
Build and Test / test (1.23.x, macos-latest) (push) Has been cancelled
Build and Test / test (1.23.x, ubuntu-latest) (push) Has been cancelled
Build and Test / test (1.23.x, windows-latest) (push) Has been cancelled

This commit is contained in:
matthias314 2024-12-09 13:42:19 -05:00 committed by GitHub
parent fb20818042
commit 8cdf68bbf6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1894,6 +1894,13 @@ func (h *BufPane) ForceQuit() bool {
// Quit this will close the current tab or view that is open // Quit this will close the current tab or view that is open
func (h *BufPane) Quit() bool { func (h *BufPane) Quit() bool {
if h.Buf.Modified() { if h.Buf.Modified() {
for _, b := range buffer.OpenBuffers {
if b != h.Buf && b.SharedBuffer == h.Buf.SharedBuffer {
h.ForceQuit()
return true
}
}
if config.GlobalSettings["autosave"].(float64) > 0 { if config.GlobalSettings["autosave"].(float64) > 0 {
// autosave on means we automatically save when quitting // autosave on means we automatically save when quitting
h.SaveCB("Quit", func() { h.SaveCB("Quit", func() {