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

Method get_selection_range

src/engine.rs:5936–5940  ·  view source on GitHub ↗

Returns the selection range (start, end) for a text input element, or None. When text-styling is enabled, these are visual positions.

(&self, element_id: u32)

Source from the content-addressed store, hash-verified

5934 /// Returns the selection range (start, end) for a text input element, or None.
5935 /// When text-styling is enabled, these are visual positions.
5936 pub fn get_selection_range(&self, element_id: u32) -> Option<(usize, usize)> {
5937 self.text_edit_states
5938 .get(&element_id)
5939 .and_then(|state| state.selection_range())
5940 }
5941
5942 /// Sets the selection range for a text input element.
5943 /// `anchor` is where selection started, `cursor` is where it ends.

Callers

nothing calls this directly

Calls 2

getMethod · 0.80
selection_rangeMethod · 0.80

Tested by

no test coverage detected