From 42a6201856845da5600a0f91c43de6ea1d01e38e Mon Sep 17 00:00:00 2001 From: Pascal Sommer
Date: Sun, 7 Jul 2024 20:43:51 +0200 Subject: [PATCH] replace newlines with spaces in set_string_truncated_at_end --- helix-tui/src/buffer.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/helix-tui/src/buffer.rs b/helix-tui/src/buffer.rs index d28c32fcc..9e1746b0f 100644 --- a/helix-tui/src/buffer.rs +++ b/helix-tui/src/buffer.rs @@ -409,6 +409,8 @@ pub fn set_string_truncated_at_end( let max_x_offset = min(self.area.right() as usize, width.saturating_add(x as usize)); for s in string.graphemes(true) { + let s = if s == "\n" { " " } else { s }; + let width = s.width(); if width == 0 { continue;