mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
prevent rendering visible whitespace on trailing cursor (#2331)
This commit is contained in:
parent
2687b8fb3b
commit
e4c2618099
@ -388,6 +388,8 @@ pub fn render_text_highlights<H: Iterator<Item = HighlightEvent>>(
|
||||
spans.pop();
|
||||
}
|
||||
HighlightEvent::Source { start, end } => {
|
||||
let is_trailing_cursor = text.len_chars() < end;
|
||||
|
||||
// `unwrap_or_else` part is for off-the-end indices of
|
||||
// the rope, to allow cursor highlighting at the end
|
||||
// of the rope.
|
||||
@ -397,7 +399,7 @@ pub fn render_text_highlights<H: Iterator<Item = HighlightEvent>>(
|
||||
.fold(text_style, |acc, span| acc.patch(theme.highlight(span.0)));
|
||||
|
||||
let space = if whitespace.render.space() == WhitespaceRenderValue::All
|
||||
&& text.len_chars() < end
|
||||
&& !is_trailing_cursor
|
||||
{
|
||||
&space
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user