mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-19 07:15:34 -04:00
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
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:
parent
fb20818042
commit
8cdf68bbf6
@ -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() {
|
||||||
|
Loading…
Reference in New Issue
Block a user