Unnamed repository; edit this file 'description' to name the repository.
Add `--no-format` flag to `:update` command (#14136)
Kristoffer Plagborg Bak Sørensen 7 months ago
parent d259593 · commit fdfc6df
-rw-r--r--helix-term/src/commands/typed.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs
index 82cad838..666b6fd5 100644
--- a/helix-term/src/commands/typed.rs
+++ b/helix-term/src/commands/typed.rs
@@ -1469,7 +1469,14 @@ fn update(cx: &mut compositor::Context, args: Args, event: PromptEvent) -> anyho
let (_view, doc) = current!(cx.editor);
if doc.is_modified() {
- write(cx, args, event)
+ write_impl(
+ cx,
+ None,
+ WriteOptions {
+ force: false,
+ auto_format: !args.has_flag(WRITE_NO_FORMAT_FLAG.name),
+ },
+ )
} else {
Ok(())
}
@@ -3237,6 +3244,7 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[
completer: CommandCompleter::none(),
signature: Signature {
positionals: (0, Some(0)),
+ flags: &[WRITE_NO_FORMAT_FLAG],
..Signature::DEFAULT
},
},