From 65a4d51d90468620ceda9567793e68260befbbd7 Mon Sep 17 00:00:00 2001 From: "brian.orwe" Date: Tue, 11 Oct 2022 15:57:46 +0300 Subject: [PATCH 1/2] Fix confusion with using --hsplit --vsplit on startup at same time --- helix-term/src/args.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/helix-term/src/args.rs b/helix-term/src/args.rs index 48c866336fdb..b59ef83424a2 100644 --- a/helix-term/src/args.rs +++ b/helix-term/src/args.rs @@ -32,8 +32,14 @@ impl Args { "--version" => args.display_version = true, "--help" => args.display_help = true, "--tutor" => args.load_tutor = true, - "--vsplit" => args.split = Some(Layout::Vertical), - "--hsplit" => args.split = Some(Layout::Horizontal), + "--vsplit" => match args.split { + Some(_) => anyhow::bail!("Can only set a split once of a specific type"), + None => args.split = Some(Layout::Vertical), + }, + "--hsplit" => match args.split { + Some(_) => anyhow::bail!("Can only set a split once of a specific type"), + None => args.split = Some(Layout::Horizontal), + }, "--health" => { args.health = true; args.health_arg = argv.next_if(|opt| !opt.starts_with('-')); From 7778dd36884be05e390a790d2c1a75be09c89c57 Mon Sep 17 00:00:00 2001 From: "brian.orwe" Date: Tue, 11 Oct 2022 15:58:29 +0300 Subject: [PATCH 2/2] Update message --- helix-term/src/args.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helix-term/src/args.rs b/helix-term/src/args.rs index b59ef83424a2..dd787f1fd18c 100644 --- a/helix-term/src/args.rs +++ b/helix-term/src/args.rs @@ -33,11 +33,11 @@ impl Args { "--help" => args.display_help = true, "--tutor" => args.load_tutor = true, "--vsplit" => match args.split { - Some(_) => anyhow::bail!("Can only set a split once of a specific type"), + Some(_) => anyhow::bail!("can only set a split once of a specific type"), None => args.split = Some(Layout::Vertical), }, "--hsplit" => match args.split { - Some(_) => anyhow::bail!("Can only set a split once of a specific type"), + Some(_) => anyhow::bail!("can only set a split once of a specific type"), None => args.split = Some(Layout::Horizontal), }, "--health" => {