MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / cursor_len

Function cursor_len

src/text_input.rs:2035–2037  ·  view source on GitHub ↗

Count the total number of visual positions in a raw styled string. Includes visible chars, `}` exit positions, and empty content positions.

(raw: &str)

Source from the content-addressed store, hash-verified

2033 /// Count the total number of visual positions in a raw styled string.
2034 /// Includes visible chars, `}` exit positions, and empty content positions.
2035 pub fn cursor_len(raw: &str) -> usize {
2036 raw_to_cursor(raw, raw.chars().count())
2037 }
2038
2039 /// If `pos` (a raw char index) points to the start of an empty `{name|}` tag,
2040 /// advance into it (returning the position between `|` and `}`).

Callers 9

set_text_valueMethod · 0.85
set_cursor_posMethod · 0.85
set_selectionMethod · 0.85
cursor_len_styledMethod · 0.85
insert_text_styledMethod · 0.85
insert_at_visualFunction · 0.85

Calls 1

raw_to_cursorFunction · 0.85