21 lines
593 B
Rust
21 lines
593 B
Rust
// src/state/app/highlight.rs
|
|
|
|
/// Represents the different states of text highlighting.
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
pub enum HighlightState {
|
|
/// Highlighting is inactive.
|
|
Off,
|
|
/// Highlighting character by character. Stores the anchor point (line index, char index).
|
|
Characterwise { anchor: (usize, usize) },
|
|
/// Highlighting line by line. Stores the anchor line index.
|
|
Linewise { anchor_line: usize },
|
|
}
|
|
|
|
impl Default for HighlightState {
|
|
/// The default state is no highlighting.
|
|
fn default() -> Self {
|
|
HighlightState::Off
|
|
}
|
|
}
|
|
|