Skip to content

Commit

Permalink
ensure :quit and :quit! take no arguments (#2654)
Browse files Browse the repository at this point in the history
  • Loading branch information
the-mikedavis authored Jun 5, 2022
1 parent d24ca66 commit 1c2aaf3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions helix-term/src/commands/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ pub struct TypableCommand {

fn quit(
cx: &mut compositor::Context,
_args: &[Cow<str>],
args: &[Cow<str>],
_event: PromptEvent,
) -> anyhow::Result<()> {
ensure!(args.is_empty(), ":quit takes no arguments");

// last view and we have unsaved changes
if cx.editor.tree.views().count() == 1 {
buffers_remaining_impl(cx.editor)?
Expand All @@ -30,9 +32,11 @@ fn quit(

fn force_quit(
cx: &mut compositor::Context,
_args: &[Cow<str>],
args: &[Cow<str>],
_event: PromptEvent,
) -> anyhow::Result<()> {
ensure!(args.is_empty(), ":quit! takes no arguments");

cx.editor.close(view!(cx.editor).id);

Ok(())
Expand Down

0 comments on commit 1c2aaf3

Please sign in to comment.