forked from Mirrors/helix
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
347 B
Rust
21 lines
347 B
Rust
4 years ago
|
use crate::View;
|
||
|
|
||
|
use std::path::PathBuf;
|
||
|
|
||
|
use anyhow::Error;
|
||
|
|
||
|
pub struct Editor {
|
||
|
pub view: Option<View>,
|
||
|
}
|
||
|
|
||
|
impl Editor {
|
||
|
pub fn new() -> Self {
|
||
|
Self { view: None }
|
||
|
}
|
||
|
|
||
|
pub fn open(&mut self, path: PathBuf, size: (u16, u16)) -> Result<(), Error> {
|
||
|
self.view = Some(View::open(path, size)?);
|
||
|
Ok(())
|
||
|
}
|
||
|
}
|