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:
parent
ff65008316
commit
20acc123af
10 changed files with 69 additions and 24 deletions
|
@ -106,6 +106,7 @@ actions!(
|
|||
AddFolderToProject,
|
||||
Unfollow,
|
||||
SaveAs,
|
||||
SaveWithoutFormat,
|
||||
ReloadActiveItem,
|
||||
ActivatePreviousPane,
|
||||
ActivateNextPane,
|
||||
|
@ -3532,6 +3533,11 @@ impl Workspace {
|
|||
.save_active_item(action.save_intent.unwrap_or(SaveIntent::Save), cx)
|
||||
.detach_and_log_err(cx);
|
||||
}))
|
||||
.on_action(cx.listener(|workspace, _: &SaveWithoutFormat, cx| {
|
||||
workspace
|
||||
.save_active_item(SaveIntent::SaveWithoutFormat, cx)
|
||||
.detach_and_log_err(cx);
|
||||
}))
|
||||
.on_action(cx.listener(|workspace, _: &SaveAs, cx| {
|
||||
workspace
|
||||
.save_active_item(SaveIntent::SaveAs, cx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue