1mod app;
8mod highlight;
9mod icons;
10pub mod lsp;
11pub mod ops;
12pub mod theme;
13
14use anyhow::Result;
15
16pub use app::{launch, EditorApp};
17
18pub trait Panel {
19 fn title(&self) -> &str;
20 fn draw(&self) -> Result<()>;
21}
22
23#[derive(Debug, Default)]
24pub struct PanelRegistry {
25 panels: Vec<String>,
26}
27
28impl PanelRegistry {
29 pub fn new() -> Self {
30 Self::default()
31 }
32
33 pub fn register(&mut self, title: impl Into<String>) {
34 self.panels.push(title.into());
35 }
36
37 pub fn titles(&self) -> &[String] {
38 &self.panels
39 }
40}
41
42#[derive(Debug, Default)]
43pub struct Editor {
44 pub panels: PanelRegistry,
45}
46
47impl Editor {
48 pub fn new() -> Self {
49 Self::default()
50 }
51}