|
|
@ -885,9 +885,16 @@ mod cmd {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn open(editor: &mut Editor, args: &[&str], event: PromptEvent) {
|
|
|
|
fn open(editor: &mut Editor, args: &[&str], event: PromptEvent) {
|
|
|
|
let path = args[0];
|
|
|
|
match args.get(0) {
|
|
|
|
|
|
|
|
Some(path) => {
|
|
|
|
|
|
|
|
// TODO: handle error
|
|
|
|
editor.open(path.into(), Action::Replace);
|
|
|
|
editor.open(path.into(), Action::Replace);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
None => {
|
|
|
|
|
|
|
|
editor.set_error("wrong argument count".to_string());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn write(editor: &mut Editor, args: &[&str], event: PromptEvent) {
|
|
|
|
fn write(editor: &mut Editor, args: &[&str], event: PromptEvent) {
|
|
|
|
let (view, doc) = editor.current();
|
|
|
|
let (view, doc) = editor.current();
|
|
|
|