only prompt the user if they can close all buffers, otherwise it would be misleading
This commit is contained in:
parent
ea0dda98ce
commit
a7e5a5b26c
1 changed files with 15 additions and 12 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue