Struct me3_framework::overlay::widgets::text_edit::CursorRange
source · [−]Expand description
A selected text range (could be a range of length zero).
Fields
primary: Cursor
When selecting with a mouse, this is where the mouse was released. When moving with e.g. shift+arrows, this is what moves. Note that the two ends can come in any order, and also be equal (no selection).
secondary: Cursor
When selecting with a mouse, this is where the mouse was first pressed. This part of the cursor does not move when shift is down.
Implementations
sourceimpl CursorRange
impl CursorRange
sourcepub fn one(cursor: Cursor) -> CursorRange
pub fn one(cursor: Cursor) -> CursorRange
The empty range.
pub fn two(min: Cursor, max: Cursor) -> CursorRange
pub fn as_ccursor_range(&self) -> CCursorRange
sourcepub fn as_sorted_char_range(&self) -> Range<usize>
pub fn as_sorted_char_range(&self) -> Range<usize>
The range of selected character indices.
sourcepub fn single(&self) -> Option<Cursor>
pub fn single(&self) -> Option<Cursor>
If there is a selection, None is returned. If the two ends is the same, that is returned.
pub fn is_sorted(&self) -> bool
pub fn sorted(self) -> CursorRange
sourcepub fn sorted_cursors(&self) -> [Cursor; 2]
pub fn sorted_cursors(&self) -> [Cursor; 2]
returns the two ends ordered
Trait Implementations
sourceimpl Clone for CursorRange
impl Clone for CursorRange
sourcefn clone(&self) -> CursorRange
fn clone(&self) -> CursorRange
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for CursorRange
impl Debug for CursorRange
sourceimpl Default for CursorRange
impl Default for CursorRange
sourcefn default() -> CursorRange
fn default() -> CursorRange
Returns the “default value” for a type. Read more
impl Copy for CursorRange
Auto Trait Implementations
impl RefUnwindSafe for CursorRange
impl Send for CursorRange
impl Sync for CursorRange
impl Unpin for CursorRange
impl UnwindSafe for CursorRange
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more