Select the word at the given character position (for double-click).
(&mut self, char_pos: usize)
| 344 | |
| 345 | /// Select the word at the given character position (for double-click). |
| 346 | pub fn select_word_at(&mut self, char_pos: usize) { |
| 347 | let (start, end) = find_word_at(&self.text, char_pos); |
| 348 | if start != end { |
| 349 | self.selection_anchor = Some(start); |
| 350 | self.cursor_pos = end; |
| 351 | } |
| 352 | self.reset_blink(); |
| 353 | } |
| 354 | |
| 355 | /// Reset blink timer so cursor is immediately visible. |
| 356 | pub fn reset_blink(&mut self) { |
no test coverage detected