diff --git a/runtime/src/widget/operation.rs b/runtime/src/widget/operation.rs index ab03bbe0..8a1af55a 100644 --- a/runtime/src/widget/operation.rs +++ b/runtime/src/widget/operation.rs @@ -86,3 +86,12 @@ pub fn move_cursor_to(id: impl Into, position: usize) -> Task { pub fn select_all(id: impl Into) -> Task { task::effect(Action::widget(operation::text_input::select_all(id.into()))) } + +/// Selects the given content range of the widget with the given [`Id`]. +pub fn select_range(id: impl Into, start: usize, end: usize) -> Task { + task::effect(Action::widget(operation::text_input::select_range( + id.into(), + start, + end, + ))) +}