mirror of
https://github.com/zed-industries/zed.git
synced 2026-12-01 21:10:37 +01:00
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. <img width="3786" height="470" alt="Screenshot From 2026-11-06 10-23-54" src="https://github.com/user-attachments/assets/7ac99615-6999-4b6b-a0fc-81391b630bff" /> ## 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
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user