From 7fa9a712a9d4f12fd6b2d7afc3a0123ca94e9ff2 Mon Sep 17 00:00:00 2001 From: talwat <83217276+talwat@users.noreply.github.com> Date: Sat, 27 Dec 2025 09:42:08 +0100 Subject: [PATCH] fix: non fancy windows shouldn't have carriage returns --- src/ui/interface/window.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ui/interface/window.rs b/src/ui/interface/window.rs index cff7084..f2fa9b9 100644 --- a/src/ui/interface/window.rs +++ b/src/ui/interface/window.rs @@ -62,7 +62,7 @@ impl Window { /// This returns both the final rendered window and also the full /// height of the rendered window. pub(crate) fn render(&self, content: Vec) -> ui::Result<(String, u16)> { - const NEWLINE: &str = "\r\n"; + let newline: &str = if self.fancy { "\r\n" } else { "\n" }; let len: u16 = content.len().try_into()?; // Note that this will have a trailing newline, which we use later. @@ -76,7 +76,7 @@ impl Window { }; let center = if self.fancy { x.reset().to_string() } else { x }; - write!(output, "{padding} {center}{space} {padding}{NEWLINE}").unwrap(); + write!(output, "{padding} {center}{space} {padding}{newline}").unwrap(); output }); @@ -91,7 +91,7 @@ impl Window { // There's no need for another newline after the main menu content, because it already has one. Ok(( format!( - "{}{NEWLINE}{menu}{}{suffix}", + "{}{newline}{menu}{}{suffix}", self.titlebar.content, self.statusbar, ), height,