on master help sign in
Fix confusion with using --hsplit --vsplit on startup at same time (#4202)
f4d96b2Brian Orwe
helix-term/src/args.rs+8−2
@@ -32,8 +32,14 @@ impl Args {
32 "--version" => args.display_version = true,
32 "--version" => args.display_version = true,
33 "--help" => args.display_help = true,
33 "--help" => args.display_help = true,
34 "--tutor" => args.load_tutor = true,
34 "--tutor" => args.load_tutor = true,
35+ "--vsplit" => match args.split {
36+ Some(_) => anyhow::bail!("can only set a split once of a specific type"),
35− "--vsplit" => args.split = Some(Layout::Vertical),
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"),
36− "--hsplit" => args.split = Some(Layout::Horizontal),
41+ None => args.split = Some(Layout::Horizontal),
42+ },
37 "--health" => {
43 "--health" => {
38 args.health = true;
44 args.health = true;
39 args.health_arg = argv.next_if(|opt| !opt.starts_with('-'));
45 args.health_arg = argv.next_if(|opt| !opt.starts_with('-'));