on master help sign in
Fix confusion with using --hsplit --vsplit on startup at same time (#4202)
commitf4d96b2ca335977ea9b9031e35994b7f15f05c25 authorBrian Orwe <Brian.orwe@gmail.com> dateTue 11 Oct 2022, 16:25 (4 years ago) parent0813276
1 file changed+8−2
helix-term/src/args.rs+8−2
helix-term/src/args.rs+8−2
@@ -32,8 +32,14 @@ impl Args {
3232 "--version" => args.display_version = true,
3333 "--help" => args.display_help = true,
3434 "--tutor" => args.load_tutor = true,
35− "--vsplit" => args.split = Some(Layout::Vertical),
36− "--hsplit" => args.split = Some(Layout::Horizontal),
35+ "--vsplit" => match args.split {
36+ Some(_) => anyhow::bail!("can only set a split once of a specific type"),
37+ None => args.split = Some(Layout::Vertical),
38+ },
39+ "--hsplit" => match args.split {
40+ Some(_) => anyhow::bail!("can only set a split once of a specific type"),
41+ None => args.split = Some(Layout::Horizontal),
42+ },
3743 "--health" => {
3844 args.health = true;
3945 args.health_arg = argv.next_if(|opt| !opt.starts_with('-'));