Select word at visual position in styled mode.
(&mut self, visual_pos: usize)
| 1084 | |
| 1085 | /// Select word at visual position in styled mode. |
| 1086 | pub fn select_word_at_styled(&mut self, visual_pos: usize) { |
| 1087 | let (start, end) = styling::find_word_at_visual(&self.text, visual_pos); |
| 1088 | if start != end { |
| 1089 | self.selection_anchor = Some(start); |
| 1090 | self.cursor_pos = end; |
| 1091 | self.snap_to_content_pos(); |
| 1092 | } |
| 1093 | self.reset_blink(); |
| 1094 | } |
| 1095 | |
| 1096 | /// Snap `cursor_pos` (and `selection_anchor`) so they only land on |
| 1097 | /// visible-character boundaries, skipping `}` and empty-content markers. |
no test coverage detected