pub struct SelectionBounds {
buf_id: i32,
start: Bound,
end: Bound,
}Expand description
Start / end bounds plus owning buffer id for a Visual selection.
Fields§
§buf_id: i32§start: Bound§end: BoundImplementations§
Source§impl SelectionBounds
impl SelectionBounds
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Builds selection bounds from the current cursor (.) and visual start (v) marks.
Retrieves positions using Nvim’s getpos() function and normalizes them to 0-based indices.
The start and end are sorted to ensure start is before end.
§Errors
- Fails if retrieving either mark fails.
- Fails if the two marks reference different buffers.
Sourcepub const fn line_range(&self) -> Range<usize>
pub const fn line_range(&self) -> Range<usize>
Range of starting (inclusive) to ending (exclusive) line indices.
Sourcepub const fn end(&self) -> &Bound
pub const fn end(&self) -> &Bound
End bound (exclusive line, exclusive column for charwise mode after adjustment).
Sourceconst fn incr_end_col(&mut self)
const fn incr_end_col(&mut self)
Increment end column (making it exclusive for charwise selections).
Trait Implementations§
Source§impl Clone for SelectionBounds
impl Clone for SelectionBounds
Source§fn clone(&self) -> SelectionBounds
fn clone(&self) -> SelectionBounds
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SelectionBounds
impl RefUnwindSafe for SelectionBounds
impl Send for SelectionBounds
impl Sync for SelectionBounds
impl Unpin for SelectionBounds
impl UnsafeUnpin for SelectionBounds
impl UnwindSafe for SelectionBounds
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.