(&self)
| 89 | } |
| 90 | |
| 91 | pub fn selection_range(&self) -> Option<((usize, usize), (usize, usize))> { |
| 92 | let anchor = self.selection_anchor?; |
| 93 | let cursor = self.cursor; |
| 94 | (anchor != cursor).then(|| { |
| 95 | let (start, end) = if (anchor.line, anchor.column) <= (cursor.line, cursor.column) { |
| 96 | (anchor, cursor) |
| 97 | } else { |
| 98 | (cursor, anchor) |
| 99 | }; |
| 100 | (start.line_col(), end.line_col()) |
| 101 | }) |
| 102 | } |
| 103 | |
| 104 | pub fn start_selection(&mut self) { |
| 105 | if self.selection_anchor.is_none() { |
no test coverage detected