From e40e600719eaefca91cd6311c79bde4514f4b160 Mon Sep 17 00:00:00 2001 From: Michal Matczuk Date: Fri, 6 Nov 2026 11:02:28 +0000 Subject: [PATCH] git_ui: Preserve line breaks in commit message view (#66608) The commit view renders the commit message as Markdown using the hover style, which treats single newlines as soft breaks. Hard-wrapped commit bodies were therefore reflowed into a single paragraph. This sets `soft_break_as_hard_break: true` on the commit view's `MarkdownStyle`, so messages keep their original line breaks. Screenshot From 2026-11-06 10-23-54 ## Self-review - [x] I've reviewed my diff for quality, security, reliability, and performance. - [x] UI changes follow the [checklist](https://zed.dev/docs/development/ui-checklist). - [x] Tests cover the new or changed behavior. Release Notes: - Fixed commit messages losing their line breaks in the commit view --- crates/git_ui/src/commit_view.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/git_ui/src/commit_view.rs b/crates/git_ui/src/commit_view.rs index 42f733aae98..1b79b38e86a 100644 --- a/crates/git_ui/src/commit_view.rs +++ b/crates/git_ui/src/commit_view.rs @@ -22,7 +22,7 @@ use language::{ Buffer, Capability, DiskState, File, LanguageRegistry, LineEnding, OffsetRangeExt as _, ReplicaId, Rope, TextBuffer, }; -use markdown::{Markdown, MarkdownElement}; +use markdown::{Markdown, MarkdownElement, MarkdownStyle}; use multi_buffer::PathKey; use project::{ Project, ProjectPath, WorktreeId, @@ -878,7 +878,10 @@ impl CommitView { return None; } - let markdown_style = hover_markdown_style(window, cx); + let markdown_style = MarkdownStyle { + soft_break_as_hard_break: true, + ..hover_markdown_style(window, cx) + }; let is_expanded = self.message_expanded;