Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
git_ui: Preserve newlines in commit messages (#45167)
Mayank Vermacec46079fea8
diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rsindex 84c6e9b301d..4e94a811510 100644--- a/crates/git_ui/src/git_panel.rs+++ b/crates/git_ui/src/git_panel.rs@@ -15,6 +15,7 @@ use askpass::AskPassDelegate;use cloud_llm_client::CompletionIntent;use collections::{BTreeMap, HashMap, HashSet};use db::kvp::KEY_VALUE_STORE;+use editor::RewrapOptions;use editor::{Direction, Editor, EditorElement, EditorMode, MultiBuffer, MultiBufferOffset,actions::ExpandAllDiffHunks,@@ -2180,7 +2181,13 @@ impl GitPanel {let editor = cx.new(|cx| Editor::for_buffer(buffer, None, window, cx));let wrapped_message = editor.update(cx, |editor, cx| {editor.select_all(&Default::default(), window, cx);- editor.rewrap(&Default::default(), window, cx);+ editor.rewrap_impl(+ RewrapOptions {+ override_language_settings: false,+ preserve_existing_whitespace: true,+ },+ cx,+ );editor.text(cx)});if wrapped_message.trim().is_empty() {