codemp/src/api/cursor.rs
alemi 917a6b96c2
feat: automatically map cursor uuids to names
not a fan of passing an Arc<DashMap> down to the cursor worker, but it
needs to access a mapping managed by the workspace so not sure if it can
be better. Into and From protocol types and Cursor are gone: do things
manually (since user is now a different thing, it can't be auto). Also
api::Cursor got changed: user field is Option<String> now
2024-09-05 23:59:05 +02:00

20 lines
629 B
Rust

//! ### Cursor
//! Represents the position of a remote user's cursor.
#[cfg(feature = "python")]
use pyo3::prelude::*;
/// User cursor position in a buffer
#[derive(Clone, Debug, Default)]
#[cfg_attr(feature = "python", pyclass)]
// #[cfg_attr(feature = "python", pyo3(crate = "reexported::pyo3"))]
pub struct Cursor {
/// Cursor start position in buffer, as 0-indexed row-column tuple.
pub start: (i32, i32),
/// Cursor end position in buffer, as 0-indexed row-column tuple.
pub end: (i32, i32),
/// Path of buffer this cursor is on.
pub buffer: String,
/// User display name, if provided.
pub user: Option<String>,
}