@@ -529,6 +529,8 @@ impl EditorView {
529529 (grapheme.as_ref(), width)
530530 };
531531
532+ let cut_off_start = offset.col.saturating_sub(visual_x as usize);
533+
532534 if !out_of_bounds {
533535 // if we're offscreen just keep going until we hit a new line
534536 surface.set_string(
@@ -541,7 +543,24 @@ impl EditorView {
541543 style
542544 },
543545 );
546+ } else if cut_off_start != 0 && cut_off_start < width {
547+ // partially on screen
548+ let rect = Rect::new(
549+ viewport.x as u16,
550+ viewport.y + line,
551+ (width - cut_off_start) as u16,
552+ 1,
553+ );
554+ surface.set_style(
555+ rect,
556+ if is_whitespace {
557+ style.patch(whitespace_style)
558+ } else {
559+ style
560+ },
561+ );
544562 }
563+
545564 if is_in_indent_area && !(grapheme == " " || grapheme == "\t") {
546565 draw_indent_guides(visual_x, line, surface);
547566 is_in_indent_area = false;