@@ -601,11 +601,18 @@ impl Component for EditorView {
601 mode => self.command_mode(mode, &mut cxt, key),
601 mode => self.command_mode(mode, &mut cxt, key),
604 self.on_next_key = cxt.on_next_key_callback.take();
605 self.on_next_key = cxt.on_next_key_callback.take();
605 self.status_msg = cxt.status_msg.take();
606 self.status_msg = cxt.status_msg.take();
606 // appease borrowck
607 // appease borrowck
607 let callback = cxt.callback.take();
608 let callback = cxt.callback.take();
610+ // if the command consumed the last view, skip the render.
611+ // on the next loop cycle the Application will then terminate.
612+ if cx.editor.should_close() {
613+ return EventResult::Ignored;
609 let (view, doc) = cx.editor.current();
616 let (view, doc) = cx.editor.current();
610 view.ensure_cursor_in_view(doc);
617 view.ensure_cursor_in_view(doc);