mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-12-01 11:23:10 +03:00
Add an :o open command.
This commit is contained in:
parent
8f0b28aeb8
commit
ed60866c54
@ -440,8 +440,15 @@ pub fn command_mode(cx: &mut Context) {
|
||||
return;
|
||||
}
|
||||
|
||||
match input {
|
||||
"q" => editor.should_close = true,
|
||||
let parts = input.split_ascii_whitespace().collect::<Vec<&str>>();
|
||||
|
||||
match parts.as_slice() {
|
||||
&["q"] => editor.should_close = true,
|
||||
&["o", path] => {
|
||||
// TODO: make view()/view_mut() always contain a view.
|
||||
let size = editor.view().unwrap().size;
|
||||
editor.open(path.into(), size);
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user