diff options
Diffstat (limited to 'helix-term')
-rw-r--r-- | helix-term/src/editor.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/helix-term/src/editor.rs b/helix-term/src/editor.rs index 23ecbea9..a3bc8b3b 100644 --- a/helix-term/src/editor.rs +++ b/helix-term/src/editor.rs @@ -127,7 +127,7 @@ impl Editor { .ranges() .iter() // TODO: limit selection to one in viewport - .filter(|range| !range.is_empty()) // && range.overlaps(&Range::new(start, end + 1)) + // .filter(|range| !range.is_empty()) // && range.overlaps(&Range::new(start, end + 1)) .copied() .collect(); @@ -178,6 +178,7 @@ impl Editor { let grapheme = Cow::from(grapheme); let width = grapheme_width(&grapheme) as u16; + // TODO: this should really happen as an after pass let style = if visible_selections .iter() .any(|range| range.contains(char_index)) @@ -188,6 +189,15 @@ impl Editor { style }; + let style = if visible_selections + .iter() + .any(|range| range.head == char_index) + { + style.clone().bg(Color::Rgb(255, 255, 255)) + } else { + style + }; + // TODO: paint cursor heads except primary self.surface.set_string( |