From 828c7432e363c46cd9202cdb973a67f0421d2c0f Mon Sep 17 00:00:00 2001 From: Ryan Fowler Date: Sun, 9 Jul 2023 07:38:50 -0700 Subject: Implement the wa! command (#7577) --- helix-term/src/commands/typed.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'helix-term') diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index 5198e5bd..94cc33f0 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -739,6 +739,18 @@ fn write_all( write_all_impl(cx, false, true) } +fn force_write_all( + cx: &mut compositor::Context, + _args: &[Cow], + event: PromptEvent, +) -> anyhow::Result<()> { + if event != PromptEvent::Validate { + return Ok(()); + } + + write_all_impl(cx, true, true) +} + fn write_all_quit( cx: &mut compositor::Context, _args: &[Cow], @@ -2444,6 +2456,13 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[ fun: write_all, signature: CommandSignature::none(), }, + TypableCommand { + name: "write-all!", + aliases: &["wa!"], + doc: "Forcefully write changes from all buffers to disk creating necessary subdirectories.", + fun: force_write_all, + signature: CommandSignature::none(), + }, TypableCommand { name: "write-quit-all", aliases: &["wqa", "xa"], -- cgit v1.2.3-70-g09d2