use std::rc::Rc;
#[derive(Clone, Copy, PartialEq, Eq)]
pub(super) enum SelectionMode {
Normal,
Visual,
}
pub struct OutputSelection {
pub(super) anchor: usize,
pub(super) selection_mode: SelectionMode,
pub(super) snapshot: Option<Rc<[String]>>,
}
impl OutputSelection {
pub(super) const fn new() -> Self {
Self {
anchor: 0,
selection_mode: SelectionMode::Normal,
snapshot: None,
}
}
pub const fn is_visual(&self) -> bool { matches!(self.selection_mode, SelectionMode::Visual) }
pub const fn snapshot(&self) -> Option<&Rc<[String]>> { self.snapshot.as_ref() }
}