Click to cursor in styled mode. `click_visual_pos` is the visual character position determined from click x.
(&mut self, click_visual_pos: usize, shift: bool)
| 1066 | /// Click to cursor in styled mode. |
| 1067 | /// `click_visual_pos` is the visual character position determined from click x. |
| 1068 | pub fn click_to_cursor_styled(&mut self, click_visual_pos: usize, shift: bool) { |
| 1069 | if shift { |
| 1070 | if self.selection_anchor.is_none() { |
| 1071 | self.selection_anchor = Some(self.cursor_pos); |
| 1072 | } |
| 1073 | } else { |
| 1074 | self.selection_anchor = None; |
| 1075 | } |
| 1076 | self.cursor_pos = click_visual_pos; |
| 1077 | if shift { |
| 1078 | if self.selection_anchor == Some(self.cursor_pos) { |
| 1079 | self.selection_anchor = None; |
| 1080 | } |
| 1081 | } |
| 1082 | self.cleanup_after_move(); |
| 1083 | } |
| 1084 | |
| 1085 | /// Select word at visual position in styled mode. |
| 1086 | pub fn select_word_at_styled(&mut self, visual_pos: usize) { |
no test coverage detected