zed icon indicating copy to clipboard operation
zed copied to clipboard

Typing "*" in Git commit joins with previous line

Open vito opened this issue 1 year ago • 4 comments

Summary

If I'm writing a Git commit message that has a bulleted list (another keyword for searchers: asterisk), the editor joins the line to the end of the previous line:

https://github.com/user-attachments/assets/1b36f33d-9ea9-406b-b7fa-3bd07546f127

Steps to trigger the problem:

  1. Start writing a Git commit
  2. Write a line of text
  3. Start a new line with "*"

Actual Behavior:

The "*" stays at the start of the new line

Expected Behavior:

The current line is joined to the previous line, and then the * is typed.

Workaround:

Insert a blank line and then delete it when you're done.

Note that if you edit the line after removing the gap the line will be joined to the previous one.

Zed Version and System Specs

Zed: v0.178.5 (Zed) OS: Linux Wayland bluefin 41 Memory: 62 GiB Architecture: x86_64 GPU: AMD Radeon 780M (RADV PHOENIX) || radv || Mesa 25.0.0

vito avatar Mar 26 '25 15:03 vito

On a related note, when you type a space at the end of a list item that has another list item after, it advances the cursor to the start of the next line without modifying the text. The workaround is the same.

https://github.com/user-attachments/assets/42dc644f-73c3-4772-827f-48ef24962d16

tvanderstad avatar Mar 27 '25 17:03 tvanderstad

Also not just list items, but any multi-line text for me.

awmartin avatar Apr 04 '25 00:04 awmartin

I'm unable to reproduce this on Linux and Mac. Could someone try making a video of them reproducing it with the key context menu open (debug: open key context view) to help me figure out whats going wrong?

probably-neb avatar Apr 15 '25 15:04 probably-neb

I'm unable to reproduce this on Linux and Mac. Could someone try making a video of them reproducing it with the key context menu open (debug: open key context view) to help me figure out whats going wrong?

Here it is in Zed 0.182.9:

https://github.com/user-attachments/assets/25f8117d-afb2-4b2e-864a-a52cf98bf8ca

tvanderstad avatar Apr 17 '25 07:04 tvanderstad

In the latest version, Zed 0.211.6.

While the git commit message editor is correctly formatted, but the message that gets committed gets rewrapped like above.

Image Image

seeni-dev avatar Nov 08 '25 13:11 seeni-dev

Could be the use of rewrap which invokes when "Commit"/"Amend" button is clicked.

seeni-dev avatar Nov 08 '25 13:11 seeni-dev

Hey @seeni-dev, that seems worth putting in a separate issue, and related to https://github.com/zed-industries/zed/pull/32114. Would you mind creating a new issue with what you've commented here so we can track it separately?

probably-neb avatar Nov 10 '25 16:11 probably-neb

In the latest version, Zed 0.211.6.

While the git commit message editor is correctly formatted, but the message that gets committed gets rewrapped like above. Image Image

same on me

Image Image

OS: Windows 11 24H2 Zed Version: Zed Dev 0.213.0

LavaCxx avatar Nov 13 '25 02:11 LavaCxx