diff --git a/src/main.rs b/src/main.rs index 1be0555336..1137beac7d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,6 +37,7 @@ fn main() { y, width, height, + size, })) = opts.command { let cwd = cwd.or_else(|| std::env::current_dir().ok()); @@ -57,6 +58,7 @@ fn main() { y, width, height, + size, }; commands::send_action_to_session(command_cli_action, opts.session, config); std::process::exit(0); @@ -71,6 +73,7 @@ fn main() { y, width, height, + size, })) = opts.command { let cwd = None; @@ -90,6 +93,7 @@ fn main() { y, width, height, + size, }; commands::send_action_to_session(command_cli_action, opts.session, config); std::process::exit(0); diff --git a/zellij-server/src/panes/tiled_panes/mod.rs b/zellij-server/src/panes/tiled_panes/mod.rs index 0e578b3bbd..4c7482c907 100644 --- a/zellij-server/src/panes/tiled_panes/mod.rs +++ b/zellij-server/src/panes/tiled_panes/mod.rs @@ -22,7 +22,7 @@ use zellij_utils::{ errors::prelude::*, input::{ command::RunCommand, - layout::{Run, RunPluginOrAlias, SplitDirection}, + layout::{Run, RunPluginOrAlias, SplitDirection, SplitSize}, }, pane_size::{Offset, PaneGeom, Size, SizeInPixels, Viewport}, }; @@ -202,7 +202,8 @@ impl TiledPanes { // this unwrap is safe because floating panes should not be visible if there are no floating panes let pane_to_split = self.panes.get_mut(&pane_id_to_split).unwrap(); let size_of_both_panes = pane_to_split.position_and_size(); - if let Some((first_geom, second_geom)) = split(split_direction, &size_of_both_panes) + if let Some((first_geom, second_geom)) = + split(split_direction, &size_of_both_panes, None, false) { pane_to_split.set_geom(first_geom); pane.set_geom(second_geom); @@ -349,7 +350,8 @@ impl TiledPanes { { return false; } else { - return split(SplitDirection::Horizontal, &full_pane_size).is_some(); + return split(SplitDirection::Horizontal, &full_pane_size, None, false) + .is_some(); } } } @@ -364,7 +366,7 @@ impl TiledPanes { { return false; } - return split(SplitDirection::Vertical, &full_pane_size).is_some(); + return split(SplitDirection::Vertical, &full_pane_size, None, false).is_some(); } } false @@ -376,7 +378,7 @@ impl TiledPanes { if full_pane_size.rows.is_fixed() || full_pane_size.is_stacked { return false; } - if split(SplitDirection::Horizontal, &full_pane_size).is_some() { + if split(SplitDirection::Horizontal, &full_pane_size, None, false).is_some() { true } else { false @@ -387,12 +389,14 @@ impl TiledPanes { pid: PaneId, mut new_pane: Box, client_id: ClientId, + size: Option, + up: bool, ) { let active_pane_id = &self.active_panes.get(&client_id).unwrap(); let active_pane = self.panes.get_mut(active_pane_id).unwrap(); let full_pane_size = active_pane.position_and_size(); if let Some((top_winsize, bottom_winsize)) = - split(SplitDirection::Horizontal, &full_pane_size) + split(SplitDirection::Horizontal, &full_pane_size, size, up) { active_pane.set_geom(top_winsize); new_pane.set_geom(bottom_winsize); @@ -407,7 +411,7 @@ impl TiledPanes { if full_pane_size.cols.is_fixed() || full_pane_size.is_stacked { return false; } - if split(SplitDirection::Vertical, &full_pane_size).is_some() { + if split(SplitDirection::Vertical, &full_pane_size, None, false).is_some() { true } else { false @@ -418,12 +422,14 @@ impl TiledPanes { pid: PaneId, mut new_pane: Box, client_id: ClientId, + size: Option, + left: bool, ) { let active_pane_id = &self.active_panes.get(&client_id).unwrap(); let active_pane = self.panes.get_mut(active_pane_id).unwrap(); let full_pane_size = active_pane.position_and_size(); if let Some((left_winsize, right_winsize)) = - split(SplitDirection::Vertical, &full_pane_size) + split(SplitDirection::Vertical, &full_pane_size, size, left) { active_pane.set_geom(left_winsize); new_pane.set_geom(right_winsize); diff --git a/zellij-server/src/panes/tiled_panes/tiled_pane_grid.rs b/zellij-server/src/panes/tiled_panes/tiled_pane_grid.rs index 7da65d712f..2192965421 100644 --- a/zellij-server/src/panes/tiled_panes/tiled_pane_grid.rs +++ b/zellij-server/src/panes/tiled_panes/tiled_pane_grid.rs @@ -6,6 +6,7 @@ use crate::{panes::PaneId, tab::Pane}; use std::cmp::{Ordering, Reverse}; use std::collections::{HashMap, HashSet}; use zellij_utils::data::{Direction, Resize, ResizeStrategy}; +use zellij_utils::input::layout::SplitSize; use zellij_utils::{ errors::prelude::*, input::layout::SplitDirection, @@ -1383,35 +1384,52 @@ impl<'a> TiledPaneGrid<'a> { } } -pub fn split(direction: SplitDirection, rect: &PaneGeom) -> Option<(PaneGeom, PaneGeom)> { +pub fn split( + direction: SplitDirection, + rect: &PaneGeom, + size: Option, + swap: bool, +) -> Option<(PaneGeom, PaneGeom)> { let space = match direction { SplitDirection::Vertical => rect.cols, SplitDirection::Horizontal => rect.rows, }; + let size = size.unwrap_or(SplitSize::Percent(50)); + let size = match size { + SplitSize::Percent(x) => x as f64 / 100.0, + SplitSize::Fixed(x) => (x as f64 / space.as_usize() as f64).clamp(0.0, 1.0), + }; + let size = if swap { 1.0 - size } else { size }; if let Some(p) = space.as_percent() { + let dim1 = Dimension::percent(p * (1.0 - size)); + let dim2 = Dimension::percent(p * size); let first_rect = match direction { SplitDirection::Vertical => PaneGeom { - cols: Dimension::percent(p / 2.0), + cols: dim1, ..*rect }, SplitDirection::Horizontal => PaneGeom { - rows: Dimension::percent(p / 2.0), + rows: dim1, ..*rect }, }; let second_rect = match direction { SplitDirection::Vertical => PaneGeom { x: first_rect.x + 1, - cols: first_rect.cols, + cols: dim2, ..*rect }, SplitDirection::Horizontal => PaneGeom { y: first_rect.y + 1, - rows: first_rect.rows, + rows: dim2, ..*rect }, }; - Some((first_rect, second_rect)) + if swap { + Some((second_rect, first_rect)) + } else { + Some((first_rect, second_rect)) + } } else { None } diff --git a/zellij-server/src/plugins/zellij_exports.rs b/zellij-server/src/plugins/zellij_exports.rs index d308689b9f..376f64f8e9 100644 --- a/zellij-server/src/plugins/zellij_exports.rs +++ b/zellij-server/src/plugins/zellij_exports.rs @@ -591,7 +591,7 @@ fn open_terminal(env: &PluginEnv, cwd: PathBuf) { TerminalAction::RunCommand(run_command) => Some(run_command.into()), _ => None, }; - let action = Action::NewTiledPane(None, run_command_action, None); + let action = Action::NewTiledPane(None, run_command_action, None, None); apply_action!(action, error_msg, env); } @@ -661,7 +661,7 @@ fn open_command_pane( context, )), }; - let action = Action::NewTiledPane(direction, Some(run_command_action), name); + let action = Action::NewTiledPane(direction, Some(run_command_action), name, None); apply_action!(action, error_msg, env); } diff --git a/zellij-server/src/pty.rs b/zellij-server/src/pty.rs index da5bd7bd86..a0b685acab 100644 --- a/zellij-server/src/pty.rs +++ b/zellij-server/src/pty.rs @@ -11,6 +11,7 @@ use crate::{ use async_std::task::{self, JoinHandle}; use std::sync::Arc; use std::{collections::HashMap, os::unix::io::RawFd, path::PathBuf}; +use zellij_utils::input::layout::SplitSize; use zellij_utils::nix::unistd::Pid; use zellij_utils::{ async_std, @@ -48,13 +49,20 @@ pub enum PtyInstruction { ), // bool (if Some) is // should_float, String is an optional pane name OpenInPlaceEditor(PathBuf, Option, ClientTabIndexOrPaneId), // Option is the optional line number - SpawnTerminalVertically(Option, Option, ClientId), // String is an - // optional pane - // name - // bool is start_suppressed - SpawnTerminalHorizontally(Option, Option, ClientId), // String is an - // optional pane - // name + SpawnTerminalVertically( + Option, + Option, + ClientId, + Option, + bool, + ), // String is an optional pane name, bool is left + SpawnTerminalHorizontally( + Option, + Option, + ClientId, + Option, + bool, + ), // String is an optional pane name, bool is up UpdateActivePane(Option, ClientId), GoToTab(TabIndex, ClientId), NewTab( @@ -385,7 +393,13 @@ pub(crate) fn pty_thread_main(mut pty: Pty, layout: Box) -> Result<()> { }, } }, - PtyInstruction::SpawnTerminalVertically(terminal_action, name, client_id) => { + PtyInstruction::SpawnTerminalVertically( + terminal_action, + name, + client_id, + size, + left, + ) => { let err_context = || format!("failed to spawn terminal vertically for client {client_id}"); @@ -410,6 +424,8 @@ pub(crate) fn pty_thread_main(mut pty: Pty, layout: Box) -> Result<()> { pane_title, hold_for_command, client_id, + size, + left, )) .with_context(err_context)?; }, @@ -424,6 +440,8 @@ pub(crate) fn pty_thread_main(mut pty: Pty, layout: Box) -> Result<()> { pane_title, hold_for_command, client_id, + size, + left, )) .with_context(err_context)?; if let Some(run_command) = run_command { @@ -456,7 +474,13 @@ pub(crate) fn pty_thread_main(mut pty: Pty, layout: Box) -> Result<()> { }, } }, - PtyInstruction::SpawnTerminalHorizontally(terminal_action, name, client_id) => { + PtyInstruction::SpawnTerminalHorizontally( + terminal_action, + name, + client_id, + size, + up, + ) => { let err_context = || format!("failed to spawn terminal horizontally for client {client_id}"); @@ -481,6 +505,8 @@ pub(crate) fn pty_thread_main(mut pty: Pty, layout: Box) -> Result<()> { pane_title, hold_for_command, client_id, + size, + up, )) .with_context(err_context)?; }, @@ -495,6 +521,8 @@ pub(crate) fn pty_thread_main(mut pty: Pty, layout: Box) -> Result<()> { pane_title, hold_for_command, client_id, + size, + up )) .with_context(err_context)?; if let Some(run_command) = run_command { diff --git a/zellij-server/src/route.rs b/zellij-server/src/route.rs index cd21140dcc..44774a5308 100644 --- a/zellij-server/src/route.rs +++ b/zellij-server/src/route.rs @@ -263,16 +263,16 @@ pub(crate) fn route_action( let shell = default_shell.clone(); let pty_instr = match direction { Some(Direction::Left) => { - PtyInstruction::SpawnTerminalVertically(shell, name, client_id) + PtyInstruction::SpawnTerminalVertically(shell, name, client_id, None, true) }, Some(Direction::Right) => { - PtyInstruction::SpawnTerminalVertically(shell, name, client_id) + PtyInstruction::SpawnTerminalVertically(shell, name, client_id, None, false) }, Some(Direction::Up) => { - PtyInstruction::SpawnTerminalHorizontally(shell, name, client_id) + PtyInstruction::SpawnTerminalHorizontally(shell, name, client_id, None, true) }, Some(Direction::Down) => { - PtyInstruction::SpawnTerminalHorizontally(shell, name, client_id) + PtyInstruction::SpawnTerminalHorizontally(shell, name, client_id, None, false) }, // No direction specified - try to put it in the biggest available spot None => PtyInstruction::SpawnTerminal( @@ -298,20 +298,24 @@ pub(crate) fn route_action( let open_file = TerminalAction::OpenFile(open_file_payload); let pty_instr = match (split_direction, should_float, should_open_in_place) { (Some(Direction::Left), false, false) => { - PtyInstruction::SpawnTerminalVertically(Some(open_file), Some(title), client_id) + PtyInstruction::SpawnTerminalVertically(Some(open_file), Some(title), client_id, None, true) }, (Some(Direction::Right), false, false) => { - PtyInstruction::SpawnTerminalVertically(Some(open_file), Some(title), client_id) + PtyInstruction::SpawnTerminalVertically(Some(open_file), Some(title), client_id, None, false) }, (Some(Direction::Up), false, false) => PtyInstruction::SpawnTerminalHorizontally( Some(open_file), Some(title), client_id, + None, + true, ), (Some(Direction::Down), false, false) => PtyInstruction::SpawnTerminalHorizontally( Some(open_file), Some(title), client_id, + None, + false, ), // open terminal in place (_, _, true) => match pane_id { @@ -410,23 +414,23 @@ pub(crate) fn route_action( }, } }, - Action::NewTiledPane(direction, run_command, name) => { + Action::NewTiledPane(direction, run_command, name, size) => { let should_float = false; let run_cmd = run_command .map(|cmd| TerminalAction::RunCommand(cmd.into())) .or_else(|| default_shell.clone()); let pty_instr = match direction { Some(Direction::Left) => { - PtyInstruction::SpawnTerminalVertically(run_cmd, name, client_id) + PtyInstruction::SpawnTerminalVertically(run_cmd, name, client_id, size, true) }, Some(Direction::Right) => { - PtyInstruction::SpawnTerminalVertically(run_cmd, name, client_id) + PtyInstruction::SpawnTerminalVertically(run_cmd, name, client_id, size, false) }, Some(Direction::Up) => { - PtyInstruction::SpawnTerminalHorizontally(run_cmd, name, client_id) + PtyInstruction::SpawnTerminalHorizontally(run_cmd, name, client_id, size, true) }, Some(Direction::Down) => { - PtyInstruction::SpawnTerminalHorizontally(run_cmd, name, client_id) + PtyInstruction::SpawnTerminalHorizontally(run_cmd, name, client_id, size, false) }, // No direction specified - try to put it in the biggest available spot None => PtyInstruction::SpawnTerminal( @@ -467,16 +471,16 @@ pub(crate) fn route_action( let run_cmd = Some(TerminalAction::RunCommand(command.clone().into())); let pty_instr = match command.direction { Some(Direction::Left) => { - PtyInstruction::SpawnTerminalVertically(run_cmd, None, client_id) + PtyInstruction::SpawnTerminalVertically(run_cmd, None, client_id, None, true) }, Some(Direction::Right) => { - PtyInstruction::SpawnTerminalVertically(run_cmd, None, client_id) + PtyInstruction::SpawnTerminalVertically(run_cmd, None, client_id, None, false) }, Some(Direction::Up) => { - PtyInstruction::SpawnTerminalHorizontally(run_cmd, None, client_id) + PtyInstruction::SpawnTerminalHorizontally(run_cmd, None, client_id, None, true) }, Some(Direction::Down) => { - PtyInstruction::SpawnTerminalHorizontally(run_cmd, None, client_id) + PtyInstruction::SpawnTerminalHorizontally(run_cmd, None, client_id, None, false) }, // No direction specified - try to put it in the biggest available spot None => PtyInstruction::SpawnTerminal( diff --git a/zellij-server/src/screen.rs b/zellij-server/src/screen.rs index a1e1407e58..054dc83658 100644 --- a/zellij-server/src/screen.rs +++ b/zellij-server/src/screen.rs @@ -15,6 +15,7 @@ use zellij_utils::errors::prelude::*; use zellij_utils::input::command::RunCommand; use zellij_utils::input::config::Config; use zellij_utils::input::keybinds::Keybinds; +use zellij_utils::input::layout::SplitSize; use zellij_utils::input::options::Clipboard; use zellij_utils::pane_size::{Size, SizeInPixels}; use zellij_utils::{ @@ -159,8 +160,22 @@ pub enum ScreenInstruction { OpenInPlaceEditor(PaneId, ClientTabIndexOrPaneId), TogglePaneEmbedOrFloating(ClientId), ToggleFloatingPanes(ClientId, Option), - HorizontalSplit(PaneId, Option, HoldForCommand, ClientId), - VerticalSplit(PaneId, Option, HoldForCommand, ClientId), + HorizontalSplit( + PaneId, + Option, + HoldForCommand, + ClientId, + Option, + bool, + ), + VerticalSplit( + PaneId, + Option, + HoldForCommand, + ClientId, + Option, + bool, + ), WriteCharacter(Option, Vec, bool, ClientId), // bool -> // is_kitty_keyboard_protocol Resize(ClientId, ResizeStrategy), @@ -2874,11 +2889,13 @@ pub(crate) fn screen_thread_main( initial_pane_title, hold_for_command, client_id, + size, + up, ) => { active_tab_and_connected_client_id!( screen, client_id, - |tab: &mut Tab, client_id: ClientId| tab.horizontal_split(pid, initial_pane_title, client_id), + |tab: &mut Tab, client_id: ClientId| tab.horizontal_split(pid, initial_pane_title, client_id, size, up), ? ); if let Some(hold_for_command) = hold_for_command { @@ -2903,11 +2920,13 @@ pub(crate) fn screen_thread_main( initial_pane_title, hold_for_command, client_id, + size, + left, ) => { active_tab_and_connected_client_id!( screen, client_id, - |tab: &mut Tab, client_id: ClientId| tab.vertical_split(pid, initial_pane_title, client_id), + |tab: &mut Tab, client_id: ClientId| tab.vertical_split(pid, initial_pane_title, client_id, size, left), ? ); if let Some(hold_for_command) = hold_for_command { diff --git a/zellij-server/src/tab/mod.rs b/zellij-server/src/tab/mod.rs index d69a23cb84..a8740c468c 100644 --- a/zellij-server/src/tab/mod.rs +++ b/zellij-server/src/tab/mod.rs @@ -7,6 +7,7 @@ mod layout_applier; mod swap_layouts; use copy_command::CopyCommand; +use zellij_utils::input::layout::SplitSize; use std::env::temp_dir; use std::path::PathBuf; use uuid::Uuid; @@ -1439,6 +1440,8 @@ impl Tab { pid: PaneId, initial_pane_title: Option, client_id: ClientId, + size: Option, + up: bool, ) -> Result<()> { let err_context = || format!("failed to split pane {pid:?} horizontally for client {client_id}"); @@ -1472,7 +1475,7 @@ impl Tab { self.explicitly_disable_kitty_keyboard_protocol, ); self.tiled_panes - .split_pane_horizontally(pid, Box::new(new_terminal), client_id); + .split_pane_horizontally(pid, Box::new(new_terminal), client_id, size, up); self.should_clear_display_before_rendering = true; self.tiled_panes.focus_pane(pid, client_id); self.swap_layouts.set_is_tiled_damaged(); @@ -1499,6 +1502,8 @@ impl Tab { pid: PaneId, initial_pane_title: Option, client_id: ClientId, + size: Option, + left: bool, ) -> Result<()> { let err_context = || format!("failed to split pane {pid:?} vertically for client {client_id}"); @@ -1532,7 +1537,7 @@ impl Tab { self.explicitly_disable_kitty_keyboard_protocol, ); self.tiled_panes - .split_pane_vertically(pid, Box::new(new_terminal), client_id); + .split_pane_vertically(pid, Box::new(new_terminal), client_id, size, left); self.should_clear_display_before_rendering = true; self.tiled_panes.focus_pane(pid, client_id); self.swap_layouts.set_is_tiled_damaged(); diff --git a/zellij-utils/src/cli.rs b/zellij-utils/src/cli.rs index 63348c4225..5a0bac5923 100644 --- a/zellij-utils/src/cli.rs +++ b/zellij-utils/src/cli.rs @@ -246,6 +246,9 @@ pub enum Sessions { /// The height if the pane is floating as a bare integer (eg. 1) or percent (eg. 10%) #[clap(long, requires("floating"))] height: Option, + /// The size if the pane is tiled as a bare integer (eg. 1) or percent (eg. 10%) + #[clap(long, conflicts_with("floating"))] + size: Option, }, /// Load a plugin #[clap(visible_alias = "p")] @@ -288,6 +291,9 @@ pub enum Sessions { /// The height if the pane is floating as a bare integer (eg. 1) or percent (eg. 10%) #[clap(long, requires("floating"))] height: Option, + /// The size if the pane is tiled as a bare integer (eg. 1) or percent (eg. 10%) + #[clap(long, conflicts_with("floating"))] + size: Option, }, /// Edit file with default $EDITOR / $VISUAL #[clap(visible_alias = "e")] @@ -526,6 +532,9 @@ pub enum CliAction { /// The height if the pane is floating as a bare integer (eg. 1) or percent (eg. 10%) #[clap(long, requires("floating"))] height: Option, + /// The size if the pane is tiled as a bare integer (eg. 1) or percent (eg. 10%) + #[clap(long, conflicts_with("floating"))] + size: Option, }, /// Open the specified file in a new zellij pane with your default EDITOR Edit { diff --git a/zellij-utils/src/input/actions.rs b/zellij-utils/src/input/actions.rs index e19a067244..640e070384 100644 --- a/zellij-utils/src/input/actions.rs +++ b/zellij-utils/src/input/actions.rs @@ -3,7 +3,7 @@ use super::command::{OpenFilePayload, RunCommandAction}; use super::layout::{ FloatingPaneLayout, Layout, PluginAlias, RunPlugin, RunPluginLocation, RunPluginOrAlias, - SwapFloatingLayout, SwapTiledLayout, TiledPaneLayout, + SwapFloatingLayout, SwapTiledLayout, TiledPaneLayout, SplitSize, }; use crate::cli::CliAction; use crate::data::{Direction, KeyWithModifier, Resize}; @@ -175,7 +175,7 @@ pub enum Action { Option, ), // String is an optional pane name /// Open a new tiled (embedded, non-floating) pane - NewTiledPane(Option, Option, Option), // String is an + NewTiledPane(Option, Option, Option, Option), // String is an /// Open a new pane in place of the focused one, suppressing it instead NewInPlacePane(Option, Option), // String is an // optional pane @@ -363,11 +363,13 @@ impl Action { y, width, height, + size, } => { let current_dir = get_current_dir(); // cwd should only be specified in a plugin alias if it was explicitly given to us, // otherwise the current_dir might override a cwd defined in the alias itself let alias_cwd = cwd.clone().map(|cwd| current_dir.join(cwd)); + let size = size.as_deref().and_then(|x| SplitSize::from_str(x).ok()); let cwd = cwd .map(|cwd| current_dir.join(cwd)) .or_else(|| Some(current_dir.clone())); @@ -449,6 +451,7 @@ impl Action { direction, Some(run_command_action), name, + size, )]) } } else { @@ -461,7 +464,7 @@ impl Action { } else if in_place { Ok(vec![Action::NewInPlacePane(None, name)]) } else { - Ok(vec![Action::NewTiledPane(direction, None, name)]) + Ok(vec![Action::NewTiledPane(direction, None, name, size)]) } } }, diff --git a/zellij-utils/src/kdl/mod.rs b/zellij-utils/src/kdl/mod.rs index e3726173db..44c542f66e 100644 --- a/zellij-utils/src/kdl/mod.rs +++ b/zellij-utils/src/kdl/mod.rs @@ -739,7 +739,7 @@ impl Action { node.push(direction); Some(node) }, - Action::NewTiledPane(direction, run_command_action, name) => { + Action::NewTiledPane(direction, run_command_action, name, size) => { let mut node = KdlNode::new("Run"); let mut node_children = KdlDocument::new(); if let Some(run_command_action) = run_command_action { @@ -779,6 +779,18 @@ impl Action { direction_node.push(direction); node_children.nodes_mut().push(direction_node); } + if let Some(size) = size { + let mut size_node = KdlNode::new("size"); + match size { + SplitSize::Percent(size) => { + size_node.push(format!("{}%", size)); + }, + SplitSize::Fixed(size) => { + size_node.push(KdlValue::Base10(*size as i64)); + }, + }; + node_children.nodes_mut().push(size_node); + } if !node_children.nodes().is_empty() { node.set_children(node_children); } @@ -1537,6 +1549,9 @@ impl TryFrom<(&KdlNode, &Options)> for Action { let height = command_metadata .and_then(|c_m| kdl_child_string_value_for_entry(c_m, "height")) .map(|s| s.to_owned()); + let size = command_metadata + .and_then(|c_m| kdl_child_string_value_for_entry(c_m, "size")) + .map(|s| s.to_owned()); if floating { Ok(Action::NewFloatingPane( Some(run_command_action), @@ -1550,6 +1565,7 @@ impl TryFrom<(&KdlNode, &Options)> for Action { direction, Some(run_command_action), name, + size.as_deref().and_then(|x| SplitSize::from_str(x).ok()), )) } }, diff --git a/zellij-utils/src/plugin_api/action.rs b/zellij-utils/src/plugin_api/action.rs index 9bb8ac7a8e..53b777cc77 100644 --- a/zellij-utils/src/plugin_api/action.rs +++ b/zellij-utils/src/plugin_api/action.rs @@ -275,9 +275,10 @@ impl TryFrom for Action { direction, Some(run_command_action), pane_name, + None, )) } else { - Ok(Action::NewTiledPane(direction, None, None)) + Ok(Action::NewTiledPane(direction, None, None, None)) } }, _ => Err("Wrong payload for Action::NewTiledPane"), @@ -937,7 +938,7 @@ impl TryFrom for ProtobufAction { )), }) }, - Action::NewTiledPane(direction, run_command_action, pane_name) => { + Action::NewTiledPane(direction, run_command_action, pane_name, _size) => { let direction = direction.and_then(|direction| { let protobuf_direction: ProtobufResizeDirection = direction.try_into().ok()?; Some(protobuf_direction as i32)