on master help sign in
prevent rendering visible whitespace on trailing cursor (#2331)
commite4c261809980fa17436a8e87cf7e56ddda8bcb68 authorMichael Davis <mcarsondavis@gmail.com> dateFri 29 Apr 2022, 19:48 (5 years ago) parent2687b8f
1 file changed+3−1
helix-term/src/ui/editor.rs+3−1
helix-term/src/ui/editor.rs+3−1
@@ -388,6 +388,8 @@ impl EditorView {
388388 spans.pop();
389389 }
390390 HighlightEvent::Source { start, end } => {
391+ let is_trailing_cursor = text.len_chars() < end;
392+
391393 // `unwrap_or_else` part is for off-the-end indices of
392394 // the rope, to allow cursor highlighting at the end
393395 // of the rope.
@@ -397,7 +399,7 @@ impl EditorView {
397399 .fold(text_style, |acc, span| acc.patch(theme.highlight(span.0)));
398400
399401 let space = if whitespace.render.space() == WhitespaceRenderValue::All
400− && text.len_chars() < end
402+ && !is_trailing_cursor
401403 {
402404 &space
403405 } else {