(&mut self, line: usize)
| 178 | } |
| 179 | |
| 180 | pub fn delete_line(&mut self, line: usize) { |
| 181 | if line >= self.line_count() { |
| 182 | return; |
| 183 | } |
| 184 | |
| 185 | let start = self.rope.line_to_char(line); |
| 186 | let end = if line + 1 < self.line_count() { |
| 187 | self.rope.line_to_char(line + 1) |
| 188 | } else { |
| 189 | self.len_chars() |
| 190 | }; |
| 191 | self.remove_char_range(start, end); |
| 192 | } |
| 193 | |
| 194 | pub fn slice_text(&self, start: usize, end: usize) -> String { |
| 195 | let start = start.min(self.len_chars()); |
nothing calls this directly
no test coverage detected