Implement 'format without save' (#8806)

This solves a major usability problem in Zed, that there's no way to
temporarily disable auto formatting without toggling the whole feature
off.

fixes https://github.com/zed-industries/zed/issues/5230

Release Notes:

- Added a new `workspace::SaveWithoutFormatting`, bound to `cmd-k s`, to
save a file without invoking the auto formatter.
This commit is contained in:
Mikayla Maki 2024-03-03 21:47:34 -08:00 committed by GitHub
parent ff65008316
commit 20acc123af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 69 additions and 24 deletions

View file

@ -735,8 +735,13 @@ impl Item for ProjectDiagnosticsEditor {
true
}
fn save(&mut self, project: Model<Project>, cx: &mut ViewContext<Self>) -> Task<Result<()>> {
self.editor.save(project, cx)
fn save(
&mut self,
format: bool,
project: Model<Project>,
cx: &mut ViewContext<Self>,
) -> Task<Result<()>> {
self.editor.save(format, project, cx)
}
fn save_as(