Get the selection range in raw positions for rendering.
(&self)
| 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. |
no test coverage detected