only prompt the user if they can close all buffers, otherwise it would be misleading

This commit is contained in:
Samantha Marshall 2017-01-10 10:18:49 -05:00
parent ea0dda98ce
commit a7e5a5b26c
No known key found for this signature in database
GPG key ID: DF782CB74434EFA2

View file

@ -1443,21 +1443,24 @@ func (v *View) QuitAll(usePlugin bool) bool {
} }
} }
should_quit, _ := messenger.YesNoPrompt("Do you want to quit micro (all open files will be closed)?") if closeAll {
// only quit if all of the buffers can be closed and the user confirms that they actually want to quit everything
if should_quit && closeAll { should_quit, _ := messenger.YesNoPrompt("Do you want to quit micro (all open files will be closed)?")
for _, tab := range tabs {
for _, v := range tab.views { if should_quit {
v.CloseBuffer() for _, tab := range tabs {
for _, v := range tab.views {
v.CloseBuffer()
}
} }
}
if usePlugin { if usePlugin {
PostActionCall("QuitAll", v) PostActionCall("QuitAll", v)
} }
screen.Fini() screen.Fini()
os.Exit(0) os.Exit(0)
}
} }
return false return false