Skip to content

Commit

Permalink
Fix confusion with using --hsplit --vsplit on startup at same time (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Borwe authored Oct 11, 2022
1 parent 0813276 commit f4d96b2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions helix-term/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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('-'));
Expand Down

0 comments on commit f4d96b2

Please sign in to comment.