on master help sign in
Add an :o open command.
ed60866Blaž Hrastnik
helix-term/src/commands.rs+9−2
@@ -440,8 +440,15 @@ pub fn command_mode(cx: &mut Context) {
440 return;
440 return;
441 }
441 }
442
442
443− match input {
443+ let parts = input.split_ascii_whitespace().collect::<Vec<&str>>();
444+
445+ match parts.as_slice() {
444− "q" => editor.should_close = true,
446+ &["q"] => editor.should_close = true,
447+ &["o", path] => {
448+ // TODO: make view()/view_mut() always contain a view.
449+ let size = editor.view().unwrap().size;
450+ editor.open(path.into(), size);
451+ }
445 _ => (),
452 _ => (),
446 }
453 }
447 },
454 },