pub struct TextSelection;Expand description
Window-level operations for text selection.
Implementations§
Source§impl TextSelection
impl TextSelection
Sourcepub fn selected_text(window: &mut Window, cx: &mut App) -> String
pub fn selected_text(window: &mut Window, cx: &mut App) -> String
Returns the currently selected text in logical document order.
Sourcepub fn has_selection(window: &mut Window, cx: &mut App) -> bool
pub fn has_selection(window: &mut Window, cx: &mut App) -> bool
Returns whether the window has a geometry selection or any participant has an active participant-local selection such as select-all.
Sourcepub fn clear(window: &mut Window, cx: &mut App)
pub fn clear(window: &mut Window, cx: &mut App)
Clears window selection and every participant’s local selection.
Sourcepub fn clear_for_window(window_id: WindowId, cx: &mut App)
pub fn clear_for_window(window_id: WindowId, cx: &mut App)
Clears selection for a known window identifier.
Prefer Self::clear when a window reference is available. This
narrow entry point supports hosts retiring deprecated window wrappers.
Sourcepub fn end(window: &mut Window, cx: &mut App)
pub fn end(window: &mut Window, cx: &mut App)
Ends the current drag while leaving its selection visible.
Sourcepub fn activate_scope(
scope: TextSelectionScopeId,
window: &mut Window,
cx: &mut App,
)
pub fn activate_scope( scope: TextSelectionScopeId, window: &mut Window, cx: &mut App, )
Activates the opaque selection scope for this window.
Auto Trait Implementations§
impl Freeze for TextSelection
impl RefUnwindSafe for TextSelection
impl Send for TextSelection
impl Sync for TextSelection
impl Unpin for TextSelection
impl UnsafeUnpin for TextSelection
impl UnwindSafe for TextSelection
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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