2023-08-11 15:33:40 +02:00
|
|
|
pub mod tracker;
|
2023-07-30 17:48:55 +02:00
|
|
|
|
2023-08-16 17:09:21 +02:00
|
|
|
use crate::proto::{RowColumn, CursorPosition};
|
2023-07-04 22:54:25 +02:00
|
|
|
|
2023-08-16 17:09:21 +02:00
|
|
|
impl From::<RowColumn> for (i32, i32) {
|
|
|
|
fn from(pos: RowColumn) -> (i32, i32) {
|
2023-07-05 00:09:09 +02:00
|
|
|
(pos.row, pos.col)
|
2023-07-04 22:54:25 +02:00
|
|
|
}
|
|
|
|
}
|
2023-04-17 14:57:06 +02:00
|
|
|
|
2023-08-16 17:09:21 +02:00
|
|
|
impl From::<(i32, i32)> for RowColumn {
|
2023-07-05 00:09:09 +02:00
|
|
|
fn from((row, col): (i32, i32)) -> Self {
|
2023-08-16 17:09:21 +02:00
|
|
|
RowColumn { row, col }
|
2023-04-17 14:57:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-16 17:09:21 +02:00
|
|
|
impl CursorPosition {
|
|
|
|
pub fn start(&self) -> RowColumn {
|
2023-07-05 00:09:09 +02:00
|
|
|
self.start.clone().unwrap_or((0, 0).into())
|
2023-04-17 14:57:06 +02:00
|
|
|
}
|
|
|
|
|
2023-08-16 17:09:21 +02:00
|
|
|
pub fn end(&self) -> RowColumn {
|
2023-07-05 00:09:09 +02:00
|
|
|
self.end.clone().unwrap_or((0, 0).into())
|
2023-07-04 22:54:25 +02:00
|
|
|
}
|
2023-04-17 14:57:06 +02:00
|
|
|
}
|