editor: Wrap placeholder if text overflows (#37919)

This fixes an issue where long placeholders would be cut off, e.g. in a
Claude Code thread:

<img width="387" height="115" alt="image"
src="https://github.com/user-attachments/assets/831a54aa-cf2b-4d87-af86-e368a5936f6b"
/>

Now:

<img width="354" height="115" alt="image"
src="https://github.com/user-attachments/assets/e5df5e05-0869-4db2-8dee-38611263191c"
/>


Most of the changes in this PR are caused by us requiring `&mut Window`
in `set_placeholder_text`.

Release Notes:

- Fixed an issue where placeholders inside editors would not wrap

---------

Co-authored-by: Agus Zubiaga <agus@zed.dev>
This commit is contained in:
Bennet Bo Fenner
2025-09-10 15:38:19 +00:00
committed by GitHub
co-authored by Agus Zubiaga
parent fb3c991112
commit acb3406eb8
36 changed files with 143 additions and 97 deletions
+1 -1
View File
@@ -198,7 +198,7 @@ impl CommitModal {
&& commit_message.is_empty()
{
commit_editor.update(cx, |editor, cx| {
editor.set_placeholder_text(suggested_commit_message, cx);
editor.set_placeholder_text(&suggested_commit_message, window, cx);
});
}