1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Default)] pub enum Mode { #[default] Normal, Insert, Visual, VisualLine, Command, Search, } impl Mode { pub fn is_visual(&self) -> bool { matches!(self, Mode::Visual | Mode::VisualLine) } }