use std::cmp::Ordering;
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq)]
pub struct Position {
pub col: usize, pub row: usize, }
impl PartialOrd for Position {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp(other))
}
}
impl Ord for Position {
fn cmp(&self, other: &Self) -> Ordering {
match self.row.cmp(&other.row) {
Ordering::Equal => self.col.cmp(&other.col),
o => o,
}
}
}
#[derive(Debug, Default)]
pub struct Layout {
pub prompt_size: Position,
pub default_prompt: bool,
pub cursor: Position,
pub end: Position,
}