@@ -885,8 +885,15 @@ mod cmd {
885885 }
886886
887887 fn open(editor: &mut Editor, args: &[&str], event: PromptEvent) {
888− let path = args[0];
889− editor.open(path.into(), Action::Replace);
888+ match args.get(0) {
889+ Some(path) => {
890+ // TODO: handle error
891+ editor.open(path.into(), Action::Replace);
892+ }
893+ None => {
894+ editor.set_error("wrong argument count".to_string());
895+ }
896+ };
890897 }
891898
892899 fn write(editor: &mut Editor, args: &[&str], event: PromptEvent) {