ensure :quit and :quit! take no arguments (#2654)

pull/2681/head
Michael Davis 3 years ago committed by GitHub
parent d24ca66dbb
commit 1c2aaf3baf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -15,9 +15,11 @@ pub struct TypableCommand {
fn quit( fn quit(
cx: &mut compositor::Context, cx: &mut compositor::Context,
_args: &[Cow<str>], args: &[Cow<str>],
_event: PromptEvent, _event: PromptEvent,
) -> anyhow::Result<()> { ) -> anyhow::Result<()> {
ensure!(args.is_empty(), ":quit takes no arguments");
// last view and we have unsaved changes // last view and we have unsaved changes
if cx.editor.tree.views().count() == 1 { if cx.editor.tree.views().count() == 1 {
buffers_remaining_impl(cx.editor)? buffers_remaining_impl(cx.editor)?
@ -30,9 +32,11 @@ fn quit(
fn force_quit( fn force_quit(
cx: &mut compositor::Context, cx: &mut compositor::Context,
_args: &[Cow<str>], args: &[Cow<str>],
_event: PromptEvent, _event: PromptEvent,
) -> anyhow::Result<()> { ) -> anyhow::Result<()> {
ensure!(args.is_empty(), ":quit! takes no arguments");
cx.editor.close(view!(cx.editor).id); cx.editor.close(view!(cx.editor).id);
Ok(()) Ok(())

Loading…
Cancel
Save