mirror of
https://github.com/wez/wezterm.git
synced 2024-09-11 14:25:57 +03:00
add move_pane_id to pane:split lua api
This commit is contained in:
parent
99c9613966
commit
22853d0c02
@ -424,6 +424,8 @@ struct SplitPane {
|
|||||||
top_level: bool,
|
top_level: bool,
|
||||||
#[dynamic(default = "default_split_size")]
|
#[dynamic(default = "default_split_size")]
|
||||||
size: f32,
|
size: f32,
|
||||||
|
#[dynamic(default)]
|
||||||
|
move_pane_id: Option<usize>,
|
||||||
}
|
}
|
||||||
impl_lua_conversion_dynamic!(SplitPane);
|
impl_lua_conversion_dynamic!(SplitPane);
|
||||||
|
|
||||||
@ -433,10 +435,14 @@ fn default_split_size() -> f32 {
|
|||||||
|
|
||||||
impl SplitPane {
|
impl SplitPane {
|
||||||
async fn run(&self, pane: &MuxPane) -> mlua::Result<MuxPane> {
|
async fn run(&self, pane: &MuxPane) -> mlua::Result<MuxPane> {
|
||||||
let (command, command_dir) = self.cmd_builder.to_command_builder();
|
let source = if let Some(move_pane_id) = self.move_pane_id {
|
||||||
let source = SplitSource::Spawn {
|
SplitSource::MovePane(move_pane_id)
|
||||||
command,
|
} else {
|
||||||
command_dir,
|
let (command, command_dir) = self.cmd_builder.to_command_builder();
|
||||||
|
SplitSource::Spawn {
|
||||||
|
command,
|
||||||
|
command_dir,
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let size = if self.size == 0.0 {
|
let size = if self.size == 0.0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user