mirror of
https://github.com/wez/wezterm.git
synced 2024-12-29 16:42:13 +03:00
split-pane: fixup some docs and defaults
The new options broke the older options; fix that up.
This commit is contained in:
parent
fe7f3e9214
commit
298b4abf70
@ -171,7 +171,8 @@ Outputs the pane-id for the newly created pane on success"
|
|||||||
#[structopt(long)]
|
#[structopt(long)]
|
||||||
pane_id: Option<PaneId>,
|
pane_id: Option<PaneId>,
|
||||||
|
|
||||||
/// Split horizontally rather than vertically
|
/// Equivalent to `--right`. If neither this nor any other direction
|
||||||
|
/// is specified, the default is equivalent to `--bottom`.
|
||||||
#[structopt(long, conflicts_with_all=&["left", "right", "top", "bottom"])]
|
#[structopt(long, conflicts_with_all=&["left", "right", "top", "bottom"])]
|
||||||
horizontal: bool,
|
horizontal: bool,
|
||||||
|
|
||||||
@ -212,7 +213,7 @@ Outputs the pane-id for the newly created pane on success"
|
|||||||
cwd: Option<OsString>,
|
cwd: Option<OsString>,
|
||||||
|
|
||||||
/// Instead of executing your shell, run PROG.
|
/// Instead of executing your shell, run PROG.
|
||||||
/// For example: `wezterm start -- bash -l` will spawn bash
|
/// For example: `wezterm cli split-pane -- bash -l` will spawn bash
|
||||||
/// as if it were a login shell.
|
/// as if it were a login shell.
|
||||||
#[structopt(parse(from_os_str))]
|
#[structopt(parse(from_os_str))]
|
||||||
prog: Vec<OsString>,
|
prog: Vec<OsString>,
|
||||||
@ -790,9 +791,9 @@ async fn run_cli_async(config: config::ConfigHandle, cli: CliCommand) -> anyhow:
|
|||||||
} else if top || bottom {
|
} else if top || bottom {
|
||||||
SplitDirection::Vertical
|
SplitDirection::Vertical
|
||||||
} else {
|
} else {
|
||||||
anyhow::bail!("impossible combination of args");
|
SplitDirection::Vertical
|
||||||
};
|
};
|
||||||
let target_is_second = right || bottom;
|
let target_is_second = !(left || top);
|
||||||
let size = match (cells, percent) {
|
let size = match (cells, percent) {
|
||||||
(Some(c), _) => SplitSize::Cells(c),
|
(Some(c), _) => SplitSize::Cells(c),
|
||||||
(_, Some(p)) => SplitSize::Percent(p),
|
(_, Some(p)) => SplitSize::Percent(p),
|
||||||
|
Loading…
Reference in New Issue
Block a user