diff options
Diffstat (limited to 'src/ui/release_notes.rs')
| -rw-r--r-- | src/ui/release_notes.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ui/release_notes.rs b/src/ui/release_notes.rs index 9d069828..e6d20885 100644 --- a/src/ui/release_notes.rs +++ b/src/ui/release_notes.rs @@ -281,7 +281,15 @@ fn release_notes_inline_spans<'a>( let (code, after_end) = after_start.split_at(end); width += code.chars().count(); if !code.is_empty() { - spans.push(Span::styled(code.to_string(), code_style)); + // Keep short config examples together when Paragraph wraps. + // Snippets like `new_tab = "prefix+c"` read poorly when they + // split at the spaces around `=` in narrow announcement modals. + let display_code = if code.contains('=') { + code.replace(' ', "\u{00a0}") + } else { + code.to_string() + }; + spans.push(Span::styled(display_code, code_style)); } remaining = &after_end[1..]; } |
