mirror of
https://github.com/hexedtech/codemp.git
synced 2024-10-23 10:19:21 +02:00
28 lines
537 B
Rust
28 lines
537 B
Rust
pub(crate) mod worker;
|
|
pub mod controller;
|
|
|
|
pub use controller::CursorController as Controller;
|
|
|
|
use crate::proto::{RowCol, CursorPosition};
|
|
|
|
impl From::<RowCol> for (i32, i32) {
|
|
fn from(pos: RowCol) -> (i32, i32) {
|
|
(pos.row, pos.col)
|
|
}
|
|
}
|
|
|
|
impl From::<(i32, i32)> for RowCol {
|
|
fn from((row, col): (i32, i32)) -> Self {
|
|
RowCol { row, col }
|
|
}
|
|
}
|
|
|
|
impl CursorPosition {
|
|
pub fn start(&self) -> RowCol {
|
|
self.start.clone().unwrap_or((0, 0).into())
|
|
}
|
|
|
|
pub fn end(&self) -> RowCol {
|
|
self.end.clone().unwrap_or((0, 0).into())
|
|
}
|
|
}
|