aboutsummaryrefslogtreecommitdiff
path: root/src/workspace.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/workspace.rs')
-rw-r--r--src/workspace.rs62
1 files changed, 53 insertions, 9 deletions
diff --git a/src/workspace.rs b/src/workspace.rs
index 8a660b02..b01b5891 100644
--- a/src/workspace.rs
+++ b/src/workspace.rs
@@ -428,6 +428,36 @@ impl Workspace {
self.split_pane_with_runtime(
pane_id,
direction,
+ None,
+ rows,
+ cols,
+ cwd,
+ scrollback_limit_bytes,
+ host_terminal_theme,
+ shell_config,
+ focus_new_pane,
+ None,
+ )
+ }
+
+ #[allow(clippy::too_many_arguments)]
+ pub fn split_pane_with_ratio(
+ &mut self,
+ pane_id: PaneId,
+ direction: Direction,
+ ratio: f32,
+ rows: u16,
+ cols: u16,
+ cwd: Option<PathBuf>,
+ scrollback_limit_bytes: usize,
+ host_terminal_theme: crate::terminal_theme::TerminalTheme,
+ shell_config: crate::pane::PaneShellConfig<'_>,
+ focus_new_pane: bool,
+ ) -> Option<std::io::Result<(usize, crate::workspace::tab::NewPane)>> {
+ self.split_pane_with_runtime(
+ pane_id,
+ direction,
+ Some(ratio),
rows,
cols,
cwd,
@@ -455,6 +485,7 @@ impl Workspace {
self.split_pane_with_runtime(
pane_id,
direction,
+ None,
rows,
cols,
cwd,
@@ -471,6 +502,7 @@ impl Workspace {
&mut self,
pane_id: PaneId,
direction: Direction,
+ ratio: Option<f32>,
rows: u16,
cols: u16,
cwd: Option<PathBuf>,
@@ -495,15 +527,27 @@ impl Workspace {
host_terminal_theme,
)
} else {
- tab.split_focused(
- direction,
- rows,
- cols,
- cwd,
- scrollback_limit_bytes,
- host_terminal_theme,
- shell_config,
- )
+ match ratio {
+ Some(ratio) => tab.split_focused_with_ratio(
+ direction,
+ ratio,
+ rows,
+ cols,
+ cwd,
+ scrollback_limit_bytes,
+ host_terminal_theme,
+ shell_config,
+ ),
+ None => tab.split_focused(
+ direction,
+ rows,
+ cols,
+ cwd,
+ scrollback_limit_bytes,
+ host_terminal_theme,
+ shell_config,
+ ),
+ }
} {
Ok(new_pane) => new_pane,
Err(err) => {