@@ -781,7 +781,10 @@ impl EditorView {
782 let mut execute_command = |command: &commands::MappableCommand| {
782 let mut execute_command = |command: &commands::MappableCommand| {
783 command.execute(cxt);
783 command.execute(cxt);
784− let doc = cxt.editor.documents.get_mut(&doc_id).unwrap();
784+ let doc = match cxt.editor.documents.get(&doc_id) {
785 let current_mode = doc.mode();
788 let current_mode = doc.mode();
786 match (last_mode, current_mode) {
789 match (last_mode, current_mode) {
787 (Mode::Normal, Mode::Insert) => {
790 (Mode::Normal, Mode::Insert) => {