(&mut self, line: usize, text: &str)
| 160 | } |
| 161 | |
| 162 | pub fn insert_line(&mut self, line: usize, text: &str) { |
| 163 | let char_idx = if line >= self.line_count() { |
| 164 | self.len_chars() |
| 165 | } else { |
| 166 | self.line_to_char(line) |
| 167 | }; |
| 168 | self.rope.insert(char_idx, text); |
| 169 | self.rope.insert_char(char_idx + text.chars().count(), '\n'); |
| 170 | } |
| 171 | |
| 172 | pub fn remove_char_range(&mut self, start: usize, end: usize) { |
| 173 | let start = start.min(self.len_chars()); |
nothing calls this directly
no test coverage detected