Move right in styled mode (visual space).
(&mut self, shift: bool)
| 826 | |
| 827 | /// Move right in styled mode (visual space). |
| 828 | pub fn move_right_styled(&mut self, shift: bool) { |
| 829 | let vis_len = self.cursor_len_styled(); |
| 830 | if !shift { |
| 831 | if let Some((_start, end)) = self.selection_range() { |
| 832 | self.cursor_pos = end; |
| 833 | self.selection_anchor = None; |
| 834 | self.cleanup_after_move(); |
| 835 | return; |
| 836 | } |
| 837 | } |
| 838 | if self.cursor_pos < vis_len { |
| 839 | if shift && self.selection_anchor.is_none() { |
| 840 | self.selection_anchor = Some(self.cursor_pos); |
| 841 | } |
| 842 | self.cursor_pos += 1; |
| 843 | if shift { |
| 844 | if self.selection_anchor == Some(self.cursor_pos) { |
| 845 | self.selection_anchor = None; |
| 846 | } |
| 847 | } |
| 848 | } |
| 849 | if !shift { |
| 850 | self.selection_anchor = None; |
| 851 | } |
| 852 | self.cleanup_after_move(); |
| 853 | } |
| 854 | |
| 855 | /// Move word left in styled mode. |
| 856 | pub fn move_word_left_styled(&mut self, shift: bool) { |