Skip to content

Indentation is broken when pasting code starting with a line break #26907

Closed
@alexkirsz

Description

@alexkirsz

Summary

When copy and pasting code from/to Zed, the indentation of the code is shifted left a few times.

Here's an example in .ron code, for which I have no formatter setup:

Screen.Recording.2025-03-17.at.10.48.41.mov

I'm seeing the exact same issue in Rust code.

As far as I can tell, this is a new issue that started occurring some time last week.

Steps to trigger the problem:

  1. Copy some indented code, starting with a \n character
  2. Paste the code.

Actual Behavior:

The code is pasted with bad indentation

Expected Behavior:

Indentation is preserved

Zed Version and System Specs

Zed: v0.177.7 (Zed)
OS: macOS 15.3.1
Memory: 48 GiB
Architecture: aarch64

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions