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