summaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorBrian Orwe2022-10-11 13:25:42 +0000
committerGitHub2022-10-11 13:25:42 +0000
commitf4d96b2ca335977ea9b9031e35994b7f15f05c25 (patch)
tree0b212cda25fa447e805521c33e6f220de8e4d0d2 /helix-term
parent081327695f7d4740f8a66bf2da75905656f70a58 (diff)
Fix confusion with using --hsplit --vsplit on startup at same time (#4202)
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/args.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/helix-term/src/args.rs b/helix-term/src/args.rs
index 48c86633..dd787f1f 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('-'));