helix-mods/helix-view/src/lib.rs

36 lines
709 B
Rust
Raw Normal View History

#[macro_use]
pub mod macros;
pub mod clipboard;
pub mod document;
pub mod editor;
pub mod graphics;
2021-06-19 17:54:37 +02:00
pub mod info;
pub mod input;
pub mod keyboard;
pub mod theme;
pub mod tree;
pub mod view;
use std::num::NonZeroUsize;
// uses NonZeroUsize so Option<DocumentId> use a byte rather than two
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
pub struct DocumentId(NonZeroUsize);
impl Default for DocumentId {
fn default() -> DocumentId {
// Safety: 1 is non-zero
DocumentId(unsafe { NonZeroUsize::new_unchecked(1) })
}
}
slotmap::new_key_type! {
pub struct ViewId;
}
pub use document::Document;
pub use editor::Editor;
pub use theme::Theme;
pub use view::View;