Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot save empty file because ensure_final_newline_on_save adds a newline #22474

Closed
1 task done
injust opened this issue Dec 28, 2024 · 1 comment
Closed
1 task done
Labels
admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue

Comments

@injust
Copy link
Contributor

injust commented Dec 28, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

With ensure_final_newline_on_save enabled (which is by default), Zed adds a newline to empty files, making it impossible to save an actually empty file.

This is technically correct, as an empty file doesn't have a trailing newline...but you probably never want this behaviour.

Zed Version and System Specs

Zed: v0.166.1 (Zed)
OS: macOS 15.2.0
Memory: 16 GiB
Architecture: x86_64

If applicable, add screenshots or screencasts of the incorrect state / behavior

No response

If applicable, attach your Zed.log file to this issue.

No response

@injust injust added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Dec 28, 2024
@SomeoneToIgnore
Copy link
Contributor

Duplicate of #11044

@SomeoneToIgnore SomeoneToIgnore marked this as a duplicate of #11044 Dec 28, 2024
@SomeoneToIgnore SomeoneToIgnore closed this as not planned Won't fix, can't repro, duplicate, stale Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue
Projects
None yet
Development

No branches or pull requests

2 participants