Make Quit() close help if its open and not the whole editor

Fixes #146
This commit is contained in:
Zachary Yedidia
2016-05-28 14:53:48 -04:00
parent 87d147cf92
commit 96c7bc67c0

View File

@@ -949,6 +949,9 @@ func (v *View) CommandMode() bool {
// is the last view
// However, since micro only supports one view for now, it doesn't really matter
func (v *View) Quit() bool {
if v.helpOpen {
return v.ToggleHelp()
}
// Make sure not to quit if there are unsaved changes
if views[mainView].CanClose("Quit anyway? (yes, no, save) ") {
screen.Fini()