Get the selected text in visual space, returning the visible chars.
(&self)
| 570 | |
| 571 | /// Get the selected text in visual space, returning the visible chars. |
| 572 | pub fn selected_text_styled(&self) -> String { |
| 573 | if let Some((start, end)) = self.selection_range() { |
| 574 | let stripped = styling::strip_styling(&self.text); |
| 575 | let byte_start = char_index_to_byte(&stripped, start); |
| 576 | let byte_end = char_index_to_byte(&stripped, end); |
| 577 | stripped[byte_start..byte_end].to_string() |
| 578 | } else { |
| 579 | String::new() |
| 580 | } |
| 581 | } |
| 582 | |
| 583 | /// Delete selection in styled mode. Returns true if a selection was deleted. |
| 584 | pub fn delete_selection_styled(&mut self) -> bool { |
no test coverage detected