pub struct TextObjRange {
pub start: Position,
pub end: Position,
pub is_linewise: bool,
}Expand description
Range computed by a text object command.
Text objects like iw, aw, i" compute a range directly instead of
moving the cursor. When executed during operator-pending mode, they store
the range for the operator resolver to consume.
§Coordinate System
start: First position in the range (inclusive)end: First position AFTER the range (exclusive)
This matches Rust’s standard Range<Position> semantics.
§Example Flow
- User presses
d→ enters operator-pending mode - User presses
iw→InnerWordcommand executes - Command calculates word boundaries and creates
TextObjRange - Command stores range in session extension state
- Operator resolver’s
on_command_completeconsumes the range - Delete operation uses the range
Fields§
§start: PositionStart position (inclusive).
end: PositionEnd position (exclusive - points to first char NOT in range).
is_linewise: boolWhether this is a linewise text object (e.g., ip, ap).
Linewise text objects affect entire lines, similar to linewise
motions like j, k, gg, G.
Implementations§
Source§impl TextObjRange
impl TextObjRange
Sourcepub const fn characterwise(start: Position, end: Position) -> TextObjRange
pub const fn characterwise(start: Position, end: Position) -> TextObjRange
Create a new characterwise text object range.
Characterwise ranges operate on a specific range of characters,
like iw (inner word) or i" (inside quotes).
Sourcepub const fn linewise(start: Position, end: Position) -> TextObjRange
pub const fn linewise(start: Position, end: Position) -> TextObjRange
Create a new linewise text object range.
Linewise ranges affect entire lines, like ip (inner paragraph)
or ap (a paragraph).
Trait Implementations§
Source§impl Clone for TextObjRange
impl Clone for TextObjRange
Source§fn clone(&self) -> TextObjRange
fn clone(&self) -> TextObjRange
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TextObjRange
impl Debug for TextObjRange
Source§impl PartialEq for TextObjRange
impl PartialEq for TextObjRange
impl Copy for TextObjRange
impl Eq for TextObjRange
impl StructuralPartialEq for TextObjRange
Auto Trait Implementations§
impl Freeze for TextObjRange
impl RefUnwindSafe for TextObjRange
impl Send for TextObjRange
impl Sync for TextObjRange
impl Unpin for TextObjRange
impl UnsafeUnpin for TextObjRange
impl UnwindSafe for TextObjRange
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.