pub struct TextDimensions {
pub line_count: usize,
pub last_line_len: usize,
}Expand description
Dimensions of text for OT position transformation.
Describes the shape of a text string in terms of line count and
the length of the last line. Used by transform_position to
compute how an edit shifts positions in a 2D text buffer.
All lengths are in Unicode scalar values (chars), consistent with
Position::column semantics throughout reovim.
Fields§
§line_count: usizeNumber of newline characters in the text.
last_line_len: usizeCharacter count of text after the last newline, or the full character count if there are no newlines.
Trait Implementations§
Source§impl Clone for TextDimensions
impl Clone for TextDimensions
Source§fn clone(&self) -> TextDimensions
fn clone(&self) -> TextDimensions
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 moreSource§impl Debug for TextDimensions
impl Debug for TextDimensions
Source§impl PartialEq for TextDimensions
impl PartialEq for TextDimensions
impl Copy for TextDimensions
impl Eq for TextDimensions
impl StructuralPartialEq for TextDimensions
Auto Trait Implementations§
impl Freeze for TextDimensions
impl RefUnwindSafe for TextDimensions
impl Send for TextDimensions
impl Sync for TextDimensions
impl Unpin for TextDimensions
impl UnsafeUnpin for TextDimensions
impl UnwindSafe for TextDimensions
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