fn highlighted_bytes(edit: &TextEditing, text: &UiText) -> Range<usize> {
    let start = edit.cursor_position
        .min(edit.cursor_position + edit.highlight_vector) as usize;
    let end = edit.cursor_position
        .max(edit.cursor_position + edit.highlight_vector) as usize;
    let start_byte = text.text
        .grapheme_indices(true)
        .nth(start)
        .map(|i| i.0)
        .unwrap_or(text.text.len());
    let end_byte = text.text
        .grapheme_indices(true)
        .nth(end)
        .map(|i| i.0)
        .unwrap_or(text.text.len());
    start_byte..end_byte
}
/// Returns the byte indices that are highlighted in the string.
Returns the byte indices that are highlighted in the string.
Returns the byte indices that are highlighted in the string .
fn highlighted_bytes(edit: &TextEditing, text: &UiText) -> Range<usize> {
    let start = edit.cursor_position
        .min(edit.cursor_position + edit.highlight_vector) as usize;
    let end = edit.cursor_position
        .max(edit.cursor_position + edit.highlight_vector) as usize;
    let start_byte = text.text
        .grapheme_indices(true)
        .nth(start)
        .map(|i| i.0)
        .unwrap_or(text.text.len());
    let end_byte = text.text
        .grapheme_indices(true)
        .nth(end)
        .map(|i| i.0)
        .unwrap_or(text.text.len());
    start_byte..end_byte
}
fn highlighted_bytes ( edit : & TextEditing , text : & UiText ) -> Range < usize > { let start = edit . cursor_position . min ( edit . cursor_position + edit . highlight_vector ) as usize ; let end = edit . cursor_position . max ( edit . cursor_position + edit . highlight_vector ) as usize ; let start_byte = text . text . grapheme_indices ( true ) . nth ( start ) . map ( | i | i . 0 ) . unwrap_or ( text . text . len ( ) ) ; let end_byte = text . text . grapheme_indices ( true ) . nth ( end ) . map ( | i | i . 0 ) . unwrap_or ( text . text . len ( ) ) ; start_byte .. end_byte }
Returns the byte indices that are highlighted in the string.
Returns the byte indices that are highlighted in the string .
edit
&TextEditing
text
&UiText
edit
&TextEditing
text
&UiText