From 75a30185a540d00701a207506ec56ca47104f814 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Thu, 15 Oct 2026 02:18:24 +0200 Subject: [PATCH] Keep blank splash lines like SplashManager.prepare Vanilla trims each line and drops only the hidden splash (hash 125780783); a blank line stays a (blank) splash. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/title.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/horizon-client/src/title.rs b/crates/horizon-client/src/title.rs index 9f667a39b..a6e7d3f23 100644 --- a/crates/horizon-client/src/title.rs +++ b/crates/horizon-client/src/title.rs @@ -207,9 +207,8 @@ fn choose_splash(text: &str, index: usize, date: (u32, u32)) -> Option { let splashes: Vec<_> = text .lines() .map(str::trim) - .filter(|s| { - !s.is_empty() && horizon_core::random::java_string_hash(s.encode_utf16()) != 125780783 - }) + // SplashManager.prepare keeps blank lines: only the hidden splash is dropped. + .filter(|s| horizon_core::random::java_string_hash(s.encode_utf16()) != 125780783) .collect(); splashes .get(index.checked_rem(splashes.len())?) @@ -1593,10 +1592,11 @@ mod classic_tests { for index in 0..6 { assert_eq!( choose_splash(&text, index, (10, 15)).as_deref(), - Some(if index % 2 == 0 { "First!" } else { "Second!" }) + Some(["", "First!", "Second!"][index % 3]) ); } - for text in ["", " \r\n", hidden] { + assert_eq!(choose_splash(" \r\n", 42, (10, 15)).as_deref(), Some("")); + for text in ["", hidden] { assert_eq!(choose_splash(text, 42, (10, 15)), None); } }