pub struct CursorPosition {
pub row: usize,
pub col: usize,
}Expand description
Represents the current cursor coordinates in the active Window.
Row is 1-based (Nvim convention), column is 0-based (byte index).
Fields§
§row: usize§col: usizeImplementations§
Source§impl CursorPosition
impl CursorPosition
Sourcepub fn get_current() -> Option<Self>
pub fn get_current() -> Option<Self>
Obtains the current cursor position from the active Window.
Sourcepub const fn adjusted_col(&self) -> usize
pub const fn adjusted_col(&self) -> usize
Returns 1-based column index for rendering purposes.
Trait Implementations§
Source§impl Debug for CursorPosition
impl Debug for CursorPosition
Source§impl From<CursorPosition> for PointWrap
impl From<CursorPosition> for PointWrap
Source§fn from(cursor_position: CursorPosition) -> Self
fn from(cursor_position: CursorPosition) -> Self
Converts a Nvim cursor position (1-based row, 0-based column) to a PointWrap.
Auto Trait Implementations§
impl Freeze for CursorPosition
impl RefUnwindSafe for CursorPosition
impl Send for CursorPosition
impl Sync for CursorPosition
impl Unpin for CursorPosition
impl UnsafeUnpin for CursorPosition
impl UnwindSafe for CursorPosition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§type Error = Infallible
type Error = Infallible
The error type in the returned
Result.§fn into_result(self) -> Result<T, <T as IntoResult<T>>::Error>
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Error>
Converts the value into a
Result.