summaryrefslogtreecommitdiff
path: root/helix-view/src/editor.rs
blob: 444e4bf7c93282869038cfde54791f5e24232e51 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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(())
    }
}