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

Method selection_range_raw

src/text_input.rs:1141–1149  ·  view source on GitHub ↗

Get the selection range in raw positions for rendering.

(&self)

Source from the content-addressed store, hash-verified

1139
1140 /// Get the selection range in raw positions for rendering.
1141 pub fn selection_range_raw(&self) -> Option<(usize, usize)> {
1142 self.selection_anchor.map(|anchor| {
1143 let raw_anchor = styling::cursor_to_raw(&self.text, anchor);
1144 let raw_cursor = styling::cursor_to_raw(&self.text, self.cursor_pos);
1145 let start = raw_anchor.min(raw_cursor);
1146 let end = raw_anchor.max(raw_cursor);
1147 (start, end)
1148 })
1149 }
1150}
1151
1152/// Configuration for a text input element's visual appearance.

Callers 1

Calls 1

cursor_to_rawFunction · 0.85

Tested by

no test coverage detected